More actions
No edit summary |
No edit summary |
||
(8 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
}); | }); | ||
/* $(document).ready(function() { | |||
$(document).ready(function() { | |||
var $sections = $('.accordion-section'); | var $sections = $('.accordion-section'); | ||
Line 48: | 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'); | |||
} |
Latest revision as of 14:27, 25 April 2025
/* Any JavaScript here will be loaded for all users on every page load. */ // Discord link $(document).ready(function() { var discordElement = $(` <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"> <img src="https://wiki.gscripts.co/images/4/4b/Discord_30_30.png" alt="Discord" width="30" height="30"> </a> </div> `); $(".citizen-header .citizen-header__logo").after(discordElement); }); /* $(document).ready(function() { var $sections = $('.accordion-section'); // Initialize: disable links in all headers by default (since all start collapsed) $sections.find('.accordion-header a').css('pointer-events', 'none'); // Handle header clicks $('.accordion-header').on('click', function(e) { var $section = $(this).closest('.accordion-section'); var $content = $section.find('.accordion-content'); var isHidden = $content.is(':hidden'); if (isHidden) { // Collapse all other sections $sections.not($section).find('.accordion-content').slideUp(200); $sections.not($section).removeClass('expanded'); $sections.not($section).find('.accordion-header a').css('pointer-events', 'none'); // Expand this section $content.slideDown(200); $section.addClass('expanded'); $section.find('.accordion-header a').css('pointer-events', 'auto'); } else { // Collapse this section $content.slideUp(200); $section.removeClass('expanded'); $section.find('.accordion-header a').css('pointer-events', 'none'); } // Prevent link click if content is hidden if (e.target.tagName === 'A' && $content.is(':hidden')) { e.preventDefault(); } }); }); */ // 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'); }