1(function (window){ 2 /** 3 * æ¾ç¤ºè¯è¨ä¸æå表 4 */ 5 function showLang(element){ 6 var hasUp = element.classList.contains("up") 7 console.log("hasUp", hasUp) 8 if(hasUp){ 9 // å±å¼æä½ 10 element.classList.remove("up") 11 element.classList.add("dp") 12 } else { 13 element.classList.add("up") 14 element.classList.remove("dp") 15 } 16 var parent = element.parentElement 17 var lis = parent.querySelectorAll("li") 18 var lislength = lis.length 19 function changeHeight(k){ 20 setTimeout(()=>{ 21 // console.log("setTimeout") 22 lis[k].style.height = hasUp ? "40px" : "0px" 23 }) 24 } 25 function hideLi(i){ 26 setTimeout(()=>{ 27 lis[i].style.display = "none" 28 },500) 29 } 30 for(var i=0;i<lislength;i++){ 31 if(i){ 32 var hasbK = lis[i].classList.contains("bk") 33 if(!hasbK){ 34 lis[i].classList.add("bk") 35 } 36 if(hasUp){ 37 lis[i].style.display = "list-item" 38 }else { 39 hideLi(i) 40 } 41 changeHeight(i) 42 } 43 } 44 } 45 46 /** 47 * 页é¢å¸é¡¶åæ¢ 48 */ 49 function pageTogetherFixed(menuNav, headerDom){ 50 var hasFixed = menuNav.classList.contains("fixed-menu-nav") 51 console.log("hasFixed", hasFixed) 52 var navDropdownMenu = document.querySelector(".nav-dropdown-menu") 53 if(!hasFixed){ 54 if(window.scrollY > 50){ 55 menuNav.classList.add("fixed-menu-nav") 56 headerDom.style.paddingTop = "80px" 57 navDropdownMenu.style.top = "80px" 58 } 59 } else { 60 if(window.scrollY < 50){ 61 menuNav.classList.remove("fixed-menu-nav") 62 headerDom.style.paddingTop = "0" 63 navDropdownMenu.style.top = "136px" 64 } 65 } 66 } 67 /** 68 * ææºç«¯åºé¨å¼¹åº 69 */ 70 function mobileBottomTogetherShow(mobileBottom, comparePanel){ 71 var hasFixed = mobileBottom.getAttribute("style") 72 console.log("hasFixed", hasFixed) 73 if(!hasFixed || !/fixed/.test(hasFixed)){ 74 if(window.scrollY > 50){ 75 mobileBottom.style.position="fixed" 76 mobileBottom.style.bottom="0" 77 if(comparePanel){ 78 comparePanel.style.bottom = "60px" 79 } 80 } 81 } else { 82 if(window.scrollY < 50){ 83 mobileBottom.style.bottom="-100px" 84 setTimeout(()=>{ 85 mobileBottom.style.position="static" 86 },500) 87 if(comparePanel){ 88 comparePanel.style.bottom = "0" 89 } 90 } 91 } 92 } 93 94 /** 95 * 页颿»å¨ 96 */ 97 function pageScroll(){ 98 var menuNav = document.querySelector(".menu-nav") 99 var headerDom = document.querySelector("header") 100 var mobileBottom = document.querySelector(".mobile-bottom") 101 var comparePanel = document.getElementById("compare-panel") 102 // console.log("windowY", window.scrollY) 103 pageTogetherFixed(menuNav, headerDom) 104 mobileBottomTogetherShow(mobileBottom,comparePanel) 105 window.addEventListener('scroll',function (e){ 106 //æ§è¡æä½ 107 if(window.getIsMobile()){ 108 // ç§»å¨ç«¯ï¼åºé¨èåå¼¹çª 109 mobileBottomTogetherShow(mobileBottom,comparePanel) 110 } else { 111 // pc端ï¼å¸é¡¶ 112 pageTogetherFixed(menuNav, headerDom) 113 } 114 }) 115 116 } 117 pageScroll() 118 /** 119 * æ´é²å ¨å±common模ååæ¹æ³ 120 * @type {{searchNow: Window.common.searchNow}} 121 */ 122 window.common = { 123 /** 124 * æç´¢ 125 */ 126 searchNow: function (content){ 127 128 }, 129 showLang, 130 } 131})(window) 132 133function UrlDecode(zipStr){ 134 var uzipStr = ''; 135 for (var i = 0; i < zipStr.length; i += 1) { 136 var chr = zipStr.charAt(i); 137 if (chr === '+') { 138 uzipStr += ' '; 139 } else if (chr === '%') { 140 var asc = zipStr.substring(i + 1, i + 3); 141 if (parseInt('0x' + asc) > 0x7f) { 142 uzipStr += decodeURI('%' + asc.toString() + zipStr.substring(i+3, i+9).toString()); 143 i += 8; 144 }else{ 145 uzipStr += AsciiToString(parseInt('0x' + asc)); 146 i += 2; 147 } 148 }else{ 149 uzipStr += chr; 150 } 151 } 152 return uzipStr; 153} 154 155function StringToAscii(str){ 156 return str.charCodeAt(0).toString(16); 157} 158function AsciiToString(asccode){ 159 return String.fromCharCode(asccode); 160}
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.