Changeset 12005


Ignore:
Timestamp:
Aug 27, 2011, 11:58:30 PM (9 years ago)
Author:
plg
Message:

feature 2417 added: add progress bar (jQuery UI progress bar) + details on
progressing upload like "photo 21 of 46".

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r11975 r12005  
    22{combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' }
    33{combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v3.0.0.min.js' }
     4{combine_script id='jquery.ui.progressbar' load='footer'}
    45{combine_css path="admin/themes/default/uploadify.jGrowl.css"}
    56{combine_css path="admin/include/uploadify/uploadify.css"}
     
    236237      /* end of the queue                                                        */
    237238      jQuery("#uploadedPhotos").prepend('<img src="'+data.thumbnail_url+'" class="thumbnail"> ');
     239    },
     240    onUploadComplete: function(file,swfuploadifyQueue) {
     241      var max = parseInt(jQuery("#progressMax").text());
     242      var next = parseInt(jQuery("#progressCurrent").text())+1;
     243      var addToProgressBar = 2;
     244      if (next <= max) {
     245        jQuery("#progressCurrent").text(next);
     246      }
     247      else {
     248        addToProgressBar = 1;
     249      }
     250
     251      jQuery("#progressbar").progressbar({
     252        value: jQuery("#progressbar").progressbar("option", "value") + addToProgressBar
     253      });
    238254    }
    239255  });
     
    254270      }
    255271    );
     272
     273    nb_files = jQuery(".uploadifyQueueItem").size();
     274    jQuery("#progressMax").text(nb_files);
     275    jQuery("#progressbar").progressbar({max: nb_files*2, value:1});
     276    jQuery("#progressCurrent").text(1);
     277
     278    jQuery("#uploadProgress").show();
    256279
    257280    jQuery("#uploadify").uploadifyUpload();
     
    389412    </p>
    390413{elseif $upload_mode eq 'multiple'}
    391     <p>
     414    <p style="margin-bottom:1em">
    392415      <input class="submit" type="button" value="{'Start Upload'|@translate}">
    393416      <input type="submit" name="submit_upload" style="display:none">
     
    396419</form>
    397420
     421<div id="uploadProgress" style="display:none">
     422{'Photo %s of %s'|@translate|@sprintf:'<span id="progressCurrent">1</span>':'<span id="progressMax">10</span>'}
     423<br>
     424<div id="progressbar"></div>
     425</div>
     426
    398427<fieldset style="display:none">
    399428  <legend>{'Uploaded Photos'|@translate}</legend>
  • trunk/admin/themes/default/theme.css

    r11967 r12005  
    10731073
    10741074#photosAddContent p.showFieldset {text-align:left;margin: 0 auto 10px auto;width: 650px;}
     1075
     1076#uploadProgress {width:650px; margin:10px auto;font-size:90%;}
     1077#progressbar {border:1px solid #ccc; background-color:#eee;}
     1078.ui-progressbar-value { background-image: url(images/pbar-ani.gif); height:10px;margin:-1px;border:1px solid #E78F08;}
  • trunk/admin/themes/roma/theme.css

    r11393 r12005  
    248248div.token-input-dropdown ul li {background-color:#eee;}
    249249div.token-input-dropdown ul li.token-input-selected-dropdown-item {background-color:#FF7800;}
     250
     251#progressbar {border:1px solid #666; background-color:#666;}
  • trunk/language/en_UK/admin.lang.php

    r11978 r12005  
    849849$lang['Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'] = 'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).';
    850850$lang['Manage Permissions'] = 'Manage Permissions';
     851$lang['Photo %s of %s'] = 'Photo %s of %s';
    851852?>
  • trunk/language/fr_FR/admin.lang.php

    r11978 r12005  
    858858$lang['Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'] = 'Résolution maximum approximative : %dM pixels (soit %dx%d pixels).';
    859859$lang['Manage Permissions'] = 'Gérer les permissions';
     860$lang['Photo %s of %s'] = 'Photo %s sur %s';
    860861?>
Note: See TracChangeset for help on using the changeset viewer.