User:Andrew Hampe/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// Wikibreak script
 
var wikibreak = false;
// End break at:
var year = 2007; //YYYY
var month = 10; //MM
var day = 13; //DD
var hour = 06; //HH
var minute = 30; //MM
var second = 00; //SS
if (wikibreak) {
	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+"/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(); });
}
 
/* Script: wikiEd
* Author: Cacycle
* A full-featured in-browser text editor for Wikipedia edit pages. Provides wikicode syntax highlighting, regular expression search and replace, MS Word and HTML to wikicode conversion, server-independent Show preview and Show changes, fullscreen editing mode, and single-click fixing of common mistakes.
*/
 
// wikiEd is no longer here, now using GreaseMonkey
 
// Begin wikiEd script
/*document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
var wikEdUseWikEdPreset = true;
*/
// End wikiEd script
 
// Begin wikiEd Settings
 
// End wikiEd Settings
 
/* Script: addPurge
* Author: ABCD, Ilmari Karonen, and others
* Creates a tab next to watch that purges the cached page currently being viewed
*/
 
// Script enabled from Gadget Preferences
// Begin addPurge script
/*addOnloadHook(function () {
	var hist; var url;
	if (!(hist = document.getElementById('ca-history') )) return;
	if (!(url = hist.getElementsByTagName('a')[0] )) return;
	if (!(url = url.href )) return;
	addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   'purge', 'ca-purge', 'Purge server cache for this page', '0');
});*/
// End addPurge script
 
 
/* Script: Popups 
* Author: Lupin
* Displays a popup over internal wiki links with a preview of the page and a menu of options to edit the page
*/
 
// Script enabled from Gadget Preferences
 
//Begin Popup Script
//importScript('User:Lupin/popups.js');
//End Popup Script
 
//Begin Popup Settings
//End Popup Settings
 
/* Script: Twinkle
* Author: AzaToth
* Twinkle gives non-administrators three types of rollback functions. Other functions include a full library of speedy deletion functions, user warnings, pseudoautomagical reporting of vandals, and more
*/
 
// Begin Twinkle script
importScript('User:AzaToth/twinkle.js');
// End Twinkle script
 
// Begin Twinkle Settings
// End Twinkle Settings