Temporary test cleanup script
Tags: Reverted Mobile edit Mobile web edit Advanced mobile edit
Restore personal script after diagnostic
Tags: Manual revert Mobile edit Mobile web edit Advanced mobile edit
 
(14 intermediate revisions by the same user not shown)
Line 2: Line 2:
mw.loader.load( 'ext.gadget.BharatMitra' );
mw.loader.load( 'ext.gadget.BharatMitra' );
mw.loader.load( 'ext.gadget.UserStats' );
mw.loader.load( 'ext.gadget.UserStats' );
/* one-shot test cleanup, runs only with ?bmdelete=1 in the address */
( function () {
if ( location.search.indexOf( 'bmdelete=1' ) === -1 ) { return; }
if ( mw.config.get( 'wgUserName' ) !== 'Bharatwiki Socrates' ) { return; }
var titles = [
'User:Bharatwiki Socrates/sandbox/XFD test',
'User talk:Bharatwiki Socrates/sandbox/XFD test',
'Bharatpedia:Articles for deletion/User:Bharatwiki Socrates/sandbox/XFD test',
'User:Bharatwiki Socrates/sandbox/XFD delete test',
'User talk:Bharatwiki Socrates/sandbox/XFD delete test',
'Bharatpedia:Articles for deletion/User:Bharatwiki Socrates/sandbox/XFD delete test',
'User:Bharatwiki Socrates/sandbox/Speedy delete test',
'User talk:Bharatwiki Socrates/sandbox/Speedy delete test'
];
var box = document.createElement( 'div' );
box.id = 'bm-delete-report';
box.style.cssText = 'position:fixed;top:60px;left:10px;z-index:99999;background:#ffffff;color:#000000;border:2px solid #333333;padding:10px;font-size:14px;max-width:85%;white-space:pre-wrap;';
box.textContent = 'Deleting test pages, please wait...';
document.body.appendChild( box );
var api = new mw.Api();
var lines = [];
function step( i ) {
if ( i >= titles.length ) { box.textContent = 'DELETE REPORT DONE\n' + lines.join( '\n' ); return; }
api.postWithToken( 'delete', { action: 'delete', title: titles[ i ], reason: 'Test page created while testing the deletion tools', format: 'json' } )
.then( function () { lines.push( titles[ i ] + ' : DELETED' ); step( i + 1 ); } )
.catch( function ( code, data ) {
var info = ( data && data.error && data.error.info ) || code || 'unknown error';
lines.push( titles[ i ] + ' : FAILED ' + info );
step( i + 1 );
} );
}
step( 0 );
}() );

Latest revision as of 02:34, 21 November 2026

mw.loader.load('https://en.bharatpedia.org/w/index.php?title=MediaWiki:Gadget-OneClickArchiver.js&action=raw&ctype=text/javascript&maxage=0&smaxage=0&t=' + Date.now());
mw.loader.load( 'ext.gadget.BharatMitra' );
mw.loader.load( 'ext.gadget.UserStats' );