Jump to content

User:2NumForIce/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 2NumForIce (talk | contribs) at 19:01, 16 September 2023 (instead of hiding them (leaves parentheses) load the confirm rollback script instead). 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.
scriptsToManage = {
  "Sandbox" : "//en.wikipedia.org/w/index.php?title=User:2NumForIce/sandbox/.js&action=raw&ctype=text/javascript",
  "Toggle VF" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:P999/Toggle VF.js",
  "StatusChanger" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Enterprisey/StatusChanger.js",
  "AntiVandal" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Ingenuity/AntiVandal.js",
  "duplinks-alt" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Evad37/duplinks-alt.js",
  "AbuseFilterContribs" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Ingenuity/AbuseFilterContribs.js",
  "Capricorn" : "//en.wikipedia.org/w/index.php?title=User:Wugapodes/Capricorn.js&action=raw&ctype=text/javascript",
  "SVGedit" : "//commons.wikimedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Rillke/SVGedit.js", // hosted on https://commons.wikimedia.org/wiki/User:Rillke/SVGedit.js
  "TeahouseWrap" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:2NumForIce/wrap/teahouse.js",
  "JWB" : "//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript",
  "CitationsWrap" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:2NumForIce/wrap/citations.js",
  "copyvios" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:The Earwig/copyvios.js",
  "Lupin Tool" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Lupin/recent2.js",
  "AfC RedirectCat" : "//en.wikipedia.org/w/index.php?title=User:Eejit43/scripts/AFCRHS.js&action=raw&ctype=text/javascript",
  "Source Table Gen" : "//en.wikipedia.org/w/index.php?title=User:DannyS712/SATG.js&action=raw&ctype=text/javascript"
};

/***
 * Scripts above can be toggled using MusikAnimal's scriptManager.
 * Example:
 * "Example" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Example/Example.js"
 * Comma separated
***/


/***
 * Scripts below will be loaded every time.
 * Recommended to keep to minimum.
***/

importScript('User:RedWarn/.js'); // Backlink: [[User:RedWarn/.js]]
importScript('User:MusikAnimal/scriptManager.js'); // Backlink: [[User:MusikAnimal/scriptManager.js]]

/*** 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: 2020, month: 3, day: 13};
	var time = { hours: 18, minutes: 32, 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");
			});
		});
	}
});
/*** END WIKIBREAK ENFORCER ***/

/* Automate purge confirmation dialog */
if (mw.config.get('wgAction') === 'purge') {
    $('form[action*="action=purge"]').submit();
}

// Get rid of rollback links on watchlists
// [[Wikipedia:Customizing watchlists]] (revision 1108114347)
if(mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges'){
    mw.loader.load( '/w/index.php?title=User:Mr._Stradivarius/gadgets/ConfirmRollback.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Mr. Stradivarius/gadgets/ConfirmRollback.js]]
}