1// æ¯å¦ä¸ºç§»å¨ç«¯ 2function isMobile() { 3 var ua = navigator.userAgent; 4 5 var detect = { 6 // æ¯å¦ä¸ºç§»å¨ç»ç«¯ 7 mobile: !!ua.match(/AppleWebKit.*Mobile.*/), 8 // iosç»ç«¯ 9 ios: !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), 10 // androidç»ç«¯æè ucæµè§å¨ 11 android: ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1, 12 // æ¯å¦ä¸ºiPhoneæè QQHDæµè§å¨ 13 iPhone: ua.indexOf('iPhone') > -1, 14 // æ¯å¦iPad 15 iPad: ua.indexOf('iPad') > -1 16 }; 17 18 return (detect.mobile || detect.ios || detect.android || detect.iPhone || detect.iPad); 19}; 20 21function pageRender(templatepath,pagecount,totalnum,categoryPath,categorynum,pagetotalcount){ 22 var $pager = $("#pager"); 23 if ($pager.pagination()) { 24 $pager.pagination('destroy'); 25 } 26 if (!totalnum) { 27 return; 28 } 29 var nowHref = window.location.href, 30 secSrc = nowHref.split('/')[nowHref.split('/').length - 1]; 31 var pageSize =nowHref.split("pageIndex=")[1]; 32 if(pageSize == null){ 33 pageSize= secSrc.split(".")[0]; 34 if(!(/[0-9]/.test(pageSize))){ 35 pageSize=1; 36 } 37 } 38 var count = Math.ceil(totalnum/pagecount); 39 var pagerConfig = { 40 pageIndex: pageIndex, 41 pageSize: pagecount, 42 total: totalnum, 43 showJump: true, 44 jumpBtnText: 'Go', 45 pageBtnCount: 10, 46 showFirstLastBtn: true, 47 showInfo: true, 48 showPageSizes: true, 49 isChosen: false, //æ¯å¦ä½¿ç¨chosenæä»¶ä¸ææ¡ï¼ä¸ºtrueæ¶ï¼éå¼å ¥chosenæä»¶ç¸å ³ã 50 infoFormat: 'å ±<span>{total}</span>è¨é² '+pageSize+'/'+count+' åã ' 51 }; 52 if (isMobile()) { 53 $pager.pagination($.extend(pagerConfig, { 54 pageBtnCount: 3, 55 showFirstLastBtn: false, 56 showInfo: false, 57 showPageSizes: false 58 })); 59 } else { 60 $pager.pagination(pagerConfig); 61 } 62 $("#pager").on("pageClicked", function (event, data) { 63 if(data.pageIndex<=0){ 64 window.location.href=categoryPath+"/"+templatepath; 65 }else if(data.pageIndex<count){ 66 window.location.href= categoryPath+"/"+(data.pageIndex+1)+".html"; 67 }else{ 68 window.location.replace(categoryPath+"/"+templatepath+"?categoryNum="+categorynum+"&pageIndex="+(data.pageIndex+1)); 69 } 70 }).on('jumpClicked', function (event, data) { 71 if(data.pageIndex<=0){ 72 window.location.href=categoryPath+"/"+templatepath; 73 }else if(data.pageIndex<count){ 74 window.location.href=categoryPath+"/"+(data.pageIndex+1)+".html"; 75 }else{ 76 window.location.replace(categoryPath+"/"+templatepath+"?categoryNum="+categorynum+"&pageIndex="+(data.pageIndex+1)); 77 } 78 }); 79}
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.