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
b59c112e
Commit
b59c112e
authored
Mar 22, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draft
parent
8c970da5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
20 deletions
+51
-20
gadget_demo_json_schema_form.html
gadget_demo_json_schema_form.html
+28
-17
gadget_demo_json_schema_form.js
gadget_demo_json_schema_form.js
+23
-3
No files found.
gadget_demo_json_schema_form.html
View file @
b59c112e
...
...
@@ -18,36 +18,47 @@
<div
role=
"main"
class=
"ui-content gadget-content"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
<!--<span class="ui-icon ui-icon-custom ui-icon-database"> </span>-->
Demo UI for JSON Scheme form generator
</h3>
</section>
<br>
<form
class=
"save_form ui-body-c"
novalidate
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"
></button>
<div
class=
"field_container"
>
<div
class=
"left"
>
<div
class=
"ui-field-contain"
>
<label
for=
"json_schema"
>
Json Schema
</label>
<textarea
name=
"field_"
id=
"json_schema"
title=
"Json Schema"
></textarea>
</div>
<div
class=
"field_container"
>
<div
class=
"left"
>
<div
class=
"ui-field-contain"
>
<label
for=
"json_schema"
>
Json Schema
</label>
<textarea
name=
"field_"
id=
"json_schema"
title=
"Json Schema"
></textarea>
</div>
<div
class=
"right"
>
</div>
<div
class=
"right"
>
<form
class=
"save_form ui-body-c"
novalidate
>
<button
type=
"submit"
class=
"ui-btn ui-icon-edit
ui-btn-icon-right"
>
Send Form
</button>
<div
class=
"ui-field-contain"
>
<div
data-gadget-url=
"gadget_json_generated_form.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
<script
data-renderjs-configuration=
"schema_url"
type=
"text/x-renderjs-configuration"
>
sample_schema
.
json
</script>
<script
data-renderjs-configuration=
"schema_url"
type=
"text/x-renderjs-configuration"
>
/
slapos
/
software
/
erp5
/
instance
-
erp5
-
input
-
schema
.
json
</script>
<!--schema7.json-->
<!--test/instance-erp5-input-schema.json-->
<!--https://github.com/SlapOS/slapos/blob/master/software/erp5/instance-erp5-output-schema.json-->
<!--https://lab.nexedi.com/nexedi/slapos/raw/master/software/erp5/instance-erp5-output-schema.json-->
<!--sample_schema.json-->
</div>
</div>
</div>
<button
type=
"submit"
class=
"ui-btn ui-icon-edit
ui-btn-icon-right"
>
Send Form
</button>
</form>
</div>
</form>
<br>
<div
data-gadget-url=
"gadget_ojs_configurator_access.html"
data-gadget-scope=
"access"
></div>
<div
class=
"global_setting_gadget"
style=
"display: none;"
></div>
</div>
</div>
</div>
...
...
gadget_demo_json_schema_form.js
View file @
b59c112e
/*jslint nomen: true, maxlen: 200, indent: 2*/
/*global rJS, console, window, document, RSVP,
btoa, atob, $, XMLSerializer, jQuery, URI, vkbeautify
*/
/*global rJS, console, window, document, RSVP,
loopEventListener
*/
(
function
(
window
,
document
,
rJS
,
loopEventListener
)
{
"
use strict
"
;
...
...
@@ -26,7 +26,20 @@
};
g
.
options
=
{
schema_url
:
""
schema_url
:
""
,
value
:
{
"
zdsddfr3434
"
:
{
"
dadasd
"
:
34
},
"
sla-dict
"
:
{
"
zzzz
"
:[
1
,
2
,
3
]},
"
developer-list
"
:
[
"
0000000000
"
,
"
fsdfasdf111
"
,
"
fsadf222
"
],
"
zope-partition-dict
"
:
{
"
DDDdf
"
:
{
"
family
"
:
"
fsdfsd
"
,
"
instance-count
"
:
1
},
"
LLsd33fqq[//
"
:
{
"
family
"
:
"
fsdfsdf33333
"
}
},
// "zodb":[{"storage-dict":{"dsdasd":""},"dasd":"","name":"czxc","mount-point":"czxc"}],
"
site-id
"
:
"
fsdf
"
}
// {"user-authorized-key": "AbocEgsom#"}
};
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
...
...
@@ -38,13 +51,20 @@
return
g
.
getDeclaredGadget
(
"
form_view
"
)
.
push
(
function
(
form_view
)
{
g
.
props
.
form_view
=
form_view
;
form_view
.
render
(
g
.
options
);
return
form_view
.
render
(
g
.
options
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
error
(
error
);
throw
error
;
});
})
.
onEvent
(
"
submit
"
,
function
()
{
var
g
=
this
;
return
g
.
props
.
form_view
.
getContent
()
.
push
(
function
(
data
)
{
console
.
log
(
data
);
});
})
.
declareService
(
function
()
{
var
g
=
this
;
return
loopEventListener
(
...
...
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