summaryrefslogtreecommitdiff
path: root/www/js/jingles.js
diff options
context:
space:
mode:
authorPeterTheOne <petertheone@gmail.com>2016-01-29 14:06:18 (GMT)
committerPeterTheOne <petertheone@gmail.com>2016-01-29 14:06:18 (GMT)
commitf306d3578d0ec18e34df3b7ed30e20fa71339bf6 (patch)
treea95f562a6698d139e0a2901e3b7985a9080b0b5a /www/js/jingles.js
parentc09725d1a62830d69daf8d286638e0d334394f78 (diff)
move authLogin function to rivendel.rh.js, use more namespaces in jingles
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r--www/js/jingles.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index fbc0807..bd3b182 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -31,7 +31,7 @@ function jingles_init() {
importer = new Rivendell.Importer();
var groupList = new Rivendell.GroupList(rivendell);
- jingleGroupListView = new JingleGroupListView(groupList);
+ jingleGroupListView = new Rivendell.JingleGroupListView(groupList);
}
function jingles_cleanup() {
@@ -42,7 +42,7 @@ function jingles_cleanup() {
importer = null;
}
-var JingleGroupListView = function(model) {
+Rivendell.JingleGroupListView = function(model) {
this.model = model;
this.jingleGroupViews = [];
@@ -52,13 +52,13 @@ var JingleGroupListView = function(model) {
var self = this;
$(this.model).on('update', function() {
$(self.model.groups).each(function(index, group) {
- self.jingleGroupViews.push(new JingleGroupView(group));
+ self.jingleGroupViews.push(new Rivendell.JingleGroupView(group));
});
});
this.model.fetch('jingle');
};
-JingleGroupListView.prototype.destroy = function() {
+Rivendell.JingleGroupListView.prototype.destroy = function() {
var self = this;
$(this.jingleGroupViews).each(function(index, groupView) {
groupView.destroy();
@@ -66,7 +66,7 @@ JingleGroupListView.prototype.destroy = function() {
this.jingleGroupViews = [];
};
-var JingleGroup = function(groupName, description, lowcart, highcart, normlevel, trimlevel, title) {
+Rivendell.JingleGroup = function(groupName, description, lowcart, highcart, normlevel, trimlevel, title) {
if (arguments.length = 1) {
Rivendell.Group.call(this, groupName);
this.title = $('jingle-title', this.xml).text();
@@ -75,10 +75,10 @@ var JingleGroup = function(groupName, description, lowcart, highcart, normlevel,
this.title = title;
}
};
-JingleGroup.prototype = Object.create(Rivendell.Group.prototype);
-JingleGroup.prototype.constructor = JingleGroup;
+Rivendell.JingleGroup.prototype = Object.create(Rivendell.Group.prototype);
+Rivendell.JingleGroup.prototype.constructor = Rivendell.JingleGroup;
-var JingleGroupView = function(model) {
+Rivendell.JingleGroupView = function(model) {
this.model = model;
this.mainCartView = null;
@@ -93,16 +93,16 @@ var JingleGroupView = function(model) {
$('table > tbody', self.$el).html('');
self.model.mainCart = self.model.carts[0];
- self.mainCartView = new JingleCartView(self.model.mainCart, self, true);
+ self.mainCartView = new Rivendell.JingleCartView(self.model.mainCart, self, true);
self.model.deactivateCart = self.model.carts[1];
- self.deactivateCartView = new JingleCartView(self.model.deactivateCart, self, false);
+ self.deactivateCartView = new Rivendell.JingleCartView(self.model.deactivateCart, self, false);
});
this.model.fetchCarts();
};
-JingleGroupView.prototype.render = function() {
+Rivendell.JingleGroupView.prototype.render = function() {
var self = this;
this.$el = $('#hiddenTemplates .jingleGroupTemplate').clone().removeClass('jingleGroupTemplate');
@@ -116,11 +116,11 @@ JingleGroupView.prototype.render = function() {
});
};
-JingleGroupView.prototype.destroy = function() {
+Rivendell.JingleGroupView.prototype.destroy = function() {
$('table > tbody', this.$el).html('');
};
-var JingleCartView = function(model, groupView, active) {
+Rivendell.JingleCartView = function(model, groupView, active) {
this.model = model;
this.groupView = groupView;
this.active = active;
@@ -132,7 +132,7 @@ var JingleCartView = function(model, groupView, active) {
$(this.model.cuts).each(function(index, cut) {
cut.active = self.active;
- var cutView = new JingleCutView(cut);
+ var cutView = new Rivendell.JingleCutView(cut);
self.cutViews.push(cutView);
$('table > tbody', self.groupView.$el).append(cutView.$el);
@@ -140,7 +140,7 @@ var JingleCartView = function(model, groupView, active) {
}
};
-var JingleCutView = function(model) {
+Rivendell.JingleCutView = function(model) {
this.model = model;
this.$el = null;
@@ -148,7 +148,7 @@ var JingleCutView = function(model) {
this.render();
};
-JingleCutView.prototype.render = function() {
+Rivendell.JingleCutView.prototype.render = function() {
var moveButton = $('<button class="btn btn-info btn-mini"><i class="icon-arrow-right icon-white"></i> Verschieben</button>');
var activateButton;
if (this.model.active) {
@@ -181,7 +181,7 @@ JingleCutView.prototype.render = function() {
);
};
-JingleCutView.prototype.move = function() {
+Rivendell.JingleCutView.prototype.move = function() {
var self = this;
var destinationCart = this.model.cartNumber;
@@ -209,7 +209,7 @@ JingleCutView.prototype.move = function() {
});
};
-JingleCutView.prototype.toggleActive = function() {
+Rivendell.JingleCutView.prototype.toggleActive = function() {
var destinationCart = this.model.cartNumber;
if (this.model.active) {
destinationCart++;
@@ -222,7 +222,7 @@ JingleCutView.prototype.toggleActive = function() {
});
};
-JingleCutView.prototype.removeSelf = function() {
+Rivendell.JingleCutView.prototype.removeSelf = function() {
var self = this;
rivendell.removeCut(this.model.cartNumber, this.model.number, function() {
self.model.cart.removeCut(this);