User:Xiplus/js/unblock-zh-helper/load.js

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

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

/* eslint indent: ["error", "tab"] */
if (
	mw.config.get('wgCanonicalSpecialPageName') === 'Blankpage' &&
	/\/unblock-zh-helper$/.test(mw.config.get('wgPageName'))
) {
	$('#firstHeading').text('unblock-zh-helper');
	$('title').text('unblock-zh-helper');
	$('#mw-content-text').html('<div id="app"></div>');

	mw.loader.using(['ext.gadget.morebits', 'mediawiki.api', 'mediawiki.jqueryMsg'], function() {
		var api = new mw.Api();
		api.loadMessagesIfMissing(['antispoof-name-illegal']).then(function() {
			mw.loader.load('https://zh.wikipedia.org/w/index.php?title=User:Xiplus/js/unblock-zh-helper/style.css&action=raw&ctype=text/css', 'text/css');
			mw.loader.load('https://zh.wikipedia.org/w/index.php?title=User:Xiplus/js/unblock-zh-helper/unblock-zh-helper.iife.js&action=raw&ctype=text/javascript');
		});
	});
	mw.loader.load('ext.gadget.CollapsibleSidebar');
}