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
Channel.prototype.playNext = function() {
if(this.currentPosition + 1 >= this.queue.length) {
this.currentMedia = null;
if(this.queue.length == 0)
return;
if(this.currentPosition + 1 >= this.queue.length) {
this.currentPosition = -1;
}
this.currentPosition++;
this.currentMedia = this.queue[this.currentPosition];

View File

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

View File

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