[SSE mobile] Correct Encoding
This commit is contained in:
parent
1b5397d222
commit
5a30ae5cc9
|
@ -25,7 +25,7 @@ export class storeEncoding {
|
||||||
}
|
}
|
||||||
|
|
||||||
type;
|
type;
|
||||||
mode;
|
mode = 1;
|
||||||
pages = [];
|
pages = [];
|
||||||
pagesName = [];
|
pagesName = [];
|
||||||
advOptions;
|
advOptions;
|
||||||
|
|
|
@ -55,13 +55,15 @@ const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady
|
||||||
|
|
||||||
storeEncoding.initOptions({type, advOptions, formatOptions});
|
storeEncoding.initOptions({type, advOptions, formatOptions});
|
||||||
storeEncoding.initPages();
|
storeEncoding.initPages();
|
||||||
storeEncoding.initNamesDelimeter([_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace]);
|
|
||||||
storeEncoding.setMode(mode);
|
storeEncoding.setMode(mode);
|
||||||
|
storeEncoding.initNamesDelimeter([_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace]);
|
||||||
storeEncoding.changeEncoding(recommendedSettings.asc_getCodePage());
|
storeEncoding.changeEncoding(recommendedSettings.asc_getCodePage());
|
||||||
storeEncoding.changeDelimeter(recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4);
|
storeEncoding.changeDelimeter(recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4);
|
||||||
|
|
||||||
|
if(mode === 2) {
|
||||||
f7.views.current.router.navigate('/encoding/');
|
f7.views.current.router.navigate('/encoding/');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// let picker;
|
// let picker;
|
||||||
// const pages = [];
|
// const pages = [];
|
||||||
// const pagesName = [];
|
// const pagesName = [];
|
||||||
|
|
|
@ -12,7 +12,7 @@ class EncodingController extends Component {
|
||||||
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
if (Device.phone) {
|
if (Device.phone) {
|
||||||
f7.sheet.close('.settings-popup', true);
|
f7.sheet.close('.settings-popup', false);
|
||||||
} else {
|
} else {
|
||||||
f7.popover.close('#settings-popover');
|
f7.popover.close('#settings-popover');
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,16 @@ class EncodingController extends Component {
|
||||||
|
|
||||||
onSaveFormat(mode, valueEncoding, valueDelimeter) {
|
onSaveFormat(mode, valueEncoding, valueDelimeter) {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
const storeEncoding = this.props.storeEncoding;
|
||||||
this.closeModal();
|
|
||||||
|
|
||||||
if(mode === 2) {
|
if(mode === 2) {
|
||||||
const formatOptions = this.props.storeEncoding.formatOptions;
|
this.closeModal();
|
||||||
|
const formatOptions = storeEncoding.formatOptions;
|
||||||
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
||||||
api.asc_DownloadAs(formatOptions);
|
api.asc_DownloadAs(formatOptions);
|
||||||
} else {
|
} else {
|
||||||
const type = this.props.storeEncoding.type;
|
storeEncoding.setMode(1);
|
||||||
|
const type = storeEncoding.type;
|
||||||
api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ class MainPage extends Component {
|
||||||
const config = appOptions.config;
|
const config = appOptions.config;
|
||||||
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
|
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
|
||||||
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
|
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
||||||
{/* Top Navbar */}
|
{/* Top Navbar */}
|
||||||
|
@ -105,7 +106,7 @@ class MainPage extends Component {
|
||||||
<AddOptions onclosed={this.handleOptionsViewClosed.bind(this, 'add')} showOptions={this.state.addShowOptions} />
|
<AddOptions onclosed={this.handleOptionsViewClosed.bind(this, 'add')} showOptions={this.state.addShowOptions} />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
!this.state.settingsVisible ? null :
|
!this.state.settingsVisible && this.props.storeEncoding.mode ? null :
|
||||||
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -124,4 +125,4 @@ class MainPage extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default inject("storeAppOptions")(observer(MainPage));
|
export default inject("storeAppOptions", "storeEncoding")(observer(MainPage));
|
|
@ -15,7 +15,7 @@ const PageEncoding = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textChooseCsvOptions} backLink={_t.textBack} />
|
<Navbar title={_t.textChooseCsvOptions} backLink={mode === 2 ? _t.textBack : ''} />
|
||||||
<BlockTitle>{_t.textDelimeter}</BlockTitle>
|
<BlockTitle>{_t.textDelimeter}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={nameDelimeter} href="/delimeter-list/"></ListItem>
|
<ListItem title={nameDelimeter} href="/delimeter-list/"></ListItem>
|
||||||
|
|
|
@ -79,7 +79,7 @@ const routes = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
const SettingsList = inject("storeAppOptions")(observer(props => {
|
const SettingsList = inject("storeAppOptions", "storeEncoding")(observer(props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('View.Settings', {returnObjects: true});
|
const _t = t('View.Settings', {returnObjects: true});
|
||||||
const navbar = <Navbar title={_t.textSettings}>
|
const navbar = <Navbar title={_t.textSettings}>
|
||||||
|
@ -138,7 +138,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={props.style} stackPages={true} routes={routes}>
|
<View style={props.style} stackPages={true} routes={routes} url={!props.storeEncoding.mode && '/encoding/'}>
|
||||||
<Page>
|
<Page>
|
||||||
{navbar}
|
{navbar}
|
||||||
<List>
|
<List>
|
||||||
|
|
Loading…
Reference in a new issue