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

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

File:
1 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>
Note: See TracChangeset for help on using the changeset viewer.