From 82a8abdfcc0be75955be059b1c8b99d24c4e0a7a Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Fri, 15 Aug 2025 11:59:30 -0400 Subject: [PATCH 01/11] Load JSON-LD from hash fragments. Supports `startTab` and `json-ld` (for the document). --- playground/next/editor.mjs | 7 +++++++ playground/next/index.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/playground/next/editor.mjs b/playground/next/editor.mjs index 10cdc8c5..07af8740 100644 --- a/playground/next/editor.mjs +++ b/playground/next/editor.mjs @@ -539,5 +539,12 @@ window.app = createApp({ '@context': this.doc['@context'] }; setEditorValue(this.contextEditor, this.contextDoc); + }, + gatherHash() { + const url = new URL(window.location); + const hash = new URLSearchParams(url.hash.slice(1)); + this.doc = JSON.parse(hash.get('json-ld') || {}); + setEditorValue(this.mainEditor, this.doc); + this.outputTab = hash.get('startTab').slice(4); } }).mount(); diff --git a/playground/next/index.html b/playground/next/index.html index af1f01fc..b0b6b01a 100644 --- a/playground/next/index.html +++ b/playground/next/index.html @@ -29,7 +29,7 @@

JSON-LD Playground

Shift+Tab) to navigate out of the editor.

-
+
- -