Mercurial > pymonkey
annotate docs/rendered/_static/doctools.js @ 141:96dc1beefc00
Regenerated docs.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 24 Aug 2009 21:54:20 -0700 |
parents | 7401af070bb8 |
children |
rev | line source |
---|---|
49
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
1 /// XXX: make it cross browser |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
2 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
3 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
4 * make the code below compatible with browsers without |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
5 * an installed firebug like debugger |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
6 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
7 if (!window.console || !console.firebug) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
8 var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
9 "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
10 window.console = {}; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
11 for (var i = 0; i < names.length; ++i) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
12 window.console[names[i]] = function() {} |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
13 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
14 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
15 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
16 * small helper function to urldecode strings |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
17 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
18 jQuery.urldecode = function(x) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
19 return decodeURIComponent(x).replace(/\+/g, ' '); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
20 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
21 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
22 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
23 * small helper function to urlencode strings |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
24 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
25 jQuery.urlencode = encodeURIComponent; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
26 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
27 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
28 * This function returns the parsed url parameters of the |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
29 * current request. Multiple values per key are supported, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
30 * it will always return arrays of strings for the value parts. |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
31 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
32 jQuery.getQueryParameters = function(s) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
33 if (typeof s == 'undefined') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
34 s = document.location.search; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
35 var parts = s.substr(s.indexOf('?') + 1).split('&'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
36 var result = {}; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
37 for (var i = 0; i < parts.length; i++) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
38 var tmp = parts[i].split('=', 2); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
39 var key = jQuery.urldecode(tmp[0]); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
40 var value = jQuery.urldecode(tmp[1]); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
41 if (key in result) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
42 result[key].push(value); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
43 else |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
44 result[key] = [value]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
45 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
46 return result; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
47 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
48 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
49 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
50 * small function to check if an array contains |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
51 * a given item. |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
52 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
53 jQuery.contains = function(arr, item) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
54 for (var i = 0; i < arr.length; i++) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
55 if (arr[i] == item) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
56 return true; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
57 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
58 return false; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
59 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
60 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
61 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
62 * highlight a given string on a jquery object by wrapping it in |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
63 * span elements with the given class name. |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
64 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
65 jQuery.fn.highlightText = function(text, className) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
66 function highlight(node) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
67 if (node.nodeType == 3) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
68 var val = node.nodeValue; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
69 var pos = val.toLowerCase().indexOf(text); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
70 if (pos >= 0 && !jQuery.className.has(node.parentNode, className)) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
71 var span = document.createElement("span"); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
72 span.className = className; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
73 span.appendChild(document.createTextNode(val.substr(pos, text.length))); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
74 node.parentNode.insertBefore(span, node.parentNode.insertBefore( |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
75 document.createTextNode(val.substr(pos + text.length)), |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
76 node.nextSibling)); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
77 node.nodeValue = val.substr(0, pos); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
78 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
79 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
80 else if (!jQuery(node).is("button, select, textarea")) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
81 jQuery.each(node.childNodes, function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
82 highlight(this) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
83 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
84 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
85 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
86 return this.each(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
87 highlight(this); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
88 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
89 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
90 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
91 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
92 * Small JavaScript module for the documentation. |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
93 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
94 var Documentation = { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
95 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
96 init : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
97 this.fixFirefoxAnchorBug(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
98 this.highlightSearchWords(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
99 this.initModIndex(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
100 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
101 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
102 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
103 * i18n support |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
104 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
105 TRANSLATIONS : {}, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
106 PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
107 LOCALE : 'unknown', |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
108 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
109 // gettext and ngettext don't access this so that the functions |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
110 // can savely bound to a different name (_ = Documentation.gettext) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
111 gettext : function(string) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
112 var translated = Documentation.TRANSLATIONS[string]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
113 if (typeof translated == 'undefined') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
114 return string; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
115 return (typeof translated == 'string') ? translated : translated[0]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
116 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
117 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
118 ngettext : function(singular, plural, n) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
119 var translated = Documentation.TRANSLATIONS[singular]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
120 if (typeof translated == 'undefined') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
121 return (n == 1) ? singular : plural; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
122 return translated[Documentation.PLURALEXPR(n)]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
123 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
124 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
125 addTranslations : function(catalog) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
126 for (var key in catalog.messages) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
127 this.TRANSLATIONS[key] = catalog.messages[key]; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
128 this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
129 this.LOCALE = catalog.locale; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
130 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
131 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
132 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
133 * add context elements like header anchor links |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
134 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
135 addContextElements : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
136 $('div[id] > :header:first').each(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
137 $('<a class="headerlink">\u00B6</a>'). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
138 attr('href', '#' + this.id). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
139 attr('title', _('Permalink to this headline')). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
140 appendTo(this); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
141 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
142 $('dt[id]').each(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
143 $('<a class="headerlink">\u00B6</a>'). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
144 attr('href', '#' + this.id). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
145 attr('title', _('Permalink to this definition')). |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
146 appendTo(this); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
147 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
148 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
149 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
150 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
151 * workaround a firefox stupidity |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
152 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
153 fixFirefoxAnchorBug : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
154 if (document.location.hash && $.browser.mozilla) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
155 window.setTimeout(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
156 document.location.href += ''; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
157 }, 10); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
158 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
159 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
160 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
161 * highlight the search words provided in the url in the text |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
162 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
163 highlightSearchWords : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
164 var params = $.getQueryParameters(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
165 var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
166 if (terms.length) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
167 var body = $('div.body'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
168 window.setTimeout(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
169 $.each(terms, function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
170 body.highlightText(this.toLowerCase(), 'highlight'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
171 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
172 }, 10); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
173 $('<li class="highlight-link"><a href="javascript:Documentation.' + |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
174 'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
175 .appendTo($('.sidebar .this-page-menu')); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
176 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
177 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
178 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
179 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
180 * init the modindex toggle buttons |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
181 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
182 initModIndex : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
183 var togglers = $('img.toggler').click(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
184 var src = $(this).attr('src'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
185 var idnum = $(this).attr('id').substr(7); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
186 console.log($('tr.cg-' + idnum).toggle()); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
187 if (src.substr(-9) == 'minus.png') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
188 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
189 else |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
190 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
191 }).css('display', ''); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
192 if (DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
193 togglers.click(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
194 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
195 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
196 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
197 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
198 * helper function to hide the search marks again |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
199 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
200 hideSearchWords : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
201 $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
202 $('span.highlight').removeClass('highlight'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
203 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
204 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
205 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
206 * make the url absolute |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
207 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
208 makeURL : function(relativeURL) { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
209 return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
210 }, |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
211 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
212 /** |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
213 * get the current relative url |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
214 */ |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
215 getCurrentURL : function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
216 var path = document.location.pathname; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
217 var parts = path.split(/\//); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
218 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
219 if (this == '..') |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
220 parts.pop(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
221 }); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
222 var url = parts.join('/'); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
223 return path.substring(url.lastIndexOf('/') + 1, path.length - 1); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
224 } |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
225 }; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
226 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
227 // quick alias for translations |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
228 _ = Documentation.gettext; |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
229 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
230 $(document).ready(function() { |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
231 Documentation.init(); |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
232 }); |