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

m
m
Line 37: Line 37:
 
$url = window.location.href.split("/");
 
$url = window.location.href.split("/");
 
 
var dict = {
+
var dict1 = {
 
"description" : "project",
 
"description" : "project",
 
"hp" : "human practice",
 
"hp" : "human practice",
 
"model" : "modelling",
 
"model" : "modelling",
"hardware" : "hardware",
 
 
"results" : "results",
 
"results" : "results",
 
"collaborations" : "collaborations",
 
"collaborations" : "collaborations",
Line 50: Line 49:
 
"gold_integrated" : "hp-gold",
 
"gold_integrated" : "hp-gold",
 
"unnatural_base_pair" : "project"
 
"unnatural_base_pair" : "project"
 +
}
 +
 +
var dict2 = {
 +
"unnatural_base_pair" : "project-ubp"
 
}
 
}
 
 
 
 
Line 55: Line 58:
 
for (i = 2; i < $url.length; ++i) {
 
for (i = 2; i < $url.length; ++i) {
 
$str = $url[i].toLowerCase();
 
$str = $url[i].toLowerCase();
$str = dict[$str];
 
 
$("#" + $str).addClass("navbar active");
 
$("#" + $str).addClass("navbar active");
 +
$strD = dict1[$str];
 +
$("#" + $strD).addClass("navbar active");
 +
$strD = dict2[$str];
 +
$("#" + $strD).addClass("navbar active");
 
}
 
}
 
});
 
});

Revision as of 02:24, 27 August 2017