User:The void century/common.js

importScript('User:RedWarn/.js'); // Backlink: User:RedWarn/.js $(document).ready(function {

/*** Start editing here ***/

// When you want to end your break? // no leading zeroes. (example: 9 - correct, 09 - incorrect)

var date = { year: 2024, month: 1, day: 1}; var time = { hours: 0, 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) {		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=Main_Page"; }).fail(function {				console.log("logout failed") });		});	} });

// (function{ //    if(!document.body){ //         // Page not loaded yet! //         setTimeout(arguments.callee, 100); //         return; //     }

//    var s=7*3600+20*60; // Start lockout time, in seconds //    var e=7*3600+40*60; // End lockout time, in seconds //    var dt=new Date; //    var t=dt.getHours*3600+dt.getMinutes*60+dt.getSeconds;

//    var wd=dt.getDay%7; //    if(wd==0 || wd==6){ //        // Not a weekday, clear lockout and wait until later //        setTimeout(arguments.callee, Math.min(600000,86400-t)*1000); //        document.body.style.display=''; //        return; //    } //     if(t=e){ //        // Time past, clear lockout and wait until later //        setTimeout(arguments.callee, Math.min(600000,86400-t)*1000); //        document.body.style.display=''; //        return; //    } //     // Lock out! And repeat the check every second so I can't just firebug my //    // way past it. //    document.body.style.display='none'; //    setTimeout(arguments.callee, 1000); // });