diff --git a/playground/next/editor.mjs b/playground/next/editor.mjs index f37ccca5..f51c2858 100644 --- a/playground/next/editor.mjs +++ b/playground/next/editor.mjs @@ -101,6 +101,7 @@ function editorListener(docName) { const parsed = JSON.parse(latestChange); this[docName] = parsed; this.parseError = ''; + this.setOutputTab(this.outputTab); } catch (err) { this.parseError = err.message; }; @@ -329,13 +330,12 @@ window.app = createApp({ inputTab: 'json-ld', outputTab: 'expanded', options: { - processingMode: '', + processingMode: 'json-ld-1.1', base: '', - baseUrl: '', compactArrays: true, compactToRelative: true, rdfDirection: '', - safe: '' + safe: false }, tabs: { expanded: {icon: 'expand alternate', label: 'Expanded'}, @@ -431,7 +431,7 @@ window.app = createApp({ this.setOutputTab(this.outputTab); }, async setOutputTab(value) { - if (!value || !this.doc) return; + if (!this.doc) return; if (value) this.outputTab = value; let context = this.contextDoc; switch (this.outputTab) { @@ -442,7 +442,7 @@ window.app = createApp({ setEditorValue(readOnlyEditor, expanded); this.parseError = ''; } catch(err) { - this.parseError = err.message; + this.parseError = err; } break; case 'compacted': diff --git a/playground/next/index.html b/playground/next/index.html index dda25087..599b766d 100644 --- a/playground/next/index.html +++ b/playground/next/index.html @@ -143,24 +143,17 @@

JSON-LD Playground

-
-
- - -
-
+ v-model="options.processingMode" @change="setOutputTab()">
+ v-model="options.processingMode" @change="setOutputTab()">
@@ -168,23 +161,9 @@

JSON-LD Playground

-
-
- - -
-
-
-
- - -
-
-
+
+ v-model="options.base" @change="setOutputTab()">
@@ -193,7 +172,7 @@

JSON-LD Playground

+ v-model="options.compactArrays" @change="setOutputTab()">
@@ -204,7 +183,7 @@

JSON-LD Playground

+ v-model="options.compactToRelative" @change="setOutputTab()">
@@ -216,14 +195,14 @@

JSON-LD Playground

+ v-model="options.rdfDirection" @change="setOutputTab()">
+ v-model="options.rdfDirection" @change="setOutputTab()">
@@ -235,22 +214,15 @@

JSON-LD Playground

- - -
-
-
-
- +
- +
@@ -291,7 +263,12 @@

JSON-LD Playground

-
+
+
+
+

+    
+