Difference between revisions of "Template:Greece/master script"

Line 4: Line 4:
 
var loc = 'https://2017.igem.org/Team:Greece/'+ sessionStorage.getItem('KEY');
 
var loc = 'https://2017.igem.org/Team:Greece/'+ sessionStorage.getItem('KEY');
  
if(ref !== loc || ref !== loc + '#'){ sessionStorage.setItem('KEY', ref.substr( ref.indexOf('Greece/')+7, ref.length )); }  
+
//if(ref !== loc || ref !== loc + '#'){ sessionStorage.setItem('KEY', ref.substr( ref.indexOf('Greece/')+7, ref.length )); }  
  
 
var master = sessionStorage.getItem('KEY');
 
var master = sessionStorage.getItem('KEY');

Revision as of 11:28, 27 September 2017

console.log('master script');

var ref = document.location.href; var loc = 'https://2017.igem.org/Team:Greece/'+ sessionStorage.getItem('KEY');

//if(ref !== loc || ref !== loc + '#'){ sessionStorage.setItem('KEY', ref.substr( ref.indexOf('Greece/')+7, ref.length )); }

var master = sessionStorage.getItem('KEY'); var link = sessionStorage.getItem('LINK'); if(link != null){ history.replaceState(null, null, link); document.title = link.toUpperCase();

if(ref !== loc){

  if(sessionStorage.getItem('LINK') !== master){
      sessionStorage.setItem('LINK', master);
  }

} }

       if(link !== master){ if(link !== null){
         $('#display_box').css('display', 'block');
         $('.display_frame').removeClass('reveal');
         $('#' + link).addClass('reveal');
         $('#footer').addClass('reveal');
         $('#ct1').goTo();
         void(document.title = link.toUpperCase());
       }}