Tieba Common

Common JS for Baidu scripts by Gerald

Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta // @require https://update.greatest.deepsurf.us/scripts/144/35452/Tieba%20Common.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name	Tieba Common
// @namespace	http://geraldl.net/
// @author	Gerald <[email protected]>
// @description	Common JS for Baidu scripts by Gerald
// @version	1.0
// ==/UserScript==

if(typeof unsafeWindow=='undefined') unsafeWindow=window;
var $=unsafeWindow.$,PageData=unsafeWindow.PageData,utils=null,
		gkey='__ge_firefox';
(function(){
function getObj(key,def){
	var v=ff[key];
	if(v==null&&def!=null) setObj(key,v=def);
	return v;
}
function setObj(key,val){ff[key]=val;}
function notice(title,msg){
	var n=getObj('msg',{});
	if(!n[title]) {
		n[title]=1;
		var d=document.createElement('div');
		d.setAttribute('style','position:fixed;z-index:999999;background:white;border:1px solid;border-radius:3px;padding:10px;top:50px;left:50px;');
		d.innerHTML='<a href=# style="float:right">关闭</a><h3 style="margin-right:2.5em;">'+title+'</h3>'+msg;
		document.body.appendChild(d);
		d.firstChild.onclick=function(e){
			e.preventDefault();d.parentNode.removeChild(d);
		};
		return d;
	}
}
var ff=unsafeWindow[gkey];
if(!ff) ff=unsafeWindow[gkey]={};
utils=getObj('utils');
if(!utils)
	notice('未检测到依赖脚本!','请确认已安装并启用:<br><a target=_blank href=https://greatest.deepsurf.us/scripts/118>Tieba Utilities</a><br><p align=right>——寂寞的原子</p>');
})();