diff --git a/apps/spreadsheeteditor/mobile/src/controller/Encoding.jsx b/apps/spreadsheeteditor/mobile/src/controller/Encoding.jsx
index 4e9198029..9dfa3ae64 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/Encoding.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/Encoding.jsx
@@ -2,44 +2,104 @@ import React, { Component } from 'react';
import { Device } from '../../../../common/mobile/utils/device';
import { f7 } from "framework7-react";
import { Encoding } from "../view/Encoding";
-import { observer, inject } from "mobx-react";
+import { withTranslation } from 'react-i18next';
class EncodingController extends Component {
constructor(props) {
super(props);
+
+ const { t } = this.props;
+ const _t = t("View.Settings", { returnObjects: true });
+
+ this.valuesDelimeter = [4, 2, 3, 1, 5];
+ this.namesDelimeter = [_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace];
this.onSaveFormat = this.onSaveFormat.bind(this);
+ this.closeModal = this.closeModal.bind(this);
+ this.state = {
+ isOpen: false
+ };
+
+ Common.Notifications.on('engineCreated', api => {
+ api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => {
+ this.initEncoding(type, advOptions, mode, formatOptions);
+ });
+ });
+
+ Common.Notifications.on('openEncoding', (type, advOptions, mode, formatOptions) => {
+ this.initEncoding(type, advOptions, mode, formatOptions);
+ });
+ }
+
+ initEncoding(type, advOptions, mode, formatOptions) {
+ if(type === Asc.c_oAscAdvancedOptionsID.CSV) {
+ Common.Notifications.trigger('preloader:close');
+ Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256, true);
+
+ this.mode = mode;
+ this.advOptions = advOptions;
+ this.formatOptions = formatOptions;
+ this.pages = [];
+ this.pagesName = [];
+
+ const recommendedSettings = this.advOptions.asc_getRecommendedSettings();
+
+ this.initPages();
+ this.valueEncoding = recommendedSettings.asc_getCodePage();
+ this.valueDelimeter = recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4;
+
+ this.setState({
+ isOpen: true
+ });
+ }
+ }
+
+ initPages() {
+ for (let page of this.advOptions.asc_getCodePages()) {
+ this.pages.push(page.asc_getCodePage());
+ this.pagesName.push(page.asc_getCodePageName());
+ }
}
closeModal() {
if (Device.phone) {
- f7.sheet.close('.encoding-popup', false);
+ f7.sheet.close('.encoding-popup', true);
} else {
f7.popover.close('#encoding-popover');
}
+
+ this.setState({isOpen: false});
}
- async onSaveFormat(mode, valueEncoding, valueDelimeter) {
+ onSaveFormat(valueEncoding, valueDelimeter) {
const api = Common.EditorApi.get();
- const storeEncoding = this.props.storeEncoding;
- await this.closeModal();
+ this.closeModal();
- if(mode === 2) {
- const formatOptions = storeEncoding.formatOptions;
- formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
- api.asc_DownloadAs(formatOptions);
+ if(this.mode === 2) {
+ this.formatOptions && this.formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
+ api.asc_DownloadAs(this.formatOptions);
} else {
- storeEncoding.setMode(1);
- const type = storeEncoding.type;
- api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
+ api.asc_setAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
}
}
render() {
return (
-
+ this.state.isOpen &&
+
);
}
}
-export default inject("storeEncoding")(observer(EncodingController));
\ No newline at end of file
+export default withTranslation()(EncodingController);
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
index ef6bdd7ff..825f7ea90 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
@@ -18,6 +18,7 @@ import ErrorController from "./Error";
import app from "../page/app";
import About from "../../../../common/mobile/lib/view/About";
import PluginsController from '../../../../common/mobile/lib/controller/Plugins.jsx';
+import EncodingController from "./Encoding";
@inject(
"storeAppOptions",
@@ -27,9 +28,8 @@ import PluginsController from '../../../../common/mobile/lib/controller/Plugins.
"storeChartSettings",
"storeSpreadsheetSettings",
"storeSpreadsheetInfo",
- "storeApplicationSettings",
- "storeEncoding"
- )
+ "storeApplicationSettings"
+)
class MainController extends Component {
constructor(props) {
super(props);
@@ -319,15 +319,15 @@ class MainController extends Component {
this.props.storeSpreadsheetSettings.addSchemes(schemes);
});
- const storeEncoding = this.props.storeEncoding;
-
// Downloaded Advanced Options
this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => {
const {t} = this.props;
const _t = t("View.Settings", { returnObjects: true });
- onAdvancedOptions(type, advOptions, mode, formatOptions, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose, this.isDRM, storeEncoding);
- if(type == Asc.c_oAscAdvancedOptionsID.DRM) this.isDRM = true;
+ if(type == Asc.c_oAscAdvancedOptionsID.DRM) {
+ onAdvancedOptions(type, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose, this.isDRM);
+ this.isDRM = true;
+ }
});
}
@@ -776,6 +776,7 @@ class MainController extends Component {
+
)
}
diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
index c0a16c96b..5091c765b 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
@@ -4,7 +4,6 @@ import { Device } from '../../../../../common/mobile/utils/device';
import { withTranslation, useTranslation } from 'react-i18next';
import { f7 } from 'framework7-react';
import { observer, inject } from "mobx-react";
-// import MainPage from '../../page/main';
class DownloadController extends Component {
constructor(props) {
@@ -27,17 +26,13 @@ class DownloadController extends Component {
if (format) {
if (format == Asc.c_oAscFileType.CSV) {
- const advOptions = api.asc_getAdvancedOptions();
- const storeEncoding = this.props.storeEncoding;
-
f7.dialog.confirm(
_t.warnDownloadAs,
_t.notcriticalErrorTitle,
- async () => {
- const canRequestClose = this.props.storeAppOptions.canRequestClose;
- await this.closeModal();
- onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, advOptions, 2, new Asc.asc_CDownloadOptions(format), _t, true, canRequestClose, false, storeEncoding);
- this.props.openOptions('encoding');
+ () => {
+ const advOptions = api.asc_getAdvancedOptions();
+ this.closeModal();
+ Common.Notifications.trigger('openEncoding', Asc.c_oAscAdvancedOptionsID.CSV, advOptions, 2, new Asc.asc_CDownloadOptions(format));
}
)
} else {
@@ -54,149 +49,51 @@ class DownloadController extends Component {
}
}
-const DownloadWithTranslation = inject("storeAppOptions", "storeEncoding")(observer(withTranslation()(DownloadController)));
+const DownloadWithTranslation = inject("storeAppOptions")(observer(withTranslation()(DownloadController)));
-const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady, canRequestClose, isDRM, storeEncoding) => {
+const onAdvancedOptions = (type, _t, isDocReady, canRequestClose, isDRM) => {
const api = Common.EditorApi.get();
- if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
- Common.Notifications.trigger('preloader:close');
- Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256, true);
-
- const recommendedSettings = advOptions.asc_getRecommendedSettings();
-
- storeEncoding.initOptions({type, advOptions, formatOptions});
- storeEncoding.initPages();
- storeEncoding.setMode(mode);
- storeEncoding.initNamesDelimeter([_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace]);
- storeEncoding.changeEncoding(recommendedSettings.asc_getCodePage());
- storeEncoding.changeDelimeter(recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4);
-
- // if(mode === 2) {
- // f7.views.current.router.navigate('/encoding/');
- // }
- }
- // let picker;
- // const pages = [];
- // const pagesName = [];
-
- // for (let page of advOptions.asc_getCodePages()) {
- // pages.push(page.asc_getCodePage());
- // pagesName.push(page.asc_getCodePageName());
- // }
-
- // Common.Notifications.trigger('preloader:close');
- // Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256, true);
-
- // const buttons = [];
-
- // if (mode === 2) {
- // buttons.push({
- // text: _t.textCancel
- // });
- // }
-
- // buttons.push({
- // text: 'OK',
- // bold: true,
- // onClick: function() {
- // let encoding = picker.cols[0].value,
- // delimiter = picker.cols[1].value;
-
- // if (mode == 2) {
- // formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(encoding, delimiter));
- // api.asc_DownloadAs(formatOptions);
- // } else {
- // api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter));
- // }
-
- // if (!isDocReady) {
- // Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256);
- // }
- // }
- // });
-
- // const dialog = f7.dialog.create({
- // title: _t.advCSVOptions,
- // text: '',
- // content:
- // '
' +
- // '
' +
- // '
' + _t.txtEncoding + '
' +
- // '
' + _t.txtDelimiter + '
' +
- // '
' +
- // '
' +
- // '
',
- // buttons: buttons,
- // cssClass: 'dlg-adv-options'
- // }).open();
-
- // const recommendedSettings = advOptions.asc_getRecommendedSettings();
-
- // dialog.on('opened', () => {
- // picker = f7.picker.create({
- // containerEl: document.getElementById('txt-encoding'),
- // cols: [{
- // textAlign: 'left',
- // values: pages,
- // displayValues: pagesName
- // },{
- // textAlign: 'right',
- // width: 120,
- // values: [4, 2, 3, 1, 5],
- // displayValues: [',', ';', ':', _t.txtTab, _t.txtSpace]
- // }],
- // toolbar: false,
- // rotateEffect: true,
- // value: [
- // recommendedSettings && recommendedSettings.asc_getCodePage(),
- // (recommendedSettings && recommendedSettings.asc_getDelimiter()) ? recommendedSettings.asc_getDelimiter() : 4
- // ],
- // });
- // });
-
- // } else
- else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
- Common.Notifications.trigger('preloader:close');
- Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256, true);
- const buttons = [{
- text: 'OK',
- bold: true,
- onClick: function () {
- const password = document.getElementById('modal-password').value;
- api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password));
- if (!isDocReady) {
- Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256);
- }
+ Common.Notifications.trigger('preloader:close');
+ Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256, true);
+ const buttons = [{
+ text: 'OK',
+ bold: true,
+ onClick: function () {
+ const password = document.getElementById('modal-password').value;
+ api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password));
+ if (!isDocReady) {
+ Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], -256);
}
- }];
-
- if(isDRM) {
- f7.dialog.create({
- text: _t.txtIncorrectPwd,
- buttons : [{
- text: 'OK',
- bold: true,
- }]
- }).open();
}
+ }];
- if (canRequestClose)
- buttons.push({
- text: _t.closeButtonText,
- onClick: function () {
- Common.Gateway.requestClose();
- }
- });
-
+ if(isDRM) {
f7.dialog.create({
- title: _t.advDRMOptions,
- text: _t.textOpenFile,
- content: Device.ios ?
- '' : '',
- buttons: buttons
+ text: _t.txtIncorrectPwd,
+ buttons : [{
+ text: 'OK',
+ bold: true,
+ }]
}).open();
}
+
+ if (canRequestClose)
+ buttons.push({
+ text: _t.closeButtonText,
+ onClick: function () {
+ Common.Gateway.requestClose();
+ }
+ });
+
+ f7.dialog.create({
+ title: _t.advDRMOptions,
+ text: _t.textOpenFile,
+ content: Device.ios ?
+ '' : '',
+ buttons: buttons
+ }).open();
+
};
export {
diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/Encoding.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/Encoding.jsx
deleted file mode 100644
index 17ed1cf0a..000000000
--- a/apps/spreadsheeteditor/mobile/src/controller/settings/Encoding.jsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import React, { Component } from 'react';
-import { Device } from '../../../../../common/mobile/utils/device';
-import { f7 } from "framework7-react";
-import { Encoding } from "../../view/settings/Encoding";
-import { observer, inject } from "mobx-react";
-
-class EncodingController extends Component {
- constructor(props) {
- super(props);
- this.onSaveFormat = this.onSaveFormat.bind(this);
- }
-
- closeModal() {
- if (Device.phone) {
- f7.sheet.close('.settings-popup', false);
- } else {
- f7.popover.close('#settings-popover');
- }
- }
-
- onSaveFormat(mode, valueEncoding, valueDelimeter) {
- const api = Common.EditorApi.get();
- const storeEncoding = this.props.storeEncoding;
-
- if(mode === 2) {
- this.closeModal();
- const formatOptions = storeEncoding.formatOptions;
- formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
- api.asc_DownloadAs(formatOptions);
- } else {
- storeEncoding.setMode(1);
- const type = storeEncoding.type;
- api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
- }
- }
-
- render() {
- return (
-
- );
- }
-}
-
-export default inject("storeEncoding")(observer(EncodingController));
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx
index 55f530939..5ebe8ac2e 100644
--- a/apps/spreadsheeteditor/mobile/src/page/main.jsx
+++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx
@@ -16,20 +16,6 @@ import { f7 } from 'framework7-react';
import {FunctionGroups} from "../controller/add/AddFunction";
import ContextMenu from '../controller/ContextMenu';
import { Toolbar } from "../controller/Toolbar";
-import EncodingController from "../controller/Encoding";
-import {PageEncodingList, PageDelimeterList} from '../view/Encoding';
-
-
-const routes = [
- {
- path: '/encoding-list/',
- component: PageEncodingList
- },
- {
- path: '/delimeter-list/',
- component: PageDelimeterList
- }
-];
class MainPage extends Component {
constructor(props) {
@@ -39,8 +25,7 @@ class MainPage extends Component {
addOptionsVisible: false,
addShowOptions: null,
settingsVisible: false,
- collaborationVisible: false,
- encodingVisible: false
+ collaborationVisible: false
};
}
@@ -57,8 +42,6 @@ class MainPage extends Component {
};
else if ( opts == 'settings' )
return {settingsVisible: true};
- else if ( opts == 'encoding' )
- return {encodingVisible: true};
else if ( opts == 'coauth' )
return {collaborationVisible: true};
});
@@ -77,8 +60,6 @@ class MainPage extends Component {
return {addOptionsVisible: false};
else if ( opts == 'settings' )
return {settingsVisible: false};
- else if ( opts == 'encoding' )
- return {encodingVisible: false};
else if ( opts == 'coauth' )
return {collaborationVisible: false};
});
@@ -132,11 +113,6 @@ class MainPage extends Component {
!this.state.collaborationVisible ? null :
}
- {
- !this.state.encodingVisible && this.props.storeEncoding.mode ? null :
-
- }
@@ -149,4 +125,4 @@ class MainPage extends Component {
}
}
-export default inject("storeAppOptions", "storeEncoding")(observer(MainPage));
\ No newline at end of file
+export default inject("storeAppOptions")(observer(MainPage));
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx b/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx
index 21e1d698f..6046bde42 100644
--- a/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx
+++ b/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx
@@ -1,51 +1,69 @@
-import React, {Component, useEffect} from 'react';
-import { observer, inject } from "mobx-react";
+import React, {Component, useEffect, useState} from 'react';
import { f7, Page, Navbar, List, ListItem, BlockTitle, ListButton, Popover, Popup, View, Link } from "framework7-react";
import { useTranslation } from "react-i18next";
import { Device } from '../../../../common/mobile/utils/device';
-const PageEncoding = inject("storeEncoding")(observer(props => {
+const PageEncoding = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueEncoding = storeEncoding.valueEncoding;
- const nameDelimeter = storeEncoding.nameDelimeter;
- const valueDelimeter = storeEncoding.valueDelimeter;
- const nameEncoding = storeEncoding.nameEncoding;
- const mode = storeEncoding.mode;
- const routes = props.routes;
+ const pagesName = props.pagesName;
+ const pages = props.pages;
+ const valuesDelimeter = props.valuesDelimeter;
+ const namesDelimeter = props.namesDelimeter;
+ const [stateEncoding, setStateEncoding] = useState(props.valueEncoding);
+ const [stateDelimeter, setStateDelimeter] = useState(props.valueDelimeter);
+ const nameEncoding = pagesName[pages.indexOf(stateEncoding)];
+ const nameDelimeter = namesDelimeter[valuesDelimeter.indexOf(stateDelimeter)];
+ const mode = props.mode;
+
+ const changeStateEncoding = value => {
+ setStateEncoding(value);
+ }
+
+ const changeStateDelimeter = value => {
+ setStateDelimeter(value);
+ }
return (
-
+
{_t.textDelimeter}
-
+
{_t.textEncoding}
-
+
{mode === 2 ?
-
+ props.closeModal()}>
: null}
- props.onSaveFormat(mode, valueEncoding, valueDelimeter)}>
+ props.onSaveFormat(stateEncoding, stateDelimeter)}>
)
-}));
+};
-const PageEncodingList = inject("storeEncoding")(observer(props => {
+const PageEncodingList = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueEncoding = storeEncoding.valueEncoding;
- const pages = storeEncoding.pages;
- const pagesName = storeEncoding.pagesName;
+ const [currentEncoding, changeCurrentEncoding] = useState(props.stateEncoding);
+ const pages = props.pages;
+ const pagesName = props.pagesName;
return (
@@ -54,8 +72,9 @@ const PageEncodingList = inject("storeEncoding")(observer(props => {
{pagesName.map((name, index) => {
return (
- {
- storeEncoding.changeEncoding(pages[index]);
+ {
+ changeCurrentEncoding(pages[index]);
+ props.changeStateEncoding(pages[index]);
f7.views.current.router.back();
}}>
)
@@ -63,15 +82,14 @@ const PageEncodingList = inject("storeEncoding")(observer(props => {
)
-}));
+};
-const PageDelimeterList = inject("storeEncoding")(observer(props => {
+const PageDelimeterList = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueDelimeter = storeEncoding.valueDelimeter;
- const namesDelimeter = storeEncoding.namesDelimeter;
- const valuesDelimeter = storeEncoding.valuesDelimeter;
+ const [currentDelimeter, changeCurrentDelimeter] = useState(props.stateDelimeter);
+ const namesDelimeter = props.namesDelimeter;
+ const valuesDelimeter = props.valuesDelimeter;
return (
@@ -80,8 +98,9 @@ const PageDelimeterList = inject("storeEncoding")(observer(props => {
{namesDelimeter.map((name, index) => {
return (
- {
- storeEncoding.changeDelimeter(valuesDelimeter[index]);
+ {
+ changeCurrentDelimeter(valuesDelimeter[index]);
+ props.changeStateDelimeter(valuesDelimeter[index]);
f7.views.current.router.back();
}}>
)
@@ -89,51 +108,88 @@ const PageDelimeterList = inject("storeEncoding")(observer(props => {
)
-}));
+};
class EncodingView extends Component {
constructor(props) {
super(props);
- this.onoptionclick = this.onoptionclick.bind(this);
- }
-
- onoptionclick(page){
- f7.views.current.router.navigate(page);
}
render() {
const show_popover = this.props.usePopover;
+
return (
show_popover ?
- this.props.onclosed()}>
-
+
+
:
- this.props.onclosed()}>
-
+
+
)
}
}
+const routes = [
+ {
+ path: '/encoding-list/',
+ component: PageEncodingList
+ },
+ {
+ path: '/delimeter-list/',
+ component: PageDelimeterList
+ }
+];
+
const Encoding = props => {
useEffect(() => {
if ( Device.phone )
f7.popup.open('.encoding-popup');
- else f7.popover.open('#encoding-popover');
+ else f7.popover.open('#encoding-popover', "#btn-settings");
return () => {
}
});
-
- const onviewclosed = () => {
- if ( props.onclosed )
- props.onclosed();
- };
-
- return
+ return (
+
+ )
};
export {Encoding, PageEncodingList, PageDelimeterList}
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/Encoding.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/Encoding.jsx
deleted file mode 100644
index f7d9b1084..000000000
--- a/apps/spreadsheeteditor/mobile/src/view/settings/Encoding.jsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import React from 'react';
-import { observer, inject } from "mobx-react";
-import { f7, Page, Navbar, List, ListItem, BlockTitle, ListButton } from "framework7-react";
-import { useTranslation } from "react-i18next";
-
-const PageEncoding = props => {
- const { t } = useTranslation();
- const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueEncoding = storeEncoding.valueEncoding;
- const nameDelimeter = storeEncoding.nameDelimeter;
- const valueDelimeter = storeEncoding.valueDelimeter;
- const nameEncoding = storeEncoding.nameEncoding;
- const mode = storeEncoding.mode;
-
- return (
-
-
- {_t.textDelimeter}
-
-
-
- {_t.textEncoding}
-
-
-
-
- props.onSaveFormat(mode, valueEncoding, valueDelimeter)}>
-
-
- )
-}
-
-const PageEncodingList = props => {
- const { t } = useTranslation();
- const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueEncoding = storeEncoding.valueEncoding;
- const pages = storeEncoding.pages;
- const pagesName = storeEncoding.pagesName;
-
- return (
-
-
- {_t.textChooseEncoding}
-
- {pagesName.map((name, index) => {
- return (
- {
- storeEncoding.changeEncoding(pages[index]);
- f7.views.current.router.back();
- }}>
- )
- })}
-
-
- )
-}
-
-const PageDelimeterList = props => {
- const { t } = useTranslation();
- const _t = t("View.Settings", { returnObjects: true });
- const storeEncoding = props.storeEncoding;
- const valueDelimeter = storeEncoding.valueDelimeter;
- const namesDelimeter = storeEncoding.namesDelimeter;
- const valuesDelimeter = storeEncoding.valuesDelimeter;
-
- return (
-
-
- {_t.textChooseDelimeter}
-
- {namesDelimeter.map((name, index) => {
- return (
- {
- storeEncoding.changeDelimeter(valuesDelimeter[index]);
- f7.views.current.router.back();
- }}>
- )
- })}
-
-
- )
-}
-
-const Encoding = inject("storeEncoding")(observer(PageEncoding));
-const EncodingList = inject("storeEncoding")(observer(PageEncodingList));
-const DelimeterList = inject("storeEncoding")(observer(PageDelimeterList));
-
-export {EncodingList, Encoding, DelimeterList}
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
index afde10636..4e5d384a6 100644
--- a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
+++ b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
@@ -12,8 +12,6 @@ import {SpreadsheetColorSchemes, SpreadsheetFormats, SpreadsheetMargins} from '.
import {MacrosSettings, RegionalSettings, FormulaLanguage} from './ApplicationSettings.jsx';
// import SpreadsheetAbout from './SpreadsheetAbout.jsx';
import About from '../../../../../common/mobile/lib/view/About';
-import EncodingController from '../../controller/settings/Encoding';
-import { EncodingList, DelimeterList } from '../../view/settings/Encoding';
const routes = [
{
@@ -63,19 +61,7 @@ const routes = [
{
path: '/about/',
component: About
- },
- // {
- // path: '/encoding/',
- // component: EncodingController
- // },
- // {
- // path: '/encoding-list/',
- // component: EncodingList
- // },
- // {
- // path: '/delimeter-list/',
- // component: DelimeterList
- // }
+ }
];
@@ -138,7 +124,6 @@ const SettingsList = inject("storeAppOptions", "storeEncoding")(observer(props =
}
return (
- // onClick={onoptionclick.bind(this, "/download/")}
{navbar}
@@ -161,7 +146,7 @@ const SettingsList = inject("storeAppOptions", "storeEncoding")(observer(props =
-
+