MediaWiki:Common.js: Difference between revisions
From MuttWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
if ((pagename.startsWith("Template:") || pagename.startsWith("Module:")) && (pagename.indexOf("/doc") != -1)) { | if ((pagename.startsWith("Template:") || pagename.startsWith("Module:")) && (pagename.indexOf("/doc") != -1)) { | ||
const url = mw.util.getUrl(pagename + "/doc"); | const url = mw.util.getUrl(pagename + "/doc"); | ||
console.log(url); | |||
mw.util.addPortletLink('p-cactions', url, 'Documentation', 'ca-visit-documentation', 'Visit the documentation page'); | mw.util.addPortletLink('p-cactions', url, 'Documentation', 'ca-visit-documentation', 'Visit the documentation page'); | ||
} | } | ||
})(); | })(); | ||
Revision as of 22:06, 26 January 2026
/* Any JavaScript here will be loaded for all users on every page load. */
(function() {
const pagename = mw.config.get('wgPageName');
console.log(pagename);
if ((pagename.startsWith("Template:") || pagename.startsWith("Module:")) && (pagename.indexOf("/doc") != -1)) {
const url = mw.util.getUrl(pagename + "/doc");
console.log(url);
mw.util.addPortletLink('p-cactions', url, 'Documentation', 'ca-visit-documentation', 'Visit the documentation page');
}
})();