Imported Debian version 2.5.0~trusty1.1
[deb_ffmpeg.git] / ffmpeg / tools / bookmarklets.html
CommitLineData
2ba45a60
DM
1<!DOCTYPE html>
2<html>
3<head>
4<!--
5 This file is part of FFmpeg.
6
7 All scripts contained in this file can be considered public domain.
8 -->
9<title>FFmpeg bookmarklets</title>
10<meta charset="UTF-8">
11<script type="text/javascript">
12function 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);
18}
19function init() {
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);
23 }
24}
25</script>
26<style type="text/css">
27pre { border: solid black 1px; padding: 0.2ex; font-size: 80% }
28</style>
29</head>
30<body onload="init()">
31
32<h1>Introduction</h1>
33
34The scripts in this page are
35<a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>: store
36their link version in a bookmark, and later activate the bookmark on a page
37to run the script.
38
39<h1>TED Talks captions</h1>
40
41<p><a id="ted_talks_captions-link" href="#">Get links to the captions</a></p>
42
43<pre id="ted_talks_captions">
44d = window.open("", "sub", "width=256,height=512,resizable=yes,scrollbars=yes").document;
45l = document.getElementById("languageCode").getElementsByTagName("option");
46for (i = 1; i &lt; 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;
51}
52</pre>
53
54</body>
55</html>