ShortCutter is a library for adding a shortcut to the
wiki-tools you can see on the fandom-community-header and the fandom-sticky-header.
Importing
To import the library in your own scripts, use:
importArticle({
type: 'script',
article: 'u:dev:MediaWiki:ShortCutter.js'
});
Usage
Methods
window.dev.ShortCutter.add(options, after, before)-
options-
hrefidclasstitleaccesskeyicon
afterbefore
Examples
importArticle({
type: 'script',
article: 'u:dev:MediaWiki:ShortCutter.js'
}).then(function () {
window.dev.ShortCutter.add({
id: 'random',
href: mw.util.getUrl('Special:Random')
});
});
importArticle({
type: 'script',
article: 'u:dev:MediaWiki:ShortCutter.js'
}).then(function () {
mw.loader.using('mediawiki.util').then(function () {
window.dev.ShortCutter.add({
id: 'watchlist',
href: '/Special:Watchlist',
title: 'A list of pages you are monitoring for changes [alt-shift-l]',
accesskey: 'l',
icon: '<svg viewBox="0 0 210 210"><polygon points="100,10 40,198 190,78 10,78 160,198"></polygon></svg>'
});
});
});
Text above can be found here (edit)