diff options
Diffstat (limited to 'www/js/shows.js')
-rw-r--r-- | www/js/shows.js | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/www/js/shows.js b/www/js/shows.js index 1ba86b9..0379951 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -22,13 +22,13 @@ 'use strict'; -var Rivendell = Rivendell || {}; +var Rdxport = Rdxport || {}; var showListView = null; function shows_init() { - var showList = new Rivendell.GroupList(); - showListView = new Rivendell.ShowListView(showList); + var showList = new Rdxport.GroupList(); + showListView = new Rdxport.ShowListView(showList); drawClock('Do, 1.1.1970', '00:00:00', 0); clock_add_callback(drawClock); @@ -39,7 +39,7 @@ function shows_cleanup() { importer.cancelAllUploads(); } -Rivendell.ShowListView = function(model) { +Rdxport.ShowListView = function(model) { this.model = model; this.showViews = []; @@ -48,7 +48,7 @@ Rivendell.ShowListView = function(model) { var self = this; $(this.model).on('update', function() { $(self.model.groups).each(function(index, show) { - var showView = new Rivendell.ShowView(show); + var showView = new Rdxport.ShowView(show); self.showViews.push(showView); }); self.updateSelector(); @@ -56,12 +56,12 @@ Rivendell.ShowListView = function(model) { this.model.fetch('show'); }; -Rivendell.ShowListView.prototype.setCurrentShowId = function(currentShowId) { +Rdxport.ShowListView.prototype.setCurrentShowId = function(currentShowId) { this.currentShowId = currentShowId; sessionStorage.setItem('currentShowId', this.currentShowId); }; -Rivendell.ShowListView.prototype.getCurrentShowView = function() { +Rdxport.ShowListView.prototype.getCurrentShowView = function() { if (this.model.groups.length === 0) { return null; } @@ -82,7 +82,7 @@ Rivendell.ShowListView.prototype.getCurrentShowView = function() { return showViewFound; }; -Rivendell.ShowListView.prototype.updateSelector = function() { +Rdxport.ShowListView.prototype.updateSelector = function() { var self = this; var $showSelector = $('#show-selector'); @@ -107,10 +107,10 @@ Rivendell.ShowListView.prototype.updateSelector = function() { this.getCurrentShowView().model.fetchCarts(); }; -Rivendell.Show = function(groupName, description, lowcart, highcart, normlevel, trimlevel, +Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, trimlevel, id, title, log, rhythm, dayofweek, starttime, length) { if (arguments.length = 1) { - Rivendell.Group.call(this, groupName); + Rdxport.Group.call(this, groupName); this.id = $('show-id', this.xml).text(); this.title = $('show-title', this.xml).text(); this.log = $('show-log', this.xml).text(); @@ -119,7 +119,7 @@ Rivendell.Show = function(groupName, description, lowcart, highcart, normlevel, this.starttime = $('show-starttime', this.xml).text(); this.length = $('show-length', this.xml).text(); } else { - Rivendell.Group.call(this, groupName, description, lowcart, highcart, normlevel, trimlevel); + Rdxport.Group.call(this, groupName, description, lowcart, highcart, normlevel, trimlevel); this.id = id; this.title = title; this.log = log; @@ -131,10 +131,10 @@ Rivendell.Show = function(groupName, description, lowcart, highcart, normlevel, this.logs = []; }; -Rivendell.Show.prototype = Object.create(Rivendell.Group.prototype); -Rivendell.Show.prototype.constructor = Rivendell.Show; +Rdxport.Show.prototype = Object.create(Rdxport.Group.prototype); +Rdxport.Show.prototype.constructor = Rdxport.Show; -Rivendell.Show.prototype.fetchCarts = function() { +Rdxport.Show.prototype.fetchCarts = function() { var self = this; var lcd = rdxport.listLog(this.log, function(logsXml, status, req) { @@ -142,7 +142,7 @@ Rivendell.Show.prototype.fetchCarts = function() { var loglines = $('logList', logsXml).children(); loglines.each(function(index, logXml) { - var log = Rivendell.Log.newFromXml(logXml, self); + var log = Rdxport.Log.newFromXml(logXml, self); if(log.cartNumber >= self.lowcart && log.cartNumber <= self.highcart) { self.logs.push(log); @@ -150,17 +150,17 @@ Rivendell.Show.prototype.fetchCarts = function() { }); }); - var gcd = rdxport.listCarts(this.groupName, 1, function(cartsXml, status, req) { + var gcd = rdxport.listCarts({GROUP_NAME: this.groupName, INCLUDE_CUTS: 1}, function(cartsXml, status, req) { self.carts = []; self.cartsByNumber = {}; var dbs = $('cartList', cartsXml).children(); dbs.each(function(index, cartXml) { - var cart = new Rivendell.Cart(cartXml, self); + var cart = new Rdxport.Cart(cartXml, self); var cuts = $('cutList', cartXml).children(); cuts.each(function(index, cut) { - cart.cuts.push(new Rivendell.Cut(cut, cart)); + cart.cuts.push(new Rdxport.Cut(cut, cart)); }); self.addCart(cart); @@ -174,7 +174,7 @@ Rivendell.Show.prototype.fetchCarts = function() { }); }; -Rivendell.ShowView = function(model) { +Rdxport.ShowView = function(model) { this.model = model; this.cartViews = []; @@ -186,7 +186,7 @@ Rivendell.ShowView = function(model) { }); }; -Rivendell.ShowView.prototype.render = function() { +Rdxport.ShowView.prototype.render = function() { $('#show-title').text(this.model.title); $('#show-dow').text(weekday[this.model.dayofweek]); $('#show-rhythm').text(this.model.rhythm); @@ -201,18 +201,18 @@ Rivendell.ShowView.prototype.render = function() { $(this.model.logs).each(function(index, log) { var cart = self.model.getCartByNumber(log.cartNumber); if (cart) { - var cartView = new Rivendell.ShowCartView(cart, self); + var cartView = new Rdxport.ShowCartView(cart, self); self.cartViews.push(cartView); cartView.render(); $('#app-shows table > tbody').append(cartView.$el); } else { - $('#app-shows table > tbody').append(Rivendell.ShowCartView.renderEmpty(self.model, self, log.cartNumber)); + $('#app-shows table > tbody').append(Rdxport.ShowCartView.renderEmpty(self.model, self, log.cartNumber)); } }); }; -Rivendell.ShowView.prototype.uploadProgress = function(upload, file) { +Rdxport.ShowView.prototype.uploadProgress = function(upload, file) { if (!file.cartNumber || !file.cutNumber) { return; } @@ -242,7 +242,7 @@ Rivendell.ShowView.prototype.uploadProgress = function(upload, file) { } }; -Rivendell.ShowView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) { +Rdxport.ShowView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) { if (!file.cartNumber) { return; } @@ -273,7 +273,7 @@ Rivendell.ShowView.prototype.uploadError = function(upload, file, msg, xhr, ackn $('#show-cart-' + file.cartNumber).replaceWith($errorRow); }; -Rivendell.ShowCartView = function(model, groupView) { +Rdxport.ShowCartView = function(model, groupView) { this.model = model; this.groupView = groupView; @@ -281,7 +281,7 @@ Rivendell.ShowCartView = function(model, groupView) { this.$el = $('<tr>'); }; -Rivendell.ShowCartView.prototype.render = function() { +Rdxport.ShowCartView.prototype.render = function() { var $deleteButton = $('<button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span> Löschen</button>'); var self = this; @@ -313,7 +313,7 @@ Rivendell.ShowCartView.prototype.render = function() { .append($('<td>').css('text-align', 'center').append($deleteButton)); }; -Rivendell.ShowCartView.renderEmpty = function(group, groupView, cartNumber) { +Rdxport.ShowCartView.renderEmpty = function(group, groupView, cartNumber) { var $uploadButton = $('<button class="uploadButton btn btn-primary btn-xs"><span class="glyphicon glyphicon-upload"></span> Importieren</button>'); $uploadButton.on('click', function() { @@ -331,13 +331,13 @@ Rivendell.ShowCartView.renderEmpty = function(group, groupView, cartNumber) { .append($('<td>').css('text-align', 'center').append($uploadButton)); }; -Rivendell.ShowCartView.prototype.delete = function() { +Rdxport.ShowCartView.prototype.delete = function() { $('td:last', this.$el).html(this.$spinner); var self = this; rdxport.removeCart(this.model.number, function() { self.model.group.removeCart(self.model); - var $empty = Rivendell.ShowCartView.renderEmpty(self.model.group, self.groupView, self.model.number); + var $empty = Rdxport.ShowCartView.renderEmpty(self.model.group, self.groupView, self.model.number); self.$el.replaceWith($empty); }); }; |