Benutzer:ABF/monobook.js
Erscheinungsbild
Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
/* <pre><nowiki> */
//Please adjust the following variables according to when you want to end your break:
var year = 2007; //YYYY
var month = 08; //MM
var day = 19; //DD
var hour = 02; //HH
var minute = 22; //MM
var second = 22; //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 ("Willkommen zurück von deiner Wikipause!");
} else {
alert ("Du bist bis " + enforced_break_end.toLocaleString() + " (currently " + currentdate.toLocaleString() + ") noch in Wikipause. CU!");
window.location.href = ("http://"+document.location.host+"/w/index.php?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;
}
addOnloadHook(function() { EnforceWikiBreak(); });
/* </nowiki></pre> */