Difference between revisions of "Template:Main2018"

Line 7: Line 7:
 
$(document).ready(function() {
 
$(document).ready(function() {
  
$("#HQ_page").attr('id','');
+
$("#HQ_page").attr('id','');
 +
 +
hide_HQ_info();
  
 +
$( "#load_menu_here" ).load( "https://2018.igem.org/HQ:Menu #load_menu_content" , function() {
  
 +
menu_functionality();
 +
highlight_current_page_menu();
 +
});
 +
 +
});
 
 
 +
 
 
 +
 +
// if HQ_info exists, hide unless the user is an admin
 +
function hide_HQ_info() {
 +
 +
if ($("#HQ_info").length){
 +
 +
switch ( wgUserName) {
 +
case "Sifuentes anita": case "Vinoo": case "THaddock": case "Meagan": case "MariaB":
 +
$("#HQ_info").show();
 +
break;
 +
 +
default:
 +
$("#HQ_info").hide();
 +
break;
 +
}
 +
    }
 +
}
 
 
var page_url="https://2018.igem.org/";
 
$( "#load_menu_here" ).load( "https://2018.igem.org/HQ:Menu #load_menu_content" , function() {
 
  
  
 +
function menu_functionality() {
 +
 +
//accessing submenus and subsubmenus
 +
$(".submenu_access").click(function(){
 +
$(this).toggleClass("showing");
 +
$(this).next().fadeToggle(400);
 +
});
 +
 +
//mobile menu access
 +
$(".igem_mobile_menu_bar").click(function(){
 +
$(this).next().fadeToggle(400);
 +
});
 +
 +
}
 +
 +
 +
 +
function highlight_current_page_menu() {
 +
 +
 +
var page_url="https://2018.igem.org/";
  
 
switch ( (wgPageName.match( /\//g ) || []).length  ) {
 
switch ( (wgPageName.match( /\//g ) || []).length  ) {
Line 76: Line 121:
 
}
 
}
  
 +
}
  
  
  
//accessing submenus and subsubmenus
 
$(".submenu_access").click(function(){
 
$(this).toggleClass("showing");
 
$(this).next().fadeToggle(400);
 
});
 
  
//mobile menu access
 
$(".igem_mobile_menu_bar").click(function(){
 
$(this).next().fadeToggle(400);
 
});
 
 
  
 
// if HQ_info exists, hide unless the user is an admin
 
if ($("#HQ_info").length){
 
 
switch ( wgUserName) {
 
case "Sifuentes anita": case "Vinoo": case "THaddock": case "Meagan": case "MariaB":
 
$("#HQ_info").show();
 
break;
 
 
default:
 
$("#HQ_info").hide();
 
break;
 
}
 
    }
 
 
});
 
 
 
 
 
});
 
 
</script>
 
</script>
 
 
  
  

Revision as of 17:50, 29 January 2018

Loading...