diff --git a/static/dist/embed.min.js b/static/dist/embed.min.js
index 830c99cb..1399f9a4 100755
--- 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){n.on("np",function(t){if(e.loaded=!1,0==t.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,full_playlist[0].id==a&&c.song_change(full_playlist[0].added);try{Suggestions.fetchYoutubeSuggests(a)}catch(n){}if(e.getTitle(d,viewers),e.setBGimage(a),!p||/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(o){switch(o.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),y||t.addClass("#player_overlay","hide"),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,p=!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()),$(".video-container").removeClass("no-opacity")}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)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,o){t.contains($(e).attr("class").split(" "),o)||$(e).addClass(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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+_.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+_.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+_.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+_.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+_.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+_.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+_.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+_.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(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={empty:!1,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(),full_playlist.length>1?($.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"))):(c.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#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.empty&&($("#empty-channel-message").remove(),c.empty=!1),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),c.empty||$("#wrapper").children()[$("#wrapper").children().length-1].remove()}full_playlist.length<=2&&(c.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#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()),c.empty||$("#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=$(" "+m+"
"),p="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",p="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(p,d),u.find(".list-suggested-image").attr(p,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,p=!1,m=$("#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
+!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.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,full_playlist[0].id==a&&c.song_change(full_playlist[0].added);try{Suggestions.fetchYoutubeSuggests(a)}catch(n){}if(e.getTitle(d,viewers),e.setBGimage(a),!p||/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(o){switch(o.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),y||t.addClass("#player_overlay","hide"),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,p=!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()),$(".video-container").removeClass("no-opacity")}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)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,o){t.contains($(e).attr("class").split(" "),o)||$(e).addClass(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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+_.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+_.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+_.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+_.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+_.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+_.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+_.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+_.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(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={empty:!1,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(),full_playlist.length>1?($.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"))):(c.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#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.empty&&($("#empty-channel-message").remove(),c.empty=!1),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),c.empty||$("#wrapper").children()[$("#wrapper").children().length-1].remove()}full_playlist.length<=2&&(c.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#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()),c.empty||$("#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=$(" "+m+"
"),p="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",p="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(p,d),u.find(".list-suggested-image").attr(p,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]},scrollTop:function(){$("#wrapper").scrollTop(0)},scrollBottom:function(){$("#wrapper").scrollTop($("#wrapper")[0].scrollHeight)}},d="",u=!1,p=!1,m=$("#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 29c080b1..d6a0f7c8 100755
--- a/static/dist/frontpage.min.js
+++ b/static/dist/frontpage.min.js
@@ -1 +1 @@
-!function(){function e(){window.onpopstate=function(e){var t=window.location.href.split("/");""!=t[3]&&"#"!=t[3].substring(0,1)&&i.to_channel(t[3],!0)},s.share_link_modifier(!1),t=$("#channel-list-container").html();var e={secure:!0,"force new connection":!0};"zoff.no"==window.location.hostname?add="https://zoff.no":add="localhost",n=io.connect(""+add+":8880",e),n.on("playlists",function(e){$("#channels").empty(),i.populate_channels(e.channels),i.set_viewers(e.viewers)}),n.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(),o=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,o=$.parseJSON(o),$("#latest-commit").html("Latest Commit: "+o[0].commit.author.date.substring(0,10)+": "+o[0].committer.login+""+o[0].sha.substring(0,10)+" : "+o[0].commit.message+" a){var r=e[x][1],l=e[x][0],c="background-image:url('https://img.youtube.com/vi/"+r+"/hqdefault.jpg');",d=e[x][4],u=pre_card;1==e[x][5]?(u.find(".pin").attr("style","display:block;"),u.find(".card").attr("title","Pinned!")):(u.find(".pin").attr("style","display:none;"),u.find(".card").attr("title","")),u.find(".chan-name").text(s),u.find(".chan-name").attr("title",s),u.find(".chan-views").text(l),u.find(".chan-songs").text(d),u.find(".chan-bg").attr("style",c),u.find(".chan-link").attr("href",s),$("#channels").append(u.html())}n+=" ",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=e.length||t>=8)&&(t=0);var o=e[t][1];if(void 0!==i.blob_list[t])setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+i.blob_list[t]+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])},500);else{var s=new Image;s.src="/static/images/thumbnails/"+o+".jpg",s.onerror=function(){$.ajax({type:"POST",data:{id:o},url:"/php/imageblob.php",success:function(o){i.blob_list.push(o),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+o+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])},500)}})},s.onload=function(){$("#mega-background").css("background","url("+s.src+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])}}setTimeout(function(){50==i.times_rotated&&a?(i.times_rotated=0,t=0,n.emit("frontpage_lists")):a&&(i.times_rotated+=1,i.add_backdrop(e,t+1))},6e3)},start_snowfall:function(){setTimeout(function(){var e=Math.floor(Math.random()*window.innerWidth+1),t=document.createElement("div"),o=document.getElementsByClassName("mega")[0];t.className="snow",t.style.left=e+"px",t.style.top="0px",o.appendChild(t),i.fall_snow(t),i.start_snowfall()},800)},fall_snow:function(e){e.style.top=parseInt(e.style.top.replace("px",""))+2+"px",parseInt(e.style.top.replace("px",""))0){var t=e>1?"listeners":"listener";$("#frontpage-viewer-counter").html(e+" "+t)}},to_channel:function(e,t){$("#channel-load").css("display","block"),window.scrollTo(0,0),a=!1,n.removeAllListeners(),$.ajax({url:e+"/php/index.php",success:function(o){$("body").css("background-color","#2d2d2d"),n.disconnect(),t||window.history.pushState("to the channel!","Title","/"+e+"/"),$(".mega").remove(),$(".mobile-search").remove(),$("main").attr("class","container center-align main"),$("body").attr("id","channelpage"),$("header").html($($(o)[37]).html()),$("main").html($($(o)[41]).html()),$("#search").attr("placeholder","Find song on youtube"),1==$("#alreadychannel").length?window.init():$("#scripts").append($($(o)[55]).html()),0==$("#alreadyfp").length&&$("head").append("
")}})}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$().ready(e),window.initfp=e,$(document).on("click","#cookieok",function(){$(this).fadeOut(function(){$(this).remove(),localStorage.ok_cookie=!0})}),$(document).on("click","#toast-container",function(){$(this).fadeOut(function(){$(this).remove()})}),$(document).on("click",".chan-link",function(e){e.preventDefault(),i.to_channel($(this).attr("href"),!1)}),$(document).on("click",".listen-button",function(e){""==$(".room-namer").val()&&(e.preventDefault(),i.to_channel($(".room-namer").attr("placeholder")))}),$(document).on("submit",".channel-finder",function(e){return e.preventDefault(),i.to_channel($(".room-namer").val()),!1}),$(document).on("submit","#base",function(e){return e.preventDefault(),i.to_channel($("#search-mobile").val()),!1}),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 s={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(),Youtube.setup_all_listeners()),lastSample=Date.now(),setTimeout(s.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,t,o){return"#"+s.componentToHex(e)+s.componentToHex(t)+s.componentToHex(o)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,t){s.contains($(e).attr("class").split(" "),t)||$(e).addClass(t)},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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+chan.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+chan.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+chan.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+chan.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+chan.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+chan.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+chan.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+chan.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var t=$("#contact-form-message").val(),o=$("#contact-form-from").val();s.send_mail(o,t)}),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}}();
\ No newline at end of file
+!function(){function e(){window.onpopstate=function(e){var t=window.location.href.split("/");""!=t[3]&&"#"!=t[3].substring(0,1)&&i.to_channel(t[3],!0)},t=$("#channel-list-container").html();var e={secure:!0,"force new connection":!0};"zoff.no"==window.location.hostname?add="https://zoff.no":add="localhost",n=io.connect(""+add+":8880",e),n.on("playlists",function(e){$("#channels").empty(),i.populate_channels(e.channels),i.set_viewers(e.viewers)}),n.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(),o=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,o=$.parseJSON(o),$("#latest-commit").html("Latest Commit: "+o[0].commit.author.date.substring(0,10)+": "+o[0].committer.login+""+o[0].sha.substring(0,10)+" : "+o[0].commit.message+" a){var r=e[x][1],l=e[x][0],c="background-image:url('https://img.youtube.com/vi/"+r+"/hqdefault.jpg');",d=e[x][4],u=pre_card;1==e[x][5]?(u.find(".pin").attr("style","display:block;"),u.find(".card").attr("title","Pinned!")):(u.find(".pin").attr("style","display:none;"),u.find(".card").attr("title","")),u.find(".chan-name").text(s),u.find(".chan-name").attr("title",s),u.find(".chan-views").text(l),u.find(".chan-songs").text(d),u.find(".chan-bg").attr("style",c),u.find(".chan-link").attr("href",s),$("#channels").append(u.html())}n+=" ",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=e.length||t>=8)&&(t=0);var o=e[t][1];if(void 0!==i.blob_list[t])setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+i.blob_list[t]+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])},500);else{var s=new Image;s.src="/static/images/thumbnails/"+o+".jpg",s.onerror=function(){$.ajax({type:"POST",data:{id:o},url:"/php/imageblob.php",success:function(o){i.blob_list.push(o),setTimeout(function(){$("#mega-background").css("background","url(data:image/png;base64,"+o+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])},500)}})},s.onload=function(){$("#mega-background").css("background","url("+s.src+")"),$("#mega-background").css("background-size","200%"),$("#mega-background").css("opacity",1),$("#search").attr("placeholder",e[t][3])}}setTimeout(function(){50==i.times_rotated&&a?(i.times_rotated=0,t=0,n.emit("frontpage_lists")):a&&(i.times_rotated+=1,i.add_backdrop(e,t+1))},6e3)},start_snowfall:function(){setTimeout(function(){var e=Math.floor(Math.random()*window.innerWidth+1),t=document.createElement("div"),o=document.getElementsByClassName("mega")[0];t.className="snow",t.style.left=e+"px",t.style.top="0px",o.appendChild(t),i.fall_snow(t),i.start_snowfall()},800)},fall_snow:function(e){e.style.top=parseInt(e.style.top.replace("px",""))+2+"px",parseInt(e.style.top.replace("px",""))0){var t=e>1?"listeners":"listener";$("#frontpage-viewer-counter").html(e+" "+t)}},to_channel:function(e,t){$("#channel-load").css("display","block"),window.scrollTo(0,0),a=!1,n.removeAllListeners(),$.ajax({url:e+"/php/index.php",success:function(o){$("body").css("background-color","#2d2d2d"),n.disconnect(),t||window.history.pushState("to the channel!","Title","/"+e+"/"),$(".mega").remove(),$(".mobile-search").remove(),$("main").attr("class","container center-align main"),$("body").attr("id","channelpage"),$("header").html($($(o)[37]).html()),$("main").html($($(o)[41]).html()),$("#search").attr("placeholder","Find song on youtube"),1==$("#alreadychannel").length?window.init():$("#scripts").append($($(o)[55]).html()),0==$("#alreadyfp").length&&$("head").append("
")}})}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$().ready(e),window.initfp=e,$(document).on("click","#cookieok",function(){$(this).fadeOut(function(){$(this).remove(),localStorage.ok_cookie=!0})}),$(document).on("click","#toast-container",function(){$(this).fadeOut(function(){$(this).remove()})}),$(document).on("click",".chan-link",function(e){e.preventDefault(),i.to_channel($(this).attr("href"),!1)}),$(document).on("click",".listen-button",function(e){""==$(".room-namer").val()&&(e.preventDefault(),i.to_channel($(".room-namer").attr("placeholder")))}),$(document).on("submit",".channel-finder",function(e){return e.preventDefault(),i.to_channel($(".room-namer").val()),!1}),$(document).on("submit","#base",function(e){return e.preventDefault(),i.to_channel($("#search-mobile").val()),!1}),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 s={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(),Youtube.setup_all_listeners()),lastSample=Date.now(),setTimeout(s.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,t,o){return"#"+s.componentToHex(e)+s.componentToHex(t)+s.componentToHex(o)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,t){s.contains($(e).attr("class").split(" "),t)||$(e).addClass(t)},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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+chan.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+chan.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+chan.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+chan.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+chan.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+chan.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+chan.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+chan.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var t=$("#contact-form-message").val(),o=$("#contact-form-from").val();s.send_mail(o,t)}),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}}();
\ No newline at end of file
diff --git a/static/dist/main.min.js b/static/dist/main.min.js
index b574d44b..c25a8c4c 100755
--- a/static/dist/main.min.js
+++ b/static/dist/main.min.js
@@ -1,2 +1,2 @@
-!function(){function e(){window.onpopstate=function(e){t()},i.share_link_modifier(!0),I=$("#chan").html(),"zoff.no"==window.location.hostname?add="https://zoff.no":add="localhost",_=io.connect(""+add+":8880",ee),_.on("get_list",function(){setTimeout(function(){_.emit("list",I.toLowerCase())},1e3)}),_.on("suggested",function(e){var t=!0;void 0==e.id&&(t=!1),setTimeout(function(){ne.catchUserSuggests(e,t)},1e3)}),setTimeout(function(){ae.stopInterval=!1,localStorage.list_update&&"13.06.15"==localStorage.list_update||(localStorage.setItem("list_update","13.06.15"),window.location.reload(!0)),ae.setup_youtube_listener(I),o.admin_listener(),S.channel_listener(),$("ul.tabs").tabs(),$("#settings").sideNav({menuWidth:300,edge:"right",closeOnClick:!1}),$(".collapsible").collapsible({accordion:!0}),$(".video-container").resizable({start:function(e,t){$("iframe").css("pointer-events","none")},stop:function(e,t){$("iframe").css("pointer-events","auto"),a.set_width($(this).width())},handles:"e",minWidth:350}),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream?(document.getElementById("search").blur(),ae.readyLooks()):(n.setup_chat_listener(I),n.allchat_listener(),window.mobilecheck()||C.host_listener(),window.onYouTubeIframeAPIReady=ae.onYouTubeIframeAPIReady,ae.loadPlayer(),$("#chat-btn").sideNav({menuWidth:272,edge:"left",closeOnClick:!1}),$(".drag-target")[1].remove(),i.msieversion()||Notification.requestPermission(),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&$(".main").height(window.innerHeight-64),git_info=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,git_info=$.parseJSON(git_info),$("#latest-commit").html("Latest Commit: "+git_info[0].commit.author.date.substring(0,10)+": "+git_info[0].committer.login+""+git_info[0].sha.substring(0,10)+" : "+git_info[0].commit.message+" ')}function t(){var e=window.location.href.split("/");"#!"==e[3].substr(0,1)||""==e[3]||5==e.length&&"#"==e[4].substr(0,1)?""==e[3]&&($("#channel-load").css("display","block"),window.scrollTo(0,0),ae.stopInterval=!0,o.display_logged_out(),o.beginning=!0,I="",Z=!1,$("#embed-button").css("display","none"),_.removeAllListeners(),$.ajax({url:"php/nochan.php",success:function(e){console.log($(e)),_.disconnect(),document.getElementById("volume-button").removeEventListener("click",te.mute_video),document.getElementById("playpause").removeEventListener("click",te.play_pause),document.getElementById("fullscreen").removeEventListener("click",te.fullscreen),f="",w="",$("meta[name=theme-color]").attr("content","#2D2D2D"),ae.ytplayer.destroy(),$(".drag-target").remove(),$("#sidenav-overlay").remove(),$("main").attr("class","center-align container"),$("body").attr("id",""),$("body").attr("style",""),$("header").html($($(e)[37]).html()),$($(e)[39]).insertAfter("header"),$($(e)[41]).insertAfter(".mega"),$("main").html($($(e)[45]).html()),1==$("#alreadyfp").length?window.initfp():("zoff.no"==window.location.hostname?number=47:number=65,$("#scripts").append($($(e)[number]).html())),0==$("#alreadychannel").length&&$("head").append("
150||(e.value.startsWith("/name ")?_.emit("namechange",e.value.substring(6)):"#all_chat"==$(".tab a.active").attr("href")?_.emit("all,chat",e.value):_.emit("chat",e.value),e.value="")},allchat_listener:function(){_.on("chat.all",function(e){0!=$("#chat-bar").position().left?z||($("#favicon").attr("href","static/images/highlogo.png"),z=!0,P=!0,d=setInterval(n.chat_blink,2e3)):document.hidden&&($("#favicon").attr("href","static/images/highlogo.png"),P=!0);var t=i.intToARGB(i.hashCode(e[0])).substring(0,6);$("#chatall").append(""+e[0]+" ");var o=document.createTextNode(e[1]);$("#chatall li:last")[0].appendChild(o),document.getElementById("chatall").scrollTop=document.getElementById("chatall").scrollHeight})},setup_chat_listener:function(e){_.on("chat",function(e){0!=$("#chat-bar").position().left&&e[1].indexOf(":")>=0&&(z||($("#favicon").attr("href","static/images/highlogo.png"),z=!0,d=setInterval(n.chat_blink,2e3)));var t=i.intToARGB(i.hashCode(e[0])).substring(0,6);$("#chatchannel").append(""+e[0]+" ");var o=document.createTextNode(e[1]);$("#chatchannel li:last")[0].appendChild(o),document.getElementById("chatchannel").scrollTop=document.getElementById("chatchannel").scrollHeight})},chat_blink:function(){$("#chat-btn i").css("opacity",.5),setTimeout(function(){$("#chat-btn i").css("opacity",1)},1e3)}},a={conf_arr:{},init:function(){document.cookie=I.toLowerCase()+"=; path=/"+I.toLowerCase()+"; expires="+new Date(0).toUTCString();try{conf_arr=a.decrypt(a.getCookie("_opt"),"_opt")}catch(e){conf_arr=a.decrypt(a.create_cookie("_opt"),"_opt")}try{conf_pass=a.decrypt(a.getCookie(I.toLowerCase()),I.toLowerCase())}catch(e){conf_pass=a.decrypt(a.create_cookie(I.toLowerCase()),I.toLowerCase())}C.change_enabled(conf_arr.remote),100!=conf_arr.width&&ae.set_width(conf_arr.width)},decrypt:function(e,t){void 0===a.getCookie(t)&&(e=a.create_cookie(t));var o=CryptoJS.AES.decrypt(e,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return $.parseJSON(o.toString(CryptoJS.enc.Utf8))},decrypt_pass:function(e){var t=CryptoJS.AES.decrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString(CryptoJS.enc.Utf8)},encrypt:function(e,t){var o=JSON.stringify(e),n=CryptoJS.AES.encrypt(o,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}),a=new Date;a.setFullYear(a.getFullYear()+1),document.cookie=t+"="+n.toString()+";expires="+a.toGMTString()+";path=/;"},encrypt_string:function(e){var t=CryptoJS.AES.encrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString()},get_volume:function(){return a.decrypt(a.getCookie("_opt"),"_opt").volume},set_volume:function(e){conf_arr.volume=e,a.encrypt(conf_arr,"_opt")},create_cookie:function(e){"_opt"==e?cookie_object={volume:100,width:100,remote:!0}:cookie_object={passwords:{}};var t=JSON.stringify(cookie_object),o=CryptoJS.AES.encrypt(t,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}),n=new Date;return n.setFullYear(n.getFullYear()+1),document.cookie=e+"="+o.toString()+";expires="+n.toGMTString()+";path=/;",a.getCookie(e)},set_pass:function(e,t){conf_pass.passwords[e]=t,a.encrypt(conf_pass,e)},remove_pass:function(e){delete conf_pass.passwords[e],a.encrypt(conf_pass,e.toLowerCase())},get_pass:function(e){return conf_pass.passwords[e]},set_remote:function(e){conf_arr.remote=e,a.encrypt(conf_arr,"_opt")},get_remote:function(e){return conf_arr.remote},crypt_pass:function(e){var t=CryptoJS.AES.encrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString()},get_width:function(){return conf_arr.width},set_width:function(e){conf_arr.width=e,a.encrypt(conf_arr,"_opt")},getCookie:function(e){var t="; "+document.cookie,o=t.split("; "+e+"=");return 2==o.length?o.pop().split(";").shift():void 0}};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 i={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()-G>=2*F&&(_.removeAllListeners(),_.disconnect(),_.connect(),ae.setup_all_listeners()),G=Date.now(),setTimeout(i.sample,F)},loadjsfile:function(e){if(-1==H.indexOf("["+e+"]")){var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t),H+="["+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,t,o){return"#"+i.componentToHex(e)+i.componentToHex(t)+i.componentToHex(o)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,t){i.contains($(e).attr("class").split(" "),t)||$(e).addClass(t)},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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+I.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+I.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+I.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+I.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+I.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+I.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+I.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+I.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var t=$("#contact-form-message").val(),o=$("#contact-form-from").val();i.send_mail(o,t)}),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 s,l,c,d,u,p,m,h,f,y,v,w,k,_,C={enabled:!0,host_listener:function(){var e;_.on("id",function(t){void 0===e?e=t:(_.removeAllListeners(t),Z=!1,e=t);var n="https://remote."+window.location.hostname+"/"+t;$("#code-text").text(t),$("#code-qr").attr("src","https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+n),$("#code-link").attr("href",n),Z||(Z=!0,_.on(t,function(e){enabled&&("volume"==e[0]?($("#volume").slider("value",e[1]),ae.ytplayer.setVolume(e[1]),localStorage.setItem("volume",e[1]),te.choose_button(e[1],!1)):"channel"==e[0]?(_.emit("change_channel"),o.beginning=!0,I=e[1].toLowerCase(),$("#chan").html(i.upperFirst(I)),T=!0,_.emit("list",I.toLowerCase()),window.history.pushState("object or string","Title","/"+I.toLowerCase())):"pause"==e[0]?ae.ytplayer.pauseVideo():"play"==e[0]?ae.ytplayer.playVideo():"skip"==e[0]&&S.skip())}))}),$("input[class=remote_switch_class]").change(function(){enabled=document.getElementsByName("remote_switch")[0].checked,a.set_remote(enabled)})},change_enabled:function(e){enabled=e,document.getElementsByName("remote_switch")[0].checked=enabled}},S={empty:!1,channel_listener:function(){_.on("channel",function(e){S.channel_function(e)})},channel_function:function(e){switch(e[0]){case"list":S.populate_list(e[1]);break;case"added":S.added_song(e[1]);break;case"deleted":S.deleted_song(e[1]);break;case"vote":S.voted_song(e[1],e[2]);break;case"song_change":S.song_change(e[1])}},populate_list:function(e){l=e,S.sortList(),$("#wrapper").empty(),l.length>1?($.each(l,function(e,t){t.now_playing||$("#wrapper").append(S.generateSong(t,!1,Q,!0))}),Q&&(window.mobilecheck()?$(".list-image").lazyload({}):$(".list-image").lazyload({container:$("#wrapper")}).removeClass("lazy"))):(S.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#settings").css("visibility","visible"),$("#settings").css("opacity","1"),$("#wrapper").css("opacity","1")},added_song:function(e){l.push(e),S.sortList(),$("#suggested-"+e.id).remove(),S.empty&&($("#empty-channel-message").remove(),S.empty=!1),S.insertAtIndex(e,!0)},deleted_song:function(e){var t=S.getIndexOfSong(e),o=$("#wrapper").children()[t];try{o.style.height=0,setTimeout(function(){$("#"+e).remove(),l.splice(S.getIndexOfSong(e),1)},305),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(n){l.splice(S.getIndexOfSong(e),1),S.empty||$("#wrapper").children()[$("#wrapper").children().length-1].remove()}l.length<=2&&(S.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#suggested-"+e).remove(),ne.checkUserEmpty()},voted_song:function(e,t){var o=S.getIndexOfSong(e),n=l[o];l[o].votes+=1,l[o].added=t,S.sortList(),$("#"+e).remove(),S.insertAtIndex(n,!1)},song_change:function(e){var t=l.length-1;l[0].now_playing=!0,l[0].votes=0,l[0].guids=[],l[0].added=e,l[t].now_playing=!1;try{l.push(l.shift()),S.empty||$("#wrapper").children()[0].remove(),S.insertAtIndex(l[t-1],!1),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(o){}},vote:function(e,t){return _.emit("vote",[I,e,t,R]),!0},skip:function(){return _.emit("skip",{pass:R,id:f}),!0},importOldList:function(e){var t="",o=0;playlist_url="lists/"+e+".json",y=$.parseJSON($.ajax({type:"GET",url:playlist_url,async:!1}).responseText),$.each(y.songs,function(e,n){t+=n.id+",",o>45&&(oe.addVideos(t),t="",o=0),o++}),oe.addVideos(t),document.getElementById("search").value=""},sortList:function(){l.sort(i.predicate({name:"votes",reverse:!0},"added"))},show:function(){window.mobilecheck()||(B?(B=!1,$("#toptitle").empty(),$("#chan").addClass("bigChan"),$("#chan").html("zoff.no/"+I.toLowerCase())):(B=!0,$("#toptitle").html("Zöff"),$("#chan").removeClass("bigChan"),$("#chan").html(I)))},insertAtIndex:function(e,t){W=S.getIndexOfSong(e.id),0===W?$("#wrapper").prepend(S.generateSong(e,t,!1,!0,!1)):$("#wrapper > div:nth-child("+W+")").after(S.generateSong(e,t,!1,!0,!1)),t&&setTimeout(function(){var e=$("#wrapper").children()[W];$(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=$(" "+M+"
"),p="style";return t&&u.find("#list-song").css("height",0),T||u.find(".card-action").removeClass("hide"),1==c&&u.find(".vote-text").text("vote"),o&&(d="//img.youtube.com/vi/"+r+"/mqdefault.jpg",p="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(p,d),u.find(".list-suggested-image").attr(p,d),u.find("#"+s).attr("data-video-id",r),u.html()},getIndexOfSong:function(e){return indexes=$.map(l,function(t,o){return t.id==e?o:void 0}),indexes[0]}},I=$("#chan").html(),T=!0,E=0,B=!0,M=$("#list-song-html").html(),z=!1,P=!1,L=0,A="***REMOVED***",N=$("#temp-results-container"),j=$("#empty-results-container").html(),V=!1,D=/P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/,c=[],q=0,O=1,R="",H="",Y=!1,h=1,U=!1,J=!1,F=6e3,G=Date.now(),Z=!1,W=-1,Q=!0,K=!1,X=!0,ee={"sync disconnect on unload":!0,secure:!0,"force new connection":!0};$().ready(function(){e()}),window.init=e,$(document).keyup(function(e){if(27==event.keyCode)$("#results").html(""),i.contains($("#search-wrapper").attr("class").split(" "),"hide")||$("#search-wrapper").toggleClass("hide"),i.contains($("#song-title").attr("class").split(" "),"hide")&&$("#song-title").toggleClass("hide"),"mdi-navigation-close"==$("#search-btn i").attr("class")&&($("#search-btn i").toggleClass("mdi-navigation-close"),$("#search-btn i").toggleClass("mdi-action-search")),$("#results").toggleClass("hide");else if($("div.result").length>2)if(children=$("#mock-div").children(),40==e.keyCode)$(children[W-1]).removeClass("hoverResults"),$(children[W]).addClass("hoverResults"),W1&&W--,$(children[W]).removeClass("hoverResults"),$(children[W-1]).addClass("hoverResults");else if(13==e.keyCode){W=0;var t=document.getElementsByClassName("hoverResults")[0];"function"==typeof t.onclick&&t.onclick.apply(t),$("div.hoverResults").removeClass("hoverResults"),$("#results").html(""),document.getElementById("search").value=""}}),$("input[class=conf]").change(function(){o.save()}),$("#clickme").click(function(){ae.ytplayer.playVideo()}),$("#listImport").on("submit",function(){oe.importPlaylist(document.getElementById("import").value)}),$(window).focus(function(){P&&($("#favicon").attr("href","static/images/favicon.png"),P=!1)}),$(document).on("click","#chat-btn",function(){$("#text-chat-input").focus(),$("#chat-btn i").css("opacity",1),clearInterval(d),z=!1,P=!1,$("#favicon").attr("href","static/images/favicon.png")}),$(document).on("click",".chat-tab",function(){$("#text-chat-input").focus()}),$(document).on("click","#skip",function(e){e.preventDefault(),S.skip()}),$(document).on("click","#chan",function(e){e.preventDefault(),S.show()}),$(document).on("submit","#adminForm",function(e){e.preventDefault(),o.pass_save()}),$(document).on("submit","#chatForm",function(){n.chat(document.getElementById("chatForm").input)}),$(document).on("click","#shuffle",function(e){e.preventDefault(),o.shuffle()}),$(document).on("click","#search-btn",function(e){e.preventDefault(),oe.showSearch()}),$(document).on("click","#song-title",function(e){e.preventDefault(),oe.showSearch()}),$(document).on("click","#admin-lock",function(e){e.preventDefault(),o.log_out()}),$(document).on("click","#closeSettings",function(e){e.preventDefault(),o.hide_settings()}),$(document).on("click","#temp-results",function(e){if($(e.target).html()!=$(" ").html()){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submitAndClose(t,o,n)}}),$(document).on("click","#add-many",function(e){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submit(t,o,n)}),$(document).on("click",".vote-container",function(e){var t=$(this).attr("data-video-id");S.vote(t,"pos")}),$(document).on("click","#del",function(e){var t=$(this).attr("data-video-id");S.vote(t,"del")}),$(document).on("click",".add-suggested",function(e){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submit(t,o,n),$("#suggested-"+t).remove()}),$(document).on("click","#del_suggested",function(e){var t=$(this).attr("data-video-id");$("#suggested-"+t).remove()}),$(document).on("click","#del_user_suggested",function(e){var t=$(this).attr("data-video-id");$("#suggested-"+t).remove(),S.vote(t,"del")}),$(document).on("click","#toast-container",function(){$(this).fadeOut(function(){$(this).remove()})}),$(document).on("click","#embed-area",function(){this.select()}),$(document).on("click",".brand-logo-navigate",function(e){e.preventDefault(),window.history.pushState("to the frontpage!","Title","/"),t()});var te={stopInterval:!1,initYoutubeControls:function(){!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#controls").appendTo("#playbar"),te.initControls()},initControls:function(){document.getElementById("volume-button").addEventListener("click",te.mute_video),document.getElementById("playpause").addEventListener("click",te.play_pause),document.getElementById("fullscreen").addEventListener("click",te.fullscreen);
-},initSlider:function(){try{vol=a.get_volume()}catch(e){}$("#volume").slider({min:0,max:100,value:vol,range:"min",animate:!0,slide:function(e,t){te.setVolume(t.value);try{a.set_volume(t.value)}catch(o){}}}),te.choose_button(vol,!1)},fullscreen:function(){var e=document.getElementById("player"),t=e.requestFullScreen||e.mozRequestFullScreen||e.webkitRequestFullScreen;t&&t.bind(e)()},play_pause:function(){1==ae.ytplayer.getPlayerState()?(ae.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==ae.ytplayer.getPlayerState()||0==ae.ytplayer.getPlayerState())&&(ae.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(e){ae.ytplayer.getPlaybackQuality!=e&&(ae.ytplayer.setPlaybackQuality(e),ae.ytplayer.getPlaybackQuality()),$("#qS").toggleClass("hide")},mute_video:function(){ae.ytplayer.isMuted()?(ae.ytplayer.unMute(),te.choose_button(ae.ytplayer.getVolume(),!1)):(te.choose_button(0,!0),ae.ytplayer.mute())},setVolume:function(e){ae.ytplayer.setVolume(e),te.choose_button(e,!1),ae.ytplayer.isMuted()&&ae.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=ae.ytplayer.getPlayerState(),button=document.getElementById("playpause"),1==state?ae.ytplayer.pauseVideo():2==state&&ae.ytplayer.playVideo()},volumeOptions:function(){ae.ytplayer.isMuted()?(ae.ytplayer.unMute(),vol=ae.ytplayer.getVolume(),$("#volume").slider("value",ae.ytplayer.getVolume())):(ae.ytplayer.mute(),$("#volume").slider("value",0))},hoverMute:function(e){vol=ae.ytplayer.getVolume()}},oe={showSearch:function(){$("#search-wrapper").toggleClass("hide"),window.mobilecheck()&&$(".search_input").focus(),$("#song-title").toggleClass("hide"),$("#results").toggleClass("hide"),$("#results").empty(),$("#search-btn i").toggleClass("mdi-navigation-close"),$("#search-btn i").toggleClass("mdi-action-search"),$("#search").focus()},search:function(e){if($(".search_results").html(""),""!==window.search_input){V=!0;var t=encodeURIComponent(window.search_input),o="https://www.googleapis.com/youtube/v3/search?key="+A+"&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";o+="&q="+t,q&&(o+="&videoCategoryId=10");var n="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+A+"&id=";i.contains($("#search_loader").attr("class").split(" "),"hide")&&$("#search_loader").removeClass("hide"),i.contains($("#results").attr("class").split(" "),"hide")&&$("#results").removeClass("hide"),$.ajax({type:"GET",url:o,dataType:"jsonp",success:function(e){0==e.items.length?($(""+j+"
").appendTo($("#results")).show("blind",83.33),i.contains($("#search_loader").attr("class").split(" "),"hide")||$("#search_loader").addClass("hide")):e.items&&($.each(e.items,function(e,t){n+=t.id.videoId+","}),$.ajax({type:"GET",url:n,dataType:"jsonp",success:function(e){var t="",o=$(N);$.each(e.items,function(e,n){var a=n.contentDetails.duration;if(secs=oe.durationToSeconds(a),!longsongs||secs<720){m=n.snippet.title,enc_title=m,s=n.id,a=a.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s"),thumb=n.snippet.thumbnails.medium.url;var i=o;i.find(".search-title").text(m),i.find(".result_info").text(a),i.find(".thumb").attr("data-original",thumb),i.find("#add-many").attr("data-video-id",s),i.find("#add-many").attr("data-video-title",enc_title),i.find("#add-many").attr("data-video-length",secs),i.find("#temp-results").attr("data-video-id",s),i.find("#temp-results").attr("data-video-title",enc_title),i.find("#temp-results").attr("data-video-length",secs),t+=i.html()}}),$(""+t+"
").appendTo($("#results")).show("blind",83.33*(e.items.length-1)),setTimeout(function(){$(".thumb").lazyload({container:$("#results")})},250),i.contains($("#search_loader").attr("class").split(" "),"hide")||$("#search_loader").addClass("hide"),$(".add-many").click(function(e){return e.preventDefault(),e.stopPropagation(),!1})}}))}})}else $(".main").removeClass("blurT"),$("#controls").removeClass("blurT"),$(".main").removeClass("clickthrough")},submitAndClose:function(e,t,o){oe.submit(e,t,o),$("#results").html(""),oe.showSearch(),document.getElementById("search").value="",$("#results").html="",$(".main").removeClass("blurT"),$("#controls").removeClass("blurT"),$(".main").removeClass("clickthrough")},importPlaylist:function(e,t){token="",void 0!==t&&(token="&pageToken="+t),playlist_url="https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+A+"&playlistId="+e+token,$.ajax({type:"GET",url:playlist_url,dataType:"jsonp",success:function(t){var o="";oe.addVideos(t.items[0].contentDetails.videoId),$.each(t.items,function(e,t){o+=t.contentDetails.videoId+","}),oe.addVideos(o),t.nextPageToken&&oe.importPlaylist(e,t.nextPageToken),document.getElementById("import").value=""}})},addVideos:function(e){var t="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id=";t+=e,$.ajax({type:"POST",url:t,dataType:"jsonp",success:function(e){$.each(e.items,function(e,t){var o=oe.durationToSeconds(t.contentDetails.duration);(!longsongs||720>o)&&(enc_title=t.snippet.title,oe.submit(t.id,enc_title,o))})}})},submit:function(e,t,o){_.emit("add",[e,decodeURIComponent(t),R,o])},durationToSeconds:function(e){var t=e.match(D);return hours=parseInt(t[12])||0,minutes=parseInt(t[14])||0,seconds=parseInt(t[16])||0,60*hours*60+60*minutes+seconds}},ne={catchUserSuggests:function(e,t){if(t)ne.createSuggested(e);else for(x in e)ne.createSuggested(e[x]);ne.checkUserEmpty()},createSuggested:function(e){var t=e.duration,o=e.id,n=e.title,a=Math.floor(t/60),i=t-60*a;duration=a+"m "+i+"s";var s=S.generateSong({id:o,title:n,length:t,duration:duration},!1,!1,!1,!0);$("#user-suggest-html").append(s)},fetchYoutubeSuggests:function(e){var t="https://www.googleapis.com/youtube/v3/search?part=snippet&relatedToVideoId="+e+"&type=video&key="+A,o="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+A+"&id=";$.ajax({type:"GET",url:t,dataType:"jsonp",success:function(e){$.each(e.items.slice(0,5),function(e,t){o+=t.id.videoId+","}),$.ajax({type:"GET",url:o,dataType:"jsonp",success:function(e){$("#suggest-song-html").empty(),$.each(e.items,function(e,t){var o=t.contentDetails.duration,n=oe.durationToSeconds(o),a=t.id,i=t.snippet.title;o=o.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s"),$("#suggest-song-html").append(S.generateSong({id:a,title:i,length:n,duration:o},!1,!1,!1))})}})}})},checkUserEmpty:function(){var e=$("#user-suggest-html").children().length;0==e?i.contains($("#user_suggests").attr("class").split(" "),"hide")||$("#user_suggests").addClass("hide"):$("#user_suggests").removeClass("hide")}},ae={loaded:!0,before_load:"",after_load:"",ytplayer:"",stopInterval:!1,setup_youtube_listener:function(e){_.on("np",function(e){if(ae.loaded=!1,0==e.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{ae.ytplayer.stopVideo()}catch(t){}}else{void 0==k?k=e[0][0].id:k!=f&&(k=f),f=e[0][0].id,c=e[1][0],time=e[2],v=time-c.startTime,w=e[0][0].title,l[0].id==f&&S.song_change(l[0].added);try{ne.fetchYoutubeSuggests(f)}catch(t){}if(ae.getTitle(w,h),ae.setBGimage(f),!Y||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream)ae.getTitle(w,h);else try{ae.ytplayer.getVideoUrl().split("v=")[1]!=f&&(ae.ytplayer.loadVideoById(f),ae.notifyUser(f,w),ae.ytplayer.seekTo(v),U&&ae.ytplayer.pauseVideo()),U||(ae.ytplayer.playVideo(),ae.durationSetter()),(ae.ytplayer.getDuration()>v||0==ae.ytplayer.getDuration())&&ae.ytplayer.seekTo(v),ae.after_load=f,setTimeout(function(){ae.loaded=!0},500)}catch(t){ae.durationSetter()}}}),_.on("viewers",function(e){h=e,void 0!==w&&ae.getTitle(w,h)})},onPlayerStateChange:function(e){switch(e.data){case-1:break;case 0:J=!1,U=!1,_.emit("end",f);break;case 1:J=!0,beginning&&window.mobilecheck()&&(ae.ytplayer.pauseVideo(),beginning=!1),K||i.addClass("#player_overlay","hide"),1==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide"),2==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),U&&(_.emit("pos"),U=!1);break;case 2:U=!0,te.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 / "+I,a.innerHTML=n,i.innerHTML=t+" "+o,a.title=n+" • "+t+" "+o},errorHandler:function(e){5==e.data||100==e.data||101==e.data||150==e.data?(curr_playing=ae.ytplayer.getVideoUrl().replace("https://www.youtube.com/watch?v=",""),_.emit("skip",{error:e.data,id:f,pass:R})):void 0!==f&&ae.ytplayer.loadVideoById(f)},onPlayerReady:function(e){$("#channel-load").css("display","none");try{beginning=!0,Y=!0,/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||($("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),ae.ytplayer.loadVideoById(f),X&&!window.mobilecheck()&&ae.ytplayer.playVideo(),ae.durationSetter(),K?setTimeout(function(){ae.ytplayer.seekTo(v),X||(ae.ytplayer.pauseVideo(),te.play_pause_show())},1e3):ae.ytplayer.seekTo(v)),ae.readyLooks(),te.initYoutubeControls(ae.ytplayer),te.initSlider(),ae.ytplayer.setVolume(a.get_volume()),$(".video-container").removeClass("no-opacity")}catch(t){}},readyLooks:function(){ae.setBGimage(f)},setBGimage:function(e){if(void 0!==e&&!K){var t=new Image;t.onload=function(){var e=new ColorThief,o=e.getColor(t);document.getElementsByTagName("body")[0].style.backgroundColor=i.rgbToHsl(o),$("meta[name=theme-color]").attr("content",i.rgbToHex(o[0],o[1],o[2]))},t.crossOrigin="Anonymous",t.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(){_.on("get_list",function(){_.emit("list",I.toLowerCase())}),ae.setup_youtube_listener(I),o.admin_listener(),n.setup_chat_listener(I),n.allchat_listener(),S.channel_listener()},onYouTubeIframeAPIReady:function(){ae.ytplayer=new YT.Player("player",{videoId:f,playerVars:{rel:"0",wmode:"transparent",controls:"0",iv_load_policy:"3",theme:"light",color:"white"},events:{onReady:ae.onPlayerReady,onStateChange:ae.onPlayerStateChange,onError:ae.errorHandler}})},durationSetter:function(){try{duration=ae.ytplayer.getDuration()}catch(e){duration=0}if(void 0!=duration)try{dMinutes=Math.floor(duration/60),dSeconds=duration-60*dMinutes,currDurr=ae.ytplayer.getCurrentTime(),currDurr>duration&&(currDurr=duration),minutes=Math.floor(currDurr/60),seconds=currDurr-60*minutes,document.getElementById("duration").innerHTML=i.pad(minutes)+":"+i.pad(seconds)+" / "+i.pad(dMinutes)+":"+i.pad(dSeconds),per=100/duration*currDurr,per>=100?per=100:0==duration&&(per=0),$("#bar").width(per+"%")}catch(e){}ae.stopInterval||setTimeout(ae.durationSetter,1e3)},loadPlayer:function(){1==$("script[src='https://www.youtube.com/iframe_api']").length?ae.onYouTubeIframeAPIReady():(u=document.createElement("script"),u.src="https://www.youtube.com/iframe_api",p=document.getElementsByTagName("script")[0],p.parentNode.insertBefore(u,p))}}}();
\ No newline at end of file
+!function(){function e(){window.onpopstate=function(e){t()},i.share_link_modifier(!0),I=$("#chan").html(),"zoff.no"==window.location.hostname?add="https://zoff.no":add="localhost",_=io.connect(""+add+":8880",ee),_.on("get_list",function(){setTimeout(function(){_.emit("list",I.toLowerCase())},1e3)}),_.on("suggested",function(e){var t=!0;void 0==e.id&&(t=!1),setTimeout(function(){ne.catchUserSuggests(e,t)},1e3)}),setTimeout(function(){ae.stopInterval=!1,localStorage.list_update&&"13.06.15"==localStorage.list_update||(localStorage.setItem("list_update","13.06.15"),window.location.reload(!0)),ae.setup_youtube_listener(I),o.admin_listener(),S.channel_listener(),$("ul.tabs").tabs(),$("#settings").sideNav({menuWidth:300,edge:"right",closeOnClick:!1}),$(".collapsible").collapsible({accordion:!0}),$(".video-container").resizable({start:function(e,t){$("iframe").css("pointer-events","none")},stop:function(e,t){$("iframe").css("pointer-events","auto"),a.set_width($(this).width())},handles:"e",minWidth:350}),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream?(document.getElementById("search").blur(),ae.readyLooks()):(n.setup_chat_listener(I),n.allchat_listener(),window.mobilecheck()||C.host_listener(),window.onYouTubeIframeAPIReady=ae.onYouTubeIframeAPIReady,ae.loadPlayer(),$("#chat-btn").sideNav({menuWidth:272,edge:"left",closeOnClick:!1}),$(".drag-target")[1].remove(),i.msieversion()||Notification.requestPermission(),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&$(".main").height(window.innerHeight-64),git_info=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,git_info=$.parseJSON(git_info),$("#latest-commit").html("Latest Commit: "+git_info[0].commit.author.date.substring(0,10)+": "+git_info[0].committer.login+""+git_info[0].sha.substring(0,10)+" : "+git_info[0].commit.message+" ')}function t(){var e=window.location.href.split("/");"#!"==e[3].substr(0,1)||""==e[3]||5==e.length&&"#"==e[4].substr(0,1)?""==e[3]&&($("#channel-load").css("display","block"),window.scrollTo(0,0),i.share_link_modifier(!1),ae.stopInterval=!0,o.display_logged_out(),o.beginning=!0,I="",Z=!1,$("#embed-button").css("display","none"),_.removeAllListeners(),$.ajax({url:"php/nochan.php",success:function(e){_.disconnect(),document.getElementById("volume-button").removeEventListener("click",te.mute_video),document.getElementById("playpause").removeEventListener("click",te.play_pause),document.getElementById("fullscreen").removeEventListener("click",te.fullscreen),f="",w="",$("meta[name=theme-color]").attr("content","#2D2D2D"),ae.ytplayer.destroy(),$(".drag-target").remove(),$("#sidenav-overlay").remove(),$("main").attr("class","center-align container"),$("body").attr("id",""),$("body").attr("style",""),$("header").html($($(e)[37]).html()),$($(e)[39]).insertAfter("header"),$($(e)[41]).insertAfter(".mega"),$("main").html($($(e)[45]).html()),1==$("#alreadyfp").length?window.initfp():("zoff.no"==window.location.hostname?number=47:number=65,$("#scripts").append($($(e)[number]).html())),0==$("#alreadychannel").length&&$("head").append("
150||(e.value.startsWith("/name ")?_.emit("namechange",e.value.substring(6)):"#all_chat"==$(".tab a.active").attr("href")?_.emit("all,chat",e.value):_.emit("chat",e.value),e.value="")},allchat_listener:function(){_.on("chat.all",function(e){0!=$("#chat-bar").position().left?z||($("#favicon").attr("href","static/images/highlogo.png"),z=!0,L=!0,d=setInterval(n.chat_blink,2e3)):document.hidden&&($("#favicon").attr("href","static/images/highlogo.png"),L=!0);var t=i.intToARGB(i.hashCode(e[0])).substring(0,6);$("#chatall").append(""+e[0]+" ");var o=document.createTextNode(e[1]);$("#chatall li:last")[0].appendChild(o),document.getElementById("chatall").scrollTop=document.getElementById("chatall").scrollHeight})},setup_chat_listener:function(e){_.on("chat",function(e){0!=$("#chat-bar").position().left&&e[1].indexOf(":")>=0&&(z||($("#favicon").attr("href","static/images/highlogo.png"),z=!0,d=setInterval(n.chat_blink,2e3)));var t=i.intToARGB(i.hashCode(e[0])).substring(0,6);$("#chatchannel").append(""+e[0]+" ");var o=document.createTextNode(e[1]);$("#chatchannel li:last")[0].appendChild(o),document.getElementById("chatchannel").scrollTop=document.getElementById("chatchannel").scrollHeight})},chat_blink:function(){$("#chat-btn i").css("opacity",.5),setTimeout(function(){$("#chat-btn i").css("opacity",1)},1e3)}},a={conf_arr:{},init:function(){document.cookie=I.toLowerCase()+"=; path=/"+I.toLowerCase()+"; expires="+new Date(0).toUTCString();try{conf_arr=a.decrypt(a.getCookie("_opt"),"_opt")}catch(e){conf_arr=a.decrypt(a.create_cookie("_opt"),"_opt")}try{conf_pass=a.decrypt(a.getCookie(I.toLowerCase()),I.toLowerCase())}catch(e){conf_pass=a.decrypt(a.create_cookie(I.toLowerCase()),I.toLowerCase())}C.change_enabled(conf_arr.remote),100!=conf_arr.width&&ae.set_width(conf_arr.width)},decrypt:function(e,t){void 0===a.getCookie(t)&&(e=a.create_cookie(t));var o=CryptoJS.AES.decrypt(e,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return $.parseJSON(o.toString(CryptoJS.enc.Utf8))},decrypt_pass:function(e){var t=CryptoJS.AES.decrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString(CryptoJS.enc.Utf8)},encrypt:function(e,t){var o=JSON.stringify(e),n=CryptoJS.AES.encrypt(o,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}),a=new Date;a.setFullYear(a.getFullYear()+1),document.cookie=t+"="+n.toString()+";expires="+a.toGMTString()+";path=/;"},encrypt_string:function(e){var t=CryptoJS.AES.encrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString()},get_volume:function(){return a.decrypt(a.getCookie("_opt"),"_opt").volume},set_volume:function(e){conf_arr.volume=e,a.encrypt(conf_arr,"_opt")},create_cookie:function(e){"_opt"==e?cookie_object={volume:100,width:100,remote:!0}:cookie_object={passwords:{}};var t=JSON.stringify(cookie_object),o=CryptoJS.AES.encrypt(t,navigator.userAgent+navigator.languages,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}),n=new Date;return n.setFullYear(n.getFullYear()+1),document.cookie=e+"="+o.toString()+";expires="+n.toGMTString()+";path=/;",a.getCookie(e)},set_pass:function(e,t){conf_pass.passwords[e]=t,a.encrypt(conf_pass,e)},remove_pass:function(e){delete conf_pass.passwords[e],a.encrypt(conf_pass,e.toLowerCase())},get_pass:function(e){return conf_pass.passwords[e]},set_remote:function(e){conf_arr.remote=e,a.encrypt(conf_arr,"_opt")},get_remote:function(e){return conf_arr.remote},crypt_pass:function(e){var t=CryptoJS.AES.encrypt(e,_.id,{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return t.toString()},get_width:function(){return conf_arr.width},set_width:function(e){conf_arr.width=e,a.encrypt(conf_arr,"_opt")},getCookie:function(e){var t="; "+document.cookie,o=t.split("; "+e+"=");return 2==o.length?o.pop().split(";").shift():void 0}};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 i={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()-G>=2*F&&(_.removeAllListeners(),_.disconnect(),_.connect(),ae.setup_all_listeners()),G=Date.now(),setTimeout(i.sample,F)},loadjsfile:function(e){if(-1==H.indexOf("["+e+"]")){var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t),H+="["+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,t,o){return"#"+i.componentToHex(e)+i.componentToHex(t)+i.componentToHex(o)},upperFirst:function(e){return e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase()},addClass:function(e,t){i.contains($(e).attr("class").split(" "),t)||$(e).addClass(t)},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 ")}},share_link_modifier:function(e){e?($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+I.toLowerCase()),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"+I.toLowerCase()+"', 'Share Playlist','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/"+I.toLowerCase()+"&text=Check%20out%20this%20playlist%20"+I.toLowerCase()+"%20on%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/"+I.toLowerCase()+"/&text=Check%20out%20this%20playlist%20"+I.toLowerCase()+"%20on%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/"+I.toLowerCase()+"&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/"+I.toLowerCase()+"&choe=UTF-8&chld=L%7C1")):($("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('http://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"))}};$(document).on("submit","#contact-form",function(e){e.preventDefault();var t=$("#contact-form-message").val(),o=$("#contact-form-from").val();i.send_mail(o,t)}),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 s,l,c,d,u,p,m,h,f,y,v,w,k,_,C={enabled:!0,host_listener:function(){var e;_.on("id",function(t){void 0===e?e=t:(_.removeAllListeners(t),Z=!1,e=t);var n="https://remote."+window.location.hostname+"/"+t;$("#code-text").text(t),$("#code-qr").attr("src","https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+n),$("#code-link").attr("href",n),Z||(Z=!0,_.on(t,function(e){enabled&&("volume"==e[0]?($("#volume").slider("value",e[1]),ae.ytplayer.setVolume(e[1]),localStorage.setItem("volume",e[1]),te.choose_button(e[1],!1)):"channel"==e[0]?(_.emit("change_channel"),o.beginning=!0,I=e[1].toLowerCase(),$("#chan").html(i.upperFirst(I)),T=!0,_.emit("list",I.toLowerCase()),window.history.pushState("object or string","Title","/"+I.toLowerCase())):"pause"==e[0]?ae.ytplayer.pauseVideo():"play"==e[0]?ae.ytplayer.playVideo():"skip"==e[0]&&S.skip())}))}),$("input[class=remote_switch_class]").change(function(){enabled=document.getElementsByName("remote_switch")[0].checked,a.set_remote(enabled)})},change_enabled:function(e){enabled=e,document.getElementsByName("remote_switch")[0].checked=enabled}},S={empty:!1,channel_listener:function(){_.on("channel",function(e){S.channel_function(e)})},channel_function:function(e){switch(e[0]){case"list":S.populate_list(e[1]);break;case"added":S.added_song(e[1]);break;case"deleted":S.deleted_song(e[1]);break;case"vote":S.voted_song(e[1],e[2]);break;case"song_change":S.song_change(e[1])}},populate_list:function(e){l=e,S.sortList(),$("#wrapper").empty(),l.length>1?($.each(l,function(e,t){t.now_playing||$("#wrapper").append(S.generateSong(t,!1,Q,!0))}),Q&&(window.mobilecheck()?$(".list-image").lazyload({}):$(".list-image").lazyload({container:$("#wrapper")}).removeClass("lazy"))):(S.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#settings").css("visibility","visible"),$("#settings").css("opacity","1"),$("#wrapper").css("opacity","1")},added_song:function(e){l.push(e),S.sortList(),$("#suggested-"+e.id).remove(),S.empty&&($("#empty-channel-message").remove(),S.empty=!1),S.insertAtIndex(e,!0)},deleted_song:function(e){var t=S.getIndexOfSong(e),o=$("#wrapper").children()[t];try{o.style.height=0,setTimeout(function(){$("#"+e).remove(),l.splice(S.getIndexOfSong(e),1)},305),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(n){l.splice(S.getIndexOfSong(e),1),S.empty||$("#wrapper").children()[$("#wrapper").children().length-1].remove()}l.length<=2&&(S.empty=!0,$("#wrapper").append("The playlist is empty. ")),$("#suggested-"+e).remove(),ne.checkUserEmpty()},voted_song:function(e,t){var o=S.getIndexOfSong(e),n=l[o];l[o].votes+=1,l[o].added=t,S.sortList(),$("#"+e).remove(),S.insertAtIndex(n,!1)},song_change:function(e){var t=l.length-1;l[0].now_playing=!0,l[0].votes=0,l[0].guids=[],l[0].added=e,l[t].now_playing=!1;try{l.push(l.shift()),S.empty||$("#wrapper").children()[0].remove(),S.insertAtIndex(l[t-1],!1),document.getElementById("wrapper").scrollTop+=1,document.getElementById("wrapper").scrollTop+=-1}catch(o){}},vote:function(e,t){return _.emit("vote",[I,e,t,R]),!0},skip:function(){return _.emit("skip",{pass:R,id:f}),!0},importOldList:function(e){var t="",o=0;playlist_url="lists/"+e+".json",y=$.parseJSON($.ajax({type:"GET",url:playlist_url,async:!1}).responseText),$.each(y.songs,function(e,n){t+=n.id+",",o>45&&(oe.addVideos(t),t="",o=0),o++}),oe.addVideos(t),document.getElementById("search").value=""},sortList:function(){l.sort(i.predicate({name:"votes",reverse:!0},"added"))},show:function(){window.mobilecheck()||(B?(B=!1,$("#toptitle").empty(),$("#chan").addClass("bigChan"),$("#chan").html("zoff.no/"+I.toLowerCase())):(B=!0,$("#toptitle").html("Zöff"),$("#chan").removeClass("bigChan"),$("#chan").html(I)))},insertAtIndex:function(e,t){W=S.getIndexOfSong(e.id),0===W?$("#wrapper").prepend(S.generateSong(e,t,!1,!0,!1)):$("#wrapper > div:nth-child("+W+")").after(S.generateSong(e,t,!1,!0,!1)),t&&setTimeout(function(){var e=$("#wrapper").children()[W];$(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=$(" "+M+"
"),p="style";return t&&u.find("#list-song").css("height",0),T||u.find(".card-action").removeClass("hide"),1==c&&u.find(".vote-text").text("vote"),o&&(d="//img.youtube.com/vi/"+r+"/mqdefault.jpg",p="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(p,d),u.find(".list-suggested-image").attr(p,d),u.find("#"+s).attr("data-video-id",r),u.html()},getIndexOfSong:function(e){return indexes=$.map(l,function(t,o){return t.id==e?o:void 0}),indexes[0]},scrollTop:function(){$("#wrapper").scrollTop(0)},scrollBottom:function(){$("#wrapper").scrollTop($("#wrapper")[0].scrollHeight)}},I=$("#chan").html(),T=!0,E=0,B=!0,M=$("#list-song-html").html(),z=!1,L=!1,P=0,A="***REMOVED***",N=$("#temp-results-container"),j=$("#empty-results-container").html(),V=!1,D=/P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/,c=[],q=0,O=1,R="",H="",Y=!1,h=1,U=!1,J=!1,F=6e3,G=Date.now(),Z=!1,W=-1,Q=!0,K=!1,X=!0,ee={"sync disconnect on unload":!0,secure:!0,"force new connection":!0};$().ready(function(){e()}),window.init=e,$(document).keyup(function(e){if(27==event.keyCode)$("#results").html(""),i.contains($("#search-wrapper").attr("class").split(" "),"hide")||$("#search-wrapper").toggleClass("hide"),i.contains($("#song-title").attr("class").split(" "),"hide")&&$("#song-title").toggleClass("hide"),"mdi-navigation-close"==$("#search-btn i").attr("class")&&($("#search-btn i").toggleClass("mdi-navigation-close"),$("#search-btn i").toggleClass("mdi-action-search")),$("#results").toggleClass("hide");else if($("div.result").length>2)if(children=$("#mock-div").children(),40==e.keyCode)$(children[W-1]).removeClass("hoverResults"),$(children[W]).addClass("hoverResults"),W1&&W--,$(children[W]).removeClass("hoverResults"),$(children[W-1]).addClass("hoverResults");else if(13==e.keyCode){W=0;var t=document.getElementsByClassName("hoverResults")[0];"function"==typeof t.onclick&&t.onclick.apply(t),$("div.hoverResults").removeClass("hoverResults"),$("#results").html(""),document.getElementById("search").value=""}}),$("input[class=conf]").change(function(){o.save()}),$("#clickme").click(function(){ae.ytplayer.playVideo()}),$("#listImport").on("submit",function(){oe.importPlaylist(document.getElementById("import").value)}),$(window).focus(function(){L&&($("#favicon").attr("href","static/images/favicon.png"),L=!1)}),$(document).on("click","#chat-btn",function(){$("#text-chat-input").focus(),$("#chat-btn i").css("opacity",1),clearInterval(d),z=!1,L=!1,$("#favicon").attr("href","static/images/favicon.png")}),$(document).on("click",".chat-tab",function(){$("#text-chat-input").focus()}),$(document).on("click","#skip",function(e){e.preventDefault(),S.skip()}),$(document).on("click","#chan",function(e){e.preventDefault(),S.show()}),$(document).on("submit","#adminForm",function(e){e.preventDefault(),o.pass_save()}),$(document).on("submit","#chatForm",function(){n.chat(document.getElementById("chatForm").input)}),$(document).on("click","#shuffle",function(e){e.preventDefault(),o.shuffle()}),$(document).on("click","#search-btn",function(e){e.preventDefault(),oe.showSearch()}),$(document).on("click","#song-title",function(e){e.preventDefault(),oe.showSearch()}),$(document).on("click","#admin-lock",function(e){e.preventDefault(),o.log_out()}),$(document).on("click","#closeSettings",function(e){e.preventDefault(),o.hide_settings()}),$(document).on("click","#temp-results",function(e){if($(e.target).html()!=$(" ").html()){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submitAndClose(t,o,n)}}),$(document).on("click","#add-many",function(e){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submit(t,o,n)}),$(document).on("click",".vote-container",function(e){var t=$(this).attr("data-video-id");S.vote(t,"pos")}),$(document).on("click","#del",function(e){var t=$(this).attr("data-video-id");S.vote(t,"del")}),$(document).on("click",".add-suggested",function(e){var t=$(this).attr("data-video-id"),o=$(this).attr("data-video-title"),n=$(this).attr("data-video-length");oe.submit(t,o,n),$("#suggested-"+t).remove()}),$(document).on("click","#del_suggested",function(e){var t=$(this).attr("data-video-id");$("#suggested-"+t).remove()}),$(document).on("click","#del_user_suggested",function(e){var t=$(this).attr("data-video-id");$("#suggested-"+t).remove(),S.vote(t,"del")}),$(document).on("click","#toast-container",function(){$(this).fadeOut(function(){$(this).remove()})}),$(document).on("click","#embed-area",function(){this.select()}),$(document).on("click",".brand-logo-navigate",function(e){e.preventDefault(),window.history.pushState("to the frontpage!","Title","/"),t()});var te={stopInterval:!1,initYoutubeControls:function(){!window.mobilecheck()||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||$("#controls").appendTo("#playbar"),te.initControls()},initControls:function(){document.getElementById("volume-button").addEventListener("click",te.mute_video),
+document.getElementById("playpause").addEventListener("click",te.play_pause),document.getElementById("fullscreen").addEventListener("click",te.fullscreen)},initSlider:function(){try{vol=a.get_volume()}catch(e){}$("#volume").slider({min:0,max:100,value:vol,range:"min",animate:!0,slide:function(e,t){te.setVolume(t.value);try{a.set_volume(t.value)}catch(o){}}}),te.choose_button(vol,!1)},fullscreen:function(){var e=document.getElementById("player"),t=e.requestFullScreen||e.mozRequestFullScreen||e.webkitRequestFullScreen;t&&t.bind(e)()},play_pause:function(){1==ae.ytplayer.getPlayerState()?(ae.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==ae.ytplayer.getPlayerState()||0==ae.ytplayer.getPlayerState())&&(ae.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(e){ae.ytplayer.getPlaybackQuality!=e&&(ae.ytplayer.setPlaybackQuality(e),ae.ytplayer.getPlaybackQuality()),$("#qS").toggleClass("hide")},mute_video:function(){ae.ytplayer.isMuted()?(ae.ytplayer.unMute(),te.choose_button(ae.ytplayer.getVolume(),!1)):(te.choose_button(0,!0),ae.ytplayer.mute())},setVolume:function(e){ae.ytplayer.setVolume(e),te.choose_button(e,!1),ae.ytplayer.isMuted()&&ae.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=ae.ytplayer.getPlayerState(),button=document.getElementById("playpause"),1==state?ae.ytplayer.pauseVideo():2==state&&ae.ytplayer.playVideo()},volumeOptions:function(){ae.ytplayer.isMuted()?(ae.ytplayer.unMute(),vol=ae.ytplayer.getVolume(),$("#volume").slider("value",ae.ytplayer.getVolume())):(ae.ytplayer.mute(),$("#volume").slider("value",0))},hoverMute:function(e){vol=ae.ytplayer.getVolume()}},oe={showSearch:function(){$("#search-wrapper").toggleClass("hide"),window.mobilecheck()&&$(".search_input").focus(),$("#song-title").toggleClass("hide"),$("#results").toggleClass("hide"),$("#results").empty(),$("#search-btn i").toggleClass("mdi-navigation-close"),$("#search-btn i").toggleClass("mdi-action-search"),$("#search").focus()},search:function(e){if($(".search_results").html(""),""!==window.search_input){V=!0;var t=encodeURIComponent(window.search_input),o="https://www.googleapis.com/youtube/v3/search?key="+A+"&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";o+="&q="+t,q&&(o+="&videoCategoryId=10");var n="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+A+"&id=";i.contains($("#search_loader").attr("class").split(" "),"hide")&&$("#search_loader").removeClass("hide"),i.contains($("#results").attr("class").split(" "),"hide")&&$("#results").removeClass("hide"),$.ajax({type:"GET",url:o,dataType:"jsonp",success:function(e){0==e.items.length?($(""+j+"
").appendTo($("#results")).show("blind",83.33),i.contains($("#search_loader").attr("class").split(" "),"hide")||$("#search_loader").addClass("hide")):e.items&&($.each(e.items,function(e,t){n+=t.id.videoId+","}),$.ajax({type:"GET",url:n,dataType:"jsonp",success:function(e){var t="",o=$(N);$.each(e.items,function(e,n){var a=n.contentDetails.duration;if(secs=oe.durationToSeconds(a),!longsongs||secs<720){m=n.snippet.title,enc_title=m,s=n.id,a=a.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s"),thumb=n.snippet.thumbnails.medium.url;var i=o;i.find(".search-title").text(m),i.find(".result_info").text(a),i.find(".thumb").attr("data-original",thumb),i.find("#add-many").attr("data-video-id",s),i.find("#add-many").attr("data-video-title",enc_title),i.find("#add-many").attr("data-video-length",secs),i.find("#temp-results").attr("data-video-id",s),i.find("#temp-results").attr("data-video-title",enc_title),i.find("#temp-results").attr("data-video-length",secs),t+=i.html()}}),$(""+t+"
").appendTo($("#results")).show("blind",83.33*(e.items.length-1)),setTimeout(function(){$(".thumb").lazyload({container:$("#results")})},250),i.contains($("#search_loader").attr("class").split(" "),"hide")||$("#search_loader").addClass("hide"),$(".add-many").click(function(e){return e.preventDefault(),e.stopPropagation(),!1})}}))}})}else $(".main").removeClass("blurT"),$("#controls").removeClass("blurT"),$(".main").removeClass("clickthrough")},submitAndClose:function(e,t,o){oe.submit(e,t,o),$("#results").html(""),oe.showSearch(),document.getElementById("search").value="",$("#results").html="",$(".main").removeClass("blurT"),$("#controls").removeClass("blurT"),$(".main").removeClass("clickthrough")},importPlaylist:function(e,t){token="",void 0!==t&&(token="&pageToken="+t),playlist_url="https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+A+"&playlistId="+e+token,$.ajax({type:"GET",url:playlist_url,dataType:"jsonp",success:function(t){var o="";oe.addVideos(t.items[0].contentDetails.videoId),$.each(t.items,function(e,t){o+=t.contentDetails.videoId+","}),oe.addVideos(o),t.nextPageToken&&oe.importPlaylist(e,t.nextPageToken),document.getElementById("import").value=""}})},addVideos:function(e){var t="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id=";t+=e,$.ajax({type:"POST",url:t,dataType:"jsonp",success:function(e){$.each(e.items,function(e,t){var o=oe.durationToSeconds(t.contentDetails.duration);(!longsongs||720>o)&&(enc_title=t.snippet.title,oe.submit(t.id,enc_title,o))})}})},submit:function(e,t,o){_.emit("add",[e,decodeURIComponent(t),R,o])},durationToSeconds:function(e){var t=e.match(D);return hours=parseInt(t[12])||0,minutes=parseInt(t[14])||0,seconds=parseInt(t[16])||0,60*hours*60+60*minutes+seconds}},ne={catchUserSuggests:function(e,t){if(t)ne.createSuggested(e);else for(x in e)ne.createSuggested(e[x]);ne.checkUserEmpty()},createSuggested:function(e){var t=e.duration,o=e.id,n=e.title,a=Math.floor(t/60),i=t-60*a;duration=a+"m "+i+"s";var s=S.generateSong({id:o,title:n,length:t,duration:duration},!1,!1,!1,!0);$("#user-suggest-html").append(s)},fetchYoutubeSuggests:function(e){var t="https://www.googleapis.com/youtube/v3/search?part=snippet&relatedToVideoId="+e+"&type=video&key="+A,o="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+A+"&id=";$.ajax({type:"GET",url:t,dataType:"jsonp",success:function(e){$.each(e.items.slice(0,5),function(e,t){o+=t.id.videoId+","}),$.ajax({type:"GET",url:o,dataType:"jsonp",success:function(e){$("#suggest-song-html").empty(),$.each(e.items,function(e,t){var o=t.contentDetails.duration,n=oe.durationToSeconds(o),a=t.id,i=t.snippet.title;o=o.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s"),$("#suggest-song-html").append(S.generateSong({id:a,title:i,length:n,duration:o},!1,!1,!1))})}})}})},checkUserEmpty:function(){var e=$("#user-suggest-html").children().length;0==e?i.contains($("#user_suggests").attr("class").split(" "),"hide")||$("#user_suggests").addClass("hide"):$("#user_suggests").removeClass("hide")}},ae={loaded:!0,before_load:"",after_load:"",ytplayer:"",stopInterval:!1,setup_youtube_listener:function(e){_.on("np",function(e){if(ae.loaded=!1,0==e.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{ae.ytplayer.stopVideo()}catch(t){}}else{void 0==k?k=e[0][0].id:k!=f&&(k=f),f=e[0][0].id,c=e[1][0],time=e[2],v=time-c.startTime,w=e[0][0].title,l[0].id==f&&S.song_change(l[0].added);try{ne.fetchYoutubeSuggests(f)}catch(t){}if(ae.getTitle(w,h),ae.setBGimage(f),!Y||/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream)ae.getTitle(w,h);else try{ae.ytplayer.getVideoUrl().split("v=")[1]!=f&&(ae.ytplayer.loadVideoById(f),ae.notifyUser(f,w),ae.ytplayer.seekTo(v),U&&ae.ytplayer.pauseVideo()),U||(ae.ytplayer.playVideo(),ae.durationSetter()),(ae.ytplayer.getDuration()>v||0==ae.ytplayer.getDuration())&&ae.ytplayer.seekTo(v),ae.after_load=f,setTimeout(function(){ae.loaded=!0},500)}catch(t){ae.durationSetter()}}}),_.on("viewers",function(e){h=e,void 0!==w&&ae.getTitle(w,h)})},onPlayerStateChange:function(e){switch(e.data){case-1:break;case 0:J=!1,U=!1,_.emit("end",f);break;case 1:J=!0,beginning&&window.mobilecheck()&&(ae.ytplayer.pauseVideo(),beginning=!1),K||i.addClass("#player_overlay","hide"),1==document.getElementById("play").className.split(" ").length&&$("#play").toggleClass("hide"),2==document.getElementById("pause").className.split(" ").length&&$("#pause").toggleClass("hide"),U&&(_.emit("pos"),U=!1);break;case 2:U=!0,te.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 / "+I,a.innerHTML=n,i.innerHTML=t+" "+o,a.title=n+" • "+t+" "+o},errorHandler:function(e){5==e.data||100==e.data||101==e.data||150==e.data?(curr_playing=ae.ytplayer.getVideoUrl().replace("https://www.youtube.com/watch?v=",""),_.emit("skip",{error:e.data,id:f,pass:R})):void 0!==f&&ae.ytplayer.loadVideoById(f)},onPlayerReady:function(e){$("#channel-load").css("display","none");try{beginning=!0,Y=!0,/iPad|iPhone|iPod/.test(navigator.userAgent)||window.MSStream||($("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),ae.ytplayer.loadVideoById(f),X&&!window.mobilecheck()&&ae.ytplayer.playVideo(),ae.durationSetter(),K?setTimeout(function(){ae.ytplayer.seekTo(v),X||(ae.ytplayer.pauseVideo(),te.play_pause_show())},1e3):ae.ytplayer.seekTo(v)),ae.readyLooks(),te.initYoutubeControls(ae.ytplayer),te.initSlider(),ae.ytplayer.setVolume(a.get_volume()),$(".video-container").removeClass("no-opacity")}catch(t){}},readyLooks:function(){ae.setBGimage(f)},setBGimage:function(e){if(void 0!==e&&!K){var t=new Image;t.onload=function(){var e=new ColorThief,o=e.getColor(t);document.getElementsByTagName("body")[0].style.backgroundColor=i.rgbToHsl(o),$("meta[name=theme-color]").attr("content",i.rgbToHex(o[0],o[1],o[2]))},t.crossOrigin="Anonymous",t.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(){_.on("get_list",function(){_.emit("list",I.toLowerCase())}),ae.setup_youtube_listener(I),o.admin_listener(),n.setup_chat_listener(I),n.allchat_listener(),S.channel_listener()},onYouTubeIframeAPIReady:function(){ae.ytplayer=new YT.Player("player",{videoId:f,playerVars:{rel:"0",wmode:"transparent",controls:"0",iv_load_policy:"3",theme:"light",color:"white"},events:{onReady:ae.onPlayerReady,onStateChange:ae.onPlayerStateChange,onError:ae.errorHandler}})},durationSetter:function(){try{duration=ae.ytplayer.getDuration()}catch(e){duration=0}if(void 0!=duration)try{dMinutes=Math.floor(duration/60),dSeconds=duration-60*dMinutes,currDurr=ae.ytplayer.getCurrentTime(),currDurr>duration&&(currDurr=duration),minutes=Math.floor(currDurr/60),seconds=currDurr-60*minutes,document.getElementById("duration").innerHTML=i.pad(minutes)+":"+i.pad(seconds)+" / "+i.pad(dMinutes)+":"+i.pad(dSeconds),per=100/duration*currDurr,per>=100?per=100:0==duration&&(per=0),$("#bar").width(per+"%")}catch(e){}ae.stopInterval||setTimeout(ae.durationSetter,1e3)},loadPlayer:function(){1==$("script[src='https://www.youtube.com/iframe_api']").length?ae.onYouTubeIframeAPIReady():(u=document.createElement("script"),u.src="https://www.youtube.com/iframe_api",p=document.getElementsByTagName("script")[0],p.parentNode.insertBefore(u,p))}}}();
\ No newline at end of file
diff --git a/static/js/list.js b/static/js/list.js
index d667662d..0ea3c11b 100755
--- a/static/js/list.js
+++ b/static/js/list.js
@@ -282,5 +282,13 @@ var List = {
}
});
return indexes[0];
+ },
+
+ scrollTop: function(){
+ $("#wrapper").scrollTop(0);
+ },
+
+ scrollBottom: function(){
+ $("#wrapper").scrollTop($("#wrapper")[0].scrollHeight);
}
}
\ No newline at end of file
diff --git a/static/js/listeners.js b/static/js/listeners.js
index 5362edea..f2c86750 100755
--- a/static/js/listeners.js
+++ b/static/js/listeners.js
@@ -413,6 +413,7 @@ function onepage_load(){
$("#channel-load").css("display", "block");
window.scrollTo(0, 0);
+ Helper.share_link_modifier(false);
Youtube.stopInterval = true;
Admin.display_logged_out();
@@ -428,8 +429,6 @@ function onepage_load(){
url: "php/nochan.php",
success: function(e){
- console.log($(e));
-
socket.disconnect();
document.getElementById("volume-button").removeEventListener("click", Playercontrols.mute_video);
diff --git a/static/js/nochan.js b/static/js/nochan.js
index 31a215f9..0623a874 100755
--- a/static/js/nochan.js
+++ b/static/js/nochan.js
@@ -271,8 +271,6 @@ function initfp(){
}
}
- Helper.share_link_modifier(false);
-
channel_list = $("#channel-list-container").html();
var connection_options = {