Add File System in settings and disable peek if not expandeed

index.htm and index.js and peek.js:
- add expand and peek function for peek expand to removeEventListener if not expanded

- add peekexp and segvexp in settings to save status (wip)

- add File System in settings
This commit is contained in:
Ewoud
2023-03-17 23:53:27 +01:00
parent 5ac9ffa073
commit aa6b1735d3
9 changed files with 2460 additions and 2429 deletions

View File

@@ -1,4 +1,5 @@
function peek(c) {
function peek(c, setOff=false) {
console.log("peek",c, setOff);
// Check for canvas support
var ctx = c.getContext('2d');
if (ctx) { // Access the rendering context
@@ -16,7 +17,8 @@ function peek(c) {
}
}
ws.binaryType = "arraybuffer";
ws.addEventListener('message',(e)=>{
function myFunction(e) {
try {
if (toString.call(e.data) === '[object ArrayBuffer]') {
let leds = new Uint8Array(e.data);
@@ -46,6 +48,11 @@ function peek(c) {
} catch (err) {
console.error("Peek WS error:",err);
}
});
}
if (!setOff)
ws.addEventListener('message', myFunction);
else
ws.removeEventListener('message', myFunction);
}
}