User:Widr/vector.js: Difference between revisions

Content deleted Content added
No edit summary
Undid revision 1132838905 by Widr (talk)
 
(7 intermediate revisions by the same user not shown)
Line 12:
 
importScript('User:Beetstra/Gadget-Spam-blacklist-Handler.js');
 
importScript("User:Animum/easyblock.js"); //[[User:Animum/easyblock.js]]
 
importScript('User:Lupin/recent2.js');
Line 37 ⟶ 35:
importScript('User:AWeenieMan/furmeScroller.js');
 
importScript('User:MusikAnimal/userRightsManager.js');
//Mass rollback function
 
//Written by John254 and modified/rewritten by Writ Keeper; original is at https://en.wikipedia.org/wiki/User:John254/mass_rollback.js
importScript('User:Writ Keeper/Scripts/massRollback.js'); // Linkback: [[User:Writ Keeper/Scripts/massRollback.js]]
//Adapted from User:Mr.Z-man/rollbackSummary.js
 
//Instructions: Selecting the "rollback all" tab when viewing a user's contributions history
importScript('User:Writ Keeper/Scripts/massRevdel.js'); // Linkback: [[User:Writ Keeper/Scripts/massRevdel.js]]
//will open all rollback links displayed there. (Use with caution)
 
mw.loader.load("/w/index.php?title=User:Writ Keeper/Scripts/sectionLinkShortener.js&action=raw&ctype=text/javascript");
function rollbackEverythingWKMR(editSummary)
 
{
importScript( 'User:Enterprisey/unblock-review.js' ); // Backlink: [[User:Enterprisey/unblock-review.js]]
if(editSummary == null)
 
{
importScript("User:Firefly/more-block-info.js");
return false;
}
var userName = mw.config.get("wgRelevantUserName");
var titleRegex = /title=([^&]+)/;
$.post("/w/api.php",{action:"query",meta:"tokens",type:"rollback",format:"json"}, function(data)
{
rollbackToken = data.query.tokens.rollbacktoken;
$("a[href*='action=rollback']").each(function(ind, el)
{
var postInfo = {action:"rollback",title:titleRegex.exec(el.href)[1],token:rollbackToken,user:userName};
if(editSummary != "")
{
postInfo.summary = editSummary;
}
$.post("/w/api.php", postInfo, function()
{
$(el).after("reverted");
$(el).remove();
});
});
});
return false;
}
$(document).ready(function()
{
if(mw.config.get("wgCanonicalSpecialPageName") == "Contributions" && $("span.mw-rollback-link").length > 0)
{
mw.loader.using("mediawiki.util").then(function ()
{
mw.util.addPortletLink('p-cactions', '#', "rollback all", "ca-rollbackeverything", "rollback all edits displayed here");
$("#ca-rollbackeverything").click(function()
{
return rollbackEverythingWKMR(prompt("Enter an edit summary, or leave blank to use the default (or hit Cancel to cancel the rollback entirely)"));
});
});
}
});