(UEditor 1.4.3.1 WebUploader 0.1.2 不支持Md5 ) 或 (UEditor 更新 WebUploader後 上傳按鈕失效) 或 (WebUploader inited

本人使用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裏對文件計數時錯誤。web

計數的地方以下this

        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;
        },spa

改成接口

        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;
        },md5

便可get

相關文章
相關標籤/搜索