Jump to content

User:LukeSurl/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by LukeSurl (talk | contribs) at 13:39, 22 May 2019 (work hours lockout). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Kephir/gadgets/rater.js'); // [[User:Kephir/gadgets/rater]]

importScript('MediaWiki:Gadget-afchelper-beta.js'); // AFCH beta script [[MediaWiki:Gadget-afchelper-beta.js]]

importScript("User:Writ Keeper/Scripts/teahouseUtility.js"); // Gives one-click option to add Teahouse invitation or talkback to a user

importScript("User:Writ Keeper/Scripts/teahouseTalkback.js"); // Adds Talkback reminder when you save an edit at the Teahouse

importScript("User:Writ Keeper/Scripts/teahouseTalkbackLink.js"); // Adds a talkback link to signatures on the Teahouse 

importScript('User:Ryan Vesey/THQ.js'); // Adds Teahouse link to sidebar

importScript("User:Ocaasi/WikiLoveinstallscript.js");// Adds Teahouse Badges to WikiLove

importScript( 'User:Enterprisey/reply-link.js' ); // Backlink: [[User:Enterprisey/reply-link.js]]

window.kephirUnclutter = {
	enableOnPageLoad            : true,
	wrapDiscussions             : true,
	collapseDiscussionsByDefault: false,
	signaturesProcess           : true,
	signaturesMinimise          : true,
	signaturesColourise         : false,
	signaturesExceptions        : ["LukeSurl"],
	userAnnotations             : { /* "username": "annotation" pairs, separated by commas */ },
	processSig                  : function (context) { return false; },
	postProcessSig              : function (context) { return false; }
};
importScript('User:Kephir/gadgets/unclutter.js'); // [[User:Kephir/gadgets/unclutter]]



mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" );

//Adds 'Check Refs' to the toolbox, links to http://toolserver.org/~dispenser/cgi-bin/reflinks.py -- Dispenser's reference title fixer.

function refcheck()
{
  addPortletLink("p-tb", "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py?page=" + wgPageName + "&citeweb=on", "Check Refs");
}
 
function linkcheck()
{
  addPortletLink("p-tb", "http://toolserver.org/~dispenser/cgi-bin/webchecklinks.py?page=" + wgPageName, "Check Links");
}
 
if ( wgNamespaceNumber == 0 ) {
 addOnloadHook(refcheck);
 addOnloadHook(linkcheck);
}

importScript('User:Theopolisme/afch-rewrite.js') // [[User:Theopolisme/afch-rewrite.js]]

// [[User:Dr pda/prosesize]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User%3ADr+pda%2Fprosesize.js&action=raw&ctype=text/javascript');

/*** 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: 2018, month: 9, day: 17};
	var time = { hours: 17, 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!");
		location = "//"+location.host+"/w/index.php?title="
			+ "Special:Userlogout&returnto=Main_Page";
	}
});
/*** END WIKIBREAK ENFORCER ***/

/* Forbid access using this account on weekdays from 0900 to 1700 local time. */
(function(){
    if(!document.body){
        // Page not loaded yet!
        setTimeout(arguments.callee, 100);
        return;
    }

    var s=9*3600+0*60; // Start lockout time, in seconds
    var e=17*3600+0*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<s){
        // Not time yet, clear lockout and try again later
        setTimeout(arguments.callee, Math.min(600000,s-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);
})();