User:MilkyDefer/common.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/*** BEGIN WIKIBREAK ENFORCER ***/
$(document).ready(function()
{
/*** Start editing here ***/
// When you want to end your break?
// no leading zeroes. (example: 9 - correct, 09 - incorrect)
var date = { year: 2020, month: 4, day: 30};
var time = { hours: 23, minutes: 59, seconds: 59 };
/*** Stop editing here ***/
var currentDate = new Date();
var enforcedBreakEnd = new Date(
date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);
if (currentDate <= enforcedBreakEnd)
{
alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
mw.loader.using(["mediawiki.api", "mediawiki.user"]).then(function ()
{
new mw.Api().post(
{
action: 'logout',
token: mw.user.tokens.get('csrfToken')
}).done(function (data)
{
location = "//" + location.host + "/w/index.php?title="
+ "Special:Userlogin&returnto=Wikipedia%3A首页";
}).fail(function ()
{
console.log("logout failed")
});
});
}
});
/*** END WIKIBREAK ENFORCER ***/
/*mw.loader.load('https://wikiplus-app.com/Main.js'); Temporarily disable WikiPlus*/
mw.loader.load( '//zh.wikipedia.org/w/index.php?title=User:和平奮鬥救地球/checklinks.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//zh.wikipedia.org/w/index.php?title=User:Vozhuo/Tool/MOSNUM_dates.js&action=raw&ctype=text/javascript' );