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

Content deleted Content added
I hate oo.ui so much
nvm
Line 1:
mw.hook("wikipage.content").add( function()
{
mw.loader.using(["mediawiki.api","mediawiki.notify","oojs-ui"]).then(function ()
{
var apiLimit = 500;
Line 225:
confirmString = confirmString + "\nYour revdel summary is: "+ summary +"\n\nAre you sure you want to do this?";
OO.ui.if(confirm(confirmString).done(function(confirmed)
{
if(confirmed)var numCompleted = 0;
for (title in pageTitles)
{
var numCompleted = 0ajaxData;
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary};
for (title in pageTitles)
if(deleteString != "")
{
var ajaxData.hide=deleteString;
}
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary};
if(deleteStringrevealString != "")
{
ajaxData.show=revealString;
}
api.postWithToken('csrf', ajaxData).done(function()
{
numCompleted++;
if(numCompleted == numTitles)
{
mw.notify("modified " + revCount + " revision(s) successfully!");
ajaxData.hide=deleteString;
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 411 ⟶ 407:
confirmString = confirmString + "\nYour oversight summary is: "+ summary +"\n\nAre you sure you want to do this?";
OO.ui.if(confirm(confirmString).done(function(confirmed)
{
if(confirmed)var numCompleted = 0;
for (title in pageTitles)
{
var numCompleted = 0ajaxData;
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary,hide:deleteString};
for (title in pageTitles)
if(oversighting == 1)
{
var ajaxData.suppress = "yes";
}
ajaxData = {action:"revisiondelete",type:"revision",ids:pageTitles[title],reason:summary,hide:deleteString};
else if(oversighting == 10)
{
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!");
ajaxData.suppress = "yes";
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;
}