diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/jingles.js | 14 | ||||
-rw-r--r-- | www/js/rdxport.js | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js index 78c2675..2a269cd 100644 --- a/www/js/jingles.js +++ b/www/js/jingles.js @@ -189,7 +189,13 @@ Rdxport.JingleCartView = function(model, groupView, active) { var self = this; if (this.model) { - $(this.model.cuts).each(function(index, cut) { + $(this.model.cuts).sort(function(a, b) { + if(a.isEvergreen == b.isEvergreen) + return 0; + if(a.isEvergreen) + return 1; + return -1; + }).each(function(index, cut) { cut.active = self.active; var cutView = new Rdxport.JingleCutView(cut); @@ -239,7 +245,11 @@ Rdxport.JingleCutView.prototype.render = function() { var activateButton; if (this.model.active) { activateButton = $('<button class="btn btn-warning btn-xs"><span class="glyphicon glyphicon-ban-circle"></span> Deaktivieren</button>'); - status.addClass('label-success').html('<span class="glyphicon glyphicon-ok"></span>'); + if (!this.model.isEvergreen) { + status.addClass('label-success').html('<span class="glyphicon glyphicon-star"></span>'); + } else { + status.addClass('label-info').html('<span class="glyphicon glyphicon-star-empty"></span>'); + } } else { activateButton = $('<button class="btn btn-success btn-xs"><span class="glyphicon glyphicon-ok"></span> Aktivieren</button>'); status.addClass('label-warning').html('<span class="glyphicon glyphicon-ban-circle"></span>'); diff --git a/www/js/rdxport.js b/www/js/rdxport.js index 44198ed..64dbf51 100644 --- a/www/js/rdxport.js +++ b/www/js/rdxport.js @@ -506,7 +506,7 @@ Rdxport.Cart.prototype.removeCut = function(cut) { }; Rdxport.Cut = function(name, description, cart, length, originDatetime, - playCounter, lastPlayDatetime) { + playCounter, lastPlayDatetime, isEvergreen) { this.xml = null; if (arguments.length === 2) { @@ -518,6 +518,7 @@ Rdxport.Cut = function(name, description, cart, length, originDatetime, this.playCounter = $('playCounter', this.xml).text(); this.lastPlayDatetime = new Date(new Date($('lastPlayDatetime', this.xml).text()) - 5000); // playout-server live 5s in the future this.cart = arguments[1]; + this.isEvergreen = ($('evergreen', this.xml).text().toLowerCase() == "true"); } else { this.name = name; this.description = description; @@ -526,6 +527,7 @@ Rdxport.Cut = function(name, description, cart, length, originDatetime, this.originDatetime = new Date(originDatetime); this.playCounter = playCounter; this.lastPlayDatetime = new Date(new Date(lastPlayDatetime) - 5000); // playout-server live 5s in the future + this.isEvergreen = isEvergreen } this.number = this.name.substr(-3); this.cartNumber = this.cart.number; |