Team:Brown/templates/header

From 2010.igem.org

(Difference between revisions)
Line 2: Line 2:
<html>
<html>
<!-- BEGIN Breadcrumbs script from TU Delft -->
<!-- BEGIN Breadcrumbs script from TU Delft -->
-
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js"></script>
+
function capitaliseFirstLetter(string)
-
<script language="javascript" type="text/javascript">
+
{
-
//Configure the script here
+
-
var teamname = "Brown";
+
-
// Do not edit below
+
-
// Loop through the URL
+
-
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:'" + teamname + ">Home</a>";
+
-
// Loop through the URL
+
-
for (count=0;count<(constituentFolders.length);count++)
+
-
{
+
-
outputStr=outputStr + " > <a href='https://2010.igem.org/Team:" + teamname + buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + "</a>";
+
-
}
+
-
// Write to the div
+
-
//$("#breadcrumbs").html(outputStr);  This was the original scripting
+
-
        document.getElementById("breadcrumbs").innerHTML="bla";
+
-
}
+
-
// Capitalize the first letter
+
-
function capitaliseFirstLetter(string) {
+
     return string.charAt(0).toUpperCase() + string.slice(1);
     return string.charAt(0).toUpperCase() + string.slice(1);
}
}
-
// Start the script upon page load
+
 
-
$(function() {
+
function buildDepth(array,count)
-
buildBreadCrumbTrail(window.location.pathname);
+
{
-
}
+
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:Brown#page=Home'>Home</a>";
 +
if(page != "Home") {
 +
for (count=0;count<(constituentFolders.length);count++)
 +
{
 +
outputStr=outputStr + " <span class='doubleright'>&raquo;</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>
 +
 +
<style>
<style>
/*BEGIN HEADER/MENU REMOVAL*/
/*BEGIN HEADER/MENU REMOVAL*/

Revision as of 02:34, 24 October 2010

function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } function buildDepth(array,count) { var depthStr=""; for (i=0;i» " + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + ""; } } $("#breadcrumbs").html(outputStr); }