Created
December 9, 2010 19:48
-
-
Save ba3r/735218 to your computer and use it in GitHub Desktop.
subtitle any video using universalsubtitles.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Universal Subtitles v0.72a */ | |
CmdUtils.CreateCommand({ | |
names: ["subtitle"], | |
description: "Add subtitles to any web video using open standards.", | |
help: "Open a video or select an URL and type subtitle", | |
author: { | |
name: "Michael Baer", | |
homepage: "http://twitter.com/shaytards", | |
}, | |
license: "GPL", | |
homepage: "http://universalsubtitles.org", | |
icon: "http://a2.twimg.com/profile_images/788922918/Universal-Subtitles_mini.png", | |
execute: function() { | |
var win = CmdUtils.getWindow(); | |
var sel = win.getSelection().encodeURI(); | |
if (sel.length < 3) {var videoURL = win.location.href;} else {var videoURL = sel;} | |
Utils.openUrlInBrowser("http://universalsubtitles.org/videos/create/" + videoURL) | |
title: win.document.title, | |
}, | |
preview: function preview(pblock) { | |
var win = CmdUtils.getWindow(); | |
var sel = win.getSelection().toString().slice(0, 30); | |
if (!sel) {var videoTitle = win.document.title;} else {var videoTitle = sel;} | |
pblock.innerHTML = "Subtitle this video " + videoTitle.bold() ; | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment