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
|
||||
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];
|
||||
|
|
9
user.js
9
user.js
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue