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()">
34 The scripts in this page are
35 <a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>: store
36 their link version in a bookmark, and later activate the bookmark on a page
39 <h1>TED Talks captions</h1>
41 <p><a id="ted_talks_captions-link" href="#">Get links to the captions</a></p>
43 <pre id="ted_talks_captions">
44 d = window.open("", "sub", "width=256,height=512,resizable=yes,scrollbars=yes").document;
45 l = document.getElementById("languageCode").getElementsByTagName("option");
46 for (i = 1; i < l.length ; i++) {
47 d.body.appendChild(p = d.createElement("p"));
48 p.appendChild(a = d.createElement("a"));
49 a.appendChild(d.createTextNode(l[i].textContent));
50 a.href="http://www.ted.com/talks/subtitles/id/" + talkID+"/lang/" + l[i].value;