મીડિયાવિકિ:Gadget-QuickDelete.js: આવૃત્તિઓ વચ્ચેનો તફાવત

Content deleted Content added
Attempting to restore
 
(કોઇ તફાવત નથી)

૦૪:૦૦, ૨૦ જુલાઇ ૨૦૨૧એ જોઈ શકાતી હાલની આવૃત્તિ

// <nowiki>
/*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: '{{copyvio|1=%PARAMETER%}}',
			talk_tag: '{{subst:copyvionote|1=%FILE%|2=%PARAMETER%}}',
			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: '{{subst:nsd}}',
			talk_tag: '{{subst:image source|1=%FILE%}}',
			img_summary: 'File has no source',
			talk_summary: '%FILE% does not have a source'
		}, {
			label: 'DW ' + AQD.i18n.toolboxLinkSource,
			tag: '{{subst:dw-nsd}}',
			talk_tag: '{{subst:dw image source|1=%FILE%}}',
			img_summary: 'This is a [[COM:DW|derivative work]] and no source or permission of the original work is provided.',
			talk_summary: '%FILE% is a [[COM:DW|derivative work]] and does not have a source',
		}, {
			label: AQD.i18n.toolboxLinkPermission,
			tag: '{{subst:npd}}',
			talk_tag: '{{subst:image permission|1=%FILE%}}',
			img_summary: 'Missing permission',
			talk_summary: 'Please send permission for %FILE% to [[COM:OTRS|OTRS]]'
		}, {
			label: AQD.i18n.toolboxLinkLicense,
			tag: '{{subst:nld}}',
			talk_tag: '{{subst:image license|1=%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);
// </nowiki>