From 86f3ce6210c9ecfe07b2ec730742ab6706bd0d1a Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 6 Jun 2011 16:14:50 -0300 Subject: Doc js files sync with latest release of sphinx. --- doc/_themes/pysidedocs/static/doctools.js | 51 +++++--- doc/_themes/pysidedocs/static/jquery.js | 180 +++++++++++++++++++++++----- doc/_themes/pysidedocs/static/underscore.js | 16 +++ 3 files changed, 200 insertions(+), 47 deletions(-) create mode 100644 doc/_themes/pysidedocs/static/underscore.js (limited to 'doc') diff --git a/doc/_themes/pysidedocs/static/doctools.js b/doc/_themes/pysidedocs/static/doctools.js index 9447678cd..8b9bd2c0e 100644 --- a/doc/_themes/pysidedocs/static/doctools.js +++ b/doc/_themes/pysidedocs/static/doctools.js @@ -1,16 +1,31 @@ -/// XXX: make it cross browser +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for all documentation. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); /** * make the code below compatible with browsers without * an installed firebug like debugger - */ if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", - "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {} + window.console[names[i]] = function() {}; } + */ /** * small helper function to urldecode strings @@ -44,7 +59,7 @@ jQuery.getQueryParameters = function(s) { result[key] = [value]; } return result; -} +}; /** * small function to check if an array contains @@ -56,7 +71,7 @@ jQuery.contains = function(arr, item) { return true; } return false; -} +}; /** * highlight a given string on a jquery object by wrapping it in @@ -67,7 +82,7 @@ jQuery.fn.highlightText = function(text, className) { if (node.nodeType == 3) { var val = node.nodeValue; var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery.className.has(node.parentNode, className)) { + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { var span = document.createElement("span"); span.className = className; span.appendChild(document.createTextNode(val.substr(pos, text.length))); @@ -79,14 +94,14 @@ jQuery.fn.highlightText = function(text, className) { } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { - highlight(this) + highlight(this); }); } } return this.each(function() { highlight(this); }); -} +}; /** * Small JavaScript module for the documentation. @@ -96,7 +111,7 @@ var Documentation = { init : function() { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); - this.initModIndex(); + this.initIndexTable(); }, /** @@ -107,7 +122,7 @@ var Documentation = { LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions - // can savely bound to a different name (_ = Documentation.gettext) + // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; if (typeof translated == 'undefined') @@ -167,7 +182,7 @@ var Documentation = { var body = $('div.body'); window.setTimeout(function() { $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlight'); + body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); $('