Commit ae82df7e authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_web_renderjs_ui: Translate the content of the Maximize button

Notably showned as a companion of the editor gadget
parent afb0a546
......@@ -335,6 +335,9 @@
scope: 'maximize',
element: div_max,
sandbox: 'public'
})
.push(function (button_maximize_gadget) {
return button_maximize_gadget.render();
});
})
.declareMethod('getContent', function getContent() {
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.27442.40137.15394</string> </value>
<value> <string>1017.65217.22701.26760</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1688063552.11</float>
<float>1726209635.9</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -6,15 +6,19 @@
<title>ERP5 Button Maximize</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_maximize_button.html">
<!--
data-i18n=Maximize
-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js"></script>
<!-- custom script -->
<script src="gadget_button_maximize.js" type="text/javascript"></script>
</head>
<body>
<button class="ui-icon-expand ui-btn-icon-notext" type="button">Maximize</button>
</body>
</html>
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.5552.51560.44322</string> </value>
<value> <string>1019.49777.15867.23517</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1536322858.1</float>
<float>1728437604.68</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS */
/*global window, rJS, domsugar */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS) {
(function (window, rJS, domsugar) {
"use strict";
rJS(window)
.declareAcquiredMethod('triggerMaximize', 'triggerMaximize')
.declareAcquiredMethod("translate", "translate")
.declareMethod('render', function () {
var gadget = this;
return gadget.changeState({'init': true});
})
.onStateChange(function (modification_dict) {
var gadget = this;
return gadget.translate("Maximize")
.push(function (translation) {
return gadget.element.appendChild(domsugar("button", {
"class": "ui-icon-expand ui-btn-icon-notext",
"type": "button",
"text": translation
}));
});
})
.onEvent('click', function (event) {
if (event.target.tagName === "BUTTON") {
......@@ -15,4 +33,4 @@
return this.triggerMaximize(true);
});
}(window, rJS));
\ No newline at end of file
}(window, rJS, domsugar));
\ No newline at end of file
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.17156.6548.44731</string> </value>
<value> <string>1019.59406.56317.53077</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1687447620.32</float>
<float>1728611478.5</float>
<string>UTC</string>
</tuple>
</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