Difference between revisions of "Sitemap"

Line 64: Line 64:
  
  
<a class=""></a>
+
<a class="" onclick="how_to_display='list'"> LIST DISPLAY </a>
  
<a class=""></a>
+
<a class=""  onclick="how_to_display='bucket'">>  BUCKET DISPLAY </a>
  
  
Line 289: Line 289:
  
  
 +
var how_to_display = "bucket";
  
+
 
$("#complete_list_of_pages").load( "https://2016.igem.org/Special:AllPages .mw-allpages-chunk", function() {  
 
$("#complete_list_of_pages").load( "https://2016.igem.org/Special:AllPages .mw-allpages-chunk", function() {  
  
 
$('ul.mw-allpages-chunk li').each(function () {
 
$('ul.mw-allpages-chunk li').each(function () {
  
sort_pages( $(this).text(),  $(this).html()) ;
+
sort_pages( $(this).text(),  $(this).html() , how_to_display );
  
 
});
 
});
Line 332: Line 333:
  
  
function sort_pages ( page_name , page_link ) {
+
function sort_pages ( page_name , page_link, how_to_display ) {
 
 
 
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 342: Line 343:
  
 
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 );  
+
if (how_to_display =="bucket") {
 +
append_tier_one_bucket ( page_name );
 +
}
 +
else if (how_to_display =="list") {
 +
append_tier_one_list ( page_name );  
 +
}
 
break;  
 
break;  
  
Line 389: Line 395:
  
  
function append_tier_one ( page_name ) {
+
function append_tier_one_bucket ( page_name ) {
 
var categories_for_links = ["About",  "Community",  "Requirements", "Calendar", "Judging",  "Safety", "Tracks", "Human_Practices",  "Giant_Jamboree", "Resources", "Team", "Sponsors" ];
 
var categories_for_links = ["About",  "Community",  "Requirements", "Calendar", "Judging",  "Safety", "Tracks", "Human_Practices",  "Giant_Jamboree", "Resources", "Team", "Sponsors" ];
 
var was_page_placed = false;
 
var was_page_placed = false;
Line 409: Line 415:
  
 
}
 
}
 +
 +
 +
function append_tier_one_bucket ( page_name ) {
 +
var categories_for_links = ["About",  "Community",  "Requirements", "Calendar", "Judging",  "Safety", "Tracks", "Human_Practices",  "Giant_Jamboree", "Resources", "Team", "Sponsors" ];
 +
var was_page_placed = false;
 +
 +
 +
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+"'>"+page_name + " Hub</a> <ol  class='turquoise_link' id='" +page_name+"' ></ol> </div>");
 +
was_page_placed = true;
 +
}
 +
}
 +
 +
 +
if ( was_page_placed == false ) {
 +
append_to_not_sorted  (page_name);
 +
}
 +
 +
}
 +
  
  
 
// Places all the elements in the main container and all , this can be used for the team information  
 
// Places all the elements in the main container and all , this can be used for the team information  
// $("#main_container").append("<div id='"+page_name+"_wrapper'><a  href='"+page_name+"'>"+page_name +"</a> <ol  class='turquoise_link' id='"+page_name+"' ></ol> </div>");
+
function append_tier_one_list ( page_name ) {
  
 +
 +
$("#main_container").append("<div id='"+page_name+"_wrapper'><a  href='"+page_name+"'>"+page_name +"</a> <ol  class='turquoise_link' id='"+page_name+"' ></ol> </div>");
 +
 +
 +
}
  
 
function append_tier_two (page_name ) {
 
function append_tier_two (page_name ) {

Revision as of 15:33, 4 March 2016

Total number of pages 2016 Wiki HQ Not sorted Redirect
LIST DISPLAY > BUCKET DISPLAY
All Pages

Menu items

Lorem ipsum

About
Requirements
Competition
Judging
Giant Jamboree
Resources
Teams and Community
HQ pages and Dev
    Not sorted
    Redirect
    Team Standard Pages
      All Pages