From d3d45a43e0d48028f8bcacf31b0f641c1c3dd414 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 27 Aug 2011 21:58:30 +0000 Subject: feature 2417 added: add progress bar (jQuery UI progress bar) + details on progressing upload like "photo 21 of 46". git-svn-id: http://piwigo.org/svn/trunk@12005 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/images/pbar-ani.gif | Bin 0 -> 7970 bytes .../themes/default/template/photos_add_direct.tpl | 31 ++++++++++++++++++++- admin/themes/default/theme.css | 6 +++- admin/themes/roma/theme.css | 2 ++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 admin/themes/default/images/pbar-ani.gif (limited to 'admin/themes') diff --git a/admin/themes/default/images/pbar-ani.gif b/admin/themes/default/images/pbar-ani.gif new file mode 100644 index 000000000..cb59a04f9 Binary files /dev/null and b/admin/themes/default/images/pbar-ani.gif differ diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl index 9aac44c93..52bc6b323 100644 --- a/admin/themes/default/template/photos_add_direct.tpl +++ b/admin/themes/default/template/photos_add_direct.tpl @@ -1,6 +1,7 @@ {if $upload_mode eq 'multiple'} {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } {combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v3.0.0.min.js' } +{combine_script id='jquery.ui.progressbar' load='footer'} {combine_css path="admin/themes/default/uploadify.jGrowl.css"} {combine_css path="admin/include/uploadify/uploadify.css"} {/if} @@ -235,6 +236,21 @@ var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */ /* Let's display the thumbnail of the uploaded photo, no need to wait the */ /* end of the queue */ jQuery("#uploadedPhotos").prepend(' '); + }, + onUploadComplete: function(file,swfuploadifyQueue) { + var max = parseInt(jQuery("#progressMax").text()); + var next = parseInt(jQuery("#progressCurrent").text())+1; + var addToProgressBar = 2; + if (next <= max) { + jQuery("#progressCurrent").text(next); + } + else { + addToProgressBar = 1; + } + + jQuery("#progressbar").progressbar({ + value: jQuery("#progressbar").progressbar("option", "value") + addToProgressBar + }); } }); @@ -254,6 +270,13 @@ var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */ } ); + nb_files = jQuery(".uploadifyQueueItem").size(); + jQuery("#progressMax").text(nb_files); + jQuery("#progressbar").progressbar({max: nb_files*2, value:1}); + jQuery("#progressCurrent").text(1); + + jQuery("#uploadProgress").show(); + jQuery("#uploadify").uploadifyUpload(); }); @@ -388,13 +411,19 @@ var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */

{elseif $upload_mode eq 'multiple'} -

+

{/if} + +
{'Uploaded Photos'|@translate}
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 84e1e2518..7b798dc59 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -1071,4 +1071,8 @@ p#uploadWarningsSummary .showInfo {position:static;display:inline;padding:1px 6p p#uploadWarnings {display:none;text-align:left;margin-bottom:1em;font-size:90%;color:#999;} p#uploadModeInfos {text-align:left;margin-top:1em;font-size:90%;color:#999;} -#photosAddContent p.showFieldset {text-align:left;margin: 0 auto 10px auto;width: 650px;} \ No newline at end of file +#photosAddContent p.showFieldset {text-align:left;margin: 0 auto 10px auto;width: 650px;} + +#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;} diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index 3248c3e01..a4cee9cc6 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -247,3 +247,5 @@ li.token-input-token span {color:#878787;} div.token-input-dropdown {background-color:#eee;border-color:#666;} div.token-input-dropdown ul li {background-color:#eee;} div.token-input-dropdown ul li.token-input-selected-dropdown-item {background-color:#FF7800;} + +#progressbar {border:1px solid #666; background-color:#666;} -- cgit v1.2.3