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

Line 12: Line 12:
 
document.title = link.toUpperCase();
 
document.title = link.toUpperCase();
  
if(ref !== loc){
+
if(ref !== loc || ref !== loc + '#'){
 
   if(sessionStorage.getItem('LINK') !== master){
 
   if(sessionStorage.getItem('LINK') !== master){
 
       sessionStorage.setItem('LINK', master);
 
       sessionStorage.setItem('LINK', master);

Revision as of 11:39, 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 || 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());
       }}