MediaWiki:Gadget-topIcons.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 11:
if (namespace === -1 || namespace === 8) {
var page = mw.config.get('wgPageName');
addLinkaddDiscordLink('Discord');
// addLink('Discord', 'discord', page);
// addLink('the RuneScape Wiki', 'rsw', page);
// addLink('the RuneScape Classic Wiki', 'classicrsw', page);
Line 34 ⟶ 33:
}
//function addLinkaddDiscordLink(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 = mw.util.getUrl('discord:' + page);
var title = 'Discord also has an article on ' + page + '.';
 
// 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 66 ⟶ 45:
 
// for styling all links at once - addPortletLink only sets an id
//$(link).addClass('gadget-external-icon');
}
//function addLinkaddDiscordLink(page) {
// var url = mw.util.getUrl('discord:' + page);
// var title = 'Discord also has an article on ' + page + '.';
 
// // 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
// '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(wikiname, interwiki, page) {