Commit 120cbfd9 authored by Boris Kocherov's avatar Boris Kocherov

demo/with_monaco: remove duplication

parent a0e92aba
...@@ -67,8 +67,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM ...@@ -67,8 +67,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
.then(s => { .then(s => {
return { return {
uri: mappedUrl || schemaUrl, uri: mappedUrl || schemaUrl,
schema: s, schema: s
schema_url: mappedUrl || schemaUrl
}; };
}); });
}; };
...@@ -84,7 +83,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM ...@@ -84,7 +83,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
return g.render({ return g.render({
key: "rjs_json_form", key: "rjs_json_form",
schema: schemas[0].schema, schema: schemas[0].schema,
schema_url: schemas[0].schema_url, schema_url: schemas[0].uri,
value: {} value: {}
}); });
}); });
...@@ -97,7 +96,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM ...@@ -97,7 +96,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
monacoSchemaEditor = monaco.editor.create( monacoSchemaEditor = monaco.editor.create(
document.getElementById("monaco-schema"), document.getElementById("monaco-schema"),
{ {
model: monaco.editor.createModel(JSON.stringify(schemas[0].schema, null, 2), "json", schemas[0].schema_url) model: monaco.editor.createModel(JSON.stringify(schemas[0].schema, null, 2), "json", schemas[0].uri)
} }
); );
...@@ -115,7 +114,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM ...@@ -115,7 +114,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
return g.render({ return g.render({
key: "rjs_json_form", key: "rjs_json_form",
schema: parsed, schema: parsed,
schema_url: schemas[0].schema_url, schema_url: schemas[0].uri,
}); });
}); });
} }
...@@ -142,7 +141,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM ...@@ -142,7 +141,7 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
return g.render({ return g.render({
key: "rjs_json_form", key: "rjs_json_form",
schema: schemas[0].schema, schema: schemas[0].schema,
schema_url: schemas[0].schema_url, schema_url: schemas[0].uri,
value: parsed value: parsed
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment