MediaWiki:Common.js: Difference between revisions

subpages only appear in user ns
(+ subpages, user rights)
(subpages only appear in user ns)
 
(2 intermediate revisions by the same user not shown)
Line 11:
mw.loader.using('mediawiki.util', function() {
 
// 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),
'Logs', ,);
'Logs for this page');
 
// addonly extension-enableddo reportthe forfollowing theif in latestuser revisionnamespace
if (conf.wgCanonicalNamespace == 'User') {
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:Report/' + mw.config.get('wgCurRevisionId')),
'Report a problem',
,
'Report a problem');
 
// add listuser ofrights subpagesfor this page
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:PrefixIndexUserRights/' + conf.wgPageName),
'Subpages',User rights');
,
'Subpages');
 
// only doadd thelist followingof ifsubpages infor userthis namespacepage
mw.util.addPortletLink(
if (conf.wgCanonicalNamespace == 'User') {
'p-cactions',
mw.util.getUrl('Special:ReportPrefixIndex/' + mwconf.config.get('wgCurRevisionId')wgPageName),
'Logs for this pageSubpages');
,}
 
// add extension-enabled report for the latest // add user rightsrevision
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:UserRightsReport/' + confmw.wgPageNameconfig.get('wgCurRevisionId')),
'Report a problem'User rights', );
});
,
}
'User rights');
});
}