Changeset 38719 in spip-zone


Ignore:
Timestamp:
Jun 9, 2010, 9:54:56 PM (11 years ago)
Author:
renato@…
Message:

plus de info pour l'upload

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/ddUpload/javascript/ajaxCallback.js

    r38619 r38719  
    316316    return this;
    317317
    318   var progress = $("<div class='ddUploadprogress'><div class='ddUploadprogress_bar'></div><span class='ddUploadprogress_text'></span></div>");
    319   progress.css({textAlign:"center",height:"15px"});
    320   progress.find("div.ddUploadprogress_bar").css({backgroundColor:"#FF0000",height:"15px",position:"absolute",zIndex:"0"});
    321   progress.find("span.ddUploadprogress_text").css({position:"relative",zIndex:"1"});
     318  var progress = $("<div class='ddUploadprogress'><div class='ddUploadprogress_bar'></div><div class='ddUploadprogress_filename'></div><div class='ddUploadprogress_text'></div></div>");
     319  progress.css({textAlign:"center",height:"30px",position:"relative"});
     320  progress.find("div.ddUploadprogress_bar").css({backgroundColor:"#FF0000",top:0,height:"30px",position:"absolute",zIndex:"0"});
     321  progress.find("div.ddUploadprogress_filename").css({position:"relative",zIndex:"1",lineHeight:"15px"});
     322  progress.find("div.ddUploadprogress_text").css({position:"relative",zIndex:"1",lineHeight:"15px"});
    322323 
    323324  return this.each(function(){
     
    337338                var width = fileProgress.width();
    338339                var progress_bar = fileProgress.find("div.ddUploadprogress_bar");
    339                 var progress_text = fileProgress.find("span.ddUploadprogress_text");
     340                fileProgress.find("div.ddUploadprogress_filename").text(file.name);
     341          var progress_text = fileProgress.find("div.ddUploadprogress_text");
    340342                                xhr.upload.onprogress = function(e) { 
    341343                                        if (e.lengthComputable) { 
    342344                                         var percentage = e.loaded / e.total; 
    343345                                         progress_bar.width(Math.round(width*percentage));
    344                                          progress_text.text(Math.round(percentage*100)+"%");
     346                                         progress_text.text(Math.round(percentage*100)+"% ("+e.loaded+"/"+e.total+")");
    345347                                        } 
    346348                                }; 
     
    348350          var onload = function(e){
    349351                                        progress_bar.width(width);
    350                                         progress_text.text("100%");
     352                                        progress_text.text("100% ("+file.size+"/"+file.size+")");
    351353                                };
    352354           
Note: See TracChangeset for help on using the changeset viewer.