User:Pppery/global.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(function(){
setTimeout(function(){
//save, not publish
var save = $("#wpSave");
if(save && save.length) {
save.attr("value",save.attr("value").replace("Publish", "Save"));
}
}, 500);
});
mw.loader.load("https://en.wikipedia.org/w/index.php?action=raw&title=User:Pppery/no-ooui-contribs.js&ctype=text/javascript");
if(mw.config.get("wgDBname") !== "enwiki") {
if ( mw.loader.getState('ext.gadget.purgetab') === null ) {
mw.loader.load("https://en.wikipedia.org/w/load.php?modules=ext.gadget.purgetab");
} else {
mw.loader.using('ext.gadget.purgetab');
}
}
/*** 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: 2025, month: 1, day: 1};
var time = { hours: 2, minutes: 0, seconds: 0 };
/*** 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 && mw.config.get("wgDBname") == "enwiki")
{
if(!confirm("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!")) {
return;
}
mw.loader.using(["mediawiki.api", "mediawiki.user"]).then(function ()
{
new mw.Api().post(
{
action: 'logout',
token: mw.user.tokens.get('csrfToken')
})
});
}
});
/*** END WIKIBREAK ENFORCER ***/