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
bca37dc7
Commit
bca37dc7
authored
May 02, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
design changes, remove gadget_erp5_page_slap_parameter_form.css dependence
parent
8b3b649b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
18 deletions
+61
-18
gadget_erp5_nojqm.css
gadget_erp5_nojqm.css
+30
-0
gadget_json_generated_form.html
gadget_json_generated_form.html
+0
-1
gadget_json_generated_form.js
gadget_json_generated_form.js
+1
-0
gadget_json_generated_form_child.html
gadget_json_generated_form_child.html
+0
-1
gadget_json_generated_form_child.js
gadget_json_generated_form_child.js
+30
-16
No files found.
gadget_erp5_nojqm.css
View file @
bca37dc7
...
...
@@ -1717,6 +1717,36 @@ div[data-gadget-scope='maximize'] button:active {
height
:
100%
;
}
/**********************************************
* JSONForm
**********************************************/
fieldset
>
.jsonformfield
{
padding-left
:
0
}
.jsonformfield
{
display
:
flex
;
/*padding-left: 20px;*/
padding-top
:
3px
;
/*margin-left: 15px;*/
}
.jsonformfield
button
{
display
:
block
;
vertical-align
:
top
;
}
.jsonformfield
.ui-btn-icon-top
::before
{
vertical-align
:
top
;
}
.jsonformfield
label
{
word-break
:
keep-all
;
hyphens
:
none
;
}
.jsonformfield
span
{
color
:
rgb
(
94
,
127
,
141
)
}
.jsonformfield
.error
{
color
:
#E82525
;
font-weight
:
600
;
}
/**********************************************
* Icons
**********************************************/
.ui-btn-icon-top
::before
,
...
...
gadget_json_generated_form.html
View file @
bca37dc7
...
...
@@ -5,7 +5,6 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
ERP5
</title>
<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=
"tv4.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
...
...
gadget_json_generated_form.js
View file @
bca37dc7
...
...
@@ -539,6 +539,7 @@
schema
:
schema
,
schema_path
:
""
,
document
:
options
.
value
,
required
:
true
,
top
:
true
});
})
...
...
gadget_json_generated_form_child.html
View file @
bca37dc7
...
...
@@ -5,7 +5,6 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
ERP5
</title>
<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=
"tv4.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
...
...
gadget_json_generated_form_child.js
View file @
bca37dc7
...
...
@@ -450,7 +450,7 @@
input
,
minItems
=
schema
.
minItems
||
0
;
div
=
document
.
createElement
(
"
div
"
);
div
.
setAttribute
(
"
class
"
,
"
sub
field
"
);
div
.
setAttribute
(
"
class
"
,
"
jsonform
field
"
);
div
.
title
=
schema
.
description
;
div_input
=
document
.
createElement
(
"
div
"
);
...
...
@@ -536,6 +536,7 @@
function
render_field
(
gadget
,
key
,
path
,
json_field
,
default_value
,
root
,
schema_path
,
options
)
{
var
type
,
div
,
delete_button
,
label
,
div_input
,
span_info
,
...
...
@@ -582,9 +583,23 @@
}
div
=
document
.
createElement
(
"
div
"
);
div
.
setAttribute
(
"
class
"
,
"
subfield
"
);
div
.
setAttribute
(
"
class
"
,
"
jsonformfield ui-field-contain
"
);
div
.
title
=
json_field
.
description
;
// if (key && !first_path) {
if
(
options
.
required
!==
true
)
{
delete_button
=
document
.
createElement
(
"
span
"
);
delete_button
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-top ui-icon-btn ui-icon-trash-o
"
);
gadget
.
props
.
delete_button
=
delete_button
;
div
.
appendChild
(
delete_button
);
}
else
if
(
options
.
top
!==
true
)
{
delete_button
=
document
.
createElement
(
"
span
"
);
delete_button
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-top ui-icon-btn ui-icon-exclamation-circle
"
);
div
.
appendChild
(
delete_button
);
}
if
(
false
)
{
// XXX;
label
=
document
.
createElement
(
"
input
"
);
...
...
@@ -594,9 +609,13 @@
label
=
document
.
createElement
(
"
label
"
);
label
.
textContent
=
[
key
,
json_field
.
title
]
.
filter
(
function
(
v
)
{
return
v
;
})
.
join
(
"
"
);
.
join
(
"
"
)
// use non-breaking hyphen
.
replace
(
"
-
"
,
"
‑
"
);
}
if
(
label
.
textContent
)
{
div
.
appendChild
(
label
);
}
div
.
appendChild
(
label
);
div_input
=
document
.
createElement
(
"
div
"
);
div_input
.
setAttribute
(
"
id
"
,
gadget
.
element
.
getAttribute
(
"
data-gadget-scope
"
)
+
first_path
+
'
/
'
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
...
...
@@ -703,7 +722,7 @@
input
;
div
=
document
.
createElement
(
"
div
"
);
div
.
setAttribute
(
"
class
"
,
"
sub
field
"
);
div
.
setAttribute
(
"
class
"
,
"
jsonform
field
"
);
// div.title = json_field.description;
div_input
=
document
.
createElement
(
"
div
"
);
...
...
@@ -1240,18 +1259,13 @@
while
(
root
.
firstChild
)
{
root
.
removeChild
(
root
.
firstChild
);
}
if
(
!
options
.
top
)
{
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
;
g
.
props
.
delete_button
=
delete_button
;
root
.
appendChild
(
delete_button
);
}
return
render_field
(
g
,
property_name
,
""
,
schema
,
options
.
document
,
root
,
options
.
schema_path
,
{
type
:
options
.
type
})
options
.
document
,
root
,
options
.
schema_path
,
{
type
:
options
.
type
,
required
:
options
.
required
,
top
:
options
.
top
})
.
push
(
function
()
{
g
.
listenEvents
();
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