Jump to content

User:SpacemanSpiff/common.js

From Wikipedia, the free encyclopedia
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.
// AfD
// importScript('User:Evad37/XFDcloser.js'); // [[User:Evad37/XFDcloser]]
// importScript('User:Mr.Z-man/closeAFD.js');

// Yet another AfC helper script v4. activate when needed
//importScript('User:Timotheus Canens/afchelper4.js'); 

//[[User:Ucucha/HarvErrors]], activate when needed
//importScript('User:Ucucha/HarvErrors.js'); 

//[[User:Animum/easyblock.js]]
importScript('User:Animum/easyblock.js');

// [[User:NuclearWarfare/Mark-blocked script.js]]
importScript('User:NuclearWarfare/Mark-blocked script.js');

// Deletion sorting script [[WP:FWDS]]
importScript('User:Fox Wilson/delsort-monobook.js');
window.addEventListener('load', function(){
  defineLink("India");
  defineLink("Cricket");
}, false);

//[[User:Ale_jrb/Scripts]]
importScript('User:Ale_jrb/Scripts/csdhelper.js');

//[[User:Ale_jrb/Scripts]]
importScript('User:Ale_jrb/Scripts/csdcheck.js');

//Mass rollback function
//Written by John254 and modified/rewritten by Writ Keeper; original is at https://wiki.riteme.site/wiki/User:John254/mass_rollback.js
//Adapted from User:Mr.Z-man/rollbackSummary.js
//Instructions: Selecting the "rollback all" tab when viewing a user's contributions history
//will open all rollback links displayed there. (Use with caution)
  
function rollbackEverythingWKMR() 
{
	var userName = /Contributions\/(.+)/.exec(mw.config.get("wgTitle"))[1];
	var tokenRegex = /token=([^&]+)/;
	var titleRegex = /title=([^&]+)/;
	$("a[href*='action=rollback']").each(function(ind, el)
	{
		var regexResults = tokenRegex.exec(el.href);
		rollbackToken = decodeURIComponent(regexResults[1]);
		
		var postInfo = {action:"rollback",title:titleRegex.exec(el.href)[1],token:rollbackToken,user:userName};
		$.post("/w/api.php", postInfo, function()
		{
			$(el).after("reverted");
			$(el).remove();
		});
	});
}
$(document).ready(function()
{
	if(mw.config.get("wgCanonicalSpecialPageName") == "Contributions" && $("span.mw-rollback-link").length > 0)
	{
		mw.util.addPortletLink('p-cactions', 'javascript:rollbackEverythingWKMR()', "rollback all", "ca-rollbackeverything", "rollback all edits displayed here");
		$("#ca-rollbackeverything").click(function(){return confirm("Really rollback *everything*?")});
	}
});

//Other
//importScript('User:Ale_jrb/Scripts/statusCheck.js'); //Online or not for users
importScript('User:Ale_jrb/Scripts/userhist.js');
importScript('User:Plastikspork/admindash.js');
//importScript('Wikipedia:WikiProject User scripts/Scripts/Force edit summary alternative');

/* User:קיפודנחש/cat-a-lot.js */
importScript( 'User:קיפודנחש/cat-a-lot.js' );// Backlink: [[User:קיפודנחש/cat-a-lot.js]]

/* User:MusikAnimal/responseHelper.js */
importScript( 'User:MusikAnimal/responseHelper.js' );// Backlink: [[User:MusikAnimal/responseHelper.js]]

/* User:Technical_13/Scripts/OneClickArchiver */
importScript( 'User:Technical_13/Scripts/OneClickArchiver.js' );// Backlink: [[User:Technical_13/Scripts/OneClickArchiver]]

importScript( 'User:DannyS712/Draft no cat.js' );// [[User:DannyS712/Draft no cat.js]]

importScript('User:Mr. Stradivarius/gadgets/Draftify.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/Draftify.js]]


// Add [[WP:Reflinks]] launcher in the toolbox on left
$(function () {
 mw.util.addPortletLink(
  "p-tb",     // toolbox portlet
  "http://dispenser.homenet.org/~dispenser/cgi-bin/webreflinks.py/" + mw.config.get('wgPageName')
   + "?client=script&citeweb=on&overwrite=&limit=20&lang=" + mw.config.get('wgContentLanguage'),
  "Reflinks"  // link label
)});