diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2014-07-25 16:39:01 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2014-07-25 16:39:01 (GMT) |
commit | 12f4a44fdde455bc73e1fd3d72ce06dacdf76c6c (patch) | |
tree | 3fdef0f70c250dae295b1bd34ae5749cc0993095 /plugins/kolab_files | |
parent | 5b26d69e202eb5ac3e4467dc14285cb8244c474b (diff) | |
download | roundcubemail-plugins-kolab-12f4a44fdde455bc73e1fd3d72ce06dacdf76c6c.tar.gz |
Support Chwala's file uploader (for future WebODF editor support)
Diffstat (limited to 'plugins/kolab_files')
-rw-r--r-- | plugins/kolab_files/kolab_files.js | 20 |
1 files changed, 20 insertions, 0 deletions
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); |