Open Office Editor W.I.P:

- Implement Save As action
This commit is contained in:
Hadi Nategh 2016-07-20 15:55:47 +02:00 committed by Ralf Becker
parent f9e7a06bca
commit bb7a96b1b0
2 changed files with 12 additions and 4 deletions

View File

@ -1489,7 +1489,7 @@ class filemanager_ui
$actions = array (
'save' => array(
'caption' => 'Save',
'icon' => 'save',
'icon' => 'apply',
'group' => ++$group,
'onExecute' => 'javaScript:app.filemanager.editor_save',
'allowOnMultiple' => false,
@ -1511,6 +1511,14 @@ class filemanager_ui
'allowOnMultiple' => false,
'toolbarDefault' => true
),
'saveas' => array(
'caption' => 'Save As',
'icon' => 'save_all',
'group' => ++$group,
'onExecute' => 'javaScript:app.filemanager.editor_save',
'allowOnMultiple' => false,
'toolbarDefault' => true
),
'delete' => array(
'caption' => 'Delete',
'icon' => 'delete',

View File

@ -1145,7 +1145,7 @@ app.classes.filemanager = AppJS.extend(
/**
* Method call for saving edited document
*/
editor_save: function () {
editor_save: function (_egwAction) {
var self = this,
widgetFilePath = this.et2.getWidgetById('file_path'),
file_path = widgetFilePath.value;
@ -1176,7 +1176,7 @@ app.classes.filemanager = AppJS.extend(
}
//existed file
if (file_path != '') {
if (file_path != '' && _egwAction.id != 'saveas') {
this.editor.getDocumentAsByteArray(saveByteArrayLocally);
}
// new file
@ -1187,7 +1187,7 @@ app.classes.filemanager = AppJS.extend(
id:'savefile',
mode: 'saveas',
button_caption:"",
button_label:"save",
button_label:_egwAction.id == 'saveas'?"save as":"save",
value: "doc.odt"
}, this.et2);