Implementing Spreadsheet XLSX import/export using WebAssembly

This commit is contained in:
Ludovic Dubost
2019-12-28 19:06:32 +01:00
parent 89d9f22e0e
commit 7026123bfc
5 changed files with 8602 additions and 3 deletions

View File

@@ -67,7 +67,11 @@ define([
var file = e.target.files[0];
var reader = new FileReader();
reader.onload = function (e) { f(e.target.result, file); };
reader.readAsText(file, type);
if (cfg && cfg.binary) {
reader.readAsArrayBuffer(file, type);
} else {
reader.readAsText(file, type);
}
});
};
};
@@ -1853,9 +1857,9 @@ define([
// Old import button, used in settings
button
.click(common.prepareFeedback(type))
.click(importContent('text/plain', function (content, file) {
.click(importContent((data && data.binary) ? 'application/octet-stream' : 'text/plain', function (content, file) {
callback(content, file);
}, {accept: data ? data.accept : undefined}));
}, {accept: data ? data.accept : undefined, binary: data ? data.binary : undefined }));
//}
break;
case 'upload':