mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Forgot the damn file..
This commit is contained in:
36
static/js/controller.js
Normal file
36
static/js/controller.js
Normal file
@@ -0,0 +1,36 @@
|
||||
var began = false;
|
||||
|
||||
socket.on("guid", function(guid)
|
||||
{
|
||||
console.log(guid);
|
||||
if(!began)
|
||||
{
|
||||
socket.on(guid, function(arr)
|
||||
{
|
||||
console.log(arr);
|
||||
if(arr[0] == "volume")
|
||||
{
|
||||
$("#volume").slider("value", arr[1]);
|
||||
ytplayer.setVolume(arr[1]);
|
||||
}else if(arr[0] == "channel")
|
||||
{
|
||||
socket.emit("change_channel");
|
||||
socket.removeAllListeners(chan.toLowerCase());
|
||||
socket.removeAllListeners("chat,"+chan.toLowerCase());
|
||||
socket.removeAllListeners(chan.toLowerCase()+",np");
|
||||
|
||||
chan = arr[1].toLowerCase();
|
||||
$("#chan").html(chan.substring(0,1).toUpperCase()+chan.substring(1).toLowerCase());
|
||||
socket.on(chan.toLowerCase(), function(msg){
|
||||
populate_list(msg, false);
|
||||
});
|
||||
|
||||
setup_youtube_listener(chan);
|
||||
setup_chat_listener(chan);
|
||||
|
||||
socket.emit("list", chan.toLowerCase()+",unused");
|
||||
}
|
||||
});
|
||||
}
|
||||
began = true;
|
||||
});
|
||||
Reference in New Issue
Block a user