Pascal Gloor 5 vuotta sitten
vanhempi
commit
72ceb2657e
1 muutettua tiedostoa jossa 10 lisäystä ja 6 poistoa
  1. 10
    6
      www/js/autodoc.js

+ 10
- 6
www/js/autodoc.js Näytä tiedosto

@@ -189,7 +189,7 @@ function upload_zone_drop(e) {

if ( temp.documentid == null ) {
$.post(conf.openapi + "/documents", {}, function(data) {
console.log(data);
temp.documentid = data.id;
handle_uploads(ev);
})
}
@@ -200,8 +200,7 @@ function upload_zone_drop(e) {

function handle_uploads(ev) {

return true;

1
$.each(ev.dataTransfer.files, function(id,file) {
var fileid = temp.upload.length();
temp.upload.push({
@@ -218,9 +217,14 @@ function handle_uploads(ev) {
}
else {
var reader = new FileReader();
reader.readAsBinaryString(file);
reader.onloadend = function() {
}
var data;
reader.onloadend = function(e) {
$.post(conf.openapi + "/documents/" + temp.documentid + "/data", e.result, function(data) {
console.log(data);
}, file.type)
};
reader.readAsArrayBuffer(data);

}
});
return true;

Loading…
Peruuta
Tallenna