Commit 54a2b715 authored by Roque's avatar Roque

erp5_officejs: naming convention and refactoring

parent 084b4bdc
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TextEditor_WebPageModule_viewWebPageListAsJio</string> </value>
<value> <string>string:${object_url}/WebPageModule_viewWebPageListAsJioForTextEditor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -75,7 +75,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TextEditor_cloneDocument</string> </value>
<value> <string>string:${object_url}/Base_cloneDocumentForTextEditor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -75,7 +75,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TextEditor_WebPage_viewAsTextDocument</string> </value>
<value> <string>string:${object_url}/WebPage_viewAsTextDocumentForTextEditor</string> </value>
</item>
</dictionary>
</pickle>
......
/*global window, rJS*/
/*global window, rJS, RSVP, Event, XMLHttpRequest*/
/*jslint nomen: true, maxlen:80, indent:2*/
(function (window, rJS) {
(function (window, rJS, RSVP, Event, XMLHttpRequest) {
"use strict";
function displayErrorContent(gadget, original_error) {
function displayErrorContent(original_error) {
var error_list = [original_error],
i,
error,
error_text = "";
// Do not break the application in case of errors.
// Display it to the user for now,
// and allow user to go back to the frontpage
// Add error handling stack
error_list.push(new Error('stopping ERP5JS'));
for (i = 0; i < error_list.length; i += 1) {
error = error_list[i];
if (error instanceof Event) {
......@@ -48,10 +41,8 @@
} catch (ignore) {
}
}
error_text += error.message || error;
error_text += '\n';
if (error.fileName !== undefined) {
error_text += 'File: ' +
error.fileName +
......@@ -62,30 +53,14 @@
}
error_text += '---\n';
}
console.error(original_error);
if (original_error instanceof Error) {
console.error(original_error.stack);
}
console.log("generated error_text:");
console.log(error_text);
return error_text;
/*if (gadget.props === undefined) {
// Gadget has not yet been correctly initialized
throw error;
}
return gadget.changeState({
error_text: error_text,
url: undefined
});*/
}
function displayError(gadget, error) {
function displayError(error) {
if (error instanceof RSVP.CancellationError) {
return "RSVP cancelation error";
}
return displayErrorContent(gadget, error);
return displayErrorContent(error);
}
rJS(window)
......@@ -93,9 +68,8 @@
return this.changeState(options);
})
.onStateChange(function (modification_dict) {
var skip_link, error_div, app_name_div, message,
var skip_link, error_div, app_name_div, message, error_text,
gadget = this;
if (modification_dict.app_name) {
app_name_div = gadget.element.querySelector(".app-name");
app_name_div.textContent = gadget.state.app_name +
......@@ -108,10 +82,7 @@
if (modification_dict.error) {
error_div = gadget.element.querySelector(".error-message");
message = "Last Error: ";
console.log("CALLING DISPLAY ERROR...");
var error_text = displayError(gadget, gadget.state.error);
error_text = displayError(gadget.state.error);
if (gadget.state.error.message) {
message += gadget.state.error.message;
} else {
......@@ -123,7 +94,7 @@
} else {
message += " " + modification_dict.error;
}
message += " - ERROR TEXT: " + error_text;
message += " - FULL ERROR: " + error_text;
error_div.textContent = message;
}
if (modification_dict.redirect_url) {
......@@ -131,5 +102,4 @@
skip_link.setAttribute('href', gadget.state.redirect_url);
}
});
}(window, rJS));
\ No newline at end of file
}(window, rJS, RSVP, Event, XMLHttpRequest));
\ No newline at end of file
......@@ -263,14 +263,14 @@ hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX3Z
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_clone)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX2Nsb25l\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_viewNewContentDialog)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl92aWV3TmV3Q29udGVudERpYWxvZw==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_WebPageModule_viewWebPageListAsJio)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9XZWJQYWdlTW9kdWxlX3ZpZXdXZWJQYWdlTGlzdEFzSmlv\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_WebPage_viewAsTextDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9XZWJQYWdlX3ZpZXdBc1RleHREb2N1bWVudA==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_cloneDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9jbG9uZURvY3VtZW50\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV92aWV3TmV3Q29udGVudERpYWxvZ0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPageModule_viewWebPageListAsJioForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPage_viewAsTextDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_cloneDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV9jbG9uZURvY3VtZW50Rm9yVGV4dEVkaXRvcg==\n
\n
\n
#Ckeditor\n
......@@ -753,7 +753,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.40767.37177.30208</string> </value>
<value> <string>977.40995.25945.24064</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -771,7 +771,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1565293643.74</float>
<float>1565341519.15</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -124,14 +124,14 @@ hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX3Z
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_clone)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX2Nsb25l\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_viewNewContentDialog)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl92aWV3TmV3Q29udGVudERpYWxvZw==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_WebPageModule_viewWebPageListAsJio)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9XZWJQYWdlTW9kdWxlX3ZpZXdXZWJQYWdlTGlzdEFzSmlv\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_WebPage_viewAsTextDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9XZWJQYWdlX3ZpZXdBc1RleHREb2N1bWVudA==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/TextEditor_cloneDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvVGV4dEVkaXRvcl9jbG9uZURvY3VtZW50\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV92aWV3TmV3Q29udGVudERpYWxvZ0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPageModule_viewWebPageListAsJioForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPage_viewAsTextDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_cloneDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV9jbG9uZURvY3VtZW50Rm9yVGV4dEVkaXRvcg==\n
\n
\n
NETWORK:\n
......@@ -276,7 +276,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.40657.33169.36983</string> </value>
<value> <string>977.41790.42136.10513</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -294,7 +294,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1565279996.03</float>
<float>1565341511.13</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -22,8 +22,8 @@
<script data-renderjs-configuration="hide_listbox_buttons" type="text/x-renderjs-configuration">1</script>
<script data-renderjs-configuration="documents_editable" type="text/x-renderjs-configuration">1</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_text_editor</script>
<!-- TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialog. For now it's in new_content_action -->
<script data-renderjs-configuration="new_content_action" type="text/x-renderjs-configuration">portal_skins/erp5_text_editor/TextEditor_viewNewContentDialog</script>
<!-- TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialogForTextEditor. For now it's in new_content_action -->
<script data-renderjs-configuration="new_content_action" type="text/x-renderjs-configuration">portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">text_editor_view</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Web Page | text_editor_view', 'Web Page | text_editor_clone')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Web Page Module | Web Page',)</script>
......
......@@ -524,7 +524,9 @@
</item>
<item>
<key> <string>configuration_wallpaper_url</string> </key>
<value> <string>officejs_logo_text_editor.png</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_webapp_manifest_url</string> </key>
......@@ -789,7 +791,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.37715.19028.59613</string> </value>
<value> <string>977.37757.10944.9710</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -807,7 +809,7 @@
</tuple>
<state>
<tuple>
<float>1565099350.01</float>
<float>1565295153.9</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -122,15 +122,15 @@
</item>
<item>
<key> <string>container_layout</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
<value> <string>StaticWebSite_getRedirectSourceUrlForOfficeJSApplication</string> </value>
</item>
<item>
<key> <string>content_layout</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
<value> <string>StaticWebSite_getRedirectSourceUrlForOfficeJSApplication</string> </value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
<value> <string>StaticWebSite_getRedirectSourceUrlForOfficeJSApplication</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -331,7 +331,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.37527.25553.57105</string> </value>
<value> <string>977.37785.31847.31180</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -349,7 +349,7 @@
</tuple>
<state>
<tuple>
<float>1565101049.15</float>
<float>1565341627.79</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -87,7 +87,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TextEditor_cloneDocument</string> </value>
<value> <string>Base_cloneDocumentForTextEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -80,7 +80,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TextEditor_viewNewContentDialog</string> </value>
<value> <string>Base_viewNewContentDialogForTextEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
<value> <string>StaticWebSite_getRedirectSourceUrlForOfficeJSApplication</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -91,7 +91,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TextEditor_WebPageModule_viewWebPageListAsJio</string> </value>
<value> <string>WebPageModule_viewWebPageListAsJioForTextEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -96,7 +96,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TextEditor_WebPage_viewAsTextDocument</string> </value>
<value> <string>WebPage_viewAsTextDocumentForTextEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
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