MediaWiki:Gadget-runerealm.js: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "(function ($, mw) { addDiscordLink(); function addDiscordLink(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...")
 
No edit summary
Line 4: Line 4:
function addDiscordLink(page) {
function addDiscordLink(page) {
var url = 'https://www.runerealm.org/discord';
var url = 'https://www.runerealm.org/discord';
var title = 'Join our Discord to talk about wiki content or becoming an editor.';
var title = 'Join our Discord to talk about wiki content or becoming an editor';


var link = mw.util.addPortletLink('p-namespaces', url, '',
var link = mw.util.addPortletLink('p-namespaces', url, '',

Revision as of 12:37, 20 October 2024

(function ($, mw) {
  addDiscordLink();
    
  function addDiscordLink(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');
  }
})(jQuery, mediaWiki);