Team:TU Delft
From 2010.igem.org
(Difference between revisions)
Line 215: | Line 215: | ||
<script language="javascript" type="text/javascript"> | <script language="javascript" type="text/javascript"> | ||
- | + | function capitaliseFirstLetter(string) | |
+ | { | ||
+ | return string.charAt(0).toUpperCase() + string.slice(1); | ||
+ | } | ||
+ | |||
+ | function buildDepth(array,count) | ||
+ | { | ||
+ | var depthStr=""; | ||
+ | for (i=0;i<count;i++) | ||
+ | { | ||
+ | depthStr=depthStr + array[i] + "/" ; | ||
+ | } | ||
+ | return depthStr; | ||
+ | } | ||
+ | function buildBreadCrumbTrail(page) | ||
+ | { | ||
+ | var constituentFolders = new Array(); | ||
+ | var currentURL = page; | ||
+ | constituentFolders=currentURL.split("/"); | ||
+ | var outputStr="<a href='https://2010.igem.org/Team:TU_Delft#page=Home'>Home</a>"; | ||
+ | if(page != "Home") { | ||
+ | for (count=0;count<(constituentFolders.length);count++) | ||
+ | { | ||
+ | outputStr=outputStr + " <span class='doubleright'>»</span> <a href='https://2010.igem.org/Team:TU_Delft#page=" + buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + "</a>"; | ||
+ | } | ||
+ | } | ||
+ | $("#breadcrumbs").html(outputStr); | ||
+ | } | ||
</script> | </script> | ||
<!-- Scripting END /--> | <!-- Scripting END /--> |