mirror of https://github.com/calzoneman/sync.git
Tweaks
This commit is contained in:
parent
873603465c
commit
bbfa4ba53d
|
@ -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];
|
||||||
|
|
9
user.js
9
user.js
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue