Mercurial > repos > yating-l > hubarchivecreatortest
annotate doc/_build/html/_static/doctools.js @ 3:fa990284327b draft default tip
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit ac73da32d59853ca563e7939d05016a6f3a6899e-dirty
| author | yating-l | 
|---|---|
| date | Mon, 30 Oct 2017 11:58:31 -0400 | 
| parents | 85195e0d4b71 | 
| children | 
| rev | line source | 
|---|---|
| 1 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 1 /* | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 2 * doctools.js | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 3 * ~~~~~~~~~~~ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 4 * | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 5 * Sphinx JavaScript utilities for all documentation. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 6 * | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 7 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 8 * :license: BSD, see LICENSE for details. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 9 * | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 10 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 11 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 12 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 13 * select a different prefix for underscore | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 14 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 15 $u = _.noConflict(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 16 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 17 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 18 * make the code below compatible with browsers without | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 19 * an installed firebug like debugger | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 20 if (!window.console || !console.firebug) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 21 var names = ["log", "debug", "info", "warn", "error", "assert", "dir", | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 22 "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 23 "profile", "profileEnd"]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 24 window.console = {}; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 25 for (var i = 0; i < names.length; ++i) | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 26 window.console[names[i]] = function() {}; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 27 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 28 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 29 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 30 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 31 * small helper function to urldecode strings | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 32 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 33 jQuery.urldecode = function(x) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 34 return decodeURIComponent(x).replace(/\+/g, ' '); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 35 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 36 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 37 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 38 * small helper function to urlencode strings | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 39 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 40 jQuery.urlencode = encodeURIComponent; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 41 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 42 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 43 * This function returns the parsed url parameters of the | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 44 * current request. Multiple values per key are supported, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 45 * it will always return arrays of strings for the value parts. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 46 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 47 jQuery.getQueryParameters = function(s) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 48 if (typeof s == 'undefined') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 49 s = document.location.search; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 50 var parts = s.substr(s.indexOf('?') + 1).split('&'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 51 var result = {}; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 52 for (var i = 0; i < parts.length; i++) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 53 var tmp = parts[i].split('=', 2); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 54 var key = jQuery.urldecode(tmp[0]); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 55 var value = jQuery.urldecode(tmp[1]); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 56 if (key in result) | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 57 result[key].push(value); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 58 else | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 59 result[key] = [value]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 60 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 61 return result; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 62 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 63 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 64 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 65 * highlight a given string on a jquery object by wrapping it in | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 66 * span elements with the given class name. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 67 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 68 jQuery.fn.highlightText = function(text, className) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 69 function highlight(node) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 70 if (node.nodeType == 3) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 71 var val = node.nodeValue; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 72 var pos = val.toLowerCase().indexOf(text); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 73 if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 74 var span = document.createElement("span"); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 75 span.className = className; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 76 span.appendChild(document.createTextNode(val.substr(pos, text.length))); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 77 node.parentNode.insertBefore(span, node.parentNode.insertBefore( | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 78 document.createTextNode(val.substr(pos + text.length)), | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 79 node.nextSibling)); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 80 node.nodeValue = val.substr(0, pos); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 81 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 82 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 83 else if (!jQuery(node).is("button, select, textarea")) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 84 jQuery.each(node.childNodes, function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 85 highlight(this); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 86 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 87 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 88 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 89 return this.each(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 90 highlight(this); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 91 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 92 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 93 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 94 /* | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 95 * backward compatibility for jQuery.browser | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 96 * This will be supported until firefox bug is fixed. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 97 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 98 if (!jQuery.browser) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 99 jQuery.uaMatch = function(ua) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 100 ua = ua.toLowerCase(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 101 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 102 var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 103 /(webkit)[ \/]([\w.]+)/.exec(ua) || | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 104 /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 105 /(msie) ([\w.]+)/.exec(ua) || | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 106 ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 107 []; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 108 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 109 return { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 110 browser: match[ 1 ] || "", | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 111 version: match[ 2 ] || "0" | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 112 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 113 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 114 jQuery.browser = {}; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 115 jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 116 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 117 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 118 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 119 * Small JavaScript module for the documentation. | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 120 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 121 var Documentation = { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 122 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 123 init : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 124 this.fixFirefoxAnchorBug(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 125 this.highlightSearchWords(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 126 this.initIndexTable(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 127 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 128 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 129 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 130 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 131 * i18n support | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 132 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 133 TRANSLATIONS : {}, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 134 PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 135 LOCALE : 'unknown', | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 136 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 137 // gettext and ngettext don't access this so that the functions | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 138 // can safely bound to a different name (_ = Documentation.gettext) | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 139 gettext : function(string) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 140 var translated = Documentation.TRANSLATIONS[string]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 141 if (typeof translated == 'undefined') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 142 return string; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 143 return (typeof translated == 'string') ? translated : translated[0]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 144 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 145 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 146 ngettext : function(singular, plural, n) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 147 var translated = Documentation.TRANSLATIONS[singular]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 148 if (typeof translated == 'undefined') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 149 return (n == 1) ? singular : plural; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 150 return translated[Documentation.PLURALEXPR(n)]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 151 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 152 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 153 addTranslations : function(catalog) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 154 for (var key in catalog.messages) | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 155 this.TRANSLATIONS[key] = catalog.messages[key]; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 156 this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 157 this.LOCALE = catalog.locale; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 158 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 159 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 160 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 161 * add context elements like header anchor links | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 162 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 163 addContextElements : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 164 $('div[id] > :header:first').each(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 165 $('<a class="headerlink">\u00B6</a>'). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 166 attr('href', '#' + this.id). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 167 attr('title', _('Permalink to this headline')). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 168 appendTo(this); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 169 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 170 $('dt[id]').each(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 171 $('<a class="headerlink">\u00B6</a>'). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 172 attr('href', '#' + this.id). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 173 attr('title', _('Permalink to this definition')). | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 174 appendTo(this); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 175 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 176 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 177 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 178 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 179 * workaround a firefox stupidity | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 180 * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 181 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 182 fixFirefoxAnchorBug : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 183 if (document.location.hash) | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 184 window.setTimeout(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 185 document.location.href += ''; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 186 }, 10); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 187 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 188 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 189 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 190 * highlight the search words provided in the url in the text | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 191 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 192 highlightSearchWords : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 193 var params = $.getQueryParameters(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 194 var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 195 if (terms.length) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 196 var body = $('div.body'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 197 if (!body.length) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 198 body = $('body'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 199 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 200 window.setTimeout(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 201 $.each(terms, function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 202 body.highlightText(this.toLowerCase(), 'highlighted'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 203 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 204 }, 10); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 205 $('<p class="highlight-link"><a href="javascript:Documentation.' + | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 206 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 207 .appendTo($('#searchbox')); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 208 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 209 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 210 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 211 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 212 * init the domain index toggle buttons | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 213 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 214 initIndexTable : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 215 var togglers = $('img.toggler').click(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 216 var src = $(this).attr('src'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 217 var idnum = $(this).attr('id').substr(7); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 218 $('tr.cg-' + idnum).toggle(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 219 if (src.substr(-9) == 'minus.png') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 220 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 221 else | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 222 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 223 }).css('display', ''); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 224 if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 225 togglers.click(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 226 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 227 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 228 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 229 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 230 * helper function to hide the search marks again | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 231 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 232 hideSearchWords : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 233 $('#searchbox .highlight-link').fadeOut(300); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 234 $('span.highlighted').removeClass('highlighted'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 235 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 236 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 237 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 238 * make the url absolute | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 239 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 240 makeURL : function(relativeURL) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 241 return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 242 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 243 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 244 /** | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 245 * get the current relative url | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 246 */ | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 247 getCurrentURL : function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 248 var path = document.location.pathname; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 249 var parts = path.split(/\//); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 250 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 251 if (this == '..') | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 252 parts.pop(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 253 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 254 var url = parts.join('/'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 255 return path.substring(url.lastIndexOf('/') + 1, path.length - 1); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 256 }, | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 257 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 258 initOnKeyListeners: function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 259 $(document).keyup(function(event) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 260 var activeElementType = document.activeElement.tagName; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 261 // don't navigate when in search box or textarea | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 262 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 263 switch (event.keyCode) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 264 case 37: // left | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 265 var prevHref = $('link[rel="prev"]').prop('href'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 266 if (prevHref) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 267 window.location.href = prevHref; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 268 return false; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 269 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 270 case 39: // right | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 271 var nextHref = $('link[rel="next"]').prop('href'); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 272 if (nextHref) { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 273 window.location.href = nextHref; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 274 return false; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 275 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 276 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 277 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 278 }); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 279 } | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 280 }; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 281 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 282 // quick alias for translations | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 283 _ = Documentation.gettext; | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 284 | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 285 $(document).ready(function() { | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 286 Documentation.init(); | 
| 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 yating-l parents: diff
changeset | 287 }); | 
