[DE mobile] Add orthography check for sailfish

This commit is contained in:
JuliaSvinareva 2021-05-12 15:05:17 +03:00
parent bd08e74547
commit f221d2202e
4 changed files with 30 additions and 4 deletions

View file

@ -71,7 +71,19 @@ const Settings = props => {
window.open(url, "_blank");
};
return <SettingsView usePopover={!Device.phone} openOptions={props.openOptions} onclosed={onviewclosed} onReaderMode={onReaderMode} onPrint={onPrint} showHelp={showHelp}/>
const onOrthographyCheck = () => {
closeModal();
Common.EditorApi.get().asc_pluginRun("asc.{B631E142-E40B-4B4C-90B9-2D00222A286E}", 0);
};
return <SettingsView usePopover={!Device.phone}
openOptions={props.openOptions}
onclosed={onviewclosed}
onReaderMode={onReaderMode}
onPrint={onPrint}
showHelp={showHelp}
onOrthographyCheck={onOrthographyCheck}
/>
};
export default inject("storeAppOptions")(observer(Settings));

View file

@ -31,6 +31,11 @@
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M20.5,6.5l1.1,1.1L11,18l0,0l0,0L0.5,7.5l1.1-1.1l9.5,9.5L20.5,6.5z"/></g></svg>');
}
//Settings
&.icon-spellcheck {
width: 22px;
height: 22px;
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1L3 15H4.2L5.97686 10H11.0231L11.6768 11.8394C11.955 11.5504 12.262 11.2892 12.593 11.0605L9 1H8ZM8.5 2.9L10.6678 9H6.33223L8.5 2.9Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21ZM15.3536 18.3536L19.3536 14.3536L18.6464 13.6464L15 17.2929L13.3536 15.6464L12.6464 16.3536L14.6464 18.3536L15 18.7071L15.3536 18.3536Z"/></g></svg>');
}
&.icon-search {
width: 22px;
height: 22px;

View file

@ -76,6 +76,11 @@
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{black}"><g><polygon points="10.9,5.1 2,13.9 4.1,16 11.1,9.2 17.9,16 20,13.9 11.2,5.1 11.1,5 "/></g></svg>');
}
//Settings
&.icon-spellcheck {
width: 22px;
height: 22px;
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1L3 15H4.2L5.97686 10H11.0231L11.6768 11.8394C11.955 11.5504 12.262 11.2892 12.593 11.0605L9 1H8ZM8.5 2.9L10.6678 9H6.33223L8.5 2.9Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21ZM15.3536 18.3536L19.3536 14.3536L18.6464 13.6464L15 17.2929L13.3536 15.6464L12.6464 16.3536L14.6464 18.3536L15 18.7071L15.3536 18.3536Z"/></g></svg>');
}
&.icon-search {
width: 22px;
height: 22px;

View file

@ -133,7 +133,11 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
<Toggle checked={appOptions.readerMode} onChange={() => {props.onReaderMode()}}/>
</ListItem>
}
{/*ToDo: settings-orthography*/}
{Device.sailfish && _isEdit &&
<ListItem title={_t.textSpellcheck} onClick={() => {props.onOrthographyCheck()}} className='no-indicator' link="#">
<Icon slot="media" icon="icon-spellcheck"></Icon>
</ListItem>
}
{_isEdit &&
<ListItem link="#" title={_t.textDocumentSettings} onClick={onoptionclick.bind(this, '/document-settings/')}>
<Icon slot="media" icon="icon-doc-setup"></Icon>
@ -192,10 +196,10 @@ class SettingsView extends Component {
return (
show_popover ?
<Popover id="settings-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}>
<SettingsList inPopover={true} onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} style={{height: '410px'}} onReaderMode={this.props.onReaderMode} onPrint={this.props.onPrint} showHelp={this.props.showHelp}/>
<SettingsList inPopover={true} onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} style={{height: '410px'}} onReaderMode={this.props.onReaderMode} onPrint={this.props.onPrint} showHelp={this.props.showHelp} onOrthographyCheck={this.props.onOrthographyCheck}/>
</Popover> :
<Popup className="settings-popup" onPopupClosed={() => this.props.onclosed()}>
<SettingsList onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} onReaderMode={this.props.onReaderMode} onPrint={this.props.onPrint} showHelp={this.props.showHelp}/>
<SettingsList onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} onReaderMode={this.props.onReaderMode} onPrint={this.props.onPrint} showHelp={this.props.showHelp} onOrthographyCheck={this.props.onOrthographyCheck}/>
</Popup>
)
}