JS: Difference between revisions

From ConsoleMods Wiki
Jump to navigation Jump to search
(HIDE NAMESPACES MOVED TO LOCALSETTINGS.PHP)
(AUTO HIDE SIDEBAR ON MOBILE MOVED TO LOCALSETTINGS.PHP)
Line 1: Line 1:
<nowiki>
<nowiki>
/* AUTO HIDE SIDEBAR ON MOBILE */
if (screen.width < 450) {
    $('body').addClass("sidebar-collapsed");
}
/* TOGGLE HIGHLIGHT ON ORDERED LISTS WHEN CLICKED */
/* TOGGLE HIGHLIGHT ON ORDERED LISTS WHEN CLICKED */
$(":not(.references li) ol li").click(function (e) {
$(":not(.references li) ol li").click(function (e) {

Revision as of 03:05, 10 June 2023

/* TOGGLE HIGHLIGHT ON ORDERED LISTS WHEN CLICKED */ $(":not(.references li) ol li").click(function (e) { e.stopPropagation(); if(!($(this).hasClass("highlighted"))) { $(this).addClass("highlighted"); $(this).find("li").addClass("highlighted"); } else { $(this).removeClass("highlighted"); $(this).find("li").removeClass("highlighted"); } }); /* TOGGLE SIDEBAR VIA CONSOLEMODS TEXT */ $("#footer-partnersico:first-child").click(function (e) { e.stopPropagation(); if(!($('body').hasClass("sidebar-collapsed"))) { $('body').addClass("sidebar-collapsed"); } else { $('body').removeClass("sidebar-collapsed"); } }); /* BACK BUTTON ON TALK PAGES */ $("#ca-talk a").each(function() { if (window.location.href.includes("_talk")) { this.href = this.href.replace("_talk",""); $("#ca-talk a span").each(function() { this.innerHTML = "Back to Page" }); } if (window.location.href.includes("Talk:")) { this.href = this.href.replace("Talk:",""); $("#ca-talk a span").each(function() { this.innerHTML = "Back to Page" }); } });