Commit 755071b1 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: use standart submit buttons in erp5_mode and renderjsui_mode

parent b1e8b649
...@@ -260,9 +260,9 @@ ...@@ -260,9 +260,9 @@
page_title: options.doc.title + " | " + options.doc.portal_type,\n page_title: options.doc.title + " | " + options.doc.portal_type,\n
back_url: "#page=" +\n back_url: "#page=" +\n
options.doc.portal_type.toLowerCase() + "_list",\n options.doc.portal_type.toLowerCase() + "_list",\n
panel_action: false\n panel_action: false,\n
// breadcrumb_url: all_result[4],\n // breadcrumb_url: all_result[4],\n
//save_action: true\n save_action: true\n
});\n });\n
})\n })\n
.push(function () {\n .push(function () {\n
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.31999.56515.17117</string> </value> <value> <string>948.36396.44642.6109</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -486,7 +486,7 @@ ...@@ -486,7 +486,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1452882676.55</float> <float>1453145109.87</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, DocsAPI, console, document*/\n <value> <string>/*global window, rJS, RSVP, 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, RSVP, DocsAPI) {\n
"use strict";\n "use strict";\n
// Document Editor event handlers\n // Document Editor event handlers\n
//function onRequestHistory() {\n //function onRequestHistory() {\n
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
\n \n
rJS(window)\n rJS(window)\n
.ready(function (g) {\n .ready(function (g) {\n
g.props = {};\n g.props = {save_defer: null};\n
})\n })\n
.ready(function (g) {\n .ready(function (g) {\n
return g.getElement()\n return g.getElement()\n
...@@ -380,11 +380,18 @@ ...@@ -380,11 +380,18 @@
//\'onRequestHistoryData\': onRequestHistoryData,\n //\'onRequestHistoryData\': onRequestHistoryData,\n
//\'onRequestHistoryClose\': onRequestHistoryClose,\n //\'onRequestHistoryClose\': onRequestHistoryClose,\n
\'onSave\': function (event) {\n \'onSave\': function (event) {\n
g.props.value = event.data;\n var result = {};\n
if (g.props.save_defer === null) {\n
g.triggerSubmit();\n g.triggerSubmit();\n
} else {\n
result[g.props.key] = event.data;\n
g.props.save_defer.resolve(result);\n
g.props.save_defer = null;\n
}\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
// g.props.docEditor.processSaveResult();\n
},\n },\n
\'onError\': onError\n \'onError\': onError\n
}\n }\n
...@@ -397,15 +404,13 @@ ...@@ -397,15 +404,13 @@
})\n })\n
\n \n
.declareMethod(\'getContent\', function () {\n .declareMethod(\'getContent\', function () {\n
var result = {};\n var g = this;\n
//document.getElementsByName(\'frameEditor\')[0]\n g.props.save_defer = RSVP.defer();\n
// .contentWindow.document.getElementById(\'id-toolbar-btn-save\').click();\n g.props.docEditor.save();\n
// this.props.docEditor.processSaveResult();\n return g.props.save_defer.promise;\n
result[this.props.key] = this.props.value;\n
return result;\n
});\n });\n
\n \n
}(rJS, DocsAPI));</string> </value> }(rJS, RSVP, DocsAPI));</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -532,7 +537,7 @@ ...@@ -532,7 +537,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.31979.10733.53111</string> </value> <value> <string>948.36349.33632.18926</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -550,7 +555,7 @@ ...@@ -550,7 +555,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1452885806.26</float> <float>1453142306.9</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -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>ts50885437.8</string> </value> <value> <string>ts53133045.59</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -306,6 +306,16 @@ ...@@ -306,6 +306,16 @@
}\r\n }\r\n
});\r\n });\r\n
};\r\n };\r\n
\r\n
var _save = function(result, message) {\r\n
_sendCommand({\r\n
command: \'save\',\r\n
data: {\r\n
result: result,\r\n
message: message\r\n
}\r\n
});\r\n
};\r\n
\r\n \r\n
var _processSaveResult = function(result, message) {\r\n var _processSaveResult = function(result, message) {\r\n
_sendCommand({\r\n _sendCommand({\r\n
...@@ -385,6 +395,7 @@ ...@@ -385,6 +395,7 @@
showError : _showError,\r\n showError : _showError,\r\n
showMessage : _showMessage,\r\n showMessage : _showMessage,\r\n
applyEditRights : _applyEditRights,\r\n applyEditRights : _applyEditRights,\r\n
save : _save,\r\n
processSaveResult : _processSaveResult,\r\n processSaveResult : _processSaveResult,\r\n
processRightsChange : _processRightsChange,\r\n processRightsChange : _processRightsChange,\r\n
refreshHistory : _refreshHistory,\r\n refreshHistory : _refreshHistory,\r\n
...@@ -411,7 +422,7 @@ ...@@ -411,7 +422,7 @@
};\r\n };\r\n
\r\n \r\n
DocsAPI.DocEditor.version = function() {\r\n DocsAPI.DocEditor.version = function() {\r\n
return \'3.0b.760\';\r\n return \'3.0b##BN#\';\r\n
};\r\n };\r\n
\r\n \r\n
MessageDispatcher = function(fn, scope) {\r\n MessageDispatcher = function(fn, scope) {\r\n
...@@ -558,7 +569,7 @@ ...@@ -558,7 +569,7 @@
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>16820</int> </value> <value> <int>17124</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</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