MediaWiki:Gadget-topIcons.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 11:
if (namespace === -1 || namespace === 8) {
var page = mw.config.get('wgPageName');
// addLink('Discord');
// addLink('Discord', 'discord', page);
// addLink('the RuneScape Wiki', 'rsw', page);
// addLink('the RuneScape Classic Wiki', 'classicrsw', page);
Line 33:
});
}
//function addLink(page) {
// var url = 'https://www.runerealm.org/discord';
// var title = 'Join our Discord to talk about wiki content or becoming an editor.';
 
// var link = mw.util.addPortletLink('p-namespaces', url, '',
// // no text - use background-image instead
// 'gadget-external-discord',
// // button id
// title // title text shown on hover
// );
 
// // for styling all links at once - addPortletLink only sets an id
// //$(link).addClass('gadget-external-icon');
//}
function addLink(page) {
var url = 'https://wwwmw.runerealmutil.org/getUrl('discord:' + page);
var title = 'JoinDiscord ouralso Discordhas toan talkarticle abouton wiki' content+ orpage becoming an+ editor'.';
 
// Special and MediaWiki namespaces
if (namespace === -1 || namespace === 8) {
url += window.location.search; // include url parameters
title = 'Open this page on Discord.';
}
var link = mw.util.addPortletLink('p-namespaces', url, '',
// no text - use background-image instead
Line 46 ⟶ 66:
 
// for styling all links at once - addPortletLink only sets an id
//$(link).addClass('gadget-external-icon');
}

Navigation menu