diff options
author | mistic100 <mistic@piwigo.org> | 2014-09-03 19:56:59 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-09-03 19:56:59 +0000 |
commit | fc143dea9cd54f898c225e144efb34fa1cd9abde (patch) | |
tree | 7681a35455529586f53f06bad7951d95359175b7 /admin/themes/default/template | |
parent | 11ec153855a62aae8cdc93deb95be09afcd0da03 (diff) |
feature:2616 add custom big progressbar
git-svn-id: http://piwigo.org/svn/trunk@29394 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/template')
-rw-r--r-- | admin/themes/default/template/photos_add_direct.tpl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl index 2f1fba296..b8e179b39 100644 --- a/admin/themes/default/template/photos_add_direct.tpl +++ b/admin/themes/default/template/photos_add_direct.tpl @@ -96,6 +96,12 @@ jQuery(document).ready(function(){ e.preventDefault(); up.start(); }); + + jQuery('#cancelUpload').on('click', function(e) { + e.preventDefault(); + up.stop(); + up.trigger('UploadComplete', up.files); + }); } }, @@ -105,11 +111,16 @@ jQuery(document).ready(function(){ jQuery('#startUpload').prop('disabled', up.files.length == 0); }, + UploadProgress: function(up, file) { + jQuery('#uploadingActions .progressbar').width(up.total.percent+'%'); + }, + BeforeUpload: function(up, file) { //console.log('[BeforeUpload]', file); // hide buttons jQuery('#startUpload, #addFiles').hide(); + jQuery('#uploadingActions').show(); // warn user if she wants to leave page while upload is running jQuery(window).bind('beforeunload', function() { @@ -180,6 +191,7 @@ jQuery(document).ready(function(){ jQuery(".batchLink").html(sprintf(batch_Label, uploadedPhotos.length)); jQuery(".afterUploadActions").show(); + jQuery('#uploadingActions').hide(); // user can safely leave page without warning jQuery(window).unbind('beforeunload'); @@ -265,10 +277,18 @@ jQuery(document).ready(function(){ <div id="uploader"> <p>Your browser doesn't have HTML5 support.</p> </div> - - <button id="startUpload" class="buttonLike icon-upload" disabled>{'Start Upload'|translate}</button> </fieldset> + + <div id="uploadingActions" style="display:none"> + <button id="cancelUpload" class="buttonLike icon-cancel-circled">{'Cancel'|translate}</button> + + <div class="big-progressbar"> + <div class="progressbar" style="width:0%"></div> + </div> + </div> + + <button id="startUpload" class="buttonLike icon-upload" disabled>{'Start Upload'|translate}</button> </form> |