Template:Team:TU Munich/crumbs.js
From 2012.igem.org
function buildDepth(array,count) { var depthStr=""; for (i=0;i<count;i++) { depthStr=depthStr + array[i] + "/" ; } return depthStr; }
// The function function buildBreadCrumbTrail(page) { // Declare vars var constituentFolders = new Array(); var currentURL = page;
// Split the URL constituentFolders=currentURL.split("/");
// Start with a link to the team home page var outputStr="<a href='https://2010.igem.org/Team:TU_Munich'>Home</a>";
// Loop through the URL for (count=2;count<(constituentFolders.length);count++) { outputStr=outputStr + " >> <a href='https://2010.igem.org/Team:TU_Munich" + buildDepth(constituentFolders,count) + constituentFolders[count] + "/'>" + constituentFolders[count].replace(/-/gi," ") + "</a>"; }
// Write to the div $("#breadcrumbs").html(outputStr); }
// Capitalize the first letter //function capitaliseFirstLetter(string) { // return string.charAt(0).toUpperCase() + string.slice(1); //}