PageSourceSearch

https://www.bcbay.com/js/tpl.js

js bcbay.com collected 2026-10-02 11:06:19 UTC 1,382 bytes, 38 lines download raw bytes

1var tpl_host=document.location.host;
2//简繁转换
3function langTo(lang){
4	if(location.pathname.match(/.*(\.php|\/)$/)){//动态页面
5		if(location.search.match(/(\?|&)?language(=[^&]*)?/)){
6			location.href=location.href.replace(/language(=[^&]*)?/,"language="+lang);
7		}else{
8			location.href=location.origin+location.pathname+location.search+(location.search!=""?'&':'?')+"language="+lang;
9		}
10	}else{//静态页面
11		var is_big5=lang=="big5";
12		document.cookie="lang="+lang+";domain="+document.location.host.replace(/(.*)\.([a-z]+)\.(com|net)$/,'.$2.$3')+";path=/;";
13		location.href=location.href.replace(is_big5?/\/([0-9]+|[a-z]+)\/([0-9-]+|index)\.htm/:/\/big5\/([^\/]+)\.htm/,is_big5?"/$1/big5/$2.htm":"/$1.htm");
14	}
15}
16//内外链接新闻统计
17function newsnlink(mid,nlink){
18	var jsonp = document.createElement('script');
19	jsonp.src = `https://${tpl_host}/getcommentcount.php?mid=${mid}&justc=true`;
20	jsonp.type = 'text/javascript';
21	document.head.appendChild(jsonp);
22	document.head.removeChild(jsonp);
23	window.open(nlink);
24}
25//繁体静态链接跳转
26function langlink(llink,target){
27	if(document.cookie.replace(/.*;?lang=([^;]*);?.*/,"$1")!="big5") return true;
28	
29	llink=llink.replace(/\/([0-9-]+)\.htm/,"/big5/$1.htm");
30	
31	if(target=="_blank"){
32		window.open(llink);
33	}else{
34		window.location.href=llink;
35	}
36
37	return false;
38}

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.