diff options
Diffstat (limited to 'www/js/musicpools.js')
-rw-r--r-- | www/js/musicpools.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/www/js/musicpools.js b/www/js/musicpools.js index ec5f864..abb6679 100644 --- a/www/js/musicpools.js +++ b/www/js/musicpools.js @@ -22,6 +22,8 @@ 'use strict'; +var Rivendell = Rivendell || {}; + var rivendell = null; var importer = null; var musicpoolsView = null; @@ -32,7 +34,7 @@ function musicpools_init() { importer = new Rivendell.Importer(); - var musicpools = new Rivendell.GroupList(rivendell, 'musicpool'); + var musicpools = new Rivendell.GroupList(rivendell); musicpoolsView = new MusicpoolsView(musicpools); } @@ -48,7 +50,7 @@ var MusicpoolsView = function(model) { this.currentPoolId = sessionStorage.getItem('currentPoolId'); var self = this; - this.model.fetch(function() { + this.model.fetch('musicpool', function() { self.updateSelector(); }); }; @@ -102,21 +104,23 @@ MusicpoolsView.prototype.updateSelector = function() { }; // this and jinglegroup are basicly the same thing -var Musicpool = function(title, clock, groupName, description, lowcart, highcart, normlevel, trimlevel) { - this.title = title; - this.clock = clock; - - this.groupName = groupName; - this.description = description; - this.lowcart = lowcart; - this.highcart = highcart; - this.normlevel = normlevel; - this.trimlevel = trimlevel; +var Musicpool = function(groupName, description, lowcart, highcart, normlevel, trimlevel, title, clock) { + if (arguments.length === 1) { + Rivendell.Group.call(this, groupName); + this.title = $('musicpool-title', this.groupXml).text(); + this.clock = $('musicpool-clock', this.groupXml).text(); + } else { + Rivendell.Group.call(this, groupName, description, lowcart, highcart, normlevel, trimlevel); + this.title = title; + this.clock = clock; + } this.carts = []; this.$el = null; }; +Musicpool.prototype = Object.create(Rivendell.Group.prototype); +Musicpool.prototype.constructor = Musicpool; Musicpool.prototype.render = function() { var self = this; |