mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added redirect for android users if they accept to the native app
This commit is contained in:
@@ -90,5 +90,37 @@ foreach($fil as $files){
|
|||||||
window.location.href = 'https://www.youtube.com/v/mK2fNG26xFg?autoplay=1&showinfo=0&autohide=1';
|
window.location.href = 'https://www.youtube.com/v/mK2fNG26xFg?autoplay=1&showinfo=0&autohide=1';
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function getCookie(cname) {
|
||||||
|
var name = cname + "=";
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for(var i=0; i<ca.length; i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0)==' ') c = c.substring(1);
|
||||||
|
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
$(document).ready(function (){
|
||||||
|
if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
|
||||||
|
console.log("android");
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
if(getCookie("show_prompt") == "")
|
||||||
|
{
|
||||||
|
var r = confirm("Do you want to download the native app for this webpage?");
|
||||||
|
if(r)
|
||||||
|
window.location.href = 'https://play.google.com/store/apps/details?id=no.lqasse.zoff';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var d = new Date();
|
||||||
|
d.setTime(d.getTime() + (10*24*60*60*1000));
|
||||||
|
var expires = "expires="+d.toUTCString();
|
||||||
|
document.cookie = "show_prompt=false;"+expires;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user