Changeset 5547430 in ammosreader for doc/build/html/_static/doctools.js
- Timestamp:
- 05/04/22 16:12:24 (3 years ago)
- Branches:
- AmmosSource, guix
- Children:
- 1b72462
- Parents:
- f3421e6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/build/html/_static/doctools.js
rf3421e6 r5547430 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-2022 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, … … 261 265 $('#searchbox .highlight-link').fadeOut(300); 262 266 $('span.highlighted').removeClass('highlighted'); 267 var url = new URL(window.location); 268 url.searchParams.delete('highlight'); 269 window.history.replaceState({}, '', url); 263 270 }, 264 271 … … 285 292 286 293 initOnKeyListeners: function() { 287 $(document).key up(function(event) {294 $(document).keydown(function(event) { 288 295 var activeElementType = document.activeElement.tagName; 289 // don't navigate when in search box or textarea 290 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 296 // don't navigate when in search box, textarea, dropdown or button 297 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 298 && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey 299 && !event.shiftKey) { 291 300 switch (event.keyCode) { 292 301 case 37: // left … … 296 305 return false; 297 306 } 307 break; 298 308 case 39: // right 299 309 var nextHref = $('link[rel="next"]').prop('href'); … … 302 312 return false; 303 313 } 314 break; 304 315 } 305 316 }
Note:
See TracChangeset
for help on using the changeset viewer.