Spaces:
Running
Running
get/harvey.html only: Open in browser button for Harvey (Family Link). No app builds, no other get/ pages, no deletions.
Browse files- get/harvey.html +19 -1
get/harvey.html
CHANGED
|
@@ -34,6 +34,8 @@ footer{text-align:center;color:#9d927d;font-size:12px;margin-top:6px}footer b{co
|
|
| 34 |
<a class="btn big" id="and" href="../downloads/android/Cover-Charge-for-Staff-v0.2.1-phone.apk" data-b64="../downloads/android/Cover-Charge-for-Staff-v0.2.1-phone.apk.b64.txt" data-name="Cover-Charge-for-Staff-Harvey.apk" role="button" aria-label="Android: download Cover Charge for Staff, signed in as Harvey">Android</a>
|
| 35 |
<p class="muted center">Install it, then open it. It opens straight into your account.</p>
|
| 36 |
<p class="muted center hide" id="st"></p>
|
|
|
|
|
|
|
| 37 |
<a class="btn big alt" id="ios" href="#" role="button" aria-label="Apple iPhone">Apple</a>
|
| 38 |
<p class="center hide" id="soon-unused" tabindex="-1">Your iPhone app opens automatically from your complete personal link.</p>
|
| 39 |
<section class="card plat hide" id="iosweb" aria-labelledby="iosh"><h2 id="iosh" tabindex="-1">iPhone</h2>
|
|
@@ -69,4 +71,20 @@ var A=/Android/i.test(navigator.userAgent)&&!/CoverChargePhone\//.test(navigator
|
|
| 69 |
var iphone=/iPhone|iPad|iPod/.test(ua)||(/Macintosh/.test(ua)&&navigator.maxTouchPoints>1),inapp=/WhatsApp|FBAN|FBAV|Instagram|Messenger|CriOS|FxiOS|GSA\//.test(ua);
|
| 70 |
if(inapp)document.getElementById('openSafari').classList.add('first');
|
| 71 |
ios.onclick=function(ev){ev.preventDefault();box.classList.remove('hide');document.getElementById('iosh').focus()};
|
| 72 |
-
if(iphone&&navigator.standalone!==true)box.classList.remove('hide')})();</script><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
<a class="btn big" id="and" href="../downloads/android/Cover-Charge-for-Staff-v0.2.1-phone.apk" data-b64="../downloads/android/Cover-Charge-for-Staff-v0.2.1-phone.apk.b64.txt" data-name="Cover-Charge-for-Staff-Harvey.apk" role="button" aria-label="Android: download Cover Charge for Staff, signed in as Harvey">Android</a>
|
| 35 |
<p class="muted center">Install it, then open it. It opens straight into your account.</p>
|
| 36 |
<p class="muted center hide" id="st"></p>
|
| 37 |
+
<a class="btn alt" id="web" href="#" role="button" aria-label="Can't install? Open in browser, signed in as Harvey">Can't install? Open in browser</a>
|
| 38 |
+
<p class="muted center" id="webtip">In Chrome, tap the menu (three dots), then Add to Home screen. It opens already signed in as you.</p>
|
| 39 |
<a class="btn big alt" id="ios" href="#" role="button" aria-label="Apple iPhone">Apple</a>
|
| 40 |
<p class="center hide" id="soon-unused" tabindex="-1">Your iPhone app opens automatically from your complete personal link.</p>
|
| 41 |
<section class="card plat hide" id="iosweb" aria-labelledby="iosh"><h2 id="iosh" tabindex="-1">iPhone</h2>
|
|
|
|
| 71 |
var iphone=/iPhone|iPad|iPod/.test(ua)||(/Macintosh/.test(ua)&&navigator.maxTouchPoints>1),inapp=/WhatsApp|FBAN|FBAV|Instagram|Messenger|CriOS|FxiOS|GSA\//.test(ua);
|
| 72 |
if(inapp)document.getElementById('openSafari').classList.add('first');
|
| 73 |
ios.onclick=function(ev){ev.preventDefault();box.classList.remove('hide');document.getElementById('iosh').focus()};
|
| 74 |
+
if(iphone&&navigator.standalone!==true)box.classList.remove('hide')})();</script><script>(function(){
|
| 75 |
+
var web=document.getElementById('web');if(!web)return;
|
| 76 |
+
var valid=function(x){return /^[A-Za-z0-9_-]{16,64}$/.test(x||'')};
|
| 77 |
+
function token(){var q=new URLSearchParams(location.hash.slice(1)),t=q.get('i');if(valid(t))return t;var m=/[#&]i=([A-Za-z0-9_-]{16,64})/.exec(location.hash);return m?m[1]:null}
|
| 78 |
+
function device(t){var q=new URLSearchParams(location.hash.slice(1)),d=q.get('d'),app=document.documentElement.dataset.app||'staff';
|
| 79 |
+
if(valid(d))return d;
|
| 80 |
+
try{var saved=JSON.parse(localStorage.getItem('cc-iphone-legacy:'+app)||'null');if(saved&&saved.token===t&&valid(saved.device))return saved.device;d=localStorage.getItem('covercharge-device-id')}catch(e){}
|
| 81 |
+
if(!valid(d)){var bytes=new Uint8Array(24);crypto.getRandomValues(bytes);d=Array.from(bytes).map(function(v){return v.toString(16).padStart(2,'0')}).join('')}
|
| 82 |
+
try{localStorage.setItem('cc-iphone-legacy:'+app,JSON.stringify({token:t,device:d}))}catch(e){}
|
| 83 |
+
return d}
|
| 84 |
+
function url(t,d){var app=document.documentElement.dataset.app||'staff';return 'iphone.html?a='+app+'&v=61#i='+encodeURIComponent(t)+'&d='+encodeURIComponent(d)}
|
| 85 |
+
function prepare(){var t=token();if(!valid(t))return;web.setAttribute('href',url(t,device(t)))}
|
| 86 |
+
prepare();
|
| 87 |
+
web.addEventListener('click',function(ev){var t=token();
|
| 88 |
+
if(!valid(t)){ev.preventDefault();var st=document.getElementById('st');if(st){st.textContent='Open your complete personal link from the message.';st.classList.remove('hide')}return}
|
| 89 |
+
var u=url(t,device(t));web.setAttribute('href',u);ev.preventDefault();location.assign(u)});
|
| 90 |
+
})();</script></body></html>
|