Commit 924411f0 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs][erp5_officejs_ui_test] Add maximize in text editor

/reviewed-on !544
parent a5aec50a
......@@ -21,8 +21,7 @@
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0
doc: options.doc
});
})
......@@ -51,7 +50,6 @@
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
var editable = gadget.state.editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -61,9 +59,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -72,9 +70,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -83,9 +81,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -94,9 +92,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -105,21 +103,22 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"css_class": editable === 1 ? "content-iframe-maximize" : "",
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable === 1 ? "GadgetField" : "EditorField",
"url": "../officejs_ckeditor_gadget/app/",
"sandbox": "iframe"
"renderjs_extra": '{"editor": "fck_editor", "maximize": true}',
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public"
}
}},
"_links": {
......@@ -144,22 +143,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
save_action: true,
selection_url: url_list[0],
save_action: true
};
if (!gadget.state.editable) {
header_dict.previous_url = url_list[1];
header_dict.next_url = url_list[2];
header_dict.edit_content = url_list[3];
}
return gadget.updateHeader(header_dict);
previous_url: url_list[1],
next_url: url_list[2]
});
});
});
}(window, rJS, RSVP));
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.37368.2625.44083</string> </value>
<value> <string>964.45581.43675.37307</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1507276723.18</float>
<float>1515490519.85</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,7 +10,7 @@
"Text Editor": {
"url": "officejs_text_editor/",
"cache": "gadget_officejs_text_editor.appcache",
"sub_gadget": ["officejs_ckeditor_gadget", "officejs_setting_gadget"]
"sub_gadget": ["officejs_setting_gadget"]
},
"Illustration Editor": {
"url": "officejs_svg_editor/",
......
......@@ -254,7 +254,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.47833.26373.64597</string> </value>
<value> <string>964.45862.32132.53930</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -272,7 +272,7 @@
</tuple>
<state>
<tuple>
<float>1511961491.29</float>
<float>1515504420.29</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -391,7 +391,9 @@
</item>
<item>
<key> <string>configuration_stylesheet_url</string> </key>
<value> <string>gadget_officejs_nojqm.css</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_translation_gadget_url</string> </key>
......@@ -650,7 +652,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -664,7 +666,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.16277.24517.44253</string> </value>
<value> <string>964.45575.40638.63488</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -682,7 +684,7 @@
</tuple>
<state>
<tuple>
<float>1504529296.63</float>
<float>1515487277.43</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -57,7 +57,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
......@@ -88,37 +88,37 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
......@@ -236,16 +236,6 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=cke_1_contents</td>
......
......@@ -77,16 +77,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=title</td>
......@@ -153,16 +143,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>search</td>
......
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