Commit 5dcf3bc7 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Use domsugar instead of DOM API

also, fix indentation
parent f46c50ec
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="domsugar.js"></script>
<script src="jiodev.js" type="text/javascript"></script> <script src="jiodev.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
...@@ -16,12 +17,12 @@ ...@@ -16,12 +17,12 @@
</head> </head>
<body> <body>
<div class="ui-input-text"> <div class="ui-input-text">
<div class="search_parsed_value"></div> <div class="search_parsed_value"></div>
<div data-gadget-url="gadget_html5_input.html" <div data-gadget-url="gadget_html5_input.html"
data-gadget-scope="input" data-gadget-scope="input"
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
<button class="search_button ui-btn-icon-notext ui-icon-search" type="submit" /> <button class="search_button ui-btn-icon-notext ui-icon-search" type="submit" />
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.15561.39912.10990</string> </value> <value> <string>997.39354.39569.61815</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1537193726.71</float> <float>1642544018.82</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, document, Node, /*global window, rJS, document, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query*/ QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar*/
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, document, Node, (function (window, rJS, document, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query) { QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar) {
"use strict"; "use strict";
function convertQueryToSearchText(query) { function convertQueryToSearchText(query) {
...@@ -114,15 +114,17 @@ ...@@ -114,15 +114,17 @@
button_container.innerHTML = ''; button_container.innerHTML = '';
len = query_text_list.length; len = query_text_list.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
button = document.createElement('button'); button_container.appendChild(
button.textContent = query_text_list[i]; domsugar("button", {
button.value = i; "text": query_text_list[i],
button_container.appendChild(button); "value": i
})
);
} }
button = document.createElement('input'); button_container.appendChild(domsugar("input", {
button.setAttribute("type", "hidden"); "type": "hidden",
button.value = parsed_value; "value": parsed_value
button_container.appendChild(button); }));
return gadget.getDeclaredGadget('input') return gadget.getDeclaredGadget('input')
.push(function (input_gadget) { .push(function (input_gadget) {
...@@ -235,4 +237,4 @@ ...@@ -235,4 +237,4 @@
}, false, false); }, false, false);
}(window, rJS, document, Node, }(window, rJS, document, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query)); QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.27464.21813.55483</string> </value> <value> <string>997.39359.32235.40874</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1604428536.71</float> <float>1642544051.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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