From e007f8dfd1c3761d83b1a09b46dff6cb2f84f10c Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 6 Apr 2024 16:03:22 +0200 Subject: [PATCH 1/3] Update preview with a newer version of the playground This is mainly to verify that it still works. --- preview/playground | 2 +- preview/webview.css | 2 +- preview/webview.html | 36 ++++++++++++++++++++---------------- preview/webview.js | 8 ++++++-- src/preview.ts | 2 +- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/preview/playground b/preview/playground index edb0414..8230b06 160000 --- a/preview/playground +++ b/preview/playground @@ -1 +1 @@ -Subproject commit edb0414c1abd7ec557af1512d60b0cffcbcb8cdd +Subproject commit 8230b06c8121090b26cdfaec1a92f67128ecd2c1 diff --git a/preview/webview.css b/preview/webview.css index c45e341..1a761b7 100644 --- a/preview/webview.css +++ b/preview/webview.css @@ -8,7 +8,7 @@ body { flex-direction: column; } -#schematic { +.schematic { height: 100%; flex-grow: 1; } diff --git a/preview/webview.html b/preview/webview.html index 6e0f127..1584935 100644 --- a/preview/webview.html +++ b/preview/webview.html @@ -10,32 +10,36 @@ - -
- + +
+
- - - - + + + + -
+
-
- +
+
-
+
-
+
Loading...
-
+
diff --git a/preview/webview.js b/preview/webview.js index 922b894..bec36bc 100644 --- a/preview/webview.js +++ b/preview/webview.js @@ -59,8 +59,12 @@ async function init(state) { // Initialize the schematic. let root = document.querySelector('#schematic-root'); - simulator = new Simulator(blobUrl, saveState); - await simulator.init(root, state) + simulator = new Simulator({ + root: root, + workerURL: blobUrl, + saveState: saveState, + }); + await simulator.setState(state) vscode.postMessage({ type: 'ready', }); diff --git a/src/preview.ts b/src/preview.ts index 8218152..d64d0f7 100644 --- a/src/preview.ts +++ b/src/preview.ts @@ -111,7 +111,7 @@ async function createPanel(context: vscode.ExtensionContext, panel: vscode.Webvi // Also, the worker shouldn't be sending invalid styles anyway (if the // worker is hijacked, security is breached anyway). // More information: https://stackoverflow.com/questions/30653698/#31759553 - html = html.replace('{CSP}', `default-src 'none'; script-src ${panel.webview.cspSource} blob: 'unsafe-eval'; style-src ${panel.webview.cspSource} 'unsafe-inline'; connect-src ${panel.webview.cspSource}; font-src ${panel.webview.cspSource}`); + html = html.replace('{CSP}', `default-src ${panel.webview.cspSource}; script-src ${panel.webview.cspSource} blob: 'unsafe-eval'; style-src ${panel.webview.cspSource} 'unsafe-inline'; connect-src ${panel.webview.cspSource}`); panel.webview.html = html; // Wrapper postMessage that ignores messages after the panel is disposed. From bbb4f8e00f4f73e1a571d53aa7fd5c5ea25f47f6 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 27 Apr 2024 11:25:37 +0200 Subject: [PATCH 2/3] Add Gopher Badge --- src/preview.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/preview.ts b/src/preview.ts index d64d0f7..f8b93e6 100644 --- a/src/preview.ts +++ b/src/preview.ts @@ -9,6 +9,7 @@ let boards = [ 'arduino-nano33', 'circuitplay-bluefruit', 'circuitplay-express', + 'gopher-badge', 'hifive1b', 'microbit', 'pinetime', From 8bf2dc48d63e179a41676d227a23fcdf01672d40 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 28 Apr 2024 14:20:05 +0200 Subject: [PATCH 3/3] Update playground --- preview/playground | 2 +- preview/webview.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/preview/playground b/preview/playground index 8230b06..20c98d1 160000 --- a/preview/playground +++ b/preview/playground @@ -1 +1 @@ -Subproject commit 8230b06c8121090b26cdfaec1a92f67128ecd2c1 +Subproject commit 20c98d1d5ee0e809ed0cebd01e58d0814d899b1b diff --git a/preview/webview.js b/preview/webview.js index bec36bc..2dd8b07 100644 --- a/preview/webview.js +++ b/preview/webview.js @@ -61,7 +61,7 @@ async function init(state) { let root = document.querySelector('#schematic-root'); simulator = new Simulator({ root: root, - workerURL: blobUrl, + schematicURL: blobUrl, saveState: saveState, }); await simulator.setState(state) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy