forked from FOSS/BangleApps
trying to switch to interface.js
parent
b9efa173bf
commit
d1ca431fd2
|
@ -12,6 +12,21 @@
|
|||
<script src="../../core/lib/interface.js"></script>
|
||||
|
||||
<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";
|
||||
console.log("imported wasm");
|
||||
|
@ -42,11 +57,7 @@
|
|||
let gpc_string = String.fromCharCode.apply(String, gpc_file);
|
||||
|
||||
console.log("uploading");
|
||||
sendCustomizedApp({
|
||||
storage:[
|
||||
{name:gpc_filename, url:'test.gpc', content:gpc_string},
|
||||
]
|
||||
});
|
||||
uploadFile(gpc_filename, gpc_string);
|
||||
});
|
||||
}
|
||||
reader.readAsText(this.files[0]);
|
||||
|
|
Loading…
Reference in New Issue