PageSourceSearch

https://www.prosopis.net/static/simple/common.js

js prosopis.net collected 2026-10-03 18:51:00 UTC 6,295 bytes, 195 lines download raw bytes

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.