diff options
Diffstat (limited to 'admin/themes/default')
-rw-r--r-- | admin/themes/default/template/photos_add_direct.tpl | 24 | ||||
-rw-r--r-- | admin/themes/default/theme.css | 30 |
2 files changed, 44 insertions, 10 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> diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index cb17a38ec..33d5a6488 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -1008,14 +1008,28 @@ p#uploadModeInfos {text-align:left;margin-top:1em;font-size:90%;color:#999;} #photosAddContent p.showFieldset {text-align:left;margin: 1em;} -#uploadForm .plupload_buttons { display:none; } -#startUpload { margin:10px 0; padding:5px 10px; font-size:1.1em; } -#startUpload:before { margin-right:0.5em; } -#addFiles { margin-bottom:10px; } - -#uploadProgress {width:650px; margin:10px auto;font-size:90%;} -#progressbar {border:1px solid #ccc; background-color:#eee;} -.ui-progressbar-value { background-image: url(images/pbar-ani.gif); height:10px;margin:-1px;border:1px solid #E78F08;} +#uploadForm .plupload_buttons, #uploadForm .plupload_progress { display:none; } +#uploadForm #startUpload { margin:5px 0 15px 15px; padding:5px 10px; font-size:1.1em; } +#uploadForm #startUpload:before { margin-right:0.5em; } +#uploadForm #addFiles { margin-right:10px; float:left; } +#uploadForm #uploadingActions { margin:10px 10px 10px 15px; } +#uploadForm .big-progressbar { vertical-align:middle; display:inline-block; margin-left:10px; } + +.big-progressbar { + width:100%; + max-width:600px; + background:#DFDFDF; + padding:3px; + border-radius:16px; + position:relative; +} +.big-progressbar .progressbar { + height:20px; + min-width:20px; + background:#444; + border-radius:10px; +} + /* Tag Manager */ .warningDeletion {display:none;font-style:italic;} |