Difference between revisions of "Dev/Sitemap"

 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Main2017}}
 
{{Main2017}}
 
<html>
 
<html>
 +
<link rel="stylesheet" type="text/css" href="https://igem.org/wiki/index.php?title=HQ:Sitemap.css&action=raw&ctype=text/css" />
 +
<script src="https://igem.org/wiki/index.php?title=HQ:Sitemap.js&action=raw&ctype=text/javascript"></script>
  
<style>
 
  
.multiple_links a{
+
<script>
color:black;
+
}
+
  
.multiple_links a:hover {
+
var special_pages_to_load = "https://2017.igem.org/Special:AllPages";
color: #72c9b6;
+
 
}
+
</script>
  
</style>
 
  
<div class="column full_width" >
+
<div class="column full_size" >
<h1> Sitemap </h1>
+
<h1>SITEMAP </h1>
 
<p> 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. </p>
 
<p> 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. </p>
 
</div>
 
</div>
  
<div class="column half_width multiple_links" id="all_pages">
 
  
  
</div>
 
  
  
<div class="column half_width multiple_links" >
 
<ul id="HQ">
 
</ul>
 
  
</div>
 
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
  
<script>
 
  
$(document).ready(function() {
 
  
  
//load the list of pages from the wiki special pages
+
<div class="column full_size">
 +
<div class="view_format selected_view" id="list_view"> PAGE LIST </div>
 +
<div class="view_format" id="team_view"> TEAM PAGES </div>
 +
<div class="view_format HQ_info" id="hq_view"> HQ </div>
 +
</div>
  
$("#all_pages").load( "https://2017.igem.org/Special:AllPages .mw-allpages-chunk", function() {
 
  
$('ul.mw-allpages-chunk li').each(function () {
 
  
//sort each page
+
<div class="clear"></div>
console.log( $(this).text(),  $(this).html() );
+
sort_pages( $(this).text(),  $(this).html() ); 
+
  
});
 
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
});
 
});
 
  
 +
<div class="column full_size multiple_links  view_format_content selected_content" id="list_view_content">
 +
<h2> LIST </h2>
  
 +
<ol  id="organized_pages">
  
 +
</ol>
  
function sort_pages ( page_name , page_link ) {
+
</div>
+
if ( is_it_a_special_page ( page_name, page_link ) == false ) {  // check if a page is a redirect
+
+
  
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
 
  
case 0:  // this might be a hub or an unassigned page
 
append_tier_one ( page_name );
 
break;
 
  
case 1: //this page is likely to have a hub to append to
+
<div class="view_format_content" id="team_view_content">
append_tier_two ( page_name  ); 
+
<div class = "column full_size">
break;
+
<h2> TEAMS </h2>     
 +
</div>
  
case 2: //this page might be a subpage inside a page in a hub list
+
<div class="column half_size">
append_tier_three ( page_name ); 
+
<ol id="team_list">
break;
+
</ol>
 +
</div>
  
case 3: //this page might be a subpage inside a page in a hub list
 
append_to_not_sorted  (page_name );
 
break;
 
}
 
  
}
+
<div class="column half_size">
 +
<p class="loading"> Loading all team pages... </p>
 +
</div>
 +
</div>
  
 
}
 
  
  
