MediaWiki:Common.js: Difference between revisions
no edit summary
(beautify + comment) |
No edit summary |
||
Line 1:
// add a bunch of stuff to the default p-cactions dropdown. documentation at [[mw:ResourceLoader/Core modules]] and https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util-method-addPortletLink
var conf = mw.config.get([
'wgCanonicalNamespace',
Line 9 ⟶ 8:
if (conf.wgCanonicalNamespace !== 'Special') {
// First wait for mediawiki.util to load, and the page to be ready.
mw.loader.using('mediawiki.util', function() {
// add logs▼
// General usage pattern: mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ );
▲ // add logs for this page
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:Log/'
// add extension-enabled report for the latest revision
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:Report/' + mw.config.get('wgCurRevisionId')),
'Report a problem',
'',
'Report a problem');
});
}
|