diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 038517442..9dffc2fd2 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -32,6 +32,7 @@ "textPresentationSettings": "Presentation Settings", "textApplicationSettings": "Application Settings", "textDownload": "Download", + "textDownloadAs": "Download As...", "textPrint": "Print", "textPresentationInfo": "Presentation Info", "textHelp": "Help", diff --git a/apps/presentationeditor/mobile/src/controller/settings/Download.jsx b/apps/presentationeditor/mobile/src/controller/settings/Download.jsx new file mode 100644 index 000000000..84914f18b --- /dev/null +++ b/apps/presentationeditor/mobile/src/controller/settings/Download.jsx @@ -0,0 +1,36 @@ +import React, { Component } from "react"; +import Download from "../../view/settings/Download"; +import { Device } from '../../../../../common/mobile/utils/device'; +import { f7 } from 'framework7-react'; + +class DownloadController extends Component { + constructor(props) { + super(props); + this.onSaveFormat = this.onSaveFormat.bind(this); + } + + closeModal() { + if (Device.phone) { + f7.sheet.close('.settings-popup', true); + } else { + f7.popover.close('#settings-popover'); + } + } + + onSaveFormat(format) { + const api = Common.EditorApi.get(); + if(format) { + api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + } + this.closeModal(); + } + + render() { + return ( + + ); + } +} + + +export default DownloadController; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/settings/Download.jsx b/apps/presentationeditor/mobile/src/view/settings/Download.jsx new file mode 100644 index 000000000..d285d819e --- /dev/null +++ b/apps/presentationeditor/mobile/src/view/settings/Download.jsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { Page, Navbar, List, ListItem, BlockTitle, Icon } from "framework7-react"; +import { useTranslation } from "react-i18next"; + +const Download = props => { + const { t } = useTranslation(); + const _t = t("View.Settings", { returnObjects: true }); + + return ( + + + {_t.textDownloadAs} + + props.onSaveFormat(Asc.c_oAscFileType.PPTX)}> + + + props.onSaveFormat(Asc.c_oAscFileType.PDF)}> + + + props.onSaveFormat(Asc.c_oAscFileType.PDFA)}> + + + props.onSaveFormat(Asc.c_oAscFileType.ODP)}> + + + props.onSaveFormat(Asc.c_oAscFileType.POTX)}> + + + props.onSaveFormat(Asc.c_oAscFileType.OTP)}> + + + + + ) +} + +export default Download; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx index fb1e66dbf..93f7a5c24 100644 --- a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx +++ b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx @@ -5,6 +5,7 @@ import {f7} from 'framework7-react'; import {Device} from '../../../../../common/mobile/utils/device'; import ApplicationSettingsController from "../../controller/settings/ApplicationSettings"; import { MacrosSettings } from "./ApplicationSettings"; +import DownloadController from "../../controller/settings/Download"; const routes = [ { @@ -18,6 +19,10 @@ const routes = [ { path: '/macros-settings/', component: MacrosSettings + }, + { + path: '/download/', + component: DownloadController } /*{ path: '/presentation-settings/', @@ -58,7 +63,7 @@ const SettingsList = withTranslation()(props => { - +