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
Rafael Monnerat
rjs_json_form
Commits
a68980fb
Commit
a68980fb
authored
Apr 20, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use required html5 attribute
parent
42b8f77d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
gadget_json_generated_form.js
gadget_json_generated_form.js
+9
-4
No files found.
gadget_json_generated_form.js
View file @
a68980fb
...
@@ -598,8 +598,9 @@
...
@@ -598,8 +598,9 @@
return
queue
;
return
queue
;
}
}
function
render_field
(
gadget
,
key
,
path
,
json_field
,
default_value
,
root
,
schema_path
,
type
)
{
function
render_field
(
gadget
,
key
,
path
,
json_field
,
default_value
,
root
,
schema_path
,
options
)
{
var
div
,
var
type
,
div
,
label
,
label
,
div_input
,
div_input
,
span_info
,
span_info
,
...
@@ -608,6 +609,9 @@
...
@@ -608,6 +609,9 @@
first_path
,
first_path
,
queue
=
RSVP
.
Queue
();
queue
=
RSVP
.
Queue
();
options
=
options
||
{};
type
=
options
.
type
;
if
(
path
&&
key
)
{
if
(
path
&&
key
)
{
first_path
=
path
+
encodeJsonPointer
(
key
);
first_path
=
path
+
encodeJsonPointer
(
key
);
}
else
{
}
else
{
...
@@ -719,6 +723,7 @@
...
@@ -719,6 +723,7 @@
// gadget.props.inputs not contain values
// gadget.props.inputs not contain values
gadget
.
props
.
inputs
.
push
(
input
);
gadget
.
props
.
inputs
.
push
(
input
);
input
.
name
=
first_path
;
input
.
name
=
first_path
;
input
.
required
=
options
.
required
;
// XXX for gui
// XXX for gui
//input.setAttribute("class", "slapos-parameter");
//input.setAttribute("class", "slapos-parameter");
div_input
.
appendChild
(
input
);
div_input
.
appendChild
(
input
);
...
@@ -840,7 +845,7 @@
...
@@ -840,7 +845,7 @@
}
}
queue
queue
.
push
(
render_field
.
bind
(
g
,
g
,
key
,
path
,
.
push
(
render_field
.
bind
(
g
,
g
,
key
,
path
,
json_field
.
properties
[
key
],
default_dict
[
key
],
root
)
json_field
.
properties
[
key
],
default_dict
[
key
],
root
,
schema_path
,
{
required
:
true
}
)
);
);
}
else
if
(
default_dict
.
hasOwnProperty
(
key
))
{
}
else
if
(
default_dict
.
hasOwnProperty
(
key
))
{
used_properties
[
key
]
=
""
;
used_properties
[
key
]
=
""
;
...
@@ -1333,7 +1338,7 @@
...
@@ -1333,7 +1338,7 @@
root
.
appendChild
(
delete_button
);
root
.
appendChild
(
delete_button
);
}
}
return
render_field
(
g
,
property_name
,
""
,
schema
,
return
render_field
(
g
,
property_name
,
""
,
schema
,
options
.
document
,
root
,
options
.
schema_path
,
options
.
type
)
options
.
document
,
root
,
options
.
schema_path
,
{
type
:
options
.
type
}
)
.
push
(
function
()
{
.
push
(
function
()
{
g
.
listenEvents
();
g
.
listenEvents
();
return
g
.
element
;
return
g
.
element
;
...
...
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