CharisKomos (Talk | contribs) |
CharisKomos (Talk | contribs) |
||
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(!['Project', 'Model', 'human_practices', 'Achievements', 'Team'].indexOf(sessionStorage.getItem('KEY')) > -1 ){ | ||
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 12:07, 27 September 2017
console.log('master script');
var ref = document.location.href; var loc = 'https://2017.igem.org/Team:Greece/'+ sessionStorage.getItem('KEY');
if(!['Project', 'Model', 'human_practices', 'Achievements', 'Team'].indexOf(sessionStorage.getItem('KEY')) > -1 ){ 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()); }}