MediaWiki:Common.js: Difference between revisions
Content added Content deleted
No edit summary |
(+ subpages, user rights) |
||
Line 11: | Line 11: | ||
mw.loader.using('mediawiki.util', function() { |
mw.loader.using('mediawiki.util', function() { |
||
// General usage pattern: mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ ); |
// General usage pattern: mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ ); |
||
// add logs for this page |
// add logs for this page |
||
mw.util.addPortletLink( |
mw.util.addPortletLink( |
||
'p-cactions', |
'p-cactions', |
||
mw.util.getUrl('Special:Log/' + conf.wgPageName), |
mw.util.getUrl('Special:Log/' + conf.wgPageName), |
||
'Logs', |
'Logs', , |
||
'' |
'Logs for this page'); |
||
⚫ | |||
// add extension-enabled report for the latest revision |
// add extension-enabled report for the latest revision |
||
mw.util.addPortletLink( |
mw.util.addPortletLink( |
||
'p-cactions', |
'p-cactions', |
||
mw.util.getUrl('Special:Report/' + mw.config.get('wgCurRevisionId')), |
mw.util.getUrl('Special:Report/' + mw.config.get('wgCurRevisionId')), |
||
'Report a problem', |
'Report a problem', |
||
, |
|||
'Report a problem'); |
'Report a problem'); |
||
⚫ | |||
// add list of subpages |
|||
} |
|||
mw.util.addPortletLink( |
|||
'p-cactions', |
|||
mw.util.getUrl('Special:PrefixIndex/' + conf.wgPageName), |
|||
'Subpages', |
|||
, |
|||
⚫ | |||
// only do the following if in user namespace |
|||
if (conf.wgCanonicalNamespace == 'User') { |
|||
// add user rights |
|||
mw.util.addPortletLink( |
|||
'p-cactions', |
|||
mw.util.getUrl('Special:UserRights/' + conf.wgPageName) |
|||
'User rights', |
|||
, |
|||
'User rights'); |
|||
}); |
|||
⚫ |