MediaWiki

Common.js: Difference between revisions

From Engineering Client Portal

(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: <script type="text/javascript"> var cn_rewrite_url = function() { var baseUrl = 'https://engineer...")
 
No edit summary
 
(3 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. */


<script type="text/javascript">
/* Make the hamburger icon collapse the side menu -La Mar */
var cn_rewrite_url = function() {
document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList);
  var baseUrl = 'https://engineeringportal.nielsen.com/docs/Special:LandingCheck';
document.getElementById("toc").childNodes[3].style.display = 'none';
  var queryString = jQuery.param({'landing_page':'Main_Page', 'language':wgUserLanguage, 'country':Geo.country});
 
  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);
</script>

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";
}
}