gstore.add('popup_opened', false); gstore.add('popup_click', function(){ /* (1) Do nothing if already opened */ if( gstore.get.popup_opened ) return; /* (2) Store that popup is opened */ gstore.get.popup_opened = true; /* (3) Open popup */ window.pop = window.open('https://sso.univ-pau.fr/cas/login?service='+window.api.target+'cas', '_blank', 'location=no,height=1024,width=1024,scrollbars=yes,status=no'); /* (4) Clear interval (optional) */ !isNaN(window.popint) && clearInterval(window.popint); /* (5) Check if popup closed -> abort */ window.popint = setInterval(function(){ window.pop.closed && window.cas_callback(-2); }, 500); }); gstore.add('login_class', 'neutral'); gstore.add('login_error_text', ''); gstore.add('icon', { it: null, a: new Audio('https://cloud.xdrm.io/index.php/s/6oJe9GzzrwpqJgj/download') }); gstore.get.icon.start = (function(e){ this.stop().it=setTimeout((function(){ this.play(); }).bind(this.a), 100*100); }).bind(gstore.get.icon); gstore.get.icon.stop = (function(e){ !isNaN(parseInt(gstore.get.icon.it)) && clearTimeout(gstore.get.icon.it); return this; }).bind(gstore.get.icon);