User:AzaToth/twinklebatchdelete.js: Difference between revisions

Content deleted Content added
separate the functions
may it work on other pages as well, as delimages
Line 28:
}
function twinklebatchdelete() {
if( wgNamespaceNumber != Namespace.CATEGORY || ! userIsInGroup( 'sysop' ) ) {
return;
}
Line 76:
label: 'Reason: '
} );
if( wgNamespaceNumber == Namespace.CATEGORY ) {
var query = {
 
'action': 'query',
var query = {
'generator': 'categorymembers',
'gcmcategoryaction': wgTitle'query',
'generator': 'categorymembers',
'gcmlimit' : 5000, // the max for sysops
'gcmcategory': wgTitle,
'prop': [ 'categories', 'revisions' ],
'gcmlimit' : 5000, // the max for sysops
'rvprop': [ 'size' ]
'prop': [ 'categories', 'revisions' ],
};
'rvprop': [ 'size' ]
};
} else {
var query = {
'action': 'query',
'generator': 'links',
'titles': wgPageName,
'prop': [ 'categories', 'revisions' ],
'rvprop': [ 'size' ],
'gplnamespace' : [ 0, 1, 100, 101 ] // only in main pand portal, plus talk, for safty
};
};
 
var wikipedia_api = new Wikipedia.api( 'Grabbing pages', query, function( self ) {