瀏覽代碼

test

master
Pascal Gloor 5 年之前
父節點
當前提交
81d791af5b
共有 1 個文件被更改,包括 22 次插入1 次删除
  1. 22
    1
      www/js/autodoc.js

+ 22
- 1
www/js/autodoc.js 查看文件

@@ -253,6 +253,27 @@ function upload_read_event(e) {
temp.upload[e.data]['progress'] = 50;
$.ajax({
type: 'POST',
url: conf.openapi + "/documents/" + temp.documentid + "/data",
data: e.target.result,
context: e.data,
beforeSend: function(XMLHttpRequest)
{
XMLHttpRequest.upload.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
console.log("upload_progress_event", evt);
}
}, false);
},
success: function(data){
console.log("upload_complete",data);
}
});

$(xhr.upload).on('progress', e.id, function(e) {
if ( e.lengthComputable ) {
var progress = Math.floor(e.originalEvent.loaded / e.originalEvent.total * 50);
@@ -269,7 +290,7 @@ function upload_read_event(e) {

xhr.open("POST", conf.openapi + "/documents/" + temp.documentid + "/data");
xhr.send(e.target.result);
}

console.log(e);

Loading…
取消
儲存