Difference between revisions of "Sitemap"

Line 122: Line 122:
  
 
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
 
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
 +
  
  
Line 159: Line 160:
  
 
$link_page.find('.mw-allpages-chunk li').each(function () {
 
$link_page.find('.mw-allpages-chunk li').each(function () {
console.log( $(this).html() );
 
console.log( $(this).text() );
 
 
sort_pages( $(this).text(),  $(this).html() );
 
sort_pages( $(this).text(),  $(this).html() );
 
});
 
});
Line 182: Line 181:
 
// 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 , "-");  
var no_underscores_name = page_name.replace( /_/g , " ");
+
var no_underscores_name = page_name.replace( /_/g , " ");
 
+
page_name = page_name.replace(/ /g,"_").replace(/:/g, "_");  // clean string from empty spaces
 +
 
 
 
if ( is_it_a_special_page ( page_name, page_link ) == false ) {  // check if a page is a redirect or a special case
 
if ( is_it_a_special_page ( page_name, page_link ) == false ) {  // check if a page is a redirect or a special case
 
 
 
page_name = page_name.replace(/ /g,"_").replace(/:/g, "_");  // clean string from empty spaces
 
 
  
 
switch  ( (page_name.match( /\//g ) || []).length  ) {  // check how many "tiers" (  /  ) the page name has in order to nest it
 
switch  ( (page_name.match( /\//g ) || []).length  ) {  // check how many "tiers" (  /  ) the page name has in order to nest it
Line 205: Line 202:
 
break;
 
break;
  
case 3: //this page might be a subpage inside a page in a hub list
+
case 3: default://this page might be a subpage inside a page in a hub list
append_to_not_sorted  (page_name );
+
$("#not_sorted").append("<li> <a  href='"+page_name+"'>"+page_name +"</a></li>");
 
break;
 
break;
 
}
 
}
Line 238: Line 235:
 
$("#HQ").append("<li ><a  href='/"+page_name+"'>"+page_name +"</a> </li>");
 
$("#HQ").append("<li ><a  href='/"+page_name+"'>"+page_name +"</a> </li>");
 
return true;
 
return true;
}
 
 
// is this a page from a team ?
 
else if ( page_name.substring(0, 4 ) == "Team") {
 
 
switch  ( (page_name.match( /\//g ) || []).length  ) {
 
case 0:
 
append_tier_one ( page_name, page_name, "#team_list") ;
 
break;
 
default:
 
append_tier_two ( page_name, page_name, page_name) ;
 
break;
 
}
 
return true;
 
 
}
 
}
  
Line 263: Line 246:
  
  
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  
function append_to_not_sorted  (page_name) {
 
 
$("#not_sorted").append("<li> <a  href='"+page_name+"'>"+page_name +"</a></li>");
 
 
}
 
  
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Line 275: Line 252:
 
function append_tier_one ( page_name, no_underscores_name, append_to ) {
 
function append_tier_one ( page_name, no_underscores_name, append_to ) {
 
 
page_id = "map0"+page_name;
+
$(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+"'>"+no_underscores_name+"</a> <ul  id='"+page_id+"' ></ul> </li>");
+
  
 
}
 
}
Line 282: Line 258:
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
function append_tier_two (page_name, no_underscores_name, clean_name ) {
+
// function append_tier_two (page_name, no_underscores_name, clean_name ) {
page_id  = "map0"+page_name;
+
// page_id  = "map0"+page_name;
$("#"+page_id.substring(0, page_id.indexOf("/") ) ).append("<li><a href='"+page_name+"'> "+no_underscores_name.substring( page_id.indexOf("/") -3, page_id.length) +"</a>  <ol id='"+clean_name+"'>  </ol></li>");
+
// $("#"+page_id.substring(0, page_id.indexOf("/") ) ).append("<li><a href='"+page_name+"'> "+no_underscores_name.substring( page_id.indexOf("/") -3, page_id.length) +"</a>  <ol id='"+clean_name+"'>  </ol></li>");
  
}
+
// }
  
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
 
 
function append_tier_three (page_name,  no_underscores_name, clean_name ) {
+
// function append_tier_three (page_name,  no_underscores_name, 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+"'>"+no_underscores_name.substring( page_name.lastIndexOf("/")+1, page_name.length )+"</a></li>");
 
 
  
}
+
// }
  
  
 
</script>
 
</script>
 
  
  

Revision as of 21:01, 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