Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
a0e92aba
Commit
a0e92aba
authored
Nov 20, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo/with_monaco: use local schema7
parent
7e79da6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
demo/with_monaco/index.js
demo/with_monaco/index.js
+5
-6
No files found.
demo/with_monaco/index.js
View file @
a0e92aba
...
@@ -59,27 +59,26 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
...
@@ -59,27 +59,26 @@ importScripts('https://unpkg.com/monaco-editor@0.14.3/min/vs/base/worker/workerM
let
modelUri
=
monaco
.
Uri
.
parse
(
"
tmp://xxx.json
"
);
// a made up unique URI for our model
let
modelUri
=
monaco
.
Uri
.
parse
(
"
tmp://xxx.json
"
);
// a made up unique URI for our model
let
model
=
monaco
.
editor
.
createModel
(
"
{
\n
}
"
,
"
json
"
,
modelUri
);
let
model
=
monaco
.
editor
.
createModel
(
"
{
\n
}
"
,
"
json
"
,
modelUri
);
const
getSchema
=
relativeUrl
=>
{
const
getSchema
=
(
schemaUrl
,
mappedUrl
)
=>
{
const
schemaUrl
=
new
URL
(
relativeUrl
,
baseUrl
);
return
fetch
(
schemaUrl
)
return
fetch
(
schemaUrl
)
.
then
(
resp
=>
{
.
then
(
resp
=>
{
return
resp
.
json
();
return
resp
.
json
();
})
})
.
then
(
s
=>
{
.
then
(
s
=>
{
return
{
return
{
uri
:
relative
Url
,
uri
:
mappedUrl
||
schema
Url
,
schema
:
s
,
schema
:
s
,
schema_url
:
schemaUrl
.
toString
()
schema_url
:
mappedUrl
||
schemaUrl
};
};
});
});
};
};
Promise
.
all
([
Promise
.
all
([
getSchema
(
mainSchema
).
then
(
s
=>
{
getSchema
(
baseUrl
+
mainSchema
).
then
(
s
=>
{
s
.
fileMatch
=
[
modelUri
.
toString
()];
// this is the main schema associated to the model
s
.
fileMatch
=
[
modelUri
.
toString
()];
// this is the main schema associated to the model
return
s
;
return
s
;
}),
}),
getSchema
(
"
http://json-schema.org/draft-07/schema
"
)
getSchema
(
"
../../json-schema/schema7.json
"
,
"
http://json-schema.org/draft-07/schema
"
)
]).
then
(
schemas
=>
{
]).
then
(
schemas
=>
{
gadget
.
getDeclaredGadget
(
"
rjs_json_form
"
).
then
(
g
=>
{
gadget
.
getDeclaredGadget
(
"
rjs_json_form
"
).
then
(
g
=>
{
return
g
.
render
({
return
g
.
render
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment