Welcome to the DFO World Wiki. With many major updates since the release of DFO, many items are missing. Visit Item Database Project to learn more.
Please remember to click "show preview" before saving the page.
Thanks for the updated logo snafuPop!
MediaWiki:Gadget-instantDelete.js
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* _____________________________________________________________________________ * | | * | === WARNING: GLOBAL GADGET FILE === | * | Changes to this page affect many users. | * | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. | * |_____________________________________________________________________________| * * Due to the convenience of instant delete, sysops should have this disabled in their preferences until many pages needed to be deleted. //dfoplayer * */ /** * Instantly delete a page in the file namespace. * @author Krinkle, 2011 * @author Bryan, 2007 * @source commons.wikimedia.org/wiki/MediaWiki:Gadget-instantDelete.js * @version 1.0 (2011-12-28) * @compatible MediaWiki 1.18 */ ( function () { "use strict"; function vqdNow(){ var reason, container; reason = document.getElementById('vqdReason').value; container = document.getElementById('vqdContainer'); $(container).text('Loading...'); $.getJSON( mw.util.wikiScript( 'api' ), { format: 'json', action: 'query', prop: 'info', intoken: 'delete', titles: mw.config.get( 'wgPageName' ) }, function ( data ) { var id, page, token; if ( !data || !data.query || !data.query.pages ) { return; } for ( id in data.query.pages ) { page = data.query.pages[id]; if ( page.deletetoken ) { token = page.deletetoken; break; } } if ( !token ) { return; } $.ajax({ url: mw.util.wikiScript( 'api' ), data: { format: 'json', action: 'delete', title: mw.config.get( 'wgPageName' ), reason: reason, token: token }, type: 'POST', success: function(data){ if(data && !data.error){ $(container).text('Page deleted.'); } else { $(container).text('Deletion failed.'); } }, error: function(){ $(container).text('Deletion failed.'); } }); }); } function veryQuickDelete (){ var form, inputbox, submit, container, filetoc, cattoc; form = document.createElement('form'); form.onsubmit = function () { return false; }; form.style.display = 'inline'; inputbox = document.createElement('input'); inputbox.value = 'Requested Deletion'; inputbox.id = 'vqdReason'; inputbox.size = '60'; form.appendChild(inputbox); submit = document.createElement('input'); submit.type = 'submit'; submit.value = 'Delete'; submit.onclick = vqdNow; form.appendChild(submit); container = document.createElement('li'); container.id = 'vqdContainer'; container.appendChild(form); filetoc = document.getElementById('filetoc'); if (filetoc) { filetoc.appendChild(container); } //dfoplayer. allows pages with category footer to add cattoc = document.getElementById('catlinks'); if (cattoc) { cattoc.appendChild(container); } } //dfoplayer. 0 is main. 6 is files. 10 is templates. 14 is categories if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) //Get anything above 0, or main { $( document ).ready( veryQuickDelete ); } }());