1function setCookies(cookieName,cookieValue,minutes){ let today = new Date(); let expire = new Date(); let exp=minutes*1000*60||1000*3600*24*365;expire.setTime(today.getTime() + exp); document.cookie = cookieName+'='+escape(cookieValue)+ ';expires='+expire.toGMTString()+'; path=/'; } 2function readCookies(cookieName){ let theCookie=''+document.cookie; let ind=theCookie.indexOf(cookieName); if (ind==-1 || cookieName=='') return ''; let ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; let rico_ret = theCookie.substring(ind+cookieName.length+1,ind1).replace(/%/g, '%25'); return unescape(decodeURI(rico_ret)); } 3 4 5function login() { 6 if ($.cookie('dx_userid')) { 7 document.writeln("<a href='/bookcase' title='æç书æ¶'>ä¼å书æ¶</a> | <a href='/logout' title='éåºç»å½'>éåº</a>"); 8 } else { 9 document.writeln("<a href='/login'>ç»å½</a> | <a href='/register'>注å</a>"); 10 } 11} 12 13 14// ie7以ä¸çæµè§å¨æç¤º 15var isIE = !!window.ActiveXObject; 16var isIE6 = isIE && !window.XMLHttpRequest; 17var isIE8 = isIE && !!document.documentMode; 18var isIE7 = isIE && !isIE6 && !isIE8; 19function tip_ie7() { 20 if (isIE && (isIE6 || isIE7 || isIE8)) { 21 document.writeln("<div class=\"tip-browser-upgrade\">"); 22 document.writeln(" ä½ æ£å¨ä½¿ç¨IEä½çº§æµè§å¨ï¼å¦æä½ æ³ææ´å¥½çé 读ä½éªï¼<br />强ç建议æ¨ç«å³ <a class=\"blue\" href=\"http://windows.microsoft.com/zh-cn/internet-explorer/download-ie\" target=\"_blank\" rel=\"nofollow\">å级IEæµè§å¨</a> æè ç¨æ´å¿«æ´å®å ¨ç <a class=\"blue\" href=\"https://www.google.com/intl/zh-CN/chrome/browser/?hl=zh-CN\" target=\"_blank\" rel=\"nofollow\">è°·ææµè§å¨Chrome</a> ã"); 23 document.writeln("</div>"); 24 } 25} 26 27//é 读页é®çæä½äºä»¶ 28 29 30//æ¯å¦ç§»å¨ç«¯ 31function is_mobile() { 32 var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i; 33 var u = navigator.userAgent; 34 if (null == u) { 35 return true; 36 } 37 var result = regex_match.exec(u); 38 if (null == result) { 39 return false 40 } else { 41 return true 42 } 43} 44 45 46//åå²è®°å½ 47var _num = 100; 48 49function LastRead(){ 50 this.bookList="bookList" 51 } 52LastRead.prototype={ 53 set:function(bid,tid,title,texttitle,author,sortname){ 54 if(!(bid&&tid&&title&&texttitle&&author&&sortname))return; 55 var v=bid+'#'+tid+'#'+title+'#'+texttitle+'#'+author+'#'+sortname; 56 this.setItem(bid,v); 57 this.setBook(bid) 58 }, 59 60 get:function(k){ 61 return this.getItem(k)?this.getItem(k).split("#"):""; 62 }, 63 64 remove:function(k){ 65 this.removeItem(k); 66 this.removeBook(k) 67 }, 68 69 setBook:function(v){ 70 var reg=new RegExp("(^|#)"+v); 71 var books = this.getItem(this.bookList); 72 if(books==""){ 73 books=v 74 } 75 else{ 76 if(books.search(reg)==-1){ 77 books+="#"+v 78 } 79 else{ 80 books.replace(reg,"#"+v) 81 } 82 } 83 this.setItem(this.bookList,books) 84 85 }, 86 87 getBook:function(){ 88 var v=this.getItem(this.bookList)?this.getItem(this.bookList).split("#"):Array(); 89 var books=Array(); 90 if(v.length){ 91 92 for(var i=0;i<v.length;i++){ 93 var tem=this.getItem(v[i]).split('#'); 94 if(i>v.length-(_num+1)){ 95 if (tem.length>3) books.push(tem); 96 } 97 else{ 98 lastread.remove(tem[0]); 99 } 100 } 101 } 102 return books 103 }, 104 105 removeBook:function(v){ 106 var reg=new RegExp("(^|#)"+v); 107 var books = this.getItem(this.bookList); 108 if(!books){ 109 books="" 110 } 111 else{ 112 if(books.search(reg)!=-1){ 113 books=books.replace(reg,"") 114 } 115 116 } 117 this.setItem(this.bookList,books) 118 119 }, 120 121 setItem:function(k,v){ 122 if(!!window.localStorage){ 123 localStorage.setItem(k,v); 124 } 125 else{ 126 var expireDate=new Date(); 127 var EXPIR_MONTH=30*24*3600*1000; 128 expireDate.setTime(expireDate.getTime()+12*EXPIR_MONTH) 129 document.cookie=k+"="+encodeURIComponent(v)+";expires="+expireDate.toGMTString()+"; path=/"; 130 } 131 }, 132 133 getItem:function(k){ 134 var value="" 135 var result="" 136 if(!!window.localStorage){ 137 result=window.localStorage.getItem(k); 138 value=result||""; 139 } 140 else{ 141 var reg=new RegExp("(^| )"+k+"=([^;]*)(;|\x24)"); 142 var result=reg.exec(document.cookie); 143 if(result){ 144 value=decodeURIComponent(result[2])||""} 145 } 146 return value 147 148 }, 149 150 removeItem:function(k){ 151 if(!!window.localStorage){ 152 window.localStorage.removeItem(k); 153 } 154 else{ 155 var expireDate=new Date(); 156 expireDate.setTime(expireDate.getTime()-1000) 157 document.cookie=k+"= "+";expires="+expireDate.toGMTString() 158 } 159 }, 160 removeAll:function(){ 161 if(!!window.localStorage){ 162 window.localStorage.clear(); 163 } 164 else{ 165 var v=this.getItem(this.bookList)?this.getItem(this.bookList).split("#"):Array(); 166 var books=Array(); 167 if(v.length){ 168 for( i in v ){ 169 var tem=this.removeItem(v[k]) 170 } 171 } 172 this.removeItem(this.bookList) 173 } 174 } 175 } 176function showbook(){ 177 var showbook=document.getElementById('showbook'); 178 var bookhtml=''; 179 var books=lastread.getBook(); 180 var books=books.reverse(); 181 if(books.length){ 182 for(var i=0 ;i<books.length;i++){ 183 bookhtml+='<div class="bookbox"><div class="p10"><span class="num">'+(i+1)+'</span><div class="bookinfo"><h4 class="bookname"><a href="'+books[i][0]+'">'+books[i][2]+'</a></h4><div class="cat">åç±»ï¼'+books[i][5]+'</div><div class="author">ä½è ï¼'+books[i][4]+'</div><div class="update"><span>已读å°ï¼</span><a href="'+books[i][1]+'">'+books[i][3]+'</a></div></div><div class="delbutton"><a class="del_but" href="javascript:removebook(\''+books[i][0]+'\')">å é¤</a></div></div></div>'; 184 } 185 }else{ 186 bookhtml+='<div style="height:100px;line-height:100px; text-align:center">
186è¿æ¨æä»»ä½ä¹¦ç±( Ëï¹Ë )</div>' 187 } 188 showbook.innerHTML=bookhtml; 189} 190function removebook(k){ 191 lastread.remove(k); 192 showbook() 193} 194window.lastread = new LastRead(); 195
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.