[PE mobile] Maked Download

This commit is contained in:
SergeyEzhin 2020-12-14 16:31:36 +03:00
parent 03ee826008
commit 310c57e717
4 changed files with 80 additions and 1 deletions

View file

@ -32,6 +32,7 @@
"textPresentationSettings": "Presentation Settings",
"textApplicationSettings": "Application Settings",
"textDownload": "Download",
"textDownloadAs": "Download As...",
"textPrint": "Print",
"textPresentationInfo": "Presentation Info",
"textHelp": "Help",

View file

@ -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 (
<Download onSaveFormat={this.onSaveFormat} />
);
}
}
export default DownloadController;

View file

@ -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 (
<Page>
<Navbar title={_t.textDownload} backLink={_t.textBack} />
<BlockTitle>{_t.textDownloadAs}</BlockTitle>
<List>
<ListItem title="PPTX" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.PPTX)}>
<Icon slot="media" icon="icon-format-pptx"></Icon>
</ListItem>
<ListItem title="PDF" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.PDF)}>
<Icon slot="media" icon="icon-format-pdf"></Icon>
</ListItem>
<ListItem title="PDF/A" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.PDFA)}>
<Icon slot="media" icon="icon-format-pdfa"></Icon>
</ListItem>
<ListItem title="ODP" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.ODP)}>
<Icon slot="media" icon="icon-format-odp"></Icon>
</ListItem>
<ListItem title="POTX" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.POTX)}>
<Icon slot="media" icon="icon-format-potx"></Icon>
</ListItem>
<ListItem title="OTP" onClick={() => props.onSaveFormat(Asc.c_oAscFileType.OTP)}>
<Icon slot="media" icon="icon-format-otp"></Icon>
</ListItem>
</List>
</Page>
)
}
export default Download;

View file

@ -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 => {
<ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, '/application-settings/')}>
<Icon slot="media" icon="icon-app-settings"></Icon>
</ListItem>
<ListItem title={_t.textDownload} link="#">
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
<Icon slot="media" icon="icon-download"></Icon>
</ListItem>
<ListItem title={_t.textPrint}>