Commit af007eef authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: spreadsheet_editor improvements

add forgeten jio_view action for Spreadsheet portal_type
add action for online edit in old erp5_UI
add fullscreen mode
parent d8e6e6a4
<?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>
</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>
...@@ -114,6 +114,8 @@ ...@@ -114,6 +114,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n
\n \n
<title>OfficeJS Jio Web Page View</title>\n <title>OfficeJS Jio Web Page View</title>\n
\n
<link rel="stylesheet" href="gadget_erp5.css">\n
\n \n
<script src="rsvp.js"></script>\n <script src="rsvp.js"></script>\n
<script src="renderjs.js"></script>\n <script src="renderjs.js"></script>\n
...@@ -321,7 +323,7 @@ ...@@ -321,7 +323,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.16435.61501.22323</string> </value> <value> <string>947.29816.43224.59067</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -339,7 +341,7 @@ ...@@ -339,7 +341,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1444332775.99</float> <float>1448904565.7</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -111,20 +111,17 @@ ...@@ -111,20 +111,17 @@
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console*/\n /*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document*/\n
/*jslint indent: 2, nomen: true, maxlen: 80*/\n /*jslint indent: 2, nomen: true, maxlen: 80*/\n
(function (window, RSVP, rJS, Handlebars, loopEventListener) {\n (function (window, RSVP, rJS, Handlebars, loopEventListener) {\n
"use strict";\n "use strict";\n
\n \n
function saveContent(gadget, submit_event) {\n function saveContent(gadget, submit_event) {\n
var i,\n var i,\n
doc = gadget.options.doc,\n doc = gadget.options.doc;\n
today = new Date();\n
doc.parent_relative_url = "document_module";\n doc.parent_relative_url = "document_module";\n
doc.portal_type = "Spreadsheet";\n doc.portal_type = "Spreadsheet";\n
doc.modification_date = today.getDate()\n doc.modification_date = (new Date()).toISOString();\n
+ \'/\' + (today.getMonth() + 1)\n
+ \'/\' + today.getFullYear();\n
for (i = 0; i < submit_event.target.length; i += 1) {\n for (i = 0; i < submit_event.target.length; i += 1) {\n
// XXX Should check input type instead\n // XXX Should check input type instead\n
if (submit_event.target[i].name) {\n if (submit_event.target[i].name) {\n
...@@ -140,8 +137,8 @@ ...@@ -140,8 +137,8 @@
})\n })\n
.push(function (data) {\n .push(function (data) {\n
doc.data = data.text_content;\n doc.data = data.text_content;\n
doc.content_type = "application/yformat.xlsy"\n doc.content_type = "application/yformat.xlsy";\n
doc.filename = doc.title + ".xlsy"\n doc.filename = doc.title + ".xlsy";\n
return gadget.put(gadget.options.jio_key, doc);\n return gadget.put(gadget.options.jio_key, doc);\n
});\n });\n
}\n }\n
...@@ -163,6 +160,46 @@ ...@@ -163,6 +160,46 @@
iframe.setAttribute(\'class\', iframe_class_string);\n iframe.setAttribute(\'class\', iframe_class_string);\n
return;\n return;\n
}\n }\n
\n
function getMaxHeight(wrap_obj) {\n
var height;\n
if (wrap_obj) {\n
height = window.innerHeight - wrap_obj.offsetTop;\n
} else {\n
height = window.innerHeight;\n
}\n
if (height < 400) {\n
height = 400;\n
}\n
return height + "px";\n
}\n
\n
function switchFullscreenMode(gadget) {\n
var fullscreen_classname = "ui-content-fullscreen",\n
wrap = gadget.props.element.querySelector(\'iframe\'),\n
info = gadget.props.fullScreenRestore;\n
if (wrap.className.search(" " + fullscreen_classname) === -1) {\n
gadget.props.fullScreenRestore = {\n
scrollTop: window.pageYOffset,\n
scrollLeft: window.pageXOffset,\n
width: wrap.style.width,\n
height: wrap.style.height\n
};\n
\n
wrap.style.width = "100%";\n
wrap.style.height = getMaxHeight();\n
// wrap.style.height = "auto";\n
wrap.className += " " + fullscreen_classname;\n
document.documentElement.style.overflow = "hidden";\n
} else {\n
wrap.className = wrap.className\n
.replace(new RegExp("\\\\s*" + fullscreen_classname + "\\\\b"), "");\n
document.documentElement.style.overflow = "";\n
wrap.style.width = info.width;\n
wrap.style.height = getMaxHeight(wrap);\n
window.scrollTo(info.scrollLeft, info.scrollTop);\n
}\n
}\n
\n \n
var gadget_klass = rJS(window),\n var gadget_klass = rJS(window),\n
source = gadget_klass.__template_element\n source = gadget_klass.__template_element\n
...@@ -183,7 +220,7 @@ ...@@ -183,7 +220,7 @@
})\n })\n
\n \n
.declareAcquiredMethod("updateHeader", "updateHeader")\n .declareAcquiredMethod("updateHeader", "updateHeader")\n
.declareAcquiredMethod("get", "jio_get")\n .declareAcquiredMethod("jio_get", "jio_get")\n
.declareAcquiredMethod("translateHtml", "translateHtml")\n .declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("put", "jio_put")\n .declareAcquiredMethod("put", "jio_put")\n
.declareAcquiredMethod(\'allDocs\', \'jio_allDocs\')\n .declareAcquiredMethod(\'allDocs\', \'jio_allDocs\')\n
...@@ -199,6 +236,17 @@ ...@@ -199,6 +236,17 @@
console.log(e);\n console.log(e);\n
});\n });\n
})\n })\n
\n
.allowPublicAcquisition(\'triggerFullscreen\', function () {\n
var gadget = this;\n
return RSVP.Queue()\n
.push(function () {\n
return switchFullscreenMode(gadget);\n
})\n
.fail(function (e) {\n
console.log(e);\n
});\n
})\n
\n \n
.allowPublicAcquisition(\'triggerSubmit\', function () {\n .allowPublicAcquisition(\'triggerSubmit\', function () {\n
return this.props.element.querySelector(\'button\').click();\n return this.props.element.querySelector(\'button\').click();\n
...@@ -211,22 +259,27 @@ ...@@ -211,22 +259,27 @@
.declareMethod("render", function (options) {\n .declareMethod("render", function (options) {\n
var gadget = this;\n var gadget = this;\n
gadget.options = options;\n gadget.options = options;\n
gadget.options.doc.title = gadget.options.doc.title || "";\n return gadget.jio_get(options.jio_key)\n
return new RSVP.Queue()\n .push(function (doc) {\n
.push(function () {\n gadget.options.doc = doc;\n
return gadget.translateHtml(template(options.doc));\n gadget.options.doc.title = gadget.options.doc.title || "";\n
})\n return new RSVP.Queue()\n
.push(function (html) {\n .push(function () {\n
gadget.props.element.innerHTML = html;\n return gadget.translateHtml(template(options.doc));\n
return gadget.updateHeader({\n })\n
title: options.doc.title + " | Spreadsheet",\n .push(function (html) {\n
back_url: "#page=spreadsheet_list",\n gadget.props.element.innerHTML = html;\n
panel_action: false,\n return gadget.updateHeader({\n
save_action: true\n page_title: options.doc.title + " | Spreadsheet",\n
});\n back_url: "#page=spreadsheet_list",\n
})\n panel_action: false,\n
.push(function () {\n // breadcrumb_url: all_result[4],\n
return gadget.props.deferred.resolve();\n //save_action: true\n
});\n
})\n
.push(function () {\n
return gadget.props.deferred.resolve();\n
});\n
});\n });\n
})\n })\n
\n \n
...@@ -255,9 +308,10 @@ ...@@ -255,9 +308,10 @@
var iframe = gadget.props.element.querySelector(\'iframe\');\n var iframe = gadget.props.element.querySelector(\'iframe\');\n
iframe.setAttribute(\n iframe.setAttribute(\n
\'style\',\n \'style\',\n
\'width:100%; border: 0 none; height: 600px\'\n \'width:100%; border: 0 none; height: \' + getMaxHeight(iframe)\n
);\n );\n
text_gadget = text_content_gadget;\n text_gadget = text_content_gadget;\n
switchFullscreenMode(gadget);\n
return text_content_gadget.render({\n return text_content_gadget.render({\n
"key": \'text_content\',\n "key": \'text_content\',\n
"value": gadget.options.doc.data\n "value": gadget.options.doc.data\n
...@@ -415,7 +469,7 @@ ...@@ -415,7 +469,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>bk</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -429,7 +483,7 @@ ...@@ -429,7 +483,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.37161.13138.58606</string> </value> <value> <string>947.30190.10718.55688</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -447,7 +501,7 @@ ...@@ -447,7 +501,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1445415095.01</float> <float>1448926957.73</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.15138.45828.46455</string> </value> <value> <string>947.29411.814.31044</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1448023868.36</float> <float>1448975347.22</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
type: "replicate",\n type: "replicate",\n
// XXX This drop the signature lists...\n // XXX This drop the signature lists...\n
query: {\n query: {\n
query: \'portal_type:"Web Page" \'\n query: \'portal_type: ( "Web Page", "Spreadsheet" ) \'\n
// XX Synchonizing the whole module is too much, here is a way to start quietly\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 // Supsended until modification_date is handled for synchronization\n
+ \' AND modification_date:>="\'\n + \' AND modification_date:>="\'\n
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.12629.17894.55808</string> </value> <value> <string>947.29694.37023.57634</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -400,7 +400,7 @@ ...@@ -400,7 +400,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1447936126.33</float> <float>1448924679.21</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -120,13 +120,11 @@ ...@@ -120,13 +120,11 @@
<head>\n <head>\n
<meta charset="utf-8">\n <meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>CKEditor Gadget</title>\n <title>OOffice Gadget</title>\n
\n \n
<script src="rsvp.js" type="text/javascript"></script>\n <script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n <script src="renderjs.js" type="text/javascript"></script>\n
\n \n
\n
<!--<script src="ckeditor/ckeditor.js"></script>-->\n
<script type="text/javascript" src="ooffice/vendor/underscore/underscore.js"></script>\n <script type="text/javascript" src="ooffice/vendor/underscore/underscore.js"></script>\n
<script type="text/javascript" src="ooffice/apps/api/documents/api.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 <script src="gadget_ooffice.js" type="text/javascript"></script>\n
......
...@@ -113,7 +113,9 @@ ...@@ -113,7 +113,9 @@
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, DocsAPI, _*/\n <value> <string encoding="cdata"><![CDATA[
/*global window, rJS, DocsAPI, _, console, document*/\n
/*jslint nomen: true, maxlen:80, indent:2*/\n /*jslint nomen: true, maxlen:80, indent:2*/\n
(function (rJS, DocsAPI, _) {\n (function (rJS, DocsAPI, _) {\n
"use strict";\n "use strict";\n
...@@ -221,17 +223,54 @@ ...@@ -221,17 +223,54 @@
console.log(\'Ready! Editor: \', event.target);\n console.log(\'Ready! Editor: \', event.target);\n
}\n }\n
}\n }\n
\n
function onDocumentStateChange(event) {\n
var isModified = event.data;\n
console.log(isModified);\n
}\n
\n \n
function onError(event) {\n function onError(event) {\n
console.log(event.data);\n console.log(event.data);\n
// critical error happened\n // critical error happened\n
// examine event.data.errorCode and event.data.errorDescription for details\n // examine event.data.errorCode and event.data.errorDescription for details\n
}\n }\n
\n
function getMaxHeight(wrap_obj) {\n
var height;\n
if (wrap_obj) {\n
height = window.innerHeight - wrap_obj.offsetTop - 280;\n
} else {\n
height = window.innerHeight;\n
}\n
if (height < 400) {\n
height = 400;\n
}\n
return height + "px";\n
}\n
\n
function switchFullscreenMode(gadget) {\n
return function (event) {\n
var fullscreen_classname = "ui-content-fullscreen",\n
info,\n
wrap = gadget.props.element.querySelector(\'iframe\');\n
if (wrap.className.search(" " + fullscreen_classname) === -1) {\n
gadget.props.fullScreenRestore = {\n
scrollTop: window.pageYOffset,\n
scrollLeft: window.pageXOffset,\n
width: wrap.width,\n
height: wrap.height\n
};\n
\n
wrap.style.width = "100%";\n
wrap.style.height = getMaxHeight();\n
wrap.className += " " + fullscreen_classname;\n
document.documentElement.style.overflow = "hidden";\n
} else {\n
wrap.className = wrap.className\n
.replace(new RegExp("\\\\s*" + fullscreen_classname + "\\\\b"), "");\n
document.documentElement.style.overflow = "";\n
info = gadget.props.fullScreenRestore;\n
wrap.style.width = info.width;\n
wrap.style.height = getMaxHeight(wrap);\n
window.scrollTo(info.scrollLeft, info.scrollTop);\n
}\n
};\n
}\n
\n \n
rJS(window)\n rJS(window)\n
.ready(function (g) {\n .ready(function (g) {\n
...@@ -321,12 +360,31 @@ ...@@ -321,12 +360,31 @@
})\n })\n
.declareAcquiredMethod("submitContent", "triggerSubmit")\n .declareAcquiredMethod("submitContent", "triggerSubmit")\n
.declareAcquiredMethod("maximize", "triggerMaximize")\n .declareAcquiredMethod("maximize", "triggerMaximize")\n
.declareAcquiredMethod("fullscreen", "triggerFullscreen")\n
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
console.log(options.value);\n var placehodler = \'oospreadsheet_gadget\',\n
this.props.docEditor = new DocsAPI.DocEditor(\'oospreadsheet_gadget\', {\n placehodler_obj = document.getElementById(placehodler),\n
save_button = document.querySelector("button[name=\'Base_edit:method\']"),\n
height,\n
onBack;\n
if (save_button) {\n
this.props.erp5_mode = true;\n
save_button.hidden = true;\n
height = getMaxHeight(placehodler_obj);\n
onBack = switchFullscreenMode(this);\n
} else {\n
height = \'100%\';\n
onBack = _.bind(function (event) {\n
this.fullscreen();\n
}, this);\n
}\n
console.log(options);\n
if (options.value === \'undefined\') { options.value = \'\'; }\n
this.props.docEditor = new DocsAPI.DocEditor(placehodler, {\n
//type: urlParams[\'type\'],\n //type: urlParams[\'type\'],\n
width: \'100%\',\n width: \'100%\',\n
height: \'100%\',\n height: height,\n
// height: getMaxHeight(placehodler_obj),\n
//documentType: urlParams[\'doctype\'],\n //documentType: urlParams[\'doctype\'],\n
document: {\n document: {\n
//key: undefined,\n //key: undefined,\n
...@@ -344,10 +402,12 @@ ...@@ -344,10 +402,12 @@
editorConfig: this.props.cfg,\n editorConfig: this.props.cfg,\n
events: {\n events: {\n
\'onReady\': onDocEditorReady,\n \'onReady\': onDocEditorReady,\n
\'onBack\': _.bind(function (event) {\n \'onBack\': onBack,\n
this.maximize();\n // \'onDocumentStateChange\': function (event) {\n
}, this),\n // if (!event.data) {\n
\'onDocumentStateChange\': onDocumentStateChange,\n // save_button.click();\n
// }\n
// },\n
\'onRequestEditRights\': _.bind(function (event) {\n \'onRequestEditRights\': _.bind(function (event) {\n
// occurs whenever the user tryes to enter edit mode\n // occurs whenever the user tryes to enter edit mode\n
this.props.docEditor.applyEditRights(true,\n this.props.docEditor.applyEditRights(true,\n
...@@ -358,8 +418,13 @@ ...@@ -358,8 +418,13 @@
//\'onRequestHistoryData\': onRequestHistoryData,\n //\'onRequestHistoryData\': onRequestHistoryData,\n
//\'onRequestHistoryClose\': onRequestHistoryClose,\n //\'onRequestHistoryClose\': onRequestHistoryClose,\n
\'onSave\': _.bind(function (event) {\n \'onSave\': _.bind(function (event) {\n
this.props.data = event.data;\n this.props.value = event.data;\n
this.submitContent();\n if (this.props.erp5_mode) {\n
save_button.click();\n
} else {\n
this.submitContent();\n
}\n
// clickSaveButton(\'Base_edit\');\n
return true;\n return true;\n
// if you want to async save process return false\n // if you want to async save process return false\n
// and call api.processSaveResult when ready\n // and call api.processSaveResult when ready\n
...@@ -368,16 +433,26 @@ ...@@ -368,16 +433,26 @@
}\n }\n
});\n });\n
this.props.key = options.key || "text_content";\n this.props.key = options.key || "text_content";\n
this.props.value = options.value;\n
// default FullscreenMode\n
if (this.props.erp5_mode) {\n
switchFullscreenMode(this)();\n
}\n
return {};\n return {};\n
})\n })\n
\n \n
.declareMethod(\'getContent\', function () {\n .declareMethod(\'getContent\', function () {\n
var result = {};\n var result = {};\n
result[this.props.key] = this.props.data;\n //document.getElementsByName(\'frameEditor\')[0]\n
// .contentWindow.document.getElementById(\'id-toolbar-btn-save\').click();\n
// this.props.docEditor.processSaveResult();\n
result[this.props.key] = this.props.value;\n
return result;\n return result;\n
});\n });\n
\n \n
}(rJS, DocsAPI, _));</string> </value> }(rJS, DocsAPI, _));
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
......
...@@ -412,9 +412,7 @@ ...@@ -412,9 +412,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_frontpage_gadget_url</string> </key> <key> <string>configuration_frontpage_gadget_url</string> </key>
<value> <value> <string>officejs_spreadsheet_list</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>configuration_hateoas_url</string> </key> <key> <string>configuration_hateoas_url</string> </key>
...@@ -442,7 +440,9 @@ ...@@ -442,7 +440,9 @@
</item> </item>
<item> <item>
<key> <string>configuration_translation_gadget_url</string> </key> <key> <string>configuration_translation_gadget_url</string> </key>
<value> <string>gadget_translation.html</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>configuration_view_action_category</string> </key> <key> <string>configuration_view_action_category</string> </key>
......
...@@ -50,19 +50,16 @@ ...@@ -50,19 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># request = container.REQUEST\n <value> <string># XXX not work for readonly documents\n
# if request.form.get(\'view\', None) == \'jio_view\':\n
portal_type = context.getPortalType()\n portal_type = context.getPortalType()\n
filename = context.getFilename()\n filename = context.getFilename()\n
if portal_type == \'Spreadsheet\' and not filename.endswith(\'.xlsy\'):\n if portal_type == \'Spreadsheet\' and not filename.endswith(\'.xlsy\'):\n
# return context.convert(format=\'xlsy\')\n
metadata, data = context.convert(format=\'xlsy\')\n metadata, data = context.convert(format=\'xlsy\')\n
context.setData(data)\n context.setData(data)\n
context.setContentType(metadata)\n context.setContentType(metadata)\n
context.setFilename(\'.\'.join(filename.split(\'.\')[:-1]) + \'.xlsy\')\n context.setFilename(\'.\'.join(filename.split(\'.\')[:-1]) + \'.xlsy\')\n
else:\n else:\n
data = context.getData()\n data = context.getData()\n
# return context.Document_viewAsJio()\n
return data\n return data\n
</string> </value> </string> </value>
</item> </item>
...@@ -72,7 +69,7 @@ return data\n ...@@ -72,7 +69,7 @@ return data\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Document_convertForJio</string> </value> <value> <string>OOoDocument_convertForJio</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>my_data</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_filename</string>
<string>my_description</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_edit</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Document_viewOOEditor</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Document Editor</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDMSFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_filename</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_filename</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDMSFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string>form_view_editable\n
ooffice_view</string> </value>
</item> </item>
<item> <item>
<key> <string>edit_order</string> </key> <key> <string>edit_order</string> </key>
...@@ -73,7 +74,6 @@ ...@@ -73,7 +74,6 @@
<value> <value>
<list> <list>
<string>my_description</string> <string>my_description</string>
<string>my_data</string>
<string>my_title</string> <string>my_title</string>
<string>my_reference</string> <string>my_reference</string>
<string>my_revision</string> <string>my_revision</string>
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<string>my_modification_date</string> <string>my_modification_date</string>
<string>my_content_type</string> <string>my_content_type</string>
<string>my_filename</string> <string>my_filename</string>
<string>my_data</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Document_viewAsJio</string> </value> <value> <string>OOoDocument_viewAsJio</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
<value> <string>form_view</string> </value> <value> <string>form_view_editable</string> </value>
</item> </item>
<item> <item>
<key> <string>row_length</string> </key> <key> <string>row_length</string> </key>
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>input_type</string> </key> <key> <string>input_type</string> </key>
......
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>My Data</string> </value> <value> <string>Data</string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>My Filename</string> </value> <value> <string>Filename</string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>input_type</string> </key> <key> <string>input_type</string> </key>
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>input_type</string> </key> <key> <string>input_type</string> </key>
......
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>My Revision</string> </value> <value> <string>Revision</string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>My Title</string> </value> <value> <string>Title</string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts44308796.29</string> </value> <value> <string>ts48059956.98</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts44308425.78</string> </value> <value> <string>ts47967161.93</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>97630</int> </value> <value> <int>97560</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -316,8 +316,7 @@ ...@@ -316,8 +316,7 @@
if (!isModified && !isSyncButton) {\r\n if (!isModified && !isSyncButton) {\r\n
return;\r\n return;\r\n
}\r\n }\r\n
Common.Gateway.save(this.api.asc_nativeGetFile());\r\n this.api.asc_Save();\r\n
//this.api.asc_Save();\r\n
}\r\n }\r\n
Common.component.Analytics.trackEvent("Save");\r\n Common.component.Analytics.trackEvent("Save");\r\n
Common.component.Analytics.trackEvent("ToolBar", "Save");\r\n Common.component.Analytics.trackEvent("ToolBar", "Save");\r\n
......
todo:
* OOoDocument auto convert not work with readonly documents
erp5_web_renderjs_ui erp5_web_renderjs_ui
erp5_web_ung_core erp5_web_ung_core
\ No newline at end of file erp5_dms
\ No newline at end of file
Spreadsheet | jio_view
Spreadsheet | ooeditor
Web Illustration | jio_view Web Illustration | jio_view
Web Page | jio_view Web Page | jio_view
\ 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