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

Content deleted Content added
fx
I hate oo.ui so much
Line 225:
confirmString = confirmString + "\nYour revdel summary is: "+ summary +"\n\nAre you sure you want to do this?";
if(OO.ui.confirm(confirmString).done(function(confirmed)
{
var numCompleted = 0;if(confirmed)
for (title in pageTitles)
{
var ajaxDatanumCompleted = 0;
for (title in pageTitles)
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary};
if(deleteString != "")
{
var ajaxData.hide=deleteString;
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary};
}
if(revealStringdeleteString != "")
{
ajaxData.show=revealString;
}
api.postWithToken('csrf', ajaxData).done(function()
{
numCompleted++;
if(numCompleted == numTitles)
{
if(deleteString ! ajaxData.hide= "")deleteString;
mw.notify("modified " + revCount + " revision(s) successfully!");
return false;
}
} if(revealString != "");
{
ajaxData.show=revealString;
}
api.postWithToken('csrf', ajaxData).done(function()
{
numCompleted++;
if(numCompleted == numTitles)
{
mw.notify("modified " + revCount + " revision(s) successfully!");
return false;
}
});
}
}
else mw.notify("Action canceled.");
});
return false;
}
Line 407 ⟶ 411:
confirmString = confirmString + "\nYour oversight summary is: "+ summary +"\n\nAre you sure you want to do this?";
if(OO.ui.confirm(confirmString).done(function(confirmed)
{
var numCompleted = 0;if(confirmed)
for (title in pageTitles)
{
var ajaxDatanumCompleted = 0;
for (title in pageTitles)
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary,hide:deleteString};
if(oversighting == 1)
{
var ajaxData.suppress = "yes";
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary,hide:deleteString};
}
else if(oversighting == 01)
{
ajaxData.suppress = "no";
}
else
{
mw.notify("Something went wrong, so we're going to abort without doing anything.");
}
api.postWithToken('csrf', ajaxData).done(function()
{
numCompleted++;
if(numCompleted == numTitles)
{
ajaxData.suppress = "yes";
mw.notify("modified " + revCount + " revision(s) successfully!");
return false;
}
} else if(oversighting == 0);
{
ajaxData.suppress = "no";
}
else
{
mw.notify("Something went wrong, so we're going to abort without doing anything.");
}
api.postWithToken('csrf', ajaxData).done(function()
{
numCompleted++;
if(numCompleted == numTitles)
{
mw.notify("modified " + revCount + " revision(s) successfully!");
return false;
}
});
}
}
else mw.notify("Action canceled.");
});
return false;
}