MediaWiki:Gadget-QuickDelete.js

// /*global jQuery:false, mediaWiki:false, AjaxQuickDelete:false */ /*jshint curly:false, scripturl:true*/ (function ($, mw) { 'use strict';

if (!window.AjaxQuickDelete) return; var AQD = AjaxQuickDelete;

AQD.doInsertTagButtons = function {

var runInsert = function (buttons) { $.each(buttons, function (k, v) {			mw.util.addPortletLink('p-tb', 'javascript:AjaxQuickDelete.insertTagOnPage("' +					v.tag + '","' +					v.img_summary + '","' +					v.talk_tag + '","' +					v.talk_summary + '","' +					v.prompt_text + '","","' +					v.optin_notify + '");', v.label );		});	};

AQD.insertTagButtons = [{ label: AQD.i18n.toolboxLinkCopyvio, tag: '', talk_tag: '%FILE%', img_summary: 'Marking as possible copyvio because %PARAMETER%', talk_summary: 'Notification of possible copyright violation for %FILE%', prompt_text: AQD.i18n.reasonForCopyvio }, {			label: AQD.i18n.toolboxLinkSource, tag: '', talk_tag: '%FILE%', img_summary: 'File has no source', talk_summary: '%FILE% does not have a source' }, {			label: 'DW ' + AQD.i18n.toolboxLinkSource, tag: '', talk_tag: '%FILE%', img_summary: 'This is a derivative work and no source or permission of the original work is provided.', talk_summary: '%FILE% is a derivative work and does not have a source', }, {			label: AQD.i18n.toolboxLinkPermission, tag: '', talk_tag: '%FILE%', img_summary: 'Missing permission', talk_summary: 'Please send permission for %FILE% to VRT' }, {			label: AQD.i18n.toolboxLinkLicense, tag: '', talk_tag: '%FILE%', img_summary: 'Missing license', talk_summary: '%FILE% does not have a license' }	];

if (mw.config.get('wgNamespaceNumber') === 6) { // Merge the user defined buttons (Help:AjaxQuickDelete) into the optional buttons if (window.AjaxDeleteExtraButtons) AQD.insertTagButtons = AQD.insertTagButtons.concat(window.AjaxDeleteExtraButtons); runInsert(AQD.insertTagButtons); }

$(document).on('AjaxQuickDeleteExtraButtonsReady', function {		runInsert(window.AjaxDeleteExtraButtons);	}); }; })(jQuery, mediaWiki); //