跳转到内容

User:Cdip150/common.js

维基百科,自由的百科全书

这是本页的一个历史版本,由Cdip150留言 | 贡献2024年4月28日 (日) 10:13编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
if(location.protocol=="http:"){
	location.replace((""+location).replace(/^http\:\/\// ,"https:\/\/"));
}

window.setTimeoutat=function(varDate, func){
	return setTimeout(func, (Date==(varDate || {}).constructor?varDate:new Date(varDate)).getTime()-Date.now() );
};

$( function(){

	//改變編輯框字型
	$("textarea").css({"font-size":"10pt","font-family":"細明體,MingLiU"}).each(function(){
		this.rows=Math.floor(this.rows*0.9);
	});

});

importScript('User:Cdip150/工具/介面/ConvertRefNoteTag.js');


// [[User:Bencmq/script/CheckUser.js]] 请保留此行注释
//importScript('User:Bencmq/script/CheckUser.js');


(function runVoteCount(){
	if( (mw || {util:null} ).util==null || $("#mw-normal-catlinks").length<=0 ) {
		setTimeout(runVoteCount, 5000);
		return null;
	}
	
	if( mw.config.get("wgPageName")!="Wikipedia:新条目推荐/候选" || mw.util.getParamValue("botcount")!=1) return null;
	
	$("img").each(function(){
		this.src=this.srcset="";
	}).remove();
	window.stop();
	
	$.post(
		'/w/api.php',
		{
			action : 'query',
			prop   : 'revisions',
			format : 'json',
			titles : 'User:Cdip150-bot/votecount.js',
			rvprop : 'content|timestamp',
		},
		null,
		'json'
	).done(
		function(data){
			var contentstr = '',
			timestamp = '',
			pageid = '',
			lastrevid = -1;
			
			for ( pageid in data.query.pages ) {
				if(pageid<0){
					timestamp = Math.floor(Date.now()/1000);
				}else{
					timestamp  = data.query.pages[pageid].revisions[0].timestamp;
					contentstr = data.query.pages[pageid].revisions[0]['*'];
					lastrevid  = data.query.pages[pageid].lastrevid;
				}
				break;
			}
			
			eval(""+contentstr);
		}
	);
})();