Made socketeventheaders better, none of that chan,np, just np now

This commit is contained in:
Kasper Rynning-Tønnesen
2015-06-13 02:19:25 +02:00
parent 63e0d9104e
commit 0b1d075e5b
6 changed files with 23 additions and 416 deletions

View File

@@ -65,7 +65,7 @@ socket.on("pw", function(msg)
Materialize.toast("Correct password. You now have access to the sacred realm of The Admin.", 4000);
});
socket.on(chan.toLowerCase()+",conf", function(msg)
socket.on("conf", function(msg)
{
set_conf(msg[0]);
});

View File

@@ -67,7 +67,7 @@ $(window).focus(function(){
function setup_chat_listener(channel)
{
document.getElementsByClassName("chat-tab")[0].innerHTML = channel;
socket.on("chat,"+channel.toLowerCase(), function(data)
socket.on("chat", function(data)
{
if($("#chat-bar").position()["left"] != 0)
{

View File

@@ -25,7 +25,7 @@ var playing = false;
//play new song
function setup_youtube_listener(channel)
{
socket.on(channel.toLowerCase()+",np", function(obj)
socket.on("np", function(obj)
{
console.log(obj);
if(obj[0].length == 0){
@@ -67,7 +67,7 @@ function setup_youtube_listener(channel)
}
});
socket.on(channel.toLowerCase()+",viewers", function(view)
socket.on("viewers", function(view)
{
viewers = view;
if(song_title !== undefined)