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 language="javascript" type="text/javascript">
+
<script>
-
//Global Vars
+
//Configure the script here
-
var currentPage;
+
var teamname = "Brown";
-
var in_frame_test = 1;
+
// Loop through the URL
-
var ampersandStr = String.fromCharCode(38);
+
function buildDepth(array,count) {
-
var loading_home = false;
+
var depthStr="";
-
 
+
for (i=0;i<count;i++)
-
function dbgout(msg) {
+
{
-
  var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
+
depthStr=depthStr + array[i] + "/" ;
-
  if(is_chrome) console.log(msg);
+
}
 +
return depthStr;
}
}
-
function updateContentEditLink() {
+
// The function
-
if (!wgUserName) {
+
function buildBreadCrumbTrail(page) {
-
return;
+
// 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>";
}
}
-
var page = currentPage ? currentPage : 'Home';
+
// Write to the div
-
var url = location.pathname + '/' + page + '?action=edit';
+
$("#breadcrumbs").html(outputStr);
-
$("#edit_content_link").attr('href', url);
+
-
// $("#edit_content_link").click(function() {
+
-
// $("#iGEM_TU_Delft_container").html('<iframe src="'+url+'" width="100%" height="100%"></iframe>');
+
-
// });
+
}
}
-
function capitaliseFirstLetter(string)
+
// Capitalize the first letter
-
{
+
function capitaliseFirstLetter(string) {
     return string.charAt(0).toUpperCase() + string.slice(1);
     return string.charAt(0).toUpperCase() + string.slice(1);
}
}
-
function buildDepth(array,count)
+
 
-
{
+
// Start the script upon page load
-
var depthStr="";
+
$(function() {
-
for (i=0;i<count;i++)
+
buildBreadCrumbTrail(window.location.pathname);
-
{
+
}
-
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:Brown#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*/
Line 124: Line 117:
<html>
<html>
<body>
<body>
-
<div style="position: relative; width: 949px; height: 150px; background: url('https://static.igem.org/mediawiki/2010/d/d2/Mainlogo.jpg'); clear: both;  ">  
+
<div id="logo" style="position: relative; width: 949px; height: 150px; background: url('https://static.igem.org/mediawiki/2010/d/d2/Mainlogo.jpg'); clear: both;  ">  
</div>
</div>
</html>
</html>
{{:Team:Brown/templates/menu}}
{{:Team:Brown/templates/menu}}
<div id="breadcrumbs"></div>
<div id="breadcrumbs"></div>

Revision as of 02:42, 24 October 2010