summaryrefslogtreecommitdiff
path: root/www/js/utils.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-04-01 15:30:45 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-04-01 15:30:45 (GMT)
commit8db94592d6222fbd0153cf05c83724d7ac518634 (patch)
treefe89e9ed21ce849f3f5fcbfecff335d1cc90f409 /www/js/utils.js
parent3c584d7ee53ecfb35f32a2182971dfbc30009590 (diff)
parent4a79af6bf48f7543a407d86fc73ce70f39fc6d94 (diff)
Merge branch 'master' into rdxportjs-refactor
Conflicts: www/js/importer.js www/js/jingles.js www/js/musicpools.js www/js/shows.js
Diffstat (limited to 'www/js/utils.js')
-rw-r--r--www/js/utils.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/js/utils.js b/www/js/utils.js
index 81501e9..26b0822 100644
--- a/www/js/utils.js
+++ b/www/js/utils.js
@@ -140,3 +140,16 @@ jQuery.fn.brightness = function() {
if (this.parent().length) return this.parent().brightness();
}
};
+
+function updateProgressBar($el, upload) {
+ if(upload.uploadprogress.progress < 99) {
+ var bytes_str = Number((upload.uploadprogress.bytesSent/1024)/1024).toFixed(1) + " von " +
+ Number((upload.uploadprogress.total/1024)/1024).toFixed(1) + " MB";
+ $el.find('.file-bytes').text(bytes_str);
+ $el.find('.progress .progress-bar').css("width", upload.uploadprogress.progress + "%");
+ } else {
+ $el.find('.file-bytes').text('importiere...');
+ $el.find('.progress .progress-bar').css('width', '100%');
+ $el.find('.progress .progress-bar').addClass('progress-bar-striped').addClass('active');
+ }
+}