GaryJJSpate (talk | contribs) Created page with "→Any JavaScript here will be loaded for all users on every page load.: mw.hook('wikipage.content').add(function () { document.querySelectorAll('a[href*="index.php?title=Talk:"]').forEach(function(link) { let url = new URL(link.href); let title = url.searchParams.get('title'); if (title) { link.href = mw.config.get('wgArticlePath').replace('$1', title); } }); });" |
GaryJJSpate (talk | contribs) No edit summary |
||
| Line 2: | Line 2: | ||
mw.hook('wikipage.content').add(function () { | mw.hook('wikipage.content').add(function () { | ||
if (title) { | document.querySelectorAll('#ca-talk a, #ca-nstab-talk a').forEach(function(link) { | ||
var url = new URL(link.href); | |||
var title = url.searchParams.get('title'); | |||
if (title && title.startsWith('Talk:')) { | |||
link.href = mw.config.get('wgArticlePath').replace('$1', title); | link.href = mw.config.get('wgArticlePath').replace('$1', title); | ||
} | } | ||
}); | }); | ||
}); | }); | ||
Revision as of 12:16, 30 July 2026
/* Any JavaScript here will be loaded for all users on every page load. */
mw.hook('wikipage.content').add(function () {
document.querySelectorAll('#ca-talk a, #ca-nstab-talk a').forEach(function(link) {
var url = new URL(link.href);
var title = url.searchParams.get('title');
if (title && title.startsWith('Talk:')) {
link.href = mw.config.get('wgArticlePath').replace('$1', title);
}
});
});
