summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-02-25 16:16:18 +0100
committerMichał Górny <mgorny@gentoo.org>2020-02-25 16:16:18 +0100
commit3acb91f3c49d455504c9c5f72b6266c2327e8ab6 (patch)
tree1130807ddb73da3beeefcf1868ecc60b3a5025c4 /_static
parentRebuild with updated theme (diff)
downloadpolicy-guide-3acb91f3c49d455504c9c5f72b6266c2327e8ab6.tar.gz
policy-guide-3acb91f3c49d455504c9c5f72b6266c2327e8ab6.tar.bz2
policy-guide-3acb91f3c49d455504c9c5f72b6266c2327e8ab6.zip
Update for PG idents
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to '_static')
-rw-r--r--_static/basic.css2
-rw-r--r--_static/doctools.js7
-rw-r--r--_static/language_data.js2
-rw-r--r--_static/searchtools.js22
4 files changed, 20 insertions, 13 deletions
diff --git a/_static/basic.css b/_static/basic.css
index b04360d..0119285 100644
--- a/_static/basic.css
+++ b/_static/basic.css
@@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
diff --git a/_static/doctools.js b/_static/doctools.js
index b33f87f..daccd20 100644
--- a/_static/doctools.js
+++ b/_static/doctools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -283,10 +283,11 @@ var Documentation = {
},
initOnKeyListeners: function() {
- $(document).keyup(function(event) {
+ $(document).keydown(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
- if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
+ if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
+ && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
diff --git a/_static/language_data.js b/_static/language_data.js
index 5266fb1..d2b4ee9 100644
--- a/_static/language_data.js
+++ b/_static/language_data.js
@@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
diff --git a/_static/searchtools.js b/_static/searchtools.js
index ad84587..d11b33a 100644
--- a/_static/searchtools.js
+++ b/_static/searchtools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -63,6 +63,11 @@ var Search = {
htmlElement.innerHTML = htmlString;
$(htmlElement).find('.headerlink').remove();
docContent = $(htmlElement).find('[role=main]')[0];
+ if(docContent === undefined) {
+ console.warn("Content block not found. Sphinx search tries to obtain it " +
+ "via '[role=main]'. Could you check your theme or template.");
+ return "";
+ }
return docContent.textContent || docContent.innerText;
},
@@ -245,6 +250,7 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
+ var requestUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
// dirhtml builder
var dirname = item[0] + '/';
@@ -253,15 +259,15 @@ var Search = {
} else if (dirname == 'index/') {
dirname = '';
}
- listItem.append($('<a/>').attr('href',
- DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
- highlightstring + item[2]).html(item[1]));
+ requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;
+
} else {
// normal html builders
- listItem.append($('<a/>').attr('href',
- item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
- highlightstring + item[2]).html(item[1]));
+ requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
}
+ listItem.append($('<a/>').attr('href',
+ requestUrl +
+ highlightstring + item[2]).html(item[1]));
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
@@ -269,7 +275,7 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
- $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX,
+ $.ajax({url: requestUrl,
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;