1let ajaxRequestCount = 0; 2let loadingTimer = null; 3let loadingShownAt = 0; 4const SHOW_DELAY = 300; 5const MIN_DISPLAY_TIME = 500; 6 7// åå§è¼å ¥é®ç½©æ§å¶ 8let initialPageLoaded = false; 9let initialAjaxDone = false; 10 11// ä¸è¬ AJAX é®ç½©ç®¡ç 12function showLoadingMask() { 13 if (!$('.loadingPage').is(':visible')) { 14 $('.loadingPage').show(); 15 loadingShownAt = Date.now(); 16 } 17} 18 19function hideLoadingMask() { 20 const timeSinceShown = Date.now() - loadingShownAt; 21 if (timeSinceShown < MIN_DISPLAY_TIME) { 22 setTimeout(() => { 23 $('.loadingPage').hide(); 24 }, MIN_DISPLAY_TIME - timeSinceShown); 25 } else { 26 $('.loadingPage').hide(); 27 } 28} 29 30// AJAX å ¨å管ç 31$(document).ajaxStart(function () { 32 ajaxRequestCount++; 33 if (ajaxRequestCount === 1) { 34 loadingTimer = setTimeout(showLoadingMask, SHOW_DELAY); 35 } 36}); 37 38$(document).ajaxStop(function () { 39 ajaxRequestCount--; 40 if (ajaxRequestCount <= 0) { 41 clearTimeout(loadingTimer); 42 hideLoadingMask(); 43 ajaxRequestCount = 0; 44 45 // æª¢æ¥æ¯å¦æ¯åå§é®ç½© 46 if (!initialAjaxDone) { 47 initialAjaxDone = true; 48 tryHideInitialMask(); 49 } 50 } 51}); 52 53$(document).ready(function () { 54 initialPageLoaded = true; 55 tryHideInitialMask(); 56 57 setTimeout(() => { 58 if (!initialAjaxDone) { 59 initialAjaxDone = true; 60 tryHideInitialMask(); 61 } 62 }, 500); 63}); 64 65function tryHideInitialMask() { 66 if (initialPageLoaded && initialAjaxDone) { 67 $('.loadingPage').hide(); 68 } 69} 70 71function redirectWithMask(url) { 72 setTimeout(() => { 73 $('.loadingPage').show(); 74 }, 350); 75 window.location = url; 76} 77 78$(document).on('click', 'a', function (e) { 79 const $a = $(this); 80 const href = $a.attr('href'); 81 const target = $a.attr('target'); 82 // ä¸èçç¡ hrefãé¨é»ãJavaScript é£çµã_blankãmailtoãPublication/DownLoadAttachment çæ æ³ 83 if (!href || 84 href.startsWith('#') || 85 href.startsWith('javascript:') || 86 href.startsWith('mailto:') || 87 href.includes('Publication/DownLoadAttachment') || 88 (target && target === '_blank')) { 89 return; 90 } 91 e.preventDefault(); 92 e.stopImmediatePropagation(); 93 redirectWithMask(href); 94}); 95 96// æª¢æ¥æ¯å¦çº "ctrl + å·¦éµ" ççµåã 97let fullNewPageCheck = false; 98document.addEventListener("click", function (e) { 99 100 // Windows/Linux Ctrl + å·¦éµ 101 if (e.ctrlKey && e.button === 0) { 102 fullNewPageCheck = true; 103 return; 104 } 105 106 // macOS Cmd + å·¦éµ 107 if (e.metaKey && e.button === 0) { 108 fullNewPageCheck = true; 109 return; 110 } 111 112 fullNewPageCheck = false; 113}, true);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.