//Function to check if the page is a redirect ( a non existing page)
+
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
function is_it_a_special_page ( page_name, page_link ) {
+
  
// is it a HQ page or a dev page ?
 
if( page_name.substring(0, 2 ) == "HQ"  ||  page_name.substring(0, page_name.indexOf("/") ) == "Dev" ) {
 
$("#HQ").append("<li ><a  href='/"+page_name+"'>"+page_name +"</a> </li>");
 
return true;
 
}
 
  
// is this a page from a team ?
+
<div class="HQ_info">
 +
<div class="column full_size view_format_content"  id="hq_view_content">
  
else if ( page_name.substring(0, 4 ) == "Team") {
+
<h2> HQ </h2>
 +
<p> This is the view for iGEM HQ </p>
  
console.log (page_name);
 
  
if ( page_name.substring(5, 12 ) == "Example" )  {
 
if ( page_name.substring(5, 13 ) != "Example2") {
 
//return false;    // if it is from team example it is fine
 
  
 +
<table>
 +
<tr>
 +
<th> Total pages </th> <th> Wiki pages </th> <th> HQ pages </th> <th> Redirect pages </th>  <th> Not sorted </th> <th> Team pages </th>
 +
</tr>
  
var page_help = page_name.replace(/:/g, "_");
+
<tr align="center">
 +
<td id="total_pages_count">  <p class="loading"> ... </p>  </td>
 +
<td id="wiki_pages_count"> <p class="loading"> ... </p> </td>
 +
<td id="hq_pages_count">  <p class="loading"> ... </p> </td>
 +
<td id="redirect_pages_count"> <p class="loading"> ... </p> </td>
 +
<td id="not_sorted_pages_count"> <p class="loading"> ... </p></td>
 +
<td id="team_pages_count">  <p class="loading"> ... </p> </td>
 +
</tr>
  
if ( page_name == "Team:Example") {
 
$("#Team_Hub").append("<div id='"+page_name+"_wrapper'><a  href='/"+page_name+"'>"+page_name+"</a> <ol  class='turquoise_link' id='" +page_help+"' ></ol> </div>");
 
$("#main_container").append("<div id='"+page_name+"_wrapper'><a  href='/"+page_name+"'>"+page_name+"</a> <ol  class='turquoise_link' id='main_"+page_help+"' ></ol> </div>");
 
}
 
  
else {
+
</table>  
console.log(page_name);
+
$("#"+page_help.substring(0, page_help.indexOf("/") ) ).append("<li><a href='/"+page_name+"'> "+page_name.substring( page_name.indexOf("/")+1, page_name.length )+"</a>  <ul id='"+page_help+"'>  </ul></li>");
+
  
$("#main_"+page_help.substring(0, page_help.indexOf("/") ) ).append("<li><a href='/"+page_name+"'> "+page_name.substring( page_name.indexOf("/")+1, page_name.length )+"</a>  <ul id='main_"+page_help+"'>  </ul></li>");
 
  
}
+
<div class="column half_size">
  
return true;  // page sorted, done!
+
<h3> HQ pages </h2>
}
+
}
+
  
else {
+
<ol id="HQ">
return true;  // this is a page from a team, ignore
+
</ol>
}
+
</div>
}
+
  
// is it a redirect?
+
<div class="column half_size">
else if( page_link.indexOf("mw-redirect") >= 0)  {
+
<h3> Redirects </h3>
$("#redirect").append("<li >"+ page_link+"</li>" );
+
<ol id="redirect">
return true;
+
</ol>
}
+
else {
+
return false;
+
}
+
}
+
  
  
function append_to_not_sorted  (page_name) {
+
<h3> Not Sorted </h3>
 +
<ol id="not_sorted">
 +
</ol>
  
$("#not_sorted").append("<li> <a  href='"+page_name+"'>"+page_name +"</a></li>");
+
</div>
  
}
+
</div>
 
+
</div>
 
+
function append_tier_one ( page_name ) {
+
var categories_for_links = ["About",  "Community",  "Requirements", "Calendar", "Judging",  "Safety", "Tracks", "Human_Practices",  "Giant_Jamboree", "Resources", "Sponsors" ];
+
var was_page_placed = false;
+
var no_underscores_name = page_name.replace( /_/g , " ");
+
 
+
 
+
 
+
for ( i =0; i< categories_for_links.length; i++) {
+
// if the page name has that specific category
+
 
+
if  ( page_name.substring( 0 ,categories_for_links[i].length) == categories_for_links[i] ) {
+
 
+
+
$("#"+categories_for_links[i]+"_Hub").append("<div id='"+page_name+"_wrapper'><a  href='"+page_name+"'>"+no_underscores_name+"</a> <ol  class='turquoise_link' id='" +page_name+"' ></ol> </div>");
+
 
+
 
+
$("#main_container").append("<div id='"+page_name+"_wrapper'><a  href='"+page_name+"'>"+no_underscores_name+"</a> <ol  class='turquoise_link' id='main_"+page_name+"' ></ol> </div>");
+
 
+
 
+
was_page_placed = true;
+
 
+
}
+
}
+
 
+
if ( was_page_placed == false ) {
+
append_to_not_sorted  (page_name);
+
}
+
 
+
}
+
 
+
 
+
 
+
 
+
 
+
function append_tier_two (page_name ) {
+
 
+
 
+
var clean_name = page_name.replace( /\//g , "-");
+
var no_underscores_name = page_name.replace( /_/g , " ");
+
 
+
 
+
 
+
 
+
// for bucket
+
$("#"+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>  <ul id='"+clean_name+"'>  </ul></li>");
+
 
+
 
+
 
+
//for list
+
$("#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>  <ul id='main_"+clean_name+"'>  </ul></li>");
+
 
+
 
+
 
+
}
+
 
+
 
+
+
function append_tier_three (page_name ) {
+
 
+
var clean_name = page_name.replace( /\//g , "-");
+
var no_underscores_name = page_name.replace( /_/g , " ");
+
 
+
//for bucket
+
$("#"+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>");
+
+
//for list
+
$("#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>");
+
+
 
+
}
+
 
+
 
+
 
+
 
+
 
+
 
+
switch ( wgUserName) {
+
+
case "Sifuentes anita":
+
case "Vinoo":
+
case "THaddock":
+
case "Meagan":
+
$(".HQ_info").delay( 800 ).fadeIn('slow');
+
break;
+
 
+
default:
+
$(".HQ_info").hide();
+
break;
+
 
+
 
+
 
+
}
+
 
+
 
+
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
</script>
+
 
+
 
+
 
+
 
+
 
+
</html>
+

Latest revision as of 15:41, 19 May 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.

PAGE LIST
TEAM PAGES
HQ

TEAMS

Loading all team pages...

HQ

This is the view for iGEM HQ

Total pages Wiki pages HQ pages Redirect pages Not sorted Team pages

...

...

...

...

...

...

HQ pages

Redirects

Not Sorted