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
Jérome Perrin
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
Hide 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,16 +5,19 @@
...
@@ -5,16 +5,19 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
ERP5
</title>
<title>
ERP5
</title>
<link
rel=
"shortcut icon"
href=
"favicon.ico"
>
<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"
/>
<link
href=
"gadget_erp5_page_slap_parameter_form.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
></script>
<script
src=
"gadget_global.js"
></script>
<script
src=
"gadget_json_generated_form.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_json_generated_form.js"
type=
"text/javascript"
></script>
</head>
</head>
<body>
<body>
<div
class=
"loadschema"
<div
data-json-path=
"/"
>
data-gadget-url=
"gadget_erp5_page_slap_load_schema.html"
</div>
data-gadget-scope=
"loadschema"
>
<div
class=
"loadschema"
</div>
data-gadget-url=
"gadget_erp5_page_slap_load_schema.html"
data-gadget-scope=
"loadschema"
>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
gadget_json_generated_form.js
View file @
6bc93576
...
@@ -69,10 +69,11 @@
...
@@ -69,10 +69,11 @@
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
input
=
document
.
createElement
(
"
button
"
);
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
.
type
=
"
button
"
;
input
.
name
=
path
;
input
.
name
=
path
;
input
.
textContent
=
"
Add
"
;
gadget
.
props
.
add_buttons
.
push
({
gadget
.
props
.
add_buttons
.
push
({
parent_type
:
'
array
'
,
parent_type
:
'
array
'
,
element
:
input
,
element
:
input
,
...
@@ -231,10 +232,11 @@
...
@@ -231,10 +232,11 @@
div_input
.
appendChild
(
input
);
div_input
.
appendChild
(
input
);
input
=
document
.
createElement
(
"
button
"
);
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
.
type
=
"
button
"
;
input
.
name
=
path
;
input
.
name
=
path
;
input
.
textContent
=
"
Add
"
;
gadget
.
props
.
add_buttons
.
push
({
gadget
.
props
.
add_buttons
.
push
({
element
:
input
,
element
:
input
,
schema_part
:
schema
schema_part
:
schema
...
@@ -558,7 +560,8 @@
...
@@ -558,7 +560,8 @@
var
g
=
this
,
var
g
=
this
,
key
=
options
.
key
,
key
=
options
.
key
,
schema
=
options
.
schema
,
schema
=
options
.
schema
,
delete_button
;
delete_button
,
root
;
g
.
props
.
inputs
=
[];
g
.
props
.
inputs
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
arrays
=
{};
g
.
props
.
arrays
=
{};
...
@@ -573,18 +576,24 @@
...
@@ -573,18 +576,24 @@
if
(
schema
.
type
===
undefined
)
{
if
(
schema
.
type
===
undefined
)
{
schema
.
type
=
"
object
"
;
schema
.
type
=
"
object
"
;
}
}
while
(
g
.
element
.
firstChild
)
{
root
=
g
.
element
.
querySelector
(
'
[data-json-path="/"]
'
);
g
.
element
.
removeChild
(
g
.
element
.
firstChild
);
if
(
!
root
)
{
root
=
g
.
element
;
}
while
(
root
.
firstChild
)
{
root
.
removeChild
(
root
.
firstChild
);
}
}
if
(
!
g
.
props
.
toplevel
)
{
if
(
!
g
.
props
.
toplevel
)
{
delete_button
=
document
.
createElement
(
"
button
"
);
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
.
type
=
"
button
"
;
delete_button
.
name
=
options
.
path
;
delete_button
.
name
=
options
.
path
;
delete_button
.
textContent
=
"
Delete
"
;
g
.
props
.
delete_button
=
delete_button
;
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
()
{
.
push
(
function
()
{
g
.
listenEvents
();
g
.
listenEvents
();
return
g
.
element
;
return
g
.
element
;
...
@@ -616,7 +625,6 @@
...
@@ -616,7 +625,6 @@
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
console
.
log
(
"
FINISHED TO RENDER, RETURNING THE GADGET
"
);
return
g
;
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