Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ajaxBatchDeleteAPage( title, reason ) {
- var url = wgServer + wgScriptPath + '/api.php?action=query&prop=info&intoken=delete|protect&titles=' + encodeURIComponent( title ) + '&format=json';
- $.getJSON( url, function( data ) {
- for ( var p in data.query.pages ) {
- break;
- }
- var DT = data.query.pages[p].deletetoken,
- PT = data.query.pages[p].protecttoken,
- url1 = wgServer + wgScriptPath + '/api.php?title=' + encodeURIComponent( title ) + '&reason=' + encodeURIComponent( reason ) + '&format=json',
- url2 = url1 + '&action=protect&protections=create=sysop&token=' + encodeURIComponent( PT );
- url1 += '&action=delete&token=' + encodeURIComponent( DT );
- $.post( url1, function() {
- $( '#abd-output' ).append( ' > Deleted\n' );
- $( '#abd-output' ).append( '> Attempting to fully protect [[' + page + ']]\n' );
- $.post( url2, function() {
- $( '#abd-output' ).append( ' > Fully protected\n' );
- setTimeout( ajaxDeleteStart, 1000 );
- });
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement