diff --git a/static/dist/embed.min.js b/static/dist/embed.min.js index cc8e9d3e..ceaccda7 100644 --- a/static/dist/embed.min.js +++ b/static/dist/embed.min.js @@ -1 +1 @@ -!function(){var e={loaded:!0,before_load:"",after_load:"",ytplayer:"",stopInterval:!1,setup_youtube_listener:function(t){o.on("np",function(t){if(e.loaded=!1,0==t[0].length){document.getElementById("song-title").innerHTML="Empty channel. Add some songs!",$("#player_overlay").height($("#player").height()),/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#player_overlay").toggleClass("hide");try{e.ytplayer.stopVideo()}catch(o){}}else{void 0==l?l=t[0][0].id:l!=a&&(l=a),a=t[0][0].id,conf=t[1][0],time=t[2],n=time-conf.startTime,d=t[0][0].title,$("#player_overlay").addClass("hide");try{Suggestions.fetchYoutubeSuggests(a)}catch(o){}if(e.getTitle(d,viewers),e.setBGimage(a),!u||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream)e.getTitle(d,viewers);else try{e.ytplayer.getVideoUrl().split("v=")[1]!=a&&(e.ytplayer.loadVideoById(a),e.notifyUser(a,d),e.ytplayer.seekTo(n),m&&e.ytplayer.pauseVideo()),m||(e.ytplayer.playVideo(),e.durationSetter()),(e.ytplayer.getDuration()>n||0==e.ytplayer.getDuration())&&e.ytplayer.seekTo(n),e.after_load=a,setTimeout(function(){e.loaded=!0},500)}catch(o){e.durationSetter()}}}),o.on("viewers",function(t){viewers=t,void 0!==d&&e.getTitle(d,viewers)})},onPlayerStateChange:function(t){switch(t.data){case-1:break;case 0:playing=!1,m=!1,o.emit("end",a);break;case 1:playing=!0,beginning&&window.mobilecheck()&&(e.ytplayer.pauseVideo(),beginning=!1),1==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide"),2==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),m&&(o.emit("pos"),m=!1);break;case 2:m=!0,s.play_pause_show();break;case 3:}},getTitle:function(e,t){var n=t>1?"viewers":"viewer",o=decodeURIComponent(e),a=document.getElementById("song-title"),i=document.getElementById("viewers");document.title=o+" • Zöff / "+_,a.innerHTML=o,i.innerHTML=t+" "+n,a.title=o+" • "+t+" "+n},errorHandler:function(t){5==t.data||100==t.data||101==t.data||150==t.data?(curr_playing=e.ytplayer.getVideoUrl().replace("https://www.youtube.com/watch?v=",""),o.emit("skip",{error:t.data,id:a,pass:w})):void 0!==a&&e.ytplayer.loadVideoById(a)},onPlayerReady:function(t){$("#channel-load").css("display","none");try{beginning=!0,u=!0,/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||($("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),e.ytplayer.loadVideoById(a),x&&!window.mobilecheck()&&e.ytplayer.playVideo(),e.durationSetter(),y?setTimeout(function(){e.ytplayer.seekTo(n),x||(e.ytplayer.pauseVideo(),s.play_pause_show())},1e3):e.ytplayer.seekTo(n)),e.readyLooks(),s.initYoutubeControls(e.ytplayer),s.initSlider(),e.ytplayer.setVolume(Crypt.get_volume())}catch(o){}},readyLooks:function(){e.setBGimage(a)},setBGimage:function(e){if(void 0!==e&&!y){var n=new Image;n.onload=function(){var e=new ColorThief,o=e.getColor(n);document.getElementsByTagName("body")[0].style.backgroundColor=t.rgbToHsl(o),$("meta[name=theme-color]").attr("content",t.rgbToHex(o[0],o[1],o[2]))},n.crossOrigin="Anonymous",n.src="https://zoff.no:8080/https://img.youtube.com/vi/"+e+"/mqdefault.jpg"}},set_width:function(e){$(".video-container").width(e)},notifyUser:function(e,t){if(t=t.replace(/\\\'/g,"'").replace(/"/g,"'").replace(/&/g,"&"),"granted"===Notification.permission&&document.hidden){var n=new Notification("Now Playing",{body:t,icon:"http://i.ytimg.com/vi/"+e+"/mqdefault.jpg",iconUrl:"http://i.ytimg.com/vi/"+e+"/mqdefault.jpg"});n.onclick=function(e){window.focus(),this.cancel()},setTimeout(function(){n.close()},5e3)}},setup_all_listeners:function(){o.on("get_list",function(){o.emit("list",_.toLowerCase())}),e.setup_youtube_listener(_),Admin.admin_listener(),Chat.setup_chat_listener(_),Chat.allchat_listener(),c.channel_listener()},onYouTubeIframeAPIReady:function(){e.ytplayer=new YT.Player("player",{videoId:a,playerVars:{rel:"0",wmode:"transparent",controls:"0",iv_load_policy:"3",theme:"light",color:"white"},events:{onReady:e.onPlayerReady,onStateChange:e.onPlayerStateChange,onError:e.errorHandler}})},durationSetter:function(){try{duration=e.ytplayer.getDuration()}catch(n){duration=0}if(void 0!=duration)try{dMinutes=Math.floor(duration/60),dSeconds=duration-60*dMinutes,currDurr=e.ytplayer.getCurrentTime(),currDurr>duration&&(currDurr=duration),minutes=Math.floor(currDurr/60),seconds=currDurr-60*minutes,document.getElementById("duration").innerHTML=t.pad(minutes)+":"+t.pad(seconds)+" / "+t.pad(dMinutes)+":"+t.pad(dSeconds),per=100/duration*currDurr,per>=100?per=100:0==duration&&(per=0),$("#bar").width(per+"%")}catch(n){}e.stopInterval||setTimeout(e.durationSetter,1e3)},loadPlayer:function(){1==$("script[src='https://www.youtube.com/iframe_api']").length?e.onYouTubeIframeAPIReady():(tag=document.createElement("script"),tag.src="https://www.youtube.com/iframe_api",firstScriptTag=document.getElementsByTagName("script")[0],firstScriptTag.parentNode.insertBefore(tag,firstScriptTag))}};window.mobilecheck=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e};var t={rnd:function(e){return e[Math.floor(Math.random()*e.length)]},predicate:function(){for(var e,t,n,o=[],a=arguments.length,i=function(e,t){return e===t?0:t>e?-1:1},r=function(e,t){var n=i,o=i;return e&&(o=function(t,o){return n(e(t),e(o))}),t?function(e,t){return-1*o(e,t)}:o},l=0;a>l;l++)e=arguments[l],"string"==typeof e?(t=e,n=i):(t=e.name,n=r(e.primer,e.reverse)),o.push({name:t,cmp:n});return function(t,n){for(var i,r,l=0;a>l&&(r=0,e=o[l],i=e.name,r=e.cmp(t[i],n[i]),0===r);l++);return r}},hashCode:function(e){for(var t=0,n=0;n>24&255).toString(16)+(e>>16&255).toString(16)+(e>>8&255).toString(16)+(255&e).toString(16)},pad:function(e){return 10>e?"0"+Math.floor(e):Math.floor(e)},contains:function(e,t){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1},sample:function(){Date.now()-lastSample>=2*SAMPLE_RATE&&(o.removeAllListeners(),o.disconnect(),o.connect(),e.setup_all_listeners()),lastSample=Date.now(),setTimeout(t.sample,SAMPLE_RATE)},loadjsfile:function(e){if(-1==filesadded.indexOf("["+e+"]")){var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t),filesadded+="["+e+"]"}},msieversion:function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return t>0||navigator.userAgent.match(/Trident.*rv\:11\./)?!0:!1},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e))+e},rgbToHsl:function(e){r=e[0],g=e[1],b=e[2],r/=255,g/=255,b/=255;var t,n,o=Math.max(r,g,b),a=Math.min(r,g,b),i=(o+a)/2;if(o==a)t=n=0;else{var l=o-a;switch(n=i>.5?l/(2-o-a):l/(o+a),o){case r:t=(g-b)/l+(g.5&&(i=.5),"hsl("+Math.floor(360*t)+", "+Math.floor(100*n)+"%, "+Math.floor(100*i)+"%)"},componentToHex:function(e){var t=e.toString(16);return 1==t.length?"0"+t:t},rgbToHex:function(e,n,o){return"#"+t.componentToHex(e)+t.componentToHex(n)+t.componentToHex(o)},send_mail:function(e,t){if(""!=e&&""!=t){$("#submit-contact-form").addClass("hide"),$("#send-loader").removeClass("hide"),$("#contact-form-from").attr("disabled","true"),$("#contact-form-message").attr("disabled","true");var e=$("#contact-form-from").val(),t=$("#contact-form-message").val();$("#contact-container").empty(),window.open("mailto:contact@zoff.no?Subject=Contact%20Zoff&Body="+t+"'","_blank"),$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: contact@zoff.no")}}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var n=$("#contact-form-message").val(),o=$("#contact-form-from").val();t.send_mail(o,n)}),Element.prototype.remove=function(){this.parentElement.removeChild(this)},NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var e=0,t=this.length;t>e;e++)this[e]&&this[e].parentElement&&this[e].parentElement.removeChild(this[e])},String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t};var n,o,a,l,s={stopInterval:!1,initYoutubeControls:function(){!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#controls").appendTo("#playbar"),s.initControls()},initControls:function(){document.getElementById("volume-button").addEventListener("click",s.mute_video),document.getElementById("playpause").addEventListener("click",s.play_pause),document.getElementById("fullscreen").addEventListener("click",s.fullscreen)},initSlider:function(){try{v=Crypt.get_volume()}catch(e){}$("#volume").slider({min:0,max:100,value:v,range:"min",animate:!0,slide:function(e,t){s.setVolume(t.value);try{Crypt.set_volume(t.value)}catch(n){}}}),s.choose_button(v,!1)},fullscreen:function(){var e=document.getElementById("player"),t=e.requestFullScreen||e.mozRequestFullScreen||e.webkitRequestFullScreen;t&&t.bind(e)()},play_pause:function(){1==e.ytplayer.getPlayerState()?(e.ytplayer.pauseVideo(),!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||(document.getElementById("player").style.display="none",$(".page-footer").toggleClass("padding-bottom-extra"))):(2==e.ytplayer.getPlayerState()||0==e.ytplayer.getPlayerState())&&(e.ytplayer.playVideo(),!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||(document.getElementById("player").style.display="block",$(".page-footer").toggleClass("padding-bottom-extra")))},play_pause_show:function(){1==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),2==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide")},settings:function(){$("#qS").toggleClass("hide")},changeQuality:function(t){e.ytplayer.getPlaybackQuality!=t&&(e.ytplayer.setPlaybackQuality(t),e.ytplayer.getPlaybackQuality()),$("#qS").toggleClass("hide")},mute_video:function(){e.ytplayer.isMuted()?(e.ytplayer.unMute(),s.choose_button(e.ytplayer.getVolume(),!1)):(s.choose_button(0,!0),e.ytplayer.mute())},setVolume:function(t){e.ytplayer.setVolume(t),s.choose_button(t,!1),e.ytplayer.isMuted()&&e.ytplayer.unMute()},choose_button:function(e,t){t?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),2==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=0&&33>=e?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),2==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=34&&66>=e?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),2==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=67&&100>=e&&(2==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide"))},playPause:function(){state=e.ytplayer.getPlayerState(),button=document.getElementById("playpause"),1==state?e.ytplayer.pauseVideo():2==state&&e.ytplayer.playVideo()},volumeOptions:function(){e.ytplayer.isMuted()?(e.ytplayer.unMute(),v=e.ytplayer.getVolume(),$("#volume").slider("value",e.ytplayer.getVolume())):(e.ytplayer.mute(),$("#volume").slider("value",0))},hoverMute:function(t){v=e.ytplayer.getVolume()}},c={channel_listener:function(){o.on("channel",function(e){c.channel_function(e)})},channel_function:function(e){switch(e[0]){case"list":c.populate_list(e[1]);break;case"added":c.added_song(e[1]);break;case"deleted":c.deleted_song(e[1]);break;case"vote":c.voted_song(e[1],e[2]);break;case"song_change":c.song_change(e[1])}},populate_list:function(e){full_playlist=e,c.sortList(),$("#wrapper").empty(),$.each(full_playlist,function(e,t){t.now_playing||$("#wrapper").append(c.generateSong(t,!1,h,!0))}),h&&(window.mobilecheck()?$(".list-image").lazyload({}):$(".list-image").lazyload({container:$("#wrapper")}).removeClass("lazy")),$("#settings").css("visibility","visible"),$("#settings").css("opacity","1"),$("#wrapper").css("opacity","1")},added_song:function(e){full_playlist.push(e),c.sortList(),$("#suggested-"+e.id).remove(),c.insertAtIndex(e,!0)},deleted_song:function(e){var t=c.getIndexOfSong(e),n=$("#wrapper").children()[t];try{n.style.height=0,setTimeout(function(){$("#"+e).remove(),full_playlist.splice(c.getIndexOfSong(e),1)},305),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(o){full_playlist.splice(c.getIndexOfSong(e),1),$("#wrapper").children()[$("#wrapper").children().length-1].remove()}$("#suggested-"+e).remove(),Suggestions.checkUserEmpty()},voted_song:function(e,t){var n=c.getIndexOfSong(e),o=full_playlist[n];full_playlist[n].votes+=1,full_playlist[n].added=t,c.sortList(),$("#"+e).remove(),c.insertAtIndex(o,!1)},song_change:function(e){var t=full_playlist.length-1;full_playlist[0].now_playing=!0,full_playlist[0].votes=0,full_playlist[0].guids=[],full_playlist[0].added=e,full_playlist[t].now_playing=!1,full_playlist.push(full_playlist.shift()),$("#wrapper").children()[0].remove(),c.insertAtIndex(full_playlist[t-1],!1),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1},vote:function(e,t){return o.emit("vote",[_,e,t,w]),!0},skip:function(){return o.emit("skip",{pass:w,id:a}),!0},importOldList:function(e){var t="",n=0;playlist_url="lists/"+e+".json",list=$.parseJSON($.ajax({type:"GET",url:playlist_url,async:!1}).responseText),$.each(list.songs,function(e,o){t+=o.id+",",n>45&&(Search.addVideos(t),t="",n=0),n++}),Search.addVideos(t),document.getElementById("search").value=""},sortList:function(){full_playlist.sort(t.predicate({name:"votes",reverse:!0},"added"))},show:function(){window.mobilecheck()||(showToggle?(showToggle=!1,$("#toptitle").empty(),$("#chan").addClass("bigChan"),$("#chan").html("zoff.no/"+_.toLowerCase())):(showToggle=!0,$("#toptitle").html("Zöff"),$("#chan").removeClass("bigChan"),$("#chan").html(_)))},insertAtIndex:function(e,t){i=c.getIndexOfSong(e.id),0===i?$("#wrapper").prepend(c.generateSong(e,t,!1,!0,!1)):$("#wrapper > div:nth-child("+i+")").after(c.generateSong(e,t,!1,!0,!1)),t&&setTimeout(function(){var e=$("#wrapper").children()[i];$(e).css("height",66)},5)},generateSong:function(e,t,n,o,a){var i,r,l=e.id,s=e.title,c=e.votes,d="background-image:url('//img.youtube.com/vi/"+l+"/mqdefault.jpg');",m=$("
"+p+"
"),u="style";return t&&m.find("#list-song").css("height",0),f||m.find(".card-action").removeClass("hide"),1==c&&m.find(".vote-text").text("vote"),n&&(d="//img.youtube.com/vi/"+l+"/mqdefault.jpg",u="data-original"),o?(m.find(".list-votes").text(c),m.find("#list-song").attr("id",l),m.find(".vote-container").attr("title",s),i=".vote-container",r="del"):o||(m.find(".vote-text").text(e.duration),i=".add-suggested",r=a?"del_user_suggested":"del_suggested",m.find(".vote-container").attr("class","clickable add-suggested"),m.find(".add-suggested").attr("title",s),m.find("#del").attr("id",r),m.find(i).attr("data-video-title",s),m.find(i).attr("data-video-length",e.length),m.find("#list-song").attr("id","suggested-"+l),m.find(".list-image").attr("class",m.find(".list-image").attr("class").replace("list-image","list-suggested-image"))),m.find(".list-title").text(s),m.find(".list-title").attr("title",s),m.find(i).attr("data-video-id",l),m.find(".list-image").attr(u,d),m.find(".list-suggested-image").attr(u,d),m.find("#"+r).attr("data-video-id",l),m.html()},getIndexOfSong:function(e){return indexes=$.map(full_playlist,function(t,n){return t.id==e?n:void 0}),indexes[0]}},d="",m=!1,u=!1,p=$("#list-song-html").html(),f=!0,h=!1,y=!0,v=100,w="",k=window.location.hash.substring(1).split("&"),_=k[0],x=!1,S={"sync disconnect on unload":!0,secure:!0,"force new connection":!0};$(document).ready(function(){2==k.length&&"autoplay"==k[1]?x=!0:m=!0,$("head").append(''),$("head").append(''),add="https://zoff.no",o=io.connect(""+add+":8880",S),o.on("get_list",function(){setTimeout(function(){o.emit("list",_.toLowerCase())},1e3)}),e.setup_youtube_listener(_),c.channel_listener(),window.onYouTubeIframeAPIReady=e.onYouTubeIframeAPIReady,e.loadPlayer(),s.initSlider()}),$(document).on("click","#zoffbutton",function(e){window.open("https://zoff.no/"+_.toLowerCase()+"/","_blank")}),$(document).on("click",".vote-container",function(e){var t=$(this).attr("data-video-id");c.vote(t,"pos")})}(); \ No newline at end of file +!function(){var e={loaded:!0,before_load:"",after_load:"",ytplayer:"",stopInterval:!1,setup_youtube_listener:function(t){n.on("np",function(t){if(e.loaded=!1,0==t[0].length){document.getElementById("song-title").innerHTML="Empty channel. Add some songs!",$("#player_overlay").height($("#player").height()),/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#player_overlay").toggleClass("hide");try{e.ytplayer.stopVideo()}catch(n){}}else{void 0==s?s=t[0][0].id:s!=a&&(s=a),a=t[0][0].id,conf=t[1][0],time=t[2],o=time-conf.startTime,d=t[0][0].title,$("#player_overlay").addClass("hide");try{Suggestions.fetchYoutubeSuggests(a)}catch(n){}if(e.getTitle(d,viewers),e.setBGimage(a),!m||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream)e.getTitle(d,viewers);else try{e.ytplayer.getVideoUrl().split("v=")[1]!=a&&(e.ytplayer.loadVideoById(a),e.notifyUser(a,d),e.ytplayer.seekTo(o),u&&e.ytplayer.pauseVideo()),u||(e.ytplayer.playVideo(),e.durationSetter()),(e.ytplayer.getDuration()>o||0==e.ytplayer.getDuration())&&e.ytplayer.seekTo(o),e.after_load=a,setTimeout(function(){e.loaded=!0},500)}catch(n){e.durationSetter()}}}),n.on("viewers",function(t){viewers=t,void 0!==d&&e.getTitle(d,viewers)})},onPlayerStateChange:function(t){switch(t.data){case-1:break;case 0:playing=!1,u=!1,n.emit("end",a);break;case 1:playing=!0,beginning&&window.mobilecheck()&&(e.ytplayer.pauseVideo(),beginning=!1),1==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide"),2==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),u&&(n.emit("pos"),u=!1);break;case 2:u=!0,l.play_pause_show();break;case 3:}},getTitle:function(e,t){var o=t>1?"viewers":"viewer",n=decodeURIComponent(e),a=document.getElementById("song-title"),i=document.getElementById("viewers");document.title=n+" • Zöff / "+_,a.innerHTML=n,i.innerHTML=t+" "+o,a.title=n+" • "+t+" "+o},errorHandler:function(t){5==t.data||100==t.data||101==t.data||150==t.data?(curr_playing=e.ytplayer.getVideoUrl().replace("https://www.youtube.com/watch?v=",""),n.emit("skip",{error:t.data,id:a,pass:w})):void 0!==a&&e.ytplayer.loadVideoById(a)},onPlayerReady:function(t){$("#channel-load").css("display","none");try{beginning=!0,m=!0,/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||($("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),e.ytplayer.loadVideoById(a),C&&!window.mobilecheck()&&e.ytplayer.playVideo(),e.durationSetter(),y?setTimeout(function(){e.ytplayer.seekTo(o),C||(e.ytplayer.pauseVideo(),l.play_pause_show())},1e3):e.ytplayer.seekTo(o)),e.readyLooks(),l.initYoutubeControls(e.ytplayer),l.initSlider(),e.ytplayer.setVolume(Crypt.get_volume())}catch(n){}},readyLooks:function(){e.setBGimage(a)},setBGimage:function(e){if(void 0!==e&&!y){var o=new Image;o.onload=function(){var e=new ColorThief,n=e.getColor(o);document.getElementsByTagName("body")[0].style.backgroundColor=t.rgbToHsl(n),$("meta[name=theme-color]").attr("content",t.rgbToHex(n[0],n[1],n[2]))},o.crossOrigin="Anonymous",o.src="https://zoff.no:8080/https://img.youtube.com/vi/"+e+"/mqdefault.jpg"}},set_width:function(e){$(".video-container").width(e)},notifyUser:function(e,t){if(t=t.replace(/\\\'/g,"'").replace(/"/g,"'").replace(/&/g,"&"),"granted"===Notification.permission&&document.hidden){var o=new Notification("Now Playing",{body:t,icon:"http://i.ytimg.com/vi/"+e+"/mqdefault.jpg",iconUrl:"http://i.ytimg.com/vi/"+e+"/mqdefault.jpg"});o.onclick=function(e){window.focus(),this.cancel()},setTimeout(function(){o.close()},5e3)}},setup_all_listeners:function(){n.on("get_list",function(){n.emit("list",_.toLowerCase())}),e.setup_youtube_listener(_),Admin.admin_listener(),Chat.setup_chat_listener(_),Chat.allchat_listener(),c.channel_listener()},onYouTubeIframeAPIReady:function(){e.ytplayer=new YT.Player("player",{videoId:a,playerVars:{rel:"0",wmode:"transparent",controls:"0",iv_load_policy:"3",theme:"light",color:"white"},events:{onReady:e.onPlayerReady,onStateChange:e.onPlayerStateChange,onError:e.errorHandler}})},durationSetter:function(){try{duration=e.ytplayer.getDuration()}catch(o){duration=0}if(void 0!=duration)try{dMinutes=Math.floor(duration/60),dSeconds=duration-60*dMinutes,currDurr=e.ytplayer.getCurrentTime(),currDurr>duration&&(currDurr=duration),minutes=Math.floor(currDurr/60),seconds=currDurr-60*minutes,document.getElementById("duration").innerHTML=t.pad(minutes)+":"+t.pad(seconds)+" / "+t.pad(dMinutes)+":"+t.pad(dSeconds),per=100/duration*currDurr,per>=100?per=100:0==duration&&(per=0),$("#bar").width(per+"%")}catch(o){}e.stopInterval||setTimeout(e.durationSetter,1e3)},loadPlayer:function(){1==$("script[src='https://www.youtube.com/iframe_api']").length?e.onYouTubeIframeAPIReady():(tag=document.createElement("script"),tag.src="https://www.youtube.com/iframe_api",firstScriptTag=document.getElementsByTagName("script")[0],firstScriptTag.parentNode.insertBefore(tag,firstScriptTag))}};window.mobilecheck=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e};var t={rnd:function(e){return e[Math.floor(Math.random()*e.length)]},predicate:function(){for(var e,t,o,n=[],a=arguments.length,i=function(e,t){return e===t?0:t>e?-1:1},s=function(e,t){var o=i,n=i;return e&&(n=function(t,n){return o(e(t),e(n))}),t?function(e,t){return-1*n(e,t)}:n},r=0;a>r;r++)e=arguments[r],"string"==typeof e?(t=e,o=i):(t=e.name,o=s(e.primer,e.reverse)),n.push({name:t,cmp:o});return function(t,o){for(var i,s,r=0;a>r&&(s=0,e=n[r],i=e.name,s=e.cmp(t[i],o[i]),0===s);r++);return s}},hashCode:function(e){for(var t=0,o=0;o>24&255).toString(16)+(e>>16&255).toString(16)+(e>>8&255).toString(16)+(255&e).toString(16)},pad:function(e){return 10>e?"0"+Math.floor(e):Math.floor(e)},contains:function(e,t){for(var o=e.length;o--;)if(e[o]===t)return!0;return!1},sample:function(){Date.now()-lastSample>=2*SAMPLE_RATE&&(n.removeAllListeners(),n.disconnect(),n.connect(),e.setup_all_listeners()),lastSample=Date.now(),setTimeout(t.sample,SAMPLE_RATE)},loadjsfile:function(e){if(-1==filesadded.indexOf("["+e+"]")){var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t),filesadded+="["+e+"]"}},msieversion:function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return t>0||navigator.userAgent.match(/Trident.*rv\:11\./)?!0:!1},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e))+e},rgbToHsl:function(e){r=e[0],g=e[1],b=e[2],r/=255,g/=255,b/=255;var t,o,n=Math.max(r,g,b),a=Math.min(r,g,b),i=(n+a)/2;if(n==a)t=o=0;else{var s=n-a;switch(o=i>.5?s/(2-n-a):s/(n+a),n){case r:t=(g-b)/s+(g.5&&(i=.5),"hsl("+Math.floor(360*t)+", "+Math.floor(100*o)+"%, "+Math.floor(100*i)+"%)"},componentToHex:function(e){var t=e.toString(16);return 1==t.length?"0"+t:t},rgbToHex:function(e,o,n){return"#"+t.componentToHex(e)+t.componentToHex(o)+t.componentToHex(n)},send_mail:function(e,t){if(""!=e&&""!=t){$("#submit-contact-form").addClass("hide"),$("#send-loader").removeClass("hide"),$("#contact-form-from").attr("disabled","true"),$("#contact-form-message").attr("disabled","true");var e=$("#contact-form-from").val(),t=$("#contact-form-message").val();$("#contact-container").empty(),window.open("mailto:contact@zoff.no?Subject=Contact%20Zoff&Body="+t+"'","_blank"),$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: contact@zoff.no")}}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var o=$("#contact-form-message").val(),n=$("#contact-form-from").val();t.send_mail(n,o)}),Element.prototype.remove=function(){this.parentElement.removeChild(this)},NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var e=0,t=this.length;t>e;e++)this[e]&&this[e].parentElement&&this[e].parentElement.removeChild(this[e])},String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t};var o,n,a,s,l={stopInterval:!1,initYoutubeControls:function(){!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#controls").appendTo("#playbar"),l.initControls()},initControls:function(){document.getElementById("volume-button").addEventListener("click",l.mute_video),document.getElementById("playpause").addEventListener("click",l.play_pause),document.getElementById("fullscreen").addEventListener("click",l.fullscreen)},initSlider:function(){try{v=Crypt.get_volume()}catch(e){}$("#volume").slider({min:0,max:100,value:v,range:"min",animate:!0,slide:function(e,t){l.setVolume(t.value);try{Crypt.set_volume(t.value)}catch(o){}}}),l.choose_button(v,!1)},fullscreen:function(){var e=document.getElementById("player"),t=e.requestFullScreen||e.mozRequestFullScreen||e.webkitRequestFullScreen;t&&t.bind(e)()},play_pause:function(){1==e.ytplayer.getPlayerState()?(e.ytplayer.pauseVideo(),!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||(document.getElementById("player").style.display="none",$(".page-footer").toggleClass("padding-bottom-extra"))):(2==e.ytplayer.getPlayerState()||0==e.ytplayer.getPlayerState())&&(e.ytplayer.playVideo(),!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||(document.getElementById("player").style.display="block",$(".page-footer").toggleClass("padding-bottom-extra")))},play_pause_show:function(){1==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),2==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide")},settings:function(){$("#qS").toggleClass("hide")},changeQuality:function(t){e.ytplayer.getPlaybackQuality!=t&&(e.ytplayer.setPlaybackQuality(t),e.ytplayer.getPlaybackQuality()),$("#qS").toggleClass("hide")},mute_video:function(){e.ytplayer.isMuted()?(e.ytplayer.unMute(),l.choose_button(e.ytplayer.getVolume(),!1)):(l.choose_button(0,!0),e.ytplayer.mute())},setVolume:function(t){e.ytplayer.setVolume(t),l.choose_button(t,!1),e.ytplayer.isMuted()&&e.ytplayer.unMute()},choose_button:function(e,t){t?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),2==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=0&&33>=e?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),2==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=34&&66>=e?(1==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),2==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide")):e>=67&&100>=e&&(2==document.getElementById("v-full").className.split(" ").length&&$("#v-full").toggleClass("hide"),1==document.getElementById("v-medium").className.split(" ").length&&$("#v-medium").toggleClass("hide"),1==document.getElementById("v-low").className.split(" ").length&&$("#v-low").toggleClass("hide"),1==document.getElementById("v-mute").className.split(" ").length&&$("#v-mute").toggleClass("hide"))},playPause:function(){state=e.ytplayer.getPlayerState(),button=document.getElementById("playpause"),1==state?e.ytplayer.pauseVideo():2==state&&e.ytplayer.playVideo()},volumeOptions:function(){e.ytplayer.isMuted()?(e.ytplayer.unMute(),v=e.ytplayer.getVolume(),$("#volume").slider("value",e.ytplayer.getVolume())):(e.ytplayer.mute(),$("#volume").slider("value",0))},hoverMute:function(t){v=e.ytplayer.getVolume()}},c={channel_listener:function(){n.on("channel",function(e){c.channel_function(e)})},channel_function:function(e){switch(e[0]){case"list":c.populate_list(e[1]);break;case"added":c.added_song(e[1]);break;case"deleted":c.deleted_song(e[1]);break;case"vote":c.voted_song(e[1],e[2]);break;case"song_change":c.song_change(e[1])}},populate_list:function(e){full_playlist=e,c.sortList(),$("#wrapper").empty(),$.each(full_playlist,function(e,t){t.now_playing||$("#wrapper").append(c.generateSong(t,!1,f,!0))}),f&&(window.mobilecheck()?$(".list-image").lazyload({}):$(".list-image").lazyload({container:$("#wrapper")}).removeClass("lazy")),$("#settings").css("visibility","visible"),$("#settings").css("opacity","1"),$("#wrapper").css("opacity","1")},added_song:function(e){full_playlist.push(e),c.sortList(),$("#suggested-"+e.id).remove(),c.insertAtIndex(e,!0)},deleted_song:function(e){var t=c.getIndexOfSong(e),o=$("#wrapper").children()[t];try{o.style.height=0,setTimeout(function(){$("#"+e).remove(),full_playlist.splice(c.getIndexOfSong(e),1)},305),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(n){full_playlist.splice(c.getIndexOfSong(e),1),$("#wrapper").children()[$("#wrapper").children().length-1].remove()}$("#suggested-"+e).remove(),Suggestions.checkUserEmpty()},voted_song:function(e,t){var o=c.getIndexOfSong(e),n=full_playlist[o];full_playlist[o].votes+=1,full_playlist[o].added=t,c.sortList(),$("#"+e).remove(),c.insertAtIndex(n,!1)},song_change:function(e){var t=full_playlist.length-1;full_playlist[0].now_playing=!0,full_playlist[0].votes=0,full_playlist[0].guids=[],full_playlist[0].added=e,full_playlist[t].now_playing=!1;try{full_playlist.push(full_playlist.shift()),$("#wrapper").children()[0].remove(),c.insertAtIndex(full_playlist[t-1],!1),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(o){}},vote:function(e,t){return n.emit("vote",[_,e,t,w]),!0},skip:function(){return n.emit("skip",{pass:w,id:a}),!0},importOldList:function(e){var t="",o=0;playlist_url="lists/"+e+".json",list=$.parseJSON($.ajax({type:"GET",url:playlist_url,async:!1}).responseText),$.each(list.songs,function(e,n){t+=n.id+",",o>45&&(Search.addVideos(t),t="",o=0),o++}),Search.addVideos(t),document.getElementById("search").value=""},sortList:function(){full_playlist.sort(t.predicate({name:"votes",reverse:!0},"added"))},show:function(){window.mobilecheck()||(showToggle?(showToggle=!1,$("#toptitle").empty(),$("#chan").addClass("bigChan"),$("#chan").html("zoff.no/"+_.toLowerCase())):(showToggle=!0,$("#toptitle").html("Zöff"),$("#chan").removeClass("bigChan"),$("#chan").html(_)))},insertAtIndex:function(e,t){i=c.getIndexOfSong(e.id),0===i?$("#wrapper").prepend(c.generateSong(e,t,!1,!0,!1)):$("#wrapper > div:nth-child("+i+")").after(c.generateSong(e,t,!1,!0,!1)),t&&setTimeout(function(){var e=$("#wrapper").children()[i];$(e).css("height",66)},5)},generateSong:function(e,t,o,n,a){var i,s,r=e.id,l=e.title,c=e.votes,d="background-image:url('//img.youtube.com/vi/"+r+"/mqdefault.jpg');",u=$("
"+p+"
"),m="style";return t&&u.find("#list-song").css("height",0),h||u.find(".card-action").removeClass("hide"),1==c&&u.find(".vote-text").text("vote"),o&&(d="//img.youtube.com/vi/"+r+"/mqdefault.jpg",m="data-original"),n?(u.find(".list-votes").text(c),u.find("#list-song").attr("id",r),u.find(".vote-container").attr("title",l),i=".vote-container",s="del"):n||(u.find(".vote-text").text(e.duration),i=".add-suggested",s=a?"del_user_suggested":"del_suggested",u.find(".vote-container").attr("class","clickable add-suggested"),u.find(".add-suggested").attr("title",l),u.find("#del").attr("id",s),u.find(i).attr("data-video-title",l),u.find(i).attr("data-video-length",e.length),u.find("#list-song").attr("id","suggested-"+r),u.find(".list-image").attr("class",u.find(".list-image").attr("class").replace("list-image","list-suggested-image"))),u.find(".list-title").text(l),u.find(".list-title").attr("title",l),u.find(i).attr("data-video-id",r),u.find(".list-image").attr(m,d),u.find(".list-suggested-image").attr(m,d),u.find("#"+s).attr("data-video-id",r),u.html()},getIndexOfSong:function(e){return indexes=$.map(full_playlist,function(t,o){return t.id==e?o:void 0}),indexes[0]}},d="",u=!1,m=!1,p=$("#list-song-html").html(),h=!0,f=!1,y=!0,v=100,w="",k=window.location.hash.substring(1).split("&"),_=k[0],C=!1,S={"sync disconnect on unload":!0,secure:!0,"force new connection":!0};$(document).ready(function(){2==k.length&&"autoplay"==k[1]?C=!0:u=!0,$("head").append(''),$("head").append(''),add="https://zoff.no",n=io.connect(""+add+":8880",S),n.on("get_list",function(){setTimeout(function(){n.emit("list",_.toLowerCase())},1e3)}),e.setup_youtube_listener(_),c.channel_listener(),window.onYouTubeIframeAPIReady=e.onYouTubeIframeAPIReady,e.loadPlayer(),l.initSlider()}),$(document).on("click","#zoffbutton",function(e){window.open("https://zoff.no/"+_.toLowerCase()+"/","_blank")}),$(document).on("click",".vote-container",function(e){var t=$(this).attr("data-video-id");c.vote(t,"pos")})}(); \ No newline at end of file diff --git a/static/dist/frontpage.min.js b/static/dist/frontpage.min.js index 082b11e5..23d63bc0 100755 --- a/static/dist/frontpage.min.js +++ b/static/dist/frontpage.min.js @@ -1 +1 @@ -!function(){function t(){window.onpopstate=function(t){var e=window.location.href.split("/");""!=e[3]&&"#"!=e[3].substring(0,1)&&i.to_channel(e[3],!0)},e=$("#channel-list-container").html();var t={secure:!0,"force new connection":!0};"zoff.no"==window.location.hostname?add="https://zoff.no":add="localhost",o=io.connect(""+add+":8880",t),o.on("playlists",function(t){$("#channels").empty(),i.populate_channels(t.channels),i.set_viewers(t.viewers)}),o.emit("frontpage_lists"),$("#channel-load").css("display","none"),"#donation"==window.location.hash&&(window.location.hash="#",$("#donation").openModal()),localStorage.ok_cookie||Materialize.toast("We're using cookies to enhance your experience! ok",1e4);var a=0;document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="http://etys.no")}),!window.mobilecheck()&&i.winter&&i.start_snowfall(),n=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,n=$.parseJSON(n),$("#latest-commit").html("Latest Commit:
"+n[0].commit.author.date.substring(0,10)+": "+n[0].committer.login+"
"+n[0].sha.substring(0,10)+": "+n[0].commit.message+"a){var c=t[x][1],s=t[x][0],l="background-image:url('https://img.youtube.com/vi/"+c+"/hqdefault.jpg');",m=t[x][4],d=pre_card;1==t[x][5]?(d.find(".pin").attr("style","display:block;"),d.find(".card").attr("title","Pinned!")):(d.find(".pin").attr("style","display:none;"),d.find(".card").attr("title","")),d.find(".chan-name").text(r),d.find(".chan-name").attr("title",r),d.find(".chan-views").text(s),d.find(".chan-songs").text(m),d.find(".chan-bg").attr("style",l),d.find(".chan-link").attr("href",r),$("#channels").append(d.html())}o+="