Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.core
Commits
7270b9ba
Commit
7270b9ba
authored
Mar 18, 2015
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_web: Also trigger submit.
parent
817c0456
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
23 deletions
+30
-23
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.xml
...lateItem/web_page_module/rjs_slapos_parameter_form_js.xml
+23
-13
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_request_form_js.xml
...mplateItem/web_page_module/rjs_slapos_request_form_js.xml
+7
-10
No files found.
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.xml
View file @
7270b9ba
...
...
@@ -104,7 +104,7 @@
/*jslint nomen: true, maxlen: 200, indent: 2*/\n
/*global rJS, console, window, document, loopEventListener, $, XMLSerializer, jQuery, URI, vkbeautify */\n
\n
(function (window, document, rJS, loopEventListener, $, XMLSerializer, jQuery,
URI,
vkbeautify) {\n
(function (window, document, rJS, loopEventListener, $, XMLSerializer, jQuery, vkbeautify) {\n
"use strict";\n
\n
var gk = rJS(window);\n
...
...
@@ -197,6 +197,10 @@
function validateForm(gadget, json_url) {\n
return gadget.processValidation(json_url);\n
}\n
\n
function submitForm(gadget, json_url) {\n
return gadget.processValidation(json_url);\n
}\n
\n
//function getSoftwareTypeFromForm(element) {\n
// var software_type;\n
...
...
@@ -299,7 +303,9 @@
input,\n
div_input,\n
span_error,\n
promise_list = [],\n
span_info,\n
fieldset_list = g.props.element.querySelectorAll(\'fieldset\'),\n
fieldset = document.createElement("fieldset"),\n
fieldset_optional = document.createElement("fieldset");\n
\n
...
...
@@ -333,21 +339,25 @@
} else {\n
fieldset.appendChild(div);\n
}\n
loopEventListener(\n
promise_list.push(
loopEventListener(\n
input,\n
\'change\',\n
false,\n
validateForm.bind(g, g, json_url)\n
);\n
));\n
promise_list.push(loopEventListener(\n
input,\n
\'submit\',\n
false,\n
submitForm.bind(g, g, json_url)\n
));\n
}\n
}\n
return [fieldset, fieldset_optional];\n
}).push(function (new_fieldset_list) {\n
var fieldset_list = g.props.element.querySelectorAll(\'fieldset\');\n
\n
$(fieldset_list[1]).replaceWith(new_fieldset_list[0]);\n
$(fieldset_list[2]).replaceWith(new_fieldset_list[1]);\n
return fieldset_list;\n
$(fieldset_list[1]).replaceWith(fieldset);\n
$(fieldset_list[2]).replaceWith(fieldset_optional);\n
return RSVP.all(promise_list);\n
}).push(function () {\n
console.log("LOADED All Promises")\n
});\n
})\n
\n
...
...
@@ -477,7 +487,7 @@
});\n
});\n
\n
}(window, document, rJS, loopEventListener, $, XMLSerializer, jQuery,
URI,
vkbeautify));
}(window, document, rJS, loopEventListener, $, XMLSerializer, jQuery, vkbeautify));
]]>
</string>
</value>
</item>
...
...
@@ -614,7 +624,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
941.4
6904.21655.48418
</string>
</value>
<value>
<string>
941.4
7120.44131.43212
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -632,7 +642,7 @@
</tuple>
<state>
<tuple>
<float>
1426
596317.01
</float>
<float>
1426
618698.56
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_request_form_js.xml
View file @
7270b9ba
...
...
@@ -108,11 +108,8 @@
json_url = "sample_schema.json";\n
\n
gk.declareMethod(\'render\', function (options) {\n
//if (options.parameter.software_release_url === undefined) {\n
// throw new Error("undefined software_release_url");\n
//}\n
var g = this,\n
element = g.__element.getElementsByTagName(\'form\')[0];\n
\n
var g = this;\n
\n
options.json_url = "../../renderjs/slapos_load_schema_software_type.json";\n
options.parameter = {};\n
...
...
@@ -136,11 +133,11 @@
\n
return g.getDeclaredGadget(\'parameter\')\n
.push(function (gadget) {\n
return gadget.render(options);\n
return gadget.render(options).push(function () {\n
console.log("FINISH TO LOADED");\n
});\n
});\n
\n
});\n
console.log("LOADED");\n
\n
}(window, rJS, $, loopEventListener));
</string>
</value>
</item>
...
...
@@ -277,7 +274,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
941.4
2676.28317.52480
</string>
</value>
<value>
<string>
941.4
7267.50185.4608
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -295,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>
1426
343134.63
</float>
<float>
1426
617885.75
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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