MediaWiki

Common.js: Difference between revisions

From Engineering Client Portal

No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


var cn_rewrite_url = function() {
/* Make the hamburger icon collapse the side menu -La Mar */
  var baseUrl = 'https://engineeringportal.nielsen.com/docs/Special:LandingCheck';
document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList);
  var queryString = jQuery.param({'landing_page':'Main_Page', 'language':wgUserLanguage, 'country':Geo.country});
document.getElementById("toc").childNodes[3].style.display = 'none';
  jQuery("a.variable_lp").attr("href", baseUrl + '?' + queryString);
 
function collapseSideList(){
var hamburger = document.getElementById("toc").childNodes[3];
 
if(hamburger.style.display == 'none'){
  hamburger.style.display = "";
} else{
hamburger.style.display = "none";
}
}
}
jQuery(document).ready(cn_rewrite_url);

Latest revision as of 21:29, 9 August 2024

/* Any JavaScript here will be loaded for all users on every page load. */

/* Make the hamburger icon collapse the side menu -La Mar */
document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList);
document.getElementById("toc").childNodes[3].style.display = 'none';

function collapseSideList(){
 var  hamburger = document.getElementById("toc").childNodes[3];

 if(hamburger.style.display == 'none'){
   hamburger.style.display = "";
} else{
 hamburger.style.display = "none";
}
}