Skip to content

Commit 775380a

Browse files
committed
Load frame & context from URL.
1 parent 525e8e3 commit 775380a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

playground/next/editor.bundle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39991,6 +39991,10 @@ ${O$2.repeat(r.depth)}}`:r.close="}";break}case f$4.TAG:e+=String(i),e+=a(f$4.PO
3999139991
gatherHash() {
3999239992
const url = new URL(window.location);
3999339993
const hash = new URLSearchParams(url.hash.slice(1));
39994+
this.contextDoc = JSON.parse(hash.get('context') || {});
39995+
setEditorValue(this.contextEditor, this.contextDoc);
39996+
this.frameDoc = JSON.parse(hash.get('frame') || {});
39997+
setEditorValue(this.frameEditor, this.frameDoc);
3999439998
this.doc = JSON.parse(hash.get('json-ld') || {});
3999539999
setEditorValue(this.mainEditor, this.doc);
3999640000
this.outputTab = hash.get('startTab').slice(4);

playground/next/editor.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ window.app = createApp({
564564
gatherHash() {
565565
const url = new URL(window.location);
566566
const hash = new URLSearchParams(url.hash.slice(1));
567+
this.contextDoc = JSON.parse(hash.get('context') || {});
568+
setEditorValue(this.contextEditor, this.contextDoc);
569+
this.frameDoc = JSON.parse(hash.get('frame') || {});
570+
setEditorValue(this.frameEditor, this.frameDoc);
567571
this.doc = JSON.parse(hash.get('json-ld') || {});
568572
setEditorValue(this.mainEditor, this.doc);
569573
this.outputTab = hash.get('startTab').slice(4);

0 commit comments

Comments
 (0)