mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Reimplementing popup for googleplay
This commit is contained in:
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
@@ -1 +1 @@
|
||||
!function(){var t,e,n={populate_channels:function(e){var o="",a=0;e.sort(n.sortFunction),pre_card=$(t);for(x in e){var i=e[x][3];if(20>a){var r=e[x][1],s=e[x][0],c="background-image:url('https://img.youtube.com/vi/"+r+"/hqdefault.jpg');",l=e[x][4],m=pre_card;m.find(".chan-name").text(i),m.find(".chan-name").attr("title",i),m.find(".chan-views").text(s),m.find(".chan-songs").text(l),m.find(".chan-bg").attr("style",c),m.find(".chan-link").attr("href",i),$("#channels").append(m.html())}o+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=o,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(t,e){var n=t[0],o=e[0],a=t[4],i=e[4];return o>n?1:n>o?-1:i>a?1:a>i?-1:0}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){t=$("#channel-list-container").html(),window.list_html=t,$("#channels").empty();var o=io.connect("//"+window.location.hostname+":3000");o.emit("frontpage_lists"),o.on("playlists",function(t){n.populate_channels(t)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==getCookie("show_prompt")){var i=confirm("Do you want to download the native app for this webpage?");if(i)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var r=new Date;r.setTime(r.getTime()+864e6);var s="expires="+r.toUTCString();document.cookie="show_prompt=false;"+s}}e=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,e=$.parseJSON(e),$("#latest-commit").html("Latest Commit: <br>"+e[0].commit.author.date.substring(0,10)+": "+e[0].committer.login+"<br><a href='"+e[0].html_url+"'>"+e[0].sha.substring(0,10)+"</a>: "+e[0].commit.message+"<br")})}();
|
||||
!function(){var e,t,o={populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e);for(x in t){var i=t[x][3];if(20>a){var s=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(i),d.find(".chan-name").attr("title",i),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",i),$("#channels").append(d.html())}n+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(e,t){var o=e[0],n=t[0],a=e[4],i=t[4];return n>o?1:o>n?-1:i>a?1:a>i?-1:0},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var a=o[n];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":3000");n.emit("frontpage_lists"),n.on("playlists",function(e){o.populate_channels(e)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==o.getCookie("show_prompt")){var i=confirm("Do you want to download the native app for this webpage?");if(i)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var s=new Date;s.setTime(s.getTime()+864e6);var l="expires="+s.toUTCString();document.cookie="show_prompt=false;"+l}}t=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,t=$.parseJSON(t),$("#latest-commit").html("Latest Commit: <br>"+t[0].commit.author.date.substring(0,10)+": "+t[0].committer.login+"<br><a href='"+t[0].html_url+"'>"+t[0].sha.substring(0,10)+"</a>: "+t[0].commit.message+"<br")})}();
|
||||
@@ -75,6 +75,17 @@ var Nochan = {
|
||||
return 0;
|
||||
},
|
||||
|
||||
getCookie: function(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 "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -111,7 +122,7 @@ $(document).ready(function (){
|
||||
|
||||
if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
|
||||
//console.log("android");
|
||||
if(getCookie("show_prompt") == ""){
|
||||
if(Nochan.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';
|
||||
|
||||
Reference in New Issue
Block a user