diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-07-28 11:45:57 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-07-28 11:45:57 +0200 |
commit | b05c1a98293a4a7c17a57589db750eace2db4c9d (patch) | |
tree | d732d4994bcfeee76e9b16b76a881a02d9abe602 /view/js | |
parent | 9fa3956aa886f7522553ac161a42569706613b0c (diff) | |
download | volse-hubzilla-b05c1a98293a4a7c17a57589db750eace2db4c9d.tar.gz volse-hubzilla-b05c1a98293a4a7c17a57589db750eace2db4c9d.tar.bz2 volse-hubzilla-b05c1a98293a4a7c17a57589db750eace2db4c9d.zip |
use single quote for js and double quote for html with proper escapes and implement a simple progressbar
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/mod_cloud.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index e29efd664..8e6b8cb05 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -84,12 +84,12 @@ function UploadFileSelectHandler(e) { function prepareHtml(f, i) { $("#cloud-index tr:nth-child(2)").after( - "<tr class='new-upload'>" + - "<td><i class='fa " + getIconFromType(f.type) + "' title='" + f.type + "'></i></td>" + - "<td>" + f.name + "</td>" + - "<td id='upload-progress-" + i + "'></td><td></td><td></td><td></td><td></td>" + - "<td class='hiiden-xs'>" + formatSizeUnits(f.size) + "</td><td class='hiiden-xs'></td>" + - "</tr>" + '<tr id=\"new-upload-' + i + '\" class=\"new-upload\" style=\"background: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOM2RHTAwAE5gH+VJ1dlgAAAABJRU5ErkJggg==\') repeat-y; background-size: 0%;\">' + + '<td><i class=\"fa ' + getIconFromType(f.type) + '\" title=\"' + f.type + '\"></i></td>' + + '<td>' + f.name + '</td>' + + '<td id=\"upload-progress-' + i + '\"></td><td></td><td></td><td></td><td></td>' + + '<td class=\"hidden-xs\">' + formatSizeUnits(f.size) + '</td><td class=\"hidden-xs\"></td>' + + '</tr>' ); } @@ -162,6 +162,7 @@ function UploadFile(file, idx) { var total = e.totalSize || e.total; // Dynamically update the percentage complete displayed in the file upload list $('#upload-progress-' + idx).html(Math.round(done / total * 100) + '%'); + $('#new-upload-' + idx).css('background-size', Math.round(done / total * 100) + '%'); }); xhr.addEventListener('load', function (e) { |