User:Writ Keeper/Scripts/massRevdel.js: Difference between revisions

Content deleted Content added
change wording
fix?
Line 6:
$("span.mw-revdelundel-link").each(function(ind,el){
var revId = /ids=(\d+)/.exec($(this).children("a").attr("href"))[1];
var pageTitle = /target=([^&]+)/.exec($(this).children("a").attr("href"))[1];
el.innerHTML = "<input type='checkbox' name='revdelIds"+decodeURIComponent(pageTitle)+"' class='revdelIds' value='"+revId+"'>";
});
$("ul.mw-contributions-list").after("</form>");
Line 40 ⟶ 41:
function()
{
//figure out which revisions and pages we're working on.
var revIds = "";
var revCount = 0;
var pageTitles = {};
$("input.revdelIds:checked").each(function(ind)
{
Line 50 ⟶ 52:
alert("You can't do more than 50 revdels at once! Canceling...");
return false;
}]
if(typeof pageTitles[$(this).attr("name")] == "undefined")
{
pageTitles[$(this).attr("name")] = $(this).val();
}
if(revIds != "")else
{
pageTitles[$(this).attr("name")] = pageTitles[$(this).attr("name")] + "|" + $(this).val();
revIds = revIds + "|";
}
revIds = revIds + $(this).val();
});
if(revIds == "")
Line 156 ⟶ 161:
if(confirm(confirmString))
{
var ajaxDatapageBatches = Object.keys(pageTitles);
var numBatches = pageBatches.length;
ajaxData = {action:"revisiondelete",type:"revision",ids:revIds,reason:summary,token: mw.user.tokens.get( 'editToken' )};
if(deleteStringvar numCompleted != "")0;
for each (title in pageBatches)
{
var ajaxData.hide=deleteString;
ajaxData = {action:"revisiondelete",type:"revision",ids:revIdspageTitles[title],reason:summary,token: mw.user.tokens.get( 'editToken' )};
if(revealStringdeleteString != "")
}) {
ajaxData.showhide=revealStringdeleteString;
}
if(revealString != "")
{
ajaxData.show=revealString;
}
$.post('/w/api.php/', ajaxData,function(){
{
numCompleted++;
if(numCompleted == numBatches)
{
alert("modified " + revCount + " revision(s) successfully!");
return false;
}
});
}
if(revealString != "")
{
ajaxData.show=revealString;
}
$.post('/w/api.php/', ajaxData,function(){
alert("modified " + revCount + " revision(s) successfully!");
return false;
})
}
return false;