User:AzaToth/twinklebatchdelete.js: Difference between revisions

Content deleted Content added
hey doood
update
Line 38:
function twinklebatchdelete() {
if( userIsInGroup( 'sysop' ) ) {
addPortletLink( 'p-cactions', "javascript:twinklebatchdelete.callback()", "batch", "tw-batch", "Delete pages found in this category/on this page", "");
}
}
addOnloadHook(twinklebatchdelete);
 
function getChecked( nobatchdeletest ) {
if( !( nobatchdeletest instanceof NodeList ) ) {
return nobatchdeletest.checked ? [ nobatchdeletest.value ] : [];
}
var result = [];
for(var i = 0; i < nobatchdeletest.length; ++i ) {
if( nobatchdeletest[i].checked ) {
result.push( nobatchdeletest[i].value );
}
}
return result;
}
 
twinklebatchdelete.unlinkCache = {};
Line 144 ⟶ 131:
twinklebatchdelete.callback.evaluate = function twinklebatchdeleteCallbackEvaluate(event) {
wgPageName = wgPageName.replace( /_/g, ' ' ); // for queen/king/whatever and country!
var pages = getChecked( event.target.getChecked( 'pages' );
var reason = event.target.reason.value;
var delete_page = event.target.delete_page.checked;