此处公告通常对读者进行申明或对该WIKI某些规则进行公告,请在确认后修改本通告。本WIKI编辑权限开放,欢迎收藏起来防止迷路,也希望有爱的小伙伴和我们一起编辑哟~

全站通知:

MediaWiki:Common.js

来自天命之子kakaoWIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */

/* 筛选页面列表筛选 */
mw.loader.load("//wiki.biligame.com"+mw.config.values.wgScriptPath+"/index.php?title=MediaWiki:CardSelectTr.js&action=raw&ctype=text/javascript", "text/javascript");

/* 参见[[模板:ResourceLoader]]*/
$(function(){
    $('.resourceLoader').each(function() {
    	var $x = $(this);
    	var text = $.trim($x.text());
    	
    	if (!text) return;
    	
    	//加载模块
    	if ($x.data('isModule') == true) 
    		return mw.loader.load(text);	
    	
    	//自动补充MediaWiki命名空间
    	var ns = text.match('^.*?:');
    	if (!ns) text = 'MediaWiki:' + text;
    	
    	//加载CSS样式表
    	var mime = ($x.data('mime') || "text/javascript").toLowerCase();
    	if (mime == "text/css") {
    		if (text.slice(-4).toLowerCase() !== '.css') text = text + '.css';
    		//if ($x.data('debug') !== true) text = text + '&debug=false';
    		return mw.loader.load("//wiki.biligame.com"+mw.config.values.wgScriptPath+"/index.php?title="+text+"&action=raw&ctype=text/css", "text/css");
    	}
    	
    	//加载JS脚本
    	if (ns && ns[0].toLowerCase() !== 'mediawiki:') {
    		return console.log('ResourceLoader: 不允许加载MediaWiki以外的js脚本');
    	}
    	if (text.slice(-3).toLowerCase() !== '.js') text = text + '.js';
    	//if ($x.data('debug') !== true) text = text + '&debug=false';
    	return mw.loader.load("//wiki.biligame.com"+mw.config.values.wgScriptPath+"/index.php?title="+text+"&action=raw&ctype=text/javascript", "text/javascript");
    });
});

//添加【信息】按钮来查看页面的属性信息
$(function(){
	var $ca = $('#p-cactions > ul.menu > li#ca-history');
	var href = $ca.children('a').attr('href');

	if ($ca[0] && href) {
		$ca.after('<li id="ca-info"><a href="'
			+ href.replace('action=history','action=info')
			+'" title="本页面的信息">信息</a></li>'
		)
	}
});