1 2function toPage(obj) { 3 console.log(obj) 4 var nPageCount = obj.count; 5 var sPageExt = obj.ext; 6 var sPageName = obj.name; 7 var _num = document.getElementById("num").value; 8 if (isNaN(_num)) { 9 alert("请è¾å ¥æ°å"); 10 return false; 11 } 12 var str = sPageName + "_" + (_num - 1) + "." + sPageExt; 13 var url = location.href.substring(0, location.href.lastIndexOf("/") + 1); 14 if (_num < 1 || _num == null) 15 location.href = url + sPageName + "." + sPageExt; 16 else if (_num > nPageCount) 17 alert("æ¬é¢éæå¤" + nPageCount + "页"); 18 else 19 location.href = url + str; 20} 21//ä¸éè¦ç¢çåè½çå页 22function createPageHTML(_nPageCount, _nCurrIndex, _sPageName, _sPageExt, jump) { 23 24 var sPageName = _sPageName.toLowerCase(); 25 var sPageExt = _sPageExt.toLowerCase(); 26 var nPageCount = _nPageCount; 27 if (_nPageCount == null || _nPageCount <= 1) { 28 return; 29 } 30 // document.write("<span>å ±</span><span class='red'>" + nPageCount + "</span><span>页</span>"); 31 32 var nCurrIndex = _nCurrIndex || 0;
33 document.write('<div class="page">'); 34 // 1 è¾åºé¦é¡µåä¸ä¸é¡µ 35 // 1.1 å½å页æ¯é¦é¡µ 36 if (_nPageCount > 1) { 37 // document.write('<a class="first" href=' + _sPageName + '.' + sPageExt + '>é¦é¡µ</a>'); 38 } 39 if (nCurrIndex == 0) { 40 document.write("<a href='javascript:void(0)' class='pre'>ä¸ä¸é¡µ</a> "); 41 document.write('<span class="btns">'); 42 document.write("<a class='active' href='javascript:void(0)'>1</a>"); 43 } else if (nCurrIndex == 1) { // 1.2 å½å页æ¯ç¬¬2页 44 document.write("<a class='pre' href='" + _sPageName + "." + sPageExt + "'>ä¸ä¸é¡µ</a>"); 45 document.write('<span class="btns">'); 46 document.write("<a href='" + _sPageName + "." + sPageExt + "'>1</a>"); 47 } else { // 1.3 å½å页䏿¯é¦é¡µå第2页 48 document.write("<a class='pre' href='" + _sPageName + "_" + (nCurrIndex - 1) + "." + sPageExt + "'>ä¸ä¸é¡µ</a>"); 49 document.write('<span class="btns">'); 50 document.write("<a href='" + _sPageName + "." + sPageExt + "'>1</a>"); 51 } 52 53 // 2 è¾åºä¸é´å页 54 // è¿éæ¯å è½½çç¥å·çflag 55 var isHiddenExist = 0; 56 for (var i = 1; i < _nPageCount; i++) { 57 if (nCurrIndex == i) { // 2.1 å½å页 æ 红 58 document.write("<a class='active' href='javascript:void(0);'>" + (i + 1) + "</a>"); 59 } else { 60 // 2.2 妿æ¯é¡µé¦ï¼ä¸é´é¡µï¼é¡µå°¾ï¼å½å页çååä¸é¡µåä¸çç¥ 61 if (i < 4 || i < ((nCurrIndex + 1) + 3) && i > ((nCurrIndex + 1) - 3) || i > (_nPageCount / 2 - 2) && i < (_nPageCount / 2 + 2) || i > (_nPageCount - 3)) { 62 document.write("<a style='#ed534b' href='" + _sPageName + "_" + i + "." + 63 sPageExt + 64 "'>" + (i + 1) 65 + "</a>"); 66 isHiddenExist = 0; 67 } else { // 2.3 å¦åå°±æé ... 68 if (isHiddenExist == 0) { 69 document.write("<a class='dian' href='javascript:void(0)'>...</a>"); 70 isHiddenExist = 1; 71 } 72 } 73 } 74 } 75 //å页跳转 76 // 3 è¾åºä¸ä¸é¡µå尾页 77 // 3.1 å½å页æ¯å°¾é¡µ
78 document.write('</span>'); 79 if (nCurrIndex == (_nPageCount - 1)) { 80 document.write("<a class='next' href='javascript:void(0)'>ä¸ä¸é¡µ</a>"); 81 } else if (nCurrIndex == 0) { // 3.2 å½å页æ¯é¦é¡µ 82 console.log("==" + _nPageCount); 83 document.write("<a class='next' href='" + _sPageName + "_" + (nCurrIndex + 1) + "." + sPageExt + 84 "'>ä¸ä¸é¡µ</a>"); 85 } else { // 3.3 å½å页䏿¯å°¾é¡µåé¦é¡µ 86 87 document.write("<a class='next' href='" + _sPageName + "_" + (nCurrIndex + 1) + "." + sPageExt + "'>ä¸ä¸é¡µ</a>"); 88 } 89 if (_nPageCount > 1) { 90 // document.write('<a class="last" href=' + _sPageName + '_' + (_nPageCount - 1) + '.' + sPageExt + '>尾页</a>'); 91 } 92 var obj = { 93 count: _nPageCount, 94 ext: sPageExt, 95 name: _sPageName 96 } 97 var objStr = JSON.stringify(obj); 98 99 if (jump) { 100 document.write( 101 "<span class='jump'>转å°ç¬¬</span><input type='text' id='num' /><span>页</span><input class='cur go' type='submit' value='æäº¤' onClick='javascript:toPage(" + objStr + ")' />" 102 ); 103 }
104 document.write('</div>'); 105 106 107}
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.