When listening on a channel, there are some different buttons you can click.
-
If you click the cogwheel, you'll open the settings panel. Here you can change channel settings, decide if you want the computer you're on can be remote-controlled, and import playlists from YouTube.
-
The search-icon, opens up a search inputfield. If you start typing here, the site will automagically search for your input!
-
If you click the button next to the search icon, you'll skip on a song. The one next to that one, is shuffleling of the list. Next one there again is to open the chat.
-
Clicking a song in the playlist, gives it a vote. If you're logged in, you'll have a delete button at your disposal.
-
Also, whenever you're logged in, you'll have two tabs in the top of the playlist thats called "Playlist" and "Suggested". The playlist obviously shows the playlist. But the suggested tab, shows 5 songs that YouTube recommends based on the current song. There might also be user recommended songs. To add any of these, just click them as you'd click a song to vote.
-
-
-
-
-
-
Embed code
-
Copy the code in the textarea, and paste on your website.
').insertAfter("#wrapper"),$(".prev_page").toggleClass("hide"),$(".next_page").toggleClass("hide"),$(".last_page").toggleClass("hide"),$(".first_page").toggleClass("hide"),$(".next_page_hide").css("display","inline-block"),$(".prev_page_hide").css("display","inline-block")),p.dynamicContentPage(-10)):(p.empty=!0,$("#wrapper").append("The playlist is empty."),$("#pageButtons").length||($('
').insertAfter("#wrapper"),$(".prev_page").toggleClass("hide"),$(".next_page").toggleClass("hide"),$(".last_page").toggleClass("hide"),$(".first_page").toggleClass("hide"),$(".next_page_hide").css("display","inline-block"),$(".prev_page_hide").css("display","inline-block"))),$("#settings").css("visibility","visible"),$("#settings").css("opacity","1"),$("#wrapper").css("opacity","1")},dynamicContentPage:function(e){1==e?($("#wrapper").children().slice(p.page,p.page+p.can_fit).hide(),p.page=p.page+p.can_fit,$("#wrapper").children().slice(p.page,p.page+p.can_fit).show(),p.page>0&&$(".prev_page").hasClass("hide")&&($(".prev_page").toggleClass("hide"),$(".prev_page_hide").css("display","none"),$(".first_page").toggleClass("hide"),$(".first_page_hide").css("display","none")),p.page+p.can_fit>=$("#wrapper").children().length&&($(".next_page_hide").css("display","inline-block"),$(".next_page").css("display","none"),$(".last_page_hide").css("display","inline-block"),$(".last_page").css("display","none"))):10==e?($("#wrapper").children().slice(p.page,p.page+p.can_fit).hide(),p.page=Math.floor(($("#wrapper").children().length-1)/p.can_fit)*p.can_fit,$("#wrapper").children().slice(p.page,p.page+p.can_fit).show(),p.page>0&&$(".prev_page").hasClass("hide")&&($(".prev_page").toggleClass("hide"),$(".prev_page_hide").css("display","none"),$(".first_page").toggleClass("hide"),$(".first_page_hide").css("display","none")),p.page+p.can_fit>=$("#wrapper").children().length&&($(".next_page_hide").css("display","inline-block"),$(".next_page").css("display","none"),$(".last_page_hide").css("display","inline-block"),$(".last_page").css("display","none"))):e==-10?($("#wrapper").children().slice(p.page,p.page+p.can_fit).hide(),p.page=0,$("#wrapper").children().slice(p.page,p.page+p.can_fit).show(),0!=p.page||$(".prev_page").hasClass("hide")?$(".prev_page").hasClass("hide")?($(".prev_page_hide").css("display","inline-block"),$(".first_page_hide").css("display","inline-block")):($(".prev_page_hide").css("display","none"),$(".first_page_hide").css("display","none")):($(".prev_page").toggleClass("hide"),$(".prev_page_hide").css("display","inline-block"),$(".first_page").toggleClass("hide"),$(".first_page_hide").css("display","inline-block")),p.page+p.can_fit<$("#wrapper").children().length&&($(".next_page_hide").css("display","none"),$(".next_page").css("display","inline-block"),$(".last_page_hide").css("display","none"),$(".last_page").css("display","inline-block"))):($("#wrapper").children().slice(p.page-p.can_fit,p.page).show(),$("#wrapper").children().slice(p.page,p.page+p.can_fit).hide(),p.page=p.page-p.can_fit,0!=p.page||$(".prev_page").hasClass("hide")?$(".prev_page").hasClass("hide")?($(".prev_page_hide").css("display","inline-block"),$(".first_page_hide").css("display","inline-block")):($(".prev_page_hide").css("display","none"),$(".first_page_hide").css("display","none")):($(".prev_page").toggleClass("hide"),$(".prev_page_hide").css("display","inline-block"),$(".first_page").toggleClass("hide"),$(".first_page_hide").css("display","inline-block")),p.page+p.can_fit<$("#wrapper").children().length&&($(".next_page_hide").css("display","none"),$(".next_page").css("display","inline-block"),$(".last_page_hide").css("display","none"),$(".last_page").css("display","inline-block"))),$("#pageNumber").html(p.page/p.can_fit+1)},added_song:function(e){var t;0!==full_playlist.length&&(t=full_playlist.pop()),full_playlist.push(e),p.sortList(),t&&full_playlist.push(t),$("#suggested-"+e.id).remove(),p.empty&&(p.empty=!1),$("#empty-channel-message").remove(),p.insertAtIndex(e,!0),$("#wrapper").children().length>p.page+p.can_fit?($(".next_page_hide").css("display","none"),$(".next_page").removeClass("hide"),$(".next_page").css("display","inline-block")):($(".next_page_hide").css("display","inline-block"),$(".next_page").css("display","none"))},deleted_song:function(e){var t=p.getIndexOfSong(e),a=$("#wrapper").children()[t];try{a.style.height=0,setTimeout(function(){$("#"+e).remove(),full_playlist.splice(p.getIndexOfSong(e),1),t=0?$($("#wrapper").children()[p.page-1]).css("display","block"):$("#wrapper").children().length>p.page+(p.can_fit-1)&&$($("#wrapper").children()[p.page+(p.can_fit-1)]).css("display","block"),p.page>=$("#wrapper").children().length?p.dynamicContentPage(-1):p.page+p.can_fit>=$("#wrapper").children().length&&($(".next_page_hide").css("display","inline-block"),$(".next_page").css("display","none")),S&&n.sendNext({title:full_playlist[0].title,videoId:full_playlist[0].id})},305)}catch(a){full_playlist.splice(p.getIndexOfSong(e),1),p.empty||($("#wrapper").children()[$("#wrapper").children().length-1].remove(),t=0?$($("#wrapper").children()[p.page-1]).css("display","block"):$("#wrapper").children().length>p.page+p.can_fit&&$($("#wrapper").children()[p.page+(p.can_fit-1)]).css("display","block"),S&&n.sendNext({title:full_playlist[0].title,videoId:full_playlist[0].id}))}full_playlist.length<=2&&(p.empty=!0,$("#wrapper").append("The playlist is empty.")),$("#suggested-"+e).remove(),p.page+p.can_fit<$("#wrapper").children().length&&($(".next_page_hide").css("display","none"),$(".next_page").css("display","inline-block")),p.page>=$("#wrapper").children().length&&p.dynamicContentPage(-1),Suggestions.checkUserEmpty()},voted_song:function(e,t){var a=p.getIndexOfSong(e),n=full_playlist[a];full_playlist[a].votes+=1,full_playlist[a].added=t,p.sortList(),$("#"+e).remove(),p.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,o.log("---------------------------"),o.log("---SONG ON FIRST INDEX-----"),o.log(full_playlist[0]),o.log("---------------------------");try{full_playlist.push(full_playlist.shift()),p.empty||$("#wrapper").children()[0].remove(),0===$("#wrapper").children().length&&(p.empty=!0,$("#wrapper").append("The playlist is empty.")),p.insertAtIndex(full_playlist[t-1],!1,!0)}catch(e){}},vote:function(e,t){return s.emit("vote",{channel:T,id:e,type:t,adminpass:k}),!0},skip:function(){return s.emit("skip",{pass:k,id:l,channel:T.toLowerCase()}),!0},exportToYoutube:function(){var e="https://www.googleapis.com/youtube/v3/playlists?part=snippet";$(".exported-list-container").removeClass("hide"),$("#playlist_loader_export").removeClass("hide"),$.ajax({type:"POST",url:e,headers:{Authorization:"Bearer "+access_token_data_youtube.access_token,"Content-Type":"application/json"},data:JSON.stringify({snippet:{title:T.toLowerCase(),description:"Playlist exported from zoff"}}),success:function(e){var t=0,a=e.id;$.each(full_playlist,function(e,n){var i="https://www.googleapis.com/youtube/v3/playlistItems?part=snippet";$.ajax({type:"POST",url:i,headers:{Authorization:"Bearer "+access_token_data_youtube.access_token,"Content-Type":"application/json"},data:JSON.stringify({snippet:{playlistId:a,resourceId:{kind:"youtube#video",videoId:n.id}}}),success:function(e){o.log("Added video: "+n.id+" to playlist id "+a),t==full_playlist.length-1&&(o.log("All videoes added!"),o.log("url: https://www.youtube.com/playlist?list="+a),$(".exported-list").append("
"),m="style";return t?h.find("#list-song").css("height",0):h.find(".list-song").css("height",p.element_height),y||h.find(".card-action").removeClass("hide"),
+1==g&&h.find(".vote-text").text("vote"),a&&(u="//img.youtube.com/vi/"+c+"/mqdefault.jpg",m="data-original"),n?(h.find(".list-votes").text(g),h.find("#list-song").attr("id",c),h.find(".vote-container").attr("title",d),($("#wrapper").children().length>=p.can_fit&&s||"none"==i)&&h.find(".card").css("display","none"),l=".vote-container",r="del"):n||(h.find(".vote-text").text(e.duration),l=".add-suggested",r=o?"del_user_suggested":"del_suggested",h.find(".vote-container").attr("class","clickable add-suggested"),h.find(".add-suggested").attr("title",d),h.find("#del").attr("id",r),h.find(l).attr("data-video-title",d),h.find(l).attr("data-video-length",e.length),h.find("#list-song").attr("id","suggested-"+c),h.find(".list-image").attr("class",h.find(".list-image").attr("class").replace("list-image","list-suggested-image"))),h.find(".list-title").text(d),h.find(".list-title").attr("title",d),h.find(l).attr("data-video-id",c),h.find(".list-image").attr(m,u),h.find(".list-suggested-image").attr(m,u),h.find("#"+r).attr("data-video-id",c),h.html()},getIndexOfSong:function(e){return indexes=$.map(full_playlist,function(t,a){if(t.id==e)return a}),indexes[0]},scrollTop:function(){$("#wrapper").scrollTop(0)},scrollBottom:function(){$("#wrapper").scrollTop($("#wrapper")[0].scrollHeight)}},u="",h=!1,m=!1,f=$("#list-song-html").html(),y=!0,v=!1,_=!0,w=100,k="",C=!1,x=!1,S=!1,I=window.location.hash.substring(1).split("&"),T=I[0],E=!1,B="#808080",L={"sync disconnect on unload":!0,secure:!0,"force new connection":!0};$(document).ready(function(){3==I.length&&"autoplay"==I[2]?E=!0:h=!0,B="#"+I[1],$("head").append(''),$("head").append(''),add="https://zoff.no",s=io.connect(""+add+":8880",L),s.on("get_list",function(){setTimeout(function(){s.emit("list",T.toLowerCase())},1e3)}),s.on("viewers",function(e){viewers=e,void 0!==u&&n.getTitle(u,viewers)}),e(),t(),window.onYouTubeIframeAPIReady=n.onYouTubeIframeAPIReady,n.loadPlayer(),d.initSlider(),window.setVolume=a,$("#controls").css("background-color",B),$("#playlist").css("background-color",B)}),$(document).on("click","#zoffbutton",function(e){window.open("https://zoff.no/"+T.toLowerCase()+"/","_blank")}),$(document).on("click",".vote-container",function(e){var t=$(this).attr("data-video-id");p.vote(t,"pos")}),$(document).on("click",".prev_page",function(e){e.preventDefault(),p.dynamicContentPage(-1)}),$(document).on("click",".next_page",function(e){e.preventDefault(),p.dynamicContentPage(1)})}();
\ No newline at end of file
diff --git a/static/dist/lib/aes.js b/public/dist/lib/aes.js
similarity index 100%
rename from static/dist/lib/aes.js
rename to public/dist/lib/aes.js
diff --git a/static/dist/lib/cache-polyfill.js b/public/dist/lib/cache-polyfill.js
similarity index 100%
rename from static/dist/lib/cache-polyfill.js
rename to public/dist/lib/cache-polyfill.js
diff --git a/static/dist/lib/color-thief.js b/public/dist/lib/color-thief.js
similarity index 100%
rename from static/dist/lib/color-thief.js
rename to public/dist/lib/color-thief.js
diff --git a/static/dist/lib/jquery-2.1.3.min.js b/public/dist/lib/jquery-2.1.3.min.js
similarity index 100%
rename from static/dist/lib/jquery-2.1.3.min.js
rename to public/dist/lib/jquery-2.1.3.min.js
diff --git a/static/dist/lib/jquery-ui-1.10.3.min.js b/public/dist/lib/jquery-ui-1.10.3.min.js
similarity index 100%
rename from static/dist/lib/jquery-ui-1.10.3.min.js
rename to public/dist/lib/jquery-ui-1.10.3.min.js
diff --git a/static/dist/lib/jquery.lazyload.js b/public/dist/lib/jquery.lazyload.js
similarity index 100%
rename from static/dist/lib/jquery.lazyload.js
rename to public/dist/lib/jquery.lazyload.js
diff --git a/static/dist/lib/jquery.scrollstop.js b/public/dist/lib/jquery.scrollstop.js
similarity index 100%
rename from static/dist/lib/jquery.scrollstop.js
rename to public/dist/lib/jquery.scrollstop.js
diff --git a/static/dist/lib/materialize.js b/public/dist/lib/materialize.js
similarity index 100%
rename from static/dist/lib/materialize.js
rename to public/dist/lib/materialize.js
diff --git a/static/dist/lib/materialize.min.js b/public/dist/lib/materialize.min.js
similarity index 100%
rename from static/dist/lib/materialize.min.js
rename to public/dist/lib/materialize.min.js
diff --git a/static/dist/lib/sha256.js b/public/dist/lib/sha256.js
similarity index 100%
rename from static/dist/lib/sha256.js
rename to public/dist/lib/sha256.js
diff --git a/static/dist/lib/socket.io-1.4.5.js b/public/dist/lib/socket.io-1.4.5.js
similarity index 100%
rename from static/dist/lib/socket.io-1.4.5.js
rename to public/dist/lib/socket.io-1.4.5.js
diff --git a/static/dist/main.min.js b/public/dist/main.min.js
similarity index 69%
rename from static/dist/main.min.js
rename to public/dist/main.min.js
index 4f54c7f1..cbe25131 100755
--- a/static/dist/main.min.js
+++ b/public/dist/main.min.js
@@ -1,3 +1,3 @@
-!function(){function e(){var e=!0;V=$("#chan").html(),Ie=M.mobilecheck();var a=M.mobilecheck()?"left":"right";if(window.onpopstate=function(e){S()},C(),"zoff.no"==window.location.hostname?add="https://zoff.no":add=window.location.hostname,void 0!==We&&(We.stopInterval=!1),$("ul.playlist-tabs").tabs(),$("ul.playlist-tabs-loggedIn").tabs(),$(".chatTabs").tabs(),$("#settings").sideNav({menuWidth:300,edge:a,closeOnClick:!1}),$(".collapsible").collapsible({accordion:!0}),w(ue),xe=$("#temp-results-container"),Se=$("#empty-results-container").html(),he=$(".not-imported-container").html(),$(".not-imported-container").empty(),$(".video-container").resizable({start:function(e,t){$("iframe").css("pointer-events","none")},stop:function(e,t){$("iframe").css("pointer-events","auto"),L.set_width($(this).width())},handles:"e",minWidth:350,maxWidth:$(window).width()-241}),(void 0===Oe||M.mobilecheck())&&(e=!1,Oe=io.connect(""+add+":8880",Re)),0===$("#alreadychannel").length||M.mobilecheck())o(),i(),s(),l();else{$("#channel-load").css("display","none"),$("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),We.readyLooks(),Ze.initYoutubeControls(We.player),Ze.initSlider(),We.player.setVolume(L.get_volume()),$(".video-container").removeClass("no-opacity");var n="https://remote."+window.location.hostname+"/"+Ee;$("#code-text").text(Ee),$("#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)}e&&Oe.emit("list",V.toLowerCase()),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream?(document.getElementById("search").blur(),$("#channel-load").css("display","none")):(window.onYouTubeIframeAPIReady=We.onYouTubeIframeAPIReady,(""===We.player||void 0===We.player||M.mobilecheck())&&We.loadPlayer()),M.mobilecheck()&&Je.initiate_volume(),c(),p(),d(),M.mobilecheck()||0!==$("#alreadychannel").length||h(),M.msieversion()||M.mobilecheck()||Notification.requestPermission(),$(".search_input").focus(),M.sample(),$("#results").hover(function(){$("div.result").removeClass("hoverResults"),oe=0},function(){}),$("#search").focus(),$("#embed-button").css("display","inline-block"),$("#embed-area").val(v(ye,fe,me,be)),$("#search").attr("placeholder","Find song on YouTube..."),we?t(1):ke?initializeCastApi():window.__onGCastApiAvailable=function(e,t){e&&initializeCastApi()}}function t(e){if($(".castButton").toggleClass("hide"),$(".castButton-active").toggleClass("hide"),1==e){$("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide");try{We.player.stopVideo()}catch(e){}We.stopInterval=!0,$("#player_overlay").removeClass("hide"),$("#player_overlay").css("display","block"),window.mobilecheck()&&($("#pause").hasClass("hide")?($("#play").toggleClass("hide"),$("#pause").toggleClass("hide")):$("#play").hasClass("hide")&&($("#play").toggleClass("hide"),$("#pause").toggleClass("hide"))),$("#player_overlay").css("background","url(https://i.ytimg.com/vi/"+Ae+"/maxresdefault.jpg)"),$("#player_overlay").css("background-position","center"),$("#player_overlay").css("background-size","100%"),$("#player_overlay").css("background-color","black"),$("#player_overlay").css("background-repeat","no-repeat"),$("#player_overlay").css("height","calc(100% - 32px)"),$("#playing_on").css("display","flex"),$("#chromecast_text").html("Playing on "+P.La.friendlyName),We.player.setVolume(100),$("#volume").slider("value",100),$("#player_overlay_text").toggleClass("hide")}else 0==e&&($("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide"),We.player.playVideo(),We.stopInterval=!1,We.durationSetter(),We.player.setVolume(L.get_volume()),$("#volume").slider("value",L.get_volume()),$("#player_overlay").addClass("hide"),$("#player_overlay_text").toggleClass("hide"),$("#chromecast_text").html(""),$("#playing_on").css("display","none"),Oe.emit("pos",{channel:V.toLowerCase()}))}function a(e,t){var a=JSON.parse(t);switch(a.type){case-1:Oe.emit("end",{id:a.videoId,channel:V.toLowerCase()});break;case 0:Oe.emit("skip",{error:a.data_code,id:a.videoId,pass:W,channel:V.toLowerCase})}}function n(){Oe.on("connect_failed",function(){M.log("Connection Failed"),ve||(ve=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))}),Oe.on("connect_error",function(){M.log("Connection Failed."),ve||(ve=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))})}function o(){Oe.on("np",We.youtube_listener)}function i(){Oe.on("get_list",function(){Oe.emit("list",V.toLowerCase())})}function s(){Oe.on("suggested",function(e){var t=!0;void 0===e.id&&(t=!1),Xe.catchUserSuggests(e,t)})}function l(){Oe.on("viewers",function(e){X=e,void 0!==De&&We.getTitle(De,X)})}function c(){Oe.on("toast",E.toast),Oe.on("pw",E.pw),Oe.on("conf",E.conf)}function d(){Oe.on("chat.all",B.allchat),Oe.on("chat",B.channelchat)}function p(){Oe.on("channel",A.channel_function)}function u(){M.log("Setting up playlist_listener"),Oe.on("playlists",Ge.frontpage_function)}function h(){Oe.on("id",N.host_listener)}function m(e){Oe.on(e,N.host_on_action)}function f(){localStorage.debug=!0}function y(){localStorage.debug=!1}function v(e,t,a,n){return'