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
6aa0026a
Commit
6aa0026a
authored
Apr 05, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
92c0ac7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
gadget_json_generated_form.js
gadget_json_generated_form.js
+9
-13
No files found.
gadget_json_generated_form.js
View file @
6aa0026a
...
@@ -61,16 +61,6 @@
...
@@ -61,16 +61,6 @@
return
schema
;
return
schema
;
}
}
function
loadJSONSchema
(
g
,
url
,
path
)
{
if
(
g
.
props
.
toplevel
)
{
return
g
.
loadJSONSchema
(
url
,
path
);
}
path
=
g
.
element
.
getAttribute
(
'
data-json-parent
'
)
+
encodeJsonPointer
(
g
.
element
.
getAttribute
(
'
data-json-property-name
'
))
+
path
;
return
g
.
loadJSONSchemaParent
(
url
,
path
);
}
function
getDocumentType
(
doc
)
{
function
getDocumentType
(
doc
)
{
if
(
doc
instanceof
Array
)
{
if
(
doc
instanceof
Array
)
{
return
"
array
"
;
return
"
array
"
;
...
@@ -274,7 +264,7 @@
...
@@ -274,7 +264,7 @@
}
}
if
(
json_field
.
$ref
!==
undefined
)
{
if
(
json_field
.
$ref
!==
undefined
)
{
return
loadJSONSchema
(
gadget
,
json_field
.
$ref
,
first_path
)
return
gadget
.
loadJSONSchema
(
json_field
.
$ref
,
first_path
)
.
push
(
function
(
schema_part
)
{
.
push
(
function
(
schema_part
)
{
return
render_field
(
gadget
,
key
,
path
,
schema_part
,
default_value
,
root
);
return
render_field
(
gadget
,
key
,
path
,
schema_part
,
default_value
,
root
);
});
});
...
@@ -920,6 +910,12 @@
...
@@ -920,6 +910,12 @@
download_url
,
download_url
,
base_url
,
base_url
,
hash
;
hash
;
if
(
!
g
.
props
.
toplevel
)
{
path
=
g
.
element
.
getAttribute
(
'
data-json-parent
'
)
+
encodeJsonPointer
(
g
.
element
.
getAttribute
(
'
data-json-property-name
'
))
+
path
;
return
g
.
loadJSONSchemaParent
(
url
,
path
);
}
// XXX need use $id
// XXX need use $id
base_url
=
getBaseUrl
(
g
,
path
);
base_url
=
getBaseUrl
(
g
,
path
);
if
(
!
base_url
)
{
if
(
!
base_url
)
{
...
@@ -957,7 +953,7 @@
...
@@ -957,7 +953,7 @@
})
})
.
declareAcquiredMethod
(
"
loadJSONSchemaParent
"
,
"
loadJSONSchemaTop
"
)
.
declareAcquiredMethod
(
"
loadJSONSchemaParent
"
,
"
loadJSONSchemaTop
"
)
.
allowPublicAcquisition
(
"
loadJSONSchemaTop
"
,
function
(
arr
)
{
.
allowPublicAcquisition
(
"
loadJSONSchemaTop
"
,
function
(
arr
)
{
return
loadJSONSchema
(
this
,
arr
[
0
],
arr
[
1
]);
return
this
.
loadJSONSchema
(
arr
[
0
],
arr
[
1
]);
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
g
=
this
,
var
g
=
this
,
...
@@ -978,7 +974,7 @@
...
@@ -978,7 +974,7 @@
return
options
.
schema
;
return
options
.
schema
;
});
});
}
else
{
}
else
{
queue
=
loadJSONSchema
(
g
,
options
.
schema_url
);
queue
=
g
.
loadJSONSchema
(
options
.
schema_url
);
}
}
return
queue
return
queue
.
push
(
function
(
schema
)
{
.
push
(
function
(
schema
)
{
...
...
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