本人使用UEditor时候需要对上传的文件进行MD5计算,但是UEditor1.4.3.1版本所带的WebUploader是0.1.2版本的不支持md5File接口,故直接将UEditor下的WebUploader直接更新为了0.1.5版本的(UEditor/dialoags/third-party/webuploader 替换为最新的就行了),但是问题出现了,添加文件后,上传按钮失效了。查找了一下是WebUploader接口更新了,导致/dialogs/image/image.js里对文件计数时错误。
计数的地方如下
getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++]; ) {
status = file.getStatus();
if ( status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
}
return readyFile;
},
改为
getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++]; ) {
status = file.getStatus();
if (status == 'inited' || status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
}
return readyFile;
},
即可