trying to switch to interface.js
parent
b9efa173bf
commit
d1ca431fd2
|
|
@ -12,6 +12,21 @@
|
||||||
<script src="../../core/lib/interface.js"></script>
|
<script src="../../core/lib/interface.js"></script>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
|
function uploadFile(fileid, contents) {
|
||||||
|
// TODO: use interface.js-provided stuff?
|
||||||
|
Puck.write(`\x10(function() {
|
||||||
|
require("Storage").write("${fileid}",'${contents}');
|
||||||
|
Bluetooth.print("OK");
|
||||||
|
})()\n`, ret => {
|
||||||
|
console.log("uploadFile", ret);
|
||||||
|
if (ret == "OK")
|
||||||
|
clean();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
import init, { convert_gpx_strings } from "./pkg/gpconv.js";
|
import init, { convert_gpx_strings } from "./pkg/gpconv.js";
|
||||||
console.log("imported wasm");
|
console.log("imported wasm");
|
||||||
|
|
@ -42,11 +57,7 @@
|
||||||
let gpc_string = String.fromCharCode.apply(String, gpc_file);
|
let gpc_string = String.fromCharCode.apply(String, gpc_file);
|
||||||
|
|
||||||
console.log("uploading");
|
console.log("uploading");
|
||||||
sendCustomizedApp({
|
uploadFile(gpc_filename, gpc_string);
|
||||||
storage:[
|
|
||||||
{name:gpc_filename, url:'test.gpc', content:gpc_string},
|
|
||||||
]
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
reader.readAsText(this.files[0]);
|
reader.readAsText(this.files[0]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue