Commit 6963546e authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Preference page: simplify code

parent 745e3643
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_preference.js" type="text/javascript"></script> <script src="gadget_erp5_page_preference.js" type="text/javascript"></script>
</head> </head>
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.23807.13030.34833</string> </value> <value> <string>954.45675.44850.53452</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>1452177084.33</float> <float>1476958219.29</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, document, rJS, RSVP, promiseEventListener */ /*global window, rJS */
/*jslint indent: 2, maxerr: 3 */ /*jslint indent: 2, maxerr: 3 */
(function (window, rJS) { (function (window, rJS) {
"use strict"; "use strict";
rJS(window) rJS(window)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.ready(function (g) {
g.props = {};
})
// Assign the element to a variable
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// handle acquisition // handle acquisition
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
...@@ -49,16 +33,16 @@ ...@@ -49,16 +33,16 @@
select_list: ['title'] select_list: ['title']
}) })
.push(function (result) { .push(function (result) {
gadget.props.element.textContent = result.data.rows[0].value.title; gadget.element.textContent = result.data.rows[0].value.title;
}); });
} }
// gadget.props.element.textContent = me; // gadget.props.element.textContent = me;
}) })
.push(function () { .push(function () {
return gadget.translateHtml(gadget.props.element.innerHTML); return gadget.translateHtml(gadget.element.innerHTML);
}) })
.push(function (my_translated_html) { .push(function (my_translated_html) {
gadget.props.element.innerHTML = my_translated_html; gadget.element.innerHTML = my_translated_html;
}); });
}); });
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.20265.22771.11229</string> </value> <value> <string>954.47266.11723.40516</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1452177225.9</float> <float>1476958263.79</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