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