diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 780d7b80a..173946bec 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -153,6 +153,7 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me)); Common.NotificationCenter.on('goback', _.bind(me.goBack, me)); + Common.NotificationCenter.on('download:advanced', _.bind(me.onAdvancedOptions, me)); // Initialize descendants _.each(me.getApplication().controllers, function(controller) { @@ -1113,7 +1114,7 @@ define([ Common.Utils.ThemeColor.setColors(colors, standart_colors); }, - onAdvancedOptions: function(type, advOptions) { + onAdvancedOptions: function(type, advOptions, mode, formatOptions) { if (this._state.openDlg) return; var me = this; @@ -1149,7 +1150,12 @@ define([ var encoding = picker.value; if (me.api) { - me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding)); + if (mode==2) { + formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(encoding)); + me.api.asc_DownloadAs(formatOptions); + } else { + me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding)); + } if (!me._isDocReady) { me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 5b60752d7..5e0791bc1 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -561,13 +561,13 @@ define([ format = $(e.currentTarget).data('format'); if (format) { - if (format == Asc.c_oAscFileType.TXT) { + if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) { _.defer(function () { uiApp.confirm( me.warnDownloadAs, me.notcriticalErrorTitle, function () { - me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); } ); }); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index b61faac15..14860621d 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -567,6 +567,18 @@ +
  • + +
    +
    + +
    +
    +
    RTF
    +
    +
    +
    +
  • diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 6532dee44..692b6ac02 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -158,6 +158,7 @@ define([ /**/ Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me)); Common.NotificationCenter.on('goback', _.bind(me.goBack, me)); + Common.NotificationCenter.on('download:advanced', _.bind(me.onAdvancedOptions, me)); // Initialize descendants _.each(me.getApplication().controllers, function(controller) { @@ -1213,7 +1214,7 @@ define([ Common.Utils.ThemeColor.setColors(colors, standart_colors); }, - onAdvancedOptions: function(type, advOptions) { + onAdvancedOptions: function(type, advOptions, mode, formatOptions) { if (this._state.openDlg) return; var me = this; @@ -1251,7 +1252,12 @@ define([ delimiter = picker.cols[1].value; if (me.api) { - me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter)); + if (mode==2) { + formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(encoding)); + me.api.asc_DownloadAs(formatOptions); + } else { + me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter)); + } if (!me._isDocReady) { me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index def0ccc68..c414ef7f4 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -200,7 +200,6 @@ define([ }); }).on('close', function () { $overlay.off('removeClass'); - $overlay.removeClass('modal-overlay-visible') }); } @@ -671,12 +670,12 @@ define([ format = $(e.currentTarget).data('format'); if (format) { - if (format == Asc.c_oAscFileType.TXT) { + if (format == Asc.c_oAscFileType.CSV) { uiApp.confirm( me.warnDownloadAs, me.notcriticalErrorTitle, function () { - me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); } ); } else {