summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/jingles.js31
1 files changed, 19 insertions, 12 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index 3c1acfa..2dc3b40 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -204,6 +204,11 @@ JingleGroup.prototype.render = function() {
$.each(cuts, function(index, cut) {
$('table > tbody', self.$el).append(cut.render());
});*/
+ if (this.mainCart) {
+ $.each(this.mainCart.cuts, function(index, cut) {
+ $('table > tbody', self.$el).append(cut.render());
+ });
+ }
if (this.deactivateCart) {
$.each(this.deactivateCart.cuts, function(index, cut) {
$('table > tbody', self.$el).append(cut.render());
@@ -363,7 +368,20 @@ var Importer = function() {
Importer.prototype.importAddCut = function(cart, dz, file) {
// todo: set additional parameters like DESCRIPTION here, when patch has been applied.
var data = { COMMAND: 10, LOGIN_NAME: auth_username, PASSWORD: auth_token, CART_NUMBER: cart.number, DESCRIPTION: 'test' };
- $.post("/rd-bin/rdxport.cgi", data, null, "xml").done(function() {
+ $.post("/rd-bin/rdxport.cgi", data, null, "xml").done(function(cutXml) {
+ var cutNumber = $(cutXml).find('cutNumber').text();
+ console.log(cutNumber);
+ dz.on('sending', function(file, xhr, formData) {
+ formData.append('COMMAND', 2);
+ formData.append('LOGIN_NAME', auth_username);
+ formData.append('PASSWORD', auth_token);
+ formData.append('CART_NUMBER', cart.number);
+ formData.append('CUT_NUMBER', cutNumber);
+ formData.append('CHANNELS', 2);
+ formData.append('NORMALIZATION_LEVEL', cart.normlevel);
+ formData.append('AUTOTRIM_LEVEL', cart.trimlevel);
+ formData.append('USE_METADATA', 1);
+ });
dz.processQueue();
}).fail(function(xhr, status, err) {
self.importFileUploadError(cart, dz, file, err, xhr);
@@ -475,17 +493,6 @@ Importer.prototype.showUploadModal = function(cart) {
this.on("error", function(file, msg) {
self.importFileSelectError(this, file, msg);
});
- this.on('sending', function(file, xhr, formData) {
- formData.append('COMMAND', 2);
- formData.append('LOGIN_NAME', auth_username);
- formData.append('PASSWORD', auth_token);
- formData.append('CART_NUMBER', cart.number);
- formData.append('CUT_NUMBER', 1); // todo: set to correct cut number!
- formData.append('CHANNELS', 2);
- formData.append('NORMALIZATION_LEVEL', cart.normlevel);
- formData.append('AUTOTRIM_LEVEL', cart.trimlevel);
- formData.append('USE_METADATA', 1);
- });
}
});