Jump to content

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
// Add a link to the actions menu ("p-cactions") to Special:Log for this page and Special:Report (extension-enabled) for the latest revision
 
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/', {+ conf.wgPageName),
page: conf.wgPageName'Logs',
}), 'Logs');,
// add report 'Logs for this page');
 
// 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',
'',
'Report a problem');
});
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.