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
6bc93576
Commit
6bc93576
authored
Mar 09, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
button replace icon
parent
cbf9ccf6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
gadget_json_generated_form.html
gadget_json_generated_form.html
+8
-5
gadget_json_generated_form.js
gadget_json_generated_form.js
+19
-11
No files found.
gadget_json_generated_form.html
View file @
6bc93576
...
...
@@ -5,6 +5,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
ERP5
</title>
<link
rel=
"shortcut icon"
href=
"favicon.ico"
>
<link
rel=
"stylesheet"
href=
"gadget_erp5_nojqm.css"
>
<link
href=
"gadget_erp5_page_slap_parameter_form.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
...
...
@@ -12,9 +13,11 @@
<script
src=
"gadget_json_generated_form.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
data-json-path=
"/"
>
</div>
<div
class=
"loadschema"
data-gadget-url=
"gadget_erp5_page_slap_load_schema.html"
data-gadget-scope=
"loadschema"
>
data-gadget-scope=
"loadschema"
>
</div>
</body>
</html>
\ No newline at end of file
gadget_json_generated_form.js
View file @
6bc93576
...
...
@@ -69,10 +69,11 @@
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
input
=
document
.
createElement
(
"
button
"
);
input
.
setAttribute
(
"
class
"
,
"
add-sub-form
"
);
input
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-notext ui-icon-btn ui-icon-plus ui-input-btn
"
);
input
.
type
=
"
button
"
;
input
.
name
=
path
;
input
.
textContent
=
"
Add
"
;
gadget
.
props
.
add_buttons
.
push
({
parent_type
:
'
array
'
,
element
:
input
,
...
...
@@ -231,10 +232,11 @@
div_input
.
appendChild
(
input
);
input
=
document
.
createElement
(
"
button
"
);
input
.
setAttribute
(
"
class
"
,
"
add-sub-form
"
);
input
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-notext ui-icon-btn ui-icon-plus ui-input-btn
"
);
input
.
type
=
"
button
"
;
input
.
name
=
path
;
input
.
textContent
=
"
Add
"
;
gadget
.
props
.
add_buttons
.
push
({
element
:
input
,
schema_part
:
schema
...
...
@@ -558,7 +560,8 @@
var
g
=
this
,
key
=
options
.
key
,
schema
=
options
.
schema
,
delete_button
;
delete_button
,
root
;
g
.
props
.
inputs
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
arrays
=
{};
...
...
@@ -573,18 +576,24 @@
if
(
schema
.
type
===
undefined
)
{
schema
.
type
=
"
object
"
;
}
while
(
g
.
element
.
firstChild
)
{
g
.
element
.
removeChild
(
g
.
element
.
firstChild
);
root
=
g
.
element
.
querySelector
(
'
[data-json-path="/"]
'
);
if
(
!
root
)
{
root
=
g
.
element
;
}
while
(
root
.
firstChild
)
{
root
.
removeChild
(
root
.
firstChild
);
}
if
(
!
g
.
props
.
toplevel
)
{
delete_button
=
document
.
createElement
(
"
button
"
);
delete_button
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-notext ui-icon-btn ui-icon-trash-o ui-input-btn
"
);
delete_button
.
type
=
"
button
"
;
delete_button
.
name
=
options
.
path
;
delete_button
.
textContent
=
"
Delete
"
;
g
.
props
.
delete_button
=
delete_button
;
g
.
elemen
t
.
appendChild
(
delete_button
);
roo
t
.
appendChild
(
delete_button
);
}
return
render_field
(
g
,
key
,
""
,
schema
,
options
.
document
,
g
.
elemen
t
)
return
render_field
(
g
,
key
,
""
,
schema
,
options
.
document
,
roo
t
)
.
push
(
function
()
{
g
.
listenEvents
();
return
g
.
element
;
...
...
@@ -616,7 +625,6 @@
});
})
.
push
(
function
()
{
console
.
log
(
"
FINISHED TO RENDER, RETURNING THE GADGET
"
);
return
g
;
});
})
...
...
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