User:JJPMaster/Scripts/masscat.js: Difference between revisions

Content deleted Content added
No edit summary
actually added the defining feature
Line 24:
var MCarts = confirm("Your articles are these, right?\n" + massCatGetArticles());
var MCcat;
var MCfinal;
if (MCarts) MCcat = confirm(`And you're adding them to ${massCatGetCat()}, right?`);
if (MCcat) MCfinal = confirm("Are you sure you want to do this mass categorization?");
if (MCcat) alert("Success");
if (MCfinal) doMassCat();
}
 
function doMassCat() {
var params;
massCatGetArticles().forEach((e) => {
params = {
action: "edit",
title: e,
appendtext: `[[Category:{massCatGetCat()}]]`,
summary: "Mass categorization with [[User:JJPMaster/masscat.js]]"
},
api = new mw.Api();
 
api.postWithToken( 'csrf', params ).done( function ( data ) {
console.log( data );
___location.reload();
} );
 
});
}