summaryrefslogtreecommitdiff
path: root/www/js/jingles.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-02-02 16:09:02 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-02-02 16:09:02 (GMT)
commit070becf035f7c1b492cca1213b026563098d7f53 (patch)
tree0e002fd6f5694b20e73a235ff0ac54c550908895 /www/js/jingles.js
parentada31015e989d062ac68d58c94701e2df253b21e (diff)
musicpools: add progressbar
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r--www/js/jingles.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index 960dd25..11f23a5 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -112,7 +112,7 @@ Rivendell.JingleGroupView.prototype.render = function() {
$('table tbody tr', this.$el).remove();
$('.uploadButton', this.$el).on('click', function() {
- importer.openModal(self.model, false, false);
+ importer.openModal(self.model, self, false, false);
});
};
@@ -120,6 +120,31 @@ Rivendell.JingleGroupView.prototype.destroy = function() {
$('table > tbody', this.$el).html('');
};
+Rivendell.JingleGroupView.prototype.uploadProgress = function(file) {
+ if (!file.cartNumber || !file.cutNumber) {
+ return;
+ }
+ var $cut = $('#jingle-' + file.cartNumber + '-' + file.cutNumber).first();
+ if (!$cut.hasClass('uploading')) {
+ var $progressBar = $('.progressBarTemplate.jingles').clone().removeClass('progressBarTemplate');
+ $progressBar.find('.file-name').text(file.name);
+ $progressBar.find('.cart-number').text(file.cartNumber);
+ $cut.html($progressBar.html());
+ $cut.addClass('uploading');
+ }
+
+ if(file.upload.progress < 99) {
+ var bytes_str = Number((file.upload.bytesSent/1024)/1024).toFixed(1) + " von " +
+ Number((file.upload.total/1024)/1024).toFixed(1) + " MB";
+ $cut.find('.file-bytes').text(bytes_str);
+ $cut.find('.progress .bar').css("width", file.upload.progress + "%");
+ } else {
+ $cut.find('.file-bytes').text('importiere...');
+ $cut.find('.progress .bar').css('width', '100%');
+ $cut.find('.progress').addClass('progress-striped').addClass('active');
+ }
+};
+
Rivendell.JingleCartView = function(model, groupView, active) {
this.model = model;
this.groupView = groupView;