Difference between revisions of "Sitemap"

Line 178: Line 178:
 
function sort_pages ( page_name , page_link ) {
 
function sort_pages ( page_name , page_link ) {
  
 +
 +
// clean string from empty spaces
 +
page_name = page_name.replace(/ /g,"_"); 
 +
 
// these variables will be used in some of the functions bellow - they show variations of page_name for #id purposes
 
// these variables will be used in some of the functions bellow - they show variations of page_name for #id purposes
var clean_name = page_name.replace( /\//g , "-");  
+
var clean_name = page_name.replace( /\//g , "0");
 +
 +
//this variable will have the page name with only the necessary information for being displayed
 +
var page_name_display = page_name.replace( /_/g , " ");
 +
page_name_display= page_name_display.substring(page_name_display.lastIndexOf("/")+1, page_name_display.length);
 
 
var no_underscores_name = page_name.replace( /_/g , " ");
 
no_underscores_name= no_underscores_name.substring(no_underscores_name.lastIndexOf("/")+1, no_underscores_name.length);
 
 
 
page_name = page_name.replace(/ /g,"_");  // clean string from empty spaces
 
 
 
 
 
Line 195: Line 200:
 
case 0:   
 
case 0:   
 
if(page_name.substring(0,4) == "Team"){
 
if(page_name.substring(0,4) == "Team"){
append_tier_one ( page_name, no_underscores_name, "#team_list") ;  
+
append_tier_one ( page_name, page_name_display, "#team_list") ;  
 
+
 
}
 
}
 
else {
 
else {
append_tier_one ( page_name, no_underscores_name, "#organized_pages") ;  
+
append_tier_one ( page_name, page_name_display, "#organized_pages") ;  
 
}
 
}
  
 
break;  
 
break;  
  
case 1: //this page is likely to have a hub to append to
+
append_tier_two ( page_name, no_underscores_name, clean_name );  
+
//this page is under a hub or a team space
 +
case 1:
 +
var append_to_id = "#Sitemap0"+ page_name.substring(0, page_name.indexOf("/"));
 +
 +
if(page_name.substring(0,4) == "Team"){
 +
 
 +
append_tier_two ( page_name, page_name_display, clean_name, append_to_id) ;  
 +
}
 +
else {
 +
append_tier_two ( page_name, page_name_display, clean_name, append_to_id) ;
 +
}
 +
 
break;
 
break;
  
 +
 +
 +
 
//case 2: //this page might be a subpage inside a page in a hub list
 
//case 2: //this page might be a subpage inside a page in a hub list
// append_tier_three ( page_name, no_underscores_name, clean_name );   
+
// append_tier_three ( page_name, page_name_display, clean_name );   
 
// break;
 
// break;
  
Line 260: Line 278:
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
function append_tier_one ( page_name, no_underscores_name, append_to ) {
+
function append_tier_one ( page_name, page_name_display, append_to ) {
 
 
$(append_to).append("<li><a href='"+page_name+"'>"+no_underscores_name+"</a><ul id='Sitemap0"+page_name+"' ></ul> </li>");
+
$(append_to).append("<li><a href='"+page_name+"'>"+page_name_display+"</a><ul id='Sitemap0"+page_name+"' ></ul> </li>");
  
 
}
 
}
Line 268: Line 286:
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
function append_tier_two (page_name, no_underscores_name, clean_name ) {
+
function append_tier_two (page_name, page_name_display, clean_name, append_to_id ) {
 
 
var page_id = "#Sitemap0" + page_name.substring(0, page_name.indexOf("/"));
+
$(append_to_id).append("<li><a href='"+page_name+"'>"+page_name_display+"</a><ol id='Sitemap0"+clean_name+"' ></ol></li>");
$(page_id).append("<li><a href='"+page_name+"'>"+no_underscores_name+"</a> <ol id='Sitemap0"+clean_name+"' ></ol> </li>");
+
  
 
}
 
}
Line 278: Line 295:
  
 
 
// function append_tier_three (page_name,  no_underscores_name, clean_name ) {
+
// function append_tier_three (page_name,  page_name_display, clean_name ) {
  
// $("#"+clean_name.substring(0,  clean_name.lastIndexOf("-") ) ).append("<li id='"+page_name+"'><a href='"+page_name+"'>"+no_underscores_name.substring( page_name.lastIndexOf("/")+1, page_name.length )+"</a></li>");
+
// $("#"+clean_name.substring(0,  clean_name.lastIndexOf("-") ) ).append("<li id='"+page_name+"'><a href='"+page_name+"'>"+page_name_display.substring( page_name.lastIndexOf("/")+1, page_name.length )+"</a></li>");
 
 
  
Line 287: Line 304:
  
 
</script>
 
</script>
 
</html>
 

Revision as of 21:47, 20 April 2017

MENU

SITEMAP

iGEM is a multifaceted competition with many different components. Our websites have a lot of information, from requirements of the competition to tips on how make fundraising easier. This page is here to help you navigate our site and make sure you have access to all of its content.

LIST
TEAMS
HQ

TEAMS