This commit is contained in:
calzoneman 2013-03-21 18:55:32 -05:00
parent 873603465c
commit bbfa4ba53d
3 changed files with 7 additions and 9 deletions

View File

@ -437,9 +437,10 @@ Channel.prototype.unqueue = function(data) {
// Play the next media in the queue // Play the next media in the queue
Channel.prototype.playNext = function() { Channel.prototype.playNext = function() {
if(this.currentPosition + 1 >= this.queue.length) { if(this.queue.length == 0)
this.currentMedia = null;
return; return;
if(this.currentPosition + 1 >= this.queue.length) {
this.currentPosition = -1;
} }
this.currentPosition++; this.currentPosition++;
this.currentMedia = this.queue[this.currentPosition]; this.currentMedia = this.queue[this.currentPosition];

View File

@ -107,16 +107,14 @@ User.prototype.initCallbacks = function() {
}.bind(this)); }.bind(this));
this.socket.on('unqueue', function(data) { this.socket.on('unqueue', function(data) {
if(Rank.hasPermission(this, "queue") || if(Rank.hasPermission(this, "queue")) {
(this.channel != null && !this.channel.qlocked)) {
if(this.channel != null) if(this.channel != null)
this.channel.unqueue(data); this.channel.unqueue(data);
} }
}.bind(this)); }.bind(this));
this.socket.on('moveMedia', function(data) { this.socket.on('moveMedia', function(data) {
if(Rank.hasPermission(this, "queue") || if(Rank.hasPermission(this, "queue")) {
(this.channel != null && !this.channel.qlocked)) {
if(this.channel != null) if(this.channel != null)
this.channel.moveMedia(data); this.channel.moveMedia(data);
} }
@ -124,8 +122,7 @@ User.prototype.initCallbacks = function() {
this.socket.on('playNext', function() { this.socket.on('playNext', function() {
if(Rank.hasPermission(this, "queue") || if(Rank.hasPermission(this, "queue") ||
(this.channel != null && ( (this.channel != null && this.channel.leader == this)) {
this.channel.leader == this || !this.channel.qlocked))) {
if(this.channel.currentPosition + 1 >= this.channel.queue.length) { if(this.channel.currentPosition + 1 >= this.channel.queue.length) {
this.channel.currentPosition = -1; this.channel.currentPosition = -1;
} }

View File

@ -173,7 +173,7 @@ $('#register').click(function() {
}); });
$('#chatline').keydown(function(ev) { $('#chatline').keydown(function(ev) {
if(ev.keyCode == 13) { if(ev.keyCode == 13 && $('#chatline').val() != '') {
socket.emit('chatMsg', { socket.emit('chatMsg', {
msg: $('#chatline').val() msg: $('#chatline').val()
}); });