User:Euphoria/common.js: Difference between revisions
From Test Wiki
no edit summary
(adjustment in the regular expression) |
No edit summary |
||
Line 20: | Line 20: | ||
var isContributionsPage = mw.config.get('wgCanonicalSpecialPageName') === 'Contributions'; | var isContributionsPage = mw.config.get('wgCanonicalSpecialPageName') === 'Contributions'; | ||
// If the current page is a user page, user talk page, or user contributions page, add the "SUL" link | // If the current page is a user page, user talk page, or user contributions page, and a valid username is available, add the "SUL" link | ||
if (isUserPage || isTalkPage || isContributionsPage) { | if ((isUserPage || isTalkPage || isContributionsPage) && username !== null) { | ||
var sulLink = mw.util.addPortletLink( | var sulLink = mw.util.addPortletLink( | ||
'p-cactions', | 'p-cactions', |