uncommented switcher

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-25 23:51:53 +01:00
parent 33803616fc
commit 8c7ced176b
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
!function(){var t,e,o={blob_list:[],populate_channels:function(e){var n="",a=0;e.sort(o.sortFunction),pre_card=$(t),o.add_backdrop(e,0);for(x in e){var i=e[x][3];if(20>a){var s=e[x][1],r=e[x][0],c="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",d=e[x][4],l=pre_card;l.find(".chan-name").text(i),l.find(".chan-name").attr("title",i),l.find(".chan-views").text(r),l.find(".chan-songs").text(d),l.find(".chan-bg").attr("style",c),l.find(".chan-link").attr("href",i),$("#channels").append(l.html())}n+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(t,e){var o=t[0],n=e[0],a=t[4],i=e[4];return n>o?1:o>n?-1:i>a?1:a>i?-1:0},getCookie:function(t){for(var e=t+"=",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(e))return a.substring(e.length,a.length)}return""},add_backdrop:function(t,e){(e>=t.length||e>=8)&&(e=0);var n=t[e][1];void 0!==o.blob_list[e]?($("#mega-background").css("opacity",0),$(".room-namer").css("opacity",0),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+o.blob_list[e]+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",t[e][3]),$(".room-namer").css("opacity",1)},500)):$.ajax({type:"POST",data:{id:n},url:"/php/imageblob.php",success:function(n){o.blob_list.push(n),$("#mega-background").css("opacity",0),$(".room-namer").css("opacity",0),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+n+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",t[e][3]),$(".room-namer").css("opacity",1)},500)}}),setTimeout(function(){},6e3)}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){"#donation"==window.location.hash&&$("#donation").openModal(),t=$("#channel-list-container").html(),window.list_html=t,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":8880");n.emit("frontpage_lists"),n.on("playlists",function(t){o.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&&""==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 r="expires="+s.toUTCString();document.cookie="show_prompt=false;"+r}}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={blob_list:[],populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e),o.add_backdrop(t,0);for(x in t){var s=t[x][3];if(20>a){var i=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+i+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(s),d.find(".chan-name").attr("title",s),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",s),$("#channels").append(d.html())}n+="<option value='"+s+"'> ",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],s=t[4];return n>o?1:o>n?-1:s>a?1:a>s?-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""},add_backdrop:function(e,t){(t>=e.length||t>=8)&&(t=0);var n=e[t][1];void 0!==o.blob_list[t]?($("#mega-background").css("opacity",0),$(".room-namer").css("opacity",0),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+o.blob_list[t]+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3]),$(".room-namer").css("opacity",1)},500)):$.ajax({type:"POST",data:{id:n},url:"/php/imageblob.php",success:function(n){o.blob_list.push(n),$("#mega-background").css("opacity",0),$(".room-namer").css("opacity",0),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+n+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3]),$(".room-namer").css("opacity",1)},500)}}),setTimeout(function(){o.add_backdrop(e,t+1)},6e3)}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){"#donation"==window.location.hash&&$("#donation").openModal(),e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":8880");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 s=confirm("Do you want to download the native app for this webpage?");if(s)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var i=new Date;i.setTime(i.getTime()+864e6);var l="expires="+i.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")})}();