User:Geagea/Gadget-QuickDelete.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:Geagea/Gadget-QuickDelete. |
// <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.toolboxLinkPermission,
tag: '{{subst:npd}}',
talk_tag: '{{subst:image permission/he|1=%FILE%|base=Image permission}} {{subst:image permission|1=%FILE%}}',
img_summary: 'Missing permission',
talk_summary: 'Please send permission for %FILE% to [[COM:OTRS|OTRS]]'
},
];
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>