5 This file is part of FFmpeg.
7 All scripts contained in this file can be considered public domain.
9 <title>FFmpeg bookmarklets
</title>
10 <meta charset=
"UTF-8">
11 <script type=
"text/javascript">
12 function convert(js
) {
13 js
= js
.replace(/\/\*.*?\*\//g, ""); /* comments */
14 js
= js
.replace(/\s+/g, " ");
15 js
= js
.replace(/\s+\z/, "");
16 js
= "(function(){" + js
+ "})();void 0";
17 return "javascript:" + escape(js
);
20 var pre
= document
.getElementsByTagName("pre");
21 for (var i
= 0; pre
.length
> i
; i
++) {
22 document
.getElementById(pre
[i
].id
+ "-link").href
= convert(pre
[i
].textContent
);
26 <style type=
"text/css">
27 pre
{ border: solid black
1px; padding: 0.2ex; font-size: 80% }
30 <body onload=
"init()">
33 <p>The scripts in this page are
34 <a href=
"http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets
</a>: store
35 their link version in a bookmark, and later activate the bookmark on a page
36 to run the script.
</p>
38 <h1>TED Talks captions
</h1>
39 <p><a id=
"ted_talks_captions-link" href=
"#">Get links to the captions
</a></p>
41 <pre id=
"ted_talks_captions">
42 d = window.open(
"",
"sub",
"width=256,height=512,resizable=yes,scrollbars=yes").document;
43 l = document.getElementById(
"languageCode").getElementsByTagName(
"option");
44 for (i =
1; i
< l.length ; i++) {
45 d.body.appendChild(p = d.createElement(
"p"));
46 p.appendChild(a = d.createElement(
"a"));
47 a.appendChild(d.createTextNode(l[i].textContent));
48 a.
href=
"http://www.ted.com/talks/subtitles/id/" + talkID+
"/lang/" + l[i].value;