Line 78: | Line 78: | ||
function sort_pages ( page_name , page_link ) { | function sort_pages ( page_name , page_link ) { | ||
+ | |||
+ | // 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 no_underscores_name = page_name.replace( /_/g , " "); | ||
+ | |||
if ( is_it_a_special_page ( page_name, page_link ) == false ) { // check if a page is a redirect | if ( is_it_a_special_page ( page_name, page_link ) == false ) { // check if a page is a redirect | ||
Line 88: | Line 93: | ||
case 0: // this might be a hub or an unassigned page | case 0: // this might be a hub or an unassigned page | ||
− | append_tier_one ( page_name, | + | append_tier_one ( page_name, no_underscores_name) ; |
break; | break; | ||
case 1: //this page is likely to have a hub to append to | case 1: //this page is likely to have a hub to append to | ||
− | append_tier_two ( page_name ); | + | append_tier_two ( page_name, no_underscores_name, clean_name ); |
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 ); | + | append_tier_three ( page_name, no_underscores_name, clean_name ); |
break; | break; | ||
Line 147: | Line 152: | ||
− | function append_tier_one ( page_name, | + | function append_tier_one ( page_name, no_underscores_name ) { |
− | + | ||
− | + | ||
− | + | ||
$("#organized_pages").append("<li> <a href='"+page_name+"'>"+no_underscores_name+"</a> <ul id='main_"+page_name+"' ></ul> </li>"); | $("#organized_pages").append("<li> <a href='"+page_name+"'>"+no_underscores_name+"</a> <ul id='main_"+page_name+"' ></ul> </li>"); | ||
} | } | ||
− | function append_tier_two (page_name | + | function append_tier_two (page_name, no_underscores_name, clean_name ) { |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | $("#main_"+page_name.substring(0, page_name.indexOf("/") ) ).append("<li><a href='"+page_name+"'> "+no_underscores_name.substring( page_name.indexOf("/")+1, page_name.length )+"</a> <ol id='main_"+clean_name+"'> </ol></li>"); | ||
} | } | ||
Line 172: | Line 166: | ||
− | function append_tier_three (page_name ) { | + | function append_tier_three (page_name, no_underscores_name, clean_name ) { |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$("#main_"+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>"); | $("#main_"+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>"); | ||
Revision as of 20:31, 24 November 2016
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.