简体   繁体   English

Valums文件上传器-列表文件-路径

[英]Valums file uploader - List file - path

Someone knows how create file list like demo when pass 10 seconds: 有人知道经过10秒后如何创建文件列表(如演示):

http://html5.sapnagroup.com/demos/dragDropUploads/ http://html5.sapnagroup.com/demos/dragDropUploads/

Demo Source code there is nothing to create this list, it's not on complete event. 演示源代码没有什么可以创建此列表,它不在完成事件上。 I think is php code inside but i cant get it 我认为里面是php代码,但我听不懂

Thanks 谢谢

The file list is being created by the fileuploader.js plugin. 文件列表由fileuploader.js插件创建。 When a file upload begins, the plugin creates the list item HTML element and then adds it to the page. 开始上传文件时,插件会创建列表项HTML元素,然后将其添加到页面。 Here's the code and how it works: 以下是代码及其工作方式:

The template for the list item is in the qq.FileUploader class: 列表项的模板在qq.FileUploader类中:

fileTemplate: '<li>' +
    '<span class="qq-upload-file"></span>' +
     '<span class="qq-upload-spinner"></span>' +
     '<span class="qq-upload-size"></span>' +
     '<a class="qq-upload-cancel" href="#">Cancel</a>' +
     '<span class="qq-upload-failed-text">Failed</span>' +
   '</li>',

The _addToList() function creates the new list item HTML element using the above template: _addToList()函数使用上述模板创建新的列表项HTML元素:

addToList: function(id, fileName){
  var item = qq.toElement(this._options.fileTemplate);                
  item.qqFileId = id;

  var fileElement = this._find(item, 'file');        
  qq.setText(fileElement, this._formatFileName(fileName));
  this._find(item, 'size').style.display = 'none';        

  this._listElement.appendChild(item);
},

When a file upload begins, the _addToList() function (above) is called in the _onSubmit() method: 文件上传开始时,在_onSubmit()方法中调用_addToList()函数(如上):

_onSubmit: function(id, fileName){
    qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
    this._addToList(id, fileName);  
},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM