User:DestroyerTau/global.js

/* * Script: MorePageActions * * Author: WooperIsBest * Co-Author: Caburum * A simple script that adds extra page actions to the page contributions dropdown menu */

'use strict';
 * (function ($, mw) {

if (window.MorePageActionsLoaded) return; window.MorePageActionsLoaded = true;

const ddm = $('#p-cactions > ul'), // Gets dropdown menu currentPage = encodeURIComponent(mw.config.get('wgPageName')), path = mw.config.get('wgArticlePath');

function link(id, page, msg) { $( '' + mw.msg(msg) + '' ).appendTo(ddm); }

mw.loader.using(['mediawiki.api']).then(function {		return new mw.Api.loadMessagesIfMissing([ 'whatlinkshere', 'log', 'currentrev', 'movesubpage' ]);	}).then(function {		link('whatlinkshere ca-linkshere', 'Special:WhatLinksHere/' + currentPage, 'whatlinkshere');		link('logs', 'Special:Log?page=' + currentPage, 'log');		link('latestrevision ca-latestdiff', currentPage + '?diff=latest', 'currentrev');		link('subpages', 'Special:PrefixIndex/' + currentPage + '/', 'movesubpage');	});

}(window.jQuery, window.mediaWiki));

window.customKeyboardShortcuts = [ {		selector: '#ca-history', accesskey: 'h', },	{		selector: '#ca-move', accesskey: 'm', },	{		selector: '#ca-purge', accesskey: 'p', },	{		selector: ['#ca-protect', '#ca-unprotect'], accesskey: '=', },	{		selector: ['#ca-delete', '#ca-undelete'], accesskey: 'd', },	{		selector: '#ca-talk', accesskey: 't', },	{		selector: '#ca-watch', accesskey: 'w', },	];

importArticles({	type: 'script',	articles: [		'u:dev:MediaWiki:RemapAccesskeys.js',		'u:dev:MediaWiki:PurgeButton/code.js',		'u:dev:MediaWiki:MultiUpload.js',		'u:dev:MediaWiki:MassProtect/code.js',		'u:dev:MediaWiki:AjaxBatchDelete.js',	] });