Changeset ada37fa in ammosreader for doc/html/_static/doctools.js
- Timestamp:
- 05/04/22 12:00:45 (3 years ago)
- Branches:
- AmmosSource, guix
- Children:
- 64565fe
- Parents:
- 1846087
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/html/_static/doctools.js
r1846087 rada37fa 5 5 * Sphinx JavaScript utilities for all documentation. 6 6 * 7 * :copyright: Copyright 2007-20 19by the Sphinx team, see AUTHORS.7 * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. 8 8 * :license: BSD, see LICENSE for details. 9 9 * … … 30 30 /** 31 31 * small helper function to urldecode strings 32 * 33 * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL 32 34 */ 33 35 jQuery.urldecode = function(x) { 34 return decodeURIComponent(x).replace(/\+/g, ' '); 36 if (!x) { 37 return x 38 } 39 return decodeURIComponent(x.replace(/\+/g, ' ')); 35 40 }; 36 41 … … 88 93 node.nodeValue = val.substr(0, pos); 89 94 if (isInSVG) { 90 var bbox = span.getBBox();91 95 var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 92 rect.x.baseVal.value = bbox.x; 96 var bbox = node.parentElement.getBBox(); 97 rect.x.baseVal.value = bbox.x; 93 98 rect.y.baseVal.value = bbox.y; 94 99 rect.width.baseVal.value = bbox.width; 95 100 rect.height.baseVal.value = bbox.height; 96 101 rect.setAttribute('class', className); 97 var parentOfText = node.parentNode.parentNode;98 102 addItems.push({ 99 103 "parent": node.parentNode, … … 285 289 286 290 initOnKeyListeners: function() { 287 $(document).key up(function(event) {291 $(document).keydown(function(event) { 288 292 var activeElementType = document.activeElement.tagName; 289 // don't navigate when in search box or textarea 290 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 293 // don't navigate when in search box, textarea, dropdown or button 294 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 295 && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey 296 && !event.shiftKey) { 291 297 switch (event.keyCode) { 292 298 case 37: // left … … 296 302 return false; 297 303 } 304 break; 298 305 case 39: // right 299 306 var nextHref = $('link[rel="next"]').prop('href'); … … 302 309 return false; 303 310 } 311 break; 304 312 } 305 313 }
Note:
See TracChangeset
for help on using the changeset viewer.