Skip to content

Commit 525e8e3

Browse files
committed
Add setting of frame & context in permalink.
1 parent b259bae commit 525e8e3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

playground/next/editor.bundle.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39779,6 +39779,12 @@ ${O$2.repeat(r.depth)}}`:r.close="}";break}case f$4.TAG:e+=String(i),e+=a(f$4.PO
3977939779
const url = new URL(window.location);
3978039780
const hash = new URLSearchParams();
3978139781
hash.set('json-ld', JSON.stringify(this.doc));
39782+
if (this.contextDoc && JSON.stringify(this.contextDoc) !== '{}') {
39783+
hash.set('context', JSON.stringify(this.contextDoc));
39784+
}
39785+
if (this.frameDoc && JSON.stringify(this.frameDoc) !== '{}') {
39786+
hash.set('frame', JSON.stringify(this.frameDoc));
39787+
}
3978239788
hash.set('startTab', `tab-${this.outputTab}`);
3978339789
url.hash = hash.toString();
3978439790
return url.toString();

playground/next/editor.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ window.app = createApp({
352352
const url = new URL(window.location);
353353
const hash = new URLSearchParams();
354354
hash.set('json-ld', JSON.stringify(this.doc));
355+
if (this.contextDoc && JSON.stringify(this.contextDoc) !== '{}') {
356+
hash.set('context', JSON.stringify(this.contextDoc));
357+
}
358+
if (this.frameDoc && JSON.stringify(this.frameDoc) !== '{}') {
359+
hash.set('frame', JSON.stringify(this.frameDoc));
360+
}
355361
hash.set('startTab', `tab-${this.outputTab}`);
356362
url.hash = hash.toString();
357363
return url.toString();

0 commit comments

Comments
 (0)