Commit b59c112e authored by Boris Kocherov's avatar Boris Kocherov

draft

parent 8c970da5
...@@ -18,12 +18,10 @@ ...@@ -18,12 +18,10 @@
<div role="main" class="ui-content gadget-content"> <div role="main" class="ui-content gadget-content">
<section class="ui-content-header-plain"> <section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c"> <h3 class="ui-content-title ui-body-c">
<!--<span class="ui-icon ui-icon-custom ui-icon-database">&nbsp;</span>-->
Demo UI for JSON Scheme form generator Demo UI for JSON Scheme form generator
</h3> </h3>
</section> </section>
<br> <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> ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div class="field_container"> <div class="field_container">
...@@ -34,20 +32,33 @@ ...@@ -34,20 +32,33 @@
</div> </div>
</div> </div>
<div class="right"> <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 class="ui-field-contain">
<div data-gadget-url="gadget_json_generated_form.html" <div data-gadget-url="gadget_json_generated_form.html"
data-gadget-scope="form_view" data-gadget-scope="form_view"
data-gadget-sandbox="public"> 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> </div>
<button type="submit" class="ui-btn ui-icon-edit
ui-btn-icon-right">Send Form
</button>
</form>
</div> </div>
</div> </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> </div>
......
/*jslint nomen: true, maxlen: 200, indent: 2*/ /*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) { (function (window, document, rJS, loopEventListener) {
"use strict"; "use strict";
...@@ -26,7 +26,20 @@ ...@@ -26,7 +26,20 @@
}; };
g.options = { 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) { for (i = 0; i < len; i += 1) {
...@@ -38,13 +51,20 @@ ...@@ -38,13 +51,20 @@
return g.getDeclaredGadget("form_view") return g.getDeclaredGadget("form_view")
.push(function (form_view) { .push(function (form_view) {
g.props.form_view = form_view; g.props.form_view = form_view;
form_view.render(g.options); return form_view.render(g.options);
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
console.error(error); console.error(error);
throw error; throw error;
}); });
}) })
.onEvent("submit", function () {
var g = this;
return g.props.form_view.getContent()
.push(function (data) {
console.log(data);
});
})
.declareService(function () { .declareService(function () {
var g = this; var g = this;
return loopEventListener( return loopEventListener(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment