Misplaced Pages

User:Tenebrae/monobook.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:Tenebrae Browse history interactively← Previous editContent deleted Content added
Revision as of 00:39, 29 November 2006 view sourceTenebrae (talk | contribs)Extended confirmed users155,424 edits wikibreak until Wed., Nov. 29 at 6 p.m.← Previous edit Latest revision as of 21:06, 6 February 2021 view source Ladsgroup (talk | contribs)Extended confirmed users, IP block exemptions, Pending changes reviewers, Rollbackers20,540 editsm Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879
(49 intermediate revisions by 2 users not shown)
Line 2: Line 2:


//Please adjust the following variables according to when you want to end your break: //Please adjust the following variables according to when you want to end your break:
var year = 2006; //YYYY var year = 2007; //YYYY
var month = 11; //MM var month = 11; //MM
var day = 29; //DD var day = 07; //DD
var hour = 18; //HH var hour = 18; //HH
var minute = 00; //MM var minute = 00; //MM
Line 37: Line 37:
} }


addOnloadHook(function() { EnforceWikiBreak(); }); $(function() { EnforceWikiBreak(); });


/* </nowiki></pre> */ /* </nowiki></pre> */

Latest revision as of 21:06, 6 February 2021

/* <pre><nowiki> */

//Please adjust the following variables according to when you want to end your break:
var year = 2007; //YYYY
var month = 11; //MM
var day = 07; //DD
var hour = 18; //HH
var minute = 00; //MM
var second = 00; //SS 

function EnforceWikiBreak() {
    var currentdate = new Date();
    var enforced_break_end = new Date(year,changemonth(),day,hour,minute,second);
    if (currentdate > enforced_break_end) {
      // alert ("Welcome back from your enforced wikibreak!");
    } else {
      alert ("Enforced wikibreak until " + enforced_break_end.toLocaleString() + " (currently " + currentdate.toLocaleString() + "). Bye!");
      window.location.href = ("http://"+document.location.host+"/search/?title=Special:Userlogout&returnto=Main_Page");
    }
}

function changemonth() {
//thing to subtract 1 from the month. you can't use month-1 because it removes the '0' from the front
if(month==01) return 00;
if(month==02) return 01;
if(month==03) return 02;
if(month==04) return 03;
if(month==05) return 04;
if(month==06) return 05;
if(month==07) return 06;
if(month==08) return 07;
if(month==09) return 08;
if(month==10) return 09;
if(month==11) return 10;
if(month==12) return 11;
return 00;
}

$(function() { EnforceWikiBreak(); });

/* </nowiki></pre> */