Commit ad05877c authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: support text editor for OOoDocuments

parent 178bf5c9
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jio_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1000.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_viewAsJio</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ooeditor</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
Please register or sign in to reply
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Online Edit</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_edit</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -119,8 +119,6 @@
function saveContent(gadget, submit_event) {\n
var i,\n
doc = gadget.options.doc;\n
doc.parent_relative_url = "document_module";\n
doc.portal_type = "Spreadsheet";\n
doc.modification_date = (new Date()).toISOString();\n
for (i = 0; i < submit_event.target.length; i += 1) {\n
// XXX Should check input type instead\n
......@@ -137,8 +135,6 @@
})\n
.push(function (data) {\n
doc.data = data.text_content;\n
doc.content_type = "application/yformat.xlsy";\n
doc.filename = doc.title + ".xlsy";\n
return gadget.put(gadget.options.jio_key, doc);\n
});\n
}\n
......@@ -270,9 +266,10 @@
.push(function (html) {\n
gadget.props.element.innerHTML = html;\n
return gadget.updateHeader({\n
page_title: options.doc.title + " | Spreadsheet",\n
back_url: "#page=spreadsheet_list",\n
panel_action: false,\n
page_title: options.doc.title + " | " + options.doc.portal_type,\n
back_url: "#page=" +\n
options.doc.portal_type.toLowerCase() + "_list",\n
panel_action: false\n
// breadcrumb_url: all_result[4],\n
//save_action: true\n
});\n
......@@ -314,7 +311,8 @@
switchFullscreenMode(gadget);\n
return text_content_gadget.render({\n
"key": \'text_content\',\n
"value": gadget.options.doc.data\n
"value": gadget.options.doc.data,\n
"portal_type": gadget.options.doc.portal_type\n
});\n
})\n
.push(function () {\n
......@@ -483,7 +481,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.30190.10718.55688</string> </value>
<value> <string>947.62818.19237.36403</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -501,7 +499,7 @@
</tuple>
<state>
<tuple>
<float>1448926957.73</float>
<float>1450798287.45</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -153,7 +153,9 @@
var doc = {\n
// XXX Hardcoded\n
parent_relative_url: "document_module",\n
portal_type: "Spreadsheet"\n
portal_type: "Spreadsheet",\n
content_type: "application/yformat.xlsy",\n
filename: ".xlsy"\n
};\n
return gadget.post(doc);\n
})\n
......@@ -303,7 +305,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.29411.814.31044</string> </value>
<value> <string>947.32437.7934.22340</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -321,7 +323,7 @@
</tuple>
<state>
<tuple>
<float>1448975347.22</float>
<float>1450783518.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -116,7 +116,7 @@
type: "replicate",\n
// XXX This drop the signature lists...\n
query: {\n
query: \'portal_type: ( "Web Page", "Spreadsheet" ) \'\n
query: \'portal_type: ( "Web Page", "Spreadsheet", "Text" ) \'\n
// XX Synchonizing the whole module is too much, here is a way to start quietly\n
// Supsended until modification_date is handled for synchronization\n
+ \' AND modification_date:>="\'\n
......@@ -382,7 +382,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.29694.37023.57634</string> </value>
<value> <string>947.30152.42918.48418</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -400,7 +400,7 @@
</tuple>
<state>
<tuple>
<float>1448924679.21</float>
<float>1450730073.08</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -125,7 +125,7 @@
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
\n
<script type="text/javascript" src="ooffice/vendor/underscore/underscore.js"></script>\n
<script type="text/javascript" src="ooffice/vendor/underscore/underscore-min.js"></script>\n
<script type="text/javascript" src="ooffice/apps/api/documents/api.js"></script>\n
<script src="gadget_ooffice.js" type="text/javascript"></script>\n
\n
......@@ -173,6 +173,18 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>ung_document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -232,4 +244,116 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.29411.54037.32699</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450885798.7</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>bk</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1448880229.4</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -367,7 +367,13 @@
placehodler_obj = document.getElementById(placehodler),\n
save_button = document.querySelector("button[name=\'Base_edit:method\']"),\n
height,\n
onBack;\n
onBack,\n
documentType,\n
magic_to_format_map = {\n
\'DOCY;\' : \'text\',\n
\'XLSY;\' : \'spreadsheet\',\n
\'PPTY;\' : \'presentation\'\n
};\n
if (save_button) {\n
this.props.erp5_mode = true;\n
save_button.hidden = true;\n
......@@ -379,8 +385,12 @@
this.fullscreen();\n
}, this);\n
}\n
console.log(options);\n
if (options.value === \'undefined\') { options.value = \'\'; }\n
if (options.value === undefined) {\n
options.value = \'\';\n
documentType = options.portal_type;\n
} else {\n
documentType = magic_to_format_map[options.value.substring(0, 5)];\n
}\n
this.props.docEditor = new DocsAPI.DocEditor(placehodler, {\n
//type: urlParams[\'type\'],\n
width: \'100%\',\n
......@@ -400,6 +410,7 @@
reader: true\n
}\n
},\n
documentType: documentType,\n
editorConfig: this.props.cfg,\n
events: {\n
\'onReady\': onDocEditorReady,\n
......@@ -486,6 +497,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -545,4 +562,63 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.64367.38968.33962</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450904842.41</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>__before_publishing_traverse__</string> </key>
<value>
<object>
<klass>
<global name="MultiHook" module="ZPublisher.BeforeTraverse"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_defined_in_class</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_hookname</string> </key>
<value> <string>__before_publishing_traverse__</string> </value>
</item>
<item>
<key> <string>_list</string> </key>
<value>
<list>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</list>
</value>
</item>
<item>
<key> <string>_prior</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>__before_traverse__</string> </key>
<value>
<dictionary>
<item>
<key>
<tuple>
<int>99</int>
<string>ERP5 Web Section/rjsunsafe</string>
</tuple>
</key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>empty_criterion_valid</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjsunsafe</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>RJSUnsafe</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RJS Unsafe</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Spreadsheet | jio_view
Spreadsheet | ooeditor
Text | jio_view
Text | ooeditor
Web Illustration | jio_view
Web Page | jio_view
\ No newline at end of file
......@@ -4,5 +4,7 @@ web_page_module/gadget_ooffice_*
web_page_module/officejs_launcher_*
web_site_module/officejs_spreadsheet
web_site_module/officejs_spreadsheet/**
web_site_module/officejs_text
web_site_module/officejs_text/**
web_site_module/officejs_text_editor
web_site_module/officejs_text_editor/**
\ No newline at end of file
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