plugins/kolab_files
Aleksander Machniak
machniak at kolabsys.com
Fri Jul 25 18:39:31 CEST 2014
plugins/kolab_files/kolab_files.js | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
New commits:
commit 12f4a44fdde455bc73e1fd3d72ce06dacdf76c6c
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Fri Jul 25 18:39:01 2014 +0200
Support Chwala's file uploader (for future WebODF editor support)
diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index 7724ed8..c520395 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -828,6 +828,26 @@ rcube_webmail.prototype.files_save = function()
if (!this.file_editor)
return;
+ // binary files like ODF need to be updated using FormData
+ if (this.file_editor.getContentCallback) {
+ if (!file_api.file_uploader_support())
+ return;
+
+ file_api.req = file_api.set_busy(true, 'saving');
+// this.file_editor.disable();
+ this.file_editor.getContentCallback(function(content, filename) {
+ file_api.file_uploader([content], {
+ action: 'file_update',
+ params: {file: rcmail.env.file, info: 1, token: file_api.env.token},
+ response_handler: 'file_save_response',
+ fieldname: 'content',
+ single: true
+ });
+ });
+
+ return;
+ }
+
var content = this.file_editor.getContent();
file_api.file_save(this.env.file, content);
More information about the commits
mailing list