Difference between revisions of "Template:Team:Bielefeld-CeBiTec/JS"

m (work on active-display)
m (small id fix)
Line 32: Line 32:
 
$(window).on('load', function() {
 
$(window).on('load', function() {
 
hideNavbars();
 
hideNavbars();
});
 
 
$(window).on('load', function() {
 
$url = window.location.href.split("/");
 
 
var dict1 = {
 
"description" : "project",
 
"hp" : "human practice",
 
"model" : "modelling",
 
"results" : "results",
 
"collaborations" : "collaborations",
 
"team" : "team",
 
"partners" : "partners",
 
"notebook" : "notebook",
 
"silver" : "hp-silver",
 
"gold_integrated" : "hp-gold",
 
"unnatural_base_pair" : "project"
 
}
 
 
var dict2 = {
 
"unnatural_base_pair" : "project-ubp"
 
}
 
 
var dict3 = {
 
"unnatural_base_pair" : "project-ubp-overview",
 
"unnatural_base_pairs" : "project-ubp-ubp",
 
"uptake_and_biosynthesis" : "project-ubp-uptake",
 
"preservation_system" : "project-ubp-preservation",
 
"challenges" : "project-ubp-challenges",
 
"translational_system" : "project-translation-overview",
 
"translation_mechanism" : "project-translation-mechanism",
 
"library_and_selection" : "project-translation-Library",
 
"toolbox" : "project-toolbox-overview",
 
"analysing" : "project-toolbox-analysing",
 
"photoswitching" : "project-toolbox-photoswitching",
 
"labeling" : "project-toolbox-labeling",
 
"photolysis" : "project-toolbox-photolysis",
 
"fusing" : "project-toolbox-fusing"
 
}
 
$("#test").html($url.length);
 
if ($url.length == 4) {
 
$("#home").addClass("navbar active");
 
} else if ($url.length == 5) {
 
$str = $url[5].toLowerCase();
 
$strD = dict1[$str];
 
$("#" + $strD).addClass("navbar active");
 
}
 
 
});
 
});
  
Line 112: Line 65:
 
hideNavbars();
 
hideNavbars();
 
$("#navbar-results").show();
 
$("#navbar-results").show();
} else if ($name == "human practice") {
+
} else if ($name == "hp") {
 
$(".sub-navbar").show();
 
$(".sub-navbar").show();
 
hideNavbars();
 
hideNavbars();
Line 152: Line 105:
 
hideNavbarsSub();
 
hideNavbarsSub();
 
$("#navbar-results-parts").show();
 
$("#navbar-results-parts").show();
} else if ($name == "home" || $name == "partners" || $name == "collabrations" || $name == "modelling" || $name == "hardware") {
+
} else if ($name == "home" || $name == "partners" || $name == "collaborations" || $name == "modelling" || $name == "hardware") {
 
hideNavbarsSub();
 
hideNavbarsSub();
 
$(".sub-navbar").hide();
 
$(".sub-navbar").hide();

Revision as of 17:20, 27 August 2017