Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
 
(19 intermediate revisions by 2 users not shown)
Line 3: Line 3:
// Discord link
// Discord link
$(document).ready(function() {
$(document).ready(function() {
    // Create the Discord link element
     var discordElement = $(`
     var discordLink = $('<li id="discord-link"><a href="https://discord.gg/your-invite-code">Join Discord</a></li>');
        <div class="g-discord citizen-header__item citizen-dropdown" style="display: flex; justify-content: center; align-items: center;">
   
            <a href="https://discord.gg/gscripts" target="_blank">
    // Prepend it as the first item in the overflow menu
                <img src="https://wiki.gscripts.co/images/4/4b/Discord_30_30.png" alt="Discord" width="30" height="30">
     $('#p-vector-user-menu-overflow .vector-menu-content-list').prepend(discordLink);
            </a>
        </div>
    `);
     $(".citizen-header .citizen-header__logo").after(discordElement);
});
});


 
/* $(document).ready(function() {
$(document).ready(function() {
     var $sections = $('.accordion-section');
     var $sections = $('.accordion-section');


Line 45: Line 47:
         }
         }
     });
     });
});
}); */
 
// Load Citizen.js if using Citizen skin
if (mw.config.get('skin') === 'citizen') {
  mw.loader.load('/index.php?title=MediaWiki:Citizen.js&action=raw&ctype=text/javascript');
}