Merge branch 'feature/mobile-apps-on-reactjs' into feature/mobile-apps-on-reactjs-fixes
This commit is contained in:
commit
4a4b144ab5
|
@ -103,7 +103,7 @@ class ContextMenuController extends Component {
|
|||
}
|
||||
|
||||
onApiOpenContextMenu(x, y) {
|
||||
if ( !this.state.opened ) {
|
||||
if ( !this.state.opened && $$('.dialog.modal-in').length < 1) {
|
||||
this.setState({
|
||||
items: this.initMenuItems(),
|
||||
extraItems: this.initExtraItems()
|
||||
|
|
283
apps/common/mobile/lib/controller/Plugins.jsx
Normal file
283
apps/common/mobile/lib/controller/Plugins.jsx
Normal file
|
@ -0,0 +1,283 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { f7 } from 'framework7-react';
|
||||
import { Device } from '../../utils/device';
|
||||
|
||||
const PluginsController = inject('storeAppOptions')(observer(props => {
|
||||
const { storeAppOptions } = props;
|
||||
let configPlugins = {autostart:[]},
|
||||
serverPlugins = {autostart:[]},
|
||||
modal,
|
||||
iframe;
|
||||
|
||||
useEffect(() => {
|
||||
const onDocumentReady = () => {
|
||||
Common.Notifications.on('engineCreated', api => {
|
||||
api.asc_registerCallback("asc_onPluginShow", showPluginModal);
|
||||
api.asc_registerCallback("asc_onPluginClose", pluginClose);
|
||||
api.asc_registerCallback("asc_onPluginResize", pluginResize);
|
||||
api.asc_registerCallback('asc_onPluginsInit', registerPlugins);
|
||||
|
||||
if(!storeAppOptions.customization || storeAppOptions.plugins !== false) {
|
||||
loadPlugins();
|
||||
}
|
||||
});
|
||||
|
||||
Common.Gateway.on('init', loadConfig);
|
||||
};
|
||||
|
||||
onDocumentReady();
|
||||
|
||||
return () => {
|
||||
const api = Common.EditorApi.get();
|
||||
|
||||
api.asc_unregisterCallback("asc_onPluginShow", showPluginModal);
|
||||
api.asc_unregisterCallback("asc_onPluginClose", pluginClose);
|
||||
api.asc_unregisterCallback("asc_onPluginResize", pluginResize);
|
||||
api.asc_unregisterCallback('asc_onPluginsInit', registerPlugins);
|
||||
|
||||
Common.Gateway.off('init', loadConfig);
|
||||
};
|
||||
});
|
||||
|
||||
const onDlgBtnClick = e => {
|
||||
const api = Common.EditorApi.get();
|
||||
let index = $$(e.currentTarget).index();
|
||||
api.asc_pluginButtonClick(index);
|
||||
};
|
||||
|
||||
|
||||
const showPluginModal = (plugin, variationIndex, frameId, urlAddition) => {
|
||||
let isAndroid = Device.android;
|
||||
let variation = plugin.get_Variations()[variationIndex];
|
||||
|
||||
if (variation.get_Visual()) {
|
||||
let url = variation.get_Url();
|
||||
url = ((plugin.get_BaseUrl().length == 0) ? url : plugin.get_BaseUrl()) + url;
|
||||
|
||||
if (urlAddition)
|
||||
url += urlAddition;
|
||||
|
||||
let isCustomWindow = variation.get_CustomWindow(),
|
||||
arrBtns = variation.get_Buttons(),
|
||||
newBtns = [],
|
||||
size = variation.get_Size();
|
||||
|
||||
if (arrBtns.length) {
|
||||
arrBtns.forEach((b, index) => {
|
||||
if ((storeAppOptions.isEdit || b.isViewer !== false)) {
|
||||
newBtns[index] = {
|
||||
text: b.text,
|
||||
attributes: {result: index}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
f7.popover.close('.document-menu.modal-in', false);
|
||||
|
||||
modal = f7.dialog.create({
|
||||
title: '',
|
||||
text: '',
|
||||
content: '<div id="plugin-frame" class="">'+'</div>',
|
||||
buttons : isCustomWindow ? undefined : newBtns
|
||||
}).open();
|
||||
|
||||
iframe = document.createElement("iframe");
|
||||
|
||||
iframe.id = frameId;
|
||||
iframe.name = 'pluginFrameEditor';
|
||||
iframe.width = '100%';
|
||||
iframe.height = '100%';
|
||||
iframe.align = "top";
|
||||
iframe.frameBorder = 0;
|
||||
iframe.scrolling = "no";
|
||||
iframe.src = url;
|
||||
|
||||
$$('#plugin-frame').append(iframe);
|
||||
|
||||
modal.$el.find('.dialog-button').on('click', onDlgBtnClick);
|
||||
|
||||
modal.$el.css({
|
||||
margin: '0',
|
||||
width: '90%',
|
||||
left: '5%',
|
||||
height: 'auto'
|
||||
});
|
||||
|
||||
modal.$el.find('.dialog-inner').css({padding: '0'});
|
||||
|
||||
if (Device.phone) {
|
||||
let height = Math.min(size[1], 240);
|
||||
modal.$el.find('#plugin-frame').css({height: height + 'px'});
|
||||
} else {
|
||||
let height = Math.min(size[1], 500);
|
||||
modal.$el.find('#plugin-frame').css({height: height + 'px'});
|
||||
}
|
||||
|
||||
if (isAndroid) {
|
||||
$$('.view.collaboration-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
|
||||
$$('.view.collaboration-root-view .navbar').prependTo('.view.collaboration-root-view > .pages > .page');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const pluginClose = plugin => {
|
||||
if (iframe) {
|
||||
iframe = null;
|
||||
}
|
||||
};
|
||||
|
||||
const pluginResize = size => {
|
||||
if (Device.phone) {
|
||||
let height = Math.min(size[1], 240);
|
||||
modal.$el.find('#plugin-frame').css({height: height + 'px'});
|
||||
} else {
|
||||
let height = Math.min(size[1], 500);
|
||||
modal.$el.find('#plugin-frame').css({height: height + 'px'});
|
||||
}
|
||||
};
|
||||
|
||||
const getPlugins = (pluginsData, fetchFunction) => {
|
||||
if (!pluginsData || pluginsData.length < 1)
|
||||
return Promise.resolve([]);
|
||||
|
||||
fetchFunction = fetchFunction || function (url) {
|
||||
return fetch(url)
|
||||
.then(function(response) {
|
||||
if (response.ok) return response.json();
|
||||
else return Promise.reject(url);
|
||||
}).then(function(json) {
|
||||
json.baseUrl = url.substring(0, url.lastIndexOf("config.json"));
|
||||
return json;
|
||||
});
|
||||
};
|
||||
|
||||
let loaded = [];
|
||||
|
||||
return pluginsData.map(fetchFunction).reduce(function (previousPromise, currentPromise) {
|
||||
return previousPromise
|
||||
.then(function()
|
||||
{
|
||||
return currentPromise;
|
||||
})
|
||||
.then(function(item)
|
||||
{
|
||||
loaded.push(item);
|
||||
return Promise.resolve(item);
|
||||
})
|
||||
.catch(function(item)
|
||||
{
|
||||
return Promise.resolve(item);
|
||||
});
|
||||
|
||||
}, Promise.resolve())
|
||||
.then(function ()
|
||||
{
|
||||
return Promise.resolve(loaded);
|
||||
});
|
||||
};
|
||||
|
||||
const loadConfig = data => {
|
||||
configPlugins.config = data.config.plugins;
|
||||
};
|
||||
|
||||
const registerPlugins = plugins => {
|
||||
let arr = [];
|
||||
|
||||
plugins.forEach(item => {
|
||||
let plugin = new Asc.CPlugin();
|
||||
|
||||
plugin.set_Name(item['name']);
|
||||
plugin.set_Guid(item['guid']);
|
||||
plugin.set_BaseUrl(item['baseUrl']);
|
||||
|
||||
let variations = item['variations'],
|
||||
variationsArr = [];
|
||||
|
||||
variations.forEach(itemVar => {
|
||||
let variation = new Asc.CPluginVariation();
|
||||
|
||||
variation.set_Description(itemVar['description']);
|
||||
variation.set_Url(itemVar['url']);
|
||||
variation.set_Icons(itemVar['icons']);
|
||||
variation.set_Visual(itemVar['isVisual']);
|
||||
variation.set_CustomWindow(itemVar['isCustomWindow']);
|
||||
variation.set_System(itemVar['isSystem']);
|
||||
variation.set_Viewer(itemVar['isViewer']);
|
||||
variation.set_EditorsSupport(itemVar['EditorsSupport']);
|
||||
variation.set_Modal(itemVar['isModal']);
|
||||
variation.set_InsideMode(itemVar['isInsideMode']);
|
||||
variation.set_InitDataType(itemVar['initDataType']);
|
||||
variation.set_InitData(itemVar['initData']);
|
||||
variation.set_UpdateOleOnResize(itemVar['isUpdateOleOnResize']);
|
||||
variation.set_Buttons(itemVar['buttons']);
|
||||
variation.set_Size(itemVar['size']);
|
||||
variation.set_InitOnSelectionChanged(itemVar['initOnSelectionChanged']);
|
||||
variation.set_Events(itemVar['events']);
|
||||
|
||||
variationsArr.push(variation);
|
||||
});
|
||||
|
||||
plugin["set_Variations"](variationsArr);
|
||||
arr.push(plugin);
|
||||
});
|
||||
|
||||
const api = Common.EditorApi.get();
|
||||
api.asc_pluginsRegister('', arr);
|
||||
};
|
||||
|
||||
const mergePlugins = () => {
|
||||
if (serverPlugins.plugins !== undefined && configPlugins.plugins !== undefined) {
|
||||
let arr = [],
|
||||
plugins = configPlugins;
|
||||
|
||||
if (plugins.plugins && plugins.plugins.length > 0) {
|
||||
arr = plugins.plugins;
|
||||
}
|
||||
|
||||
plugins = serverPlugins;
|
||||
|
||||
if (plugins.plugins && plugins.plugins.length > 0) {
|
||||
arr = arr.concat(plugins.plugins);
|
||||
}
|
||||
|
||||
registerPlugins(arr);
|
||||
}
|
||||
};
|
||||
|
||||
const loadPlugins = () => {
|
||||
if (configPlugins.config) {
|
||||
getPlugins(configPlugins.config.pluginsData)
|
||||
.then(function(loaded)
|
||||
{
|
||||
configPlugins.plugins = loaded;
|
||||
mergePlugins();
|
||||
});
|
||||
} else {
|
||||
configPlugins.plugins = false;
|
||||
}
|
||||
|
||||
let server_plugins_url = '../../../../plugins.json';
|
||||
|
||||
Common.Utils.loadConfig(server_plugins_url, function (obj) {
|
||||
if (obj != 'error') {
|
||||
serverPlugins.config = obj;
|
||||
getPlugins(serverPlugins.config.pluginsData)
|
||||
.then(function(loaded)
|
||||
{
|
||||
serverPlugins.plugins = loaded;
|
||||
mergePlugins();
|
||||
});
|
||||
} else
|
||||
serverPlugins.plugins = false;
|
||||
});
|
||||
};
|
||||
|
||||
return <></>
|
||||
}));
|
||||
|
||||
export default PluginsController;
|
||||
|
||||
|
||||
|
|
@ -9,7 +9,8 @@ import { observable, runInAction } from "mobx";
|
|||
import { observer } from "mobx-react";
|
||||
|
||||
const searchOptions = observable({
|
||||
usereplace: false
|
||||
usereplace: false,
|
||||
isReplaceAll: false
|
||||
});
|
||||
|
||||
const popoverStyle = {
|
||||
|
@ -31,15 +32,20 @@ class SearchSettingsView extends Component {
|
|||
searchBy: 1,
|
||||
lookIn: 1,
|
||||
isMatchCase: false,
|
||||
isMatchCell: false
|
||||
isMatchCell: false,
|
||||
isReplaceAll: false
|
||||
};
|
||||
}
|
||||
|
||||
onFindReplaceClick(action) {
|
||||
runInAction(() => searchOptions.usereplace = action == 'replace');
|
||||
runInAction(() => {
|
||||
searchOptions.usereplace = action == 'replace';
|
||||
searchOptions.isReplaceAll = action == 'replace-all';
|
||||
});
|
||||
|
||||
this.setState({
|
||||
useReplace: searchOptions.usereplace
|
||||
useReplace: searchOptions.usereplace,
|
||||
isReplaceAll: searchOptions.isReplaceAll
|
||||
});
|
||||
|
||||
if (this.onReplaceChecked) {}
|
||||
|
@ -251,14 +257,15 @@ class SearchView extends Component {
|
|||
|
||||
render() {
|
||||
const usereplace = searchOptions.usereplace;
|
||||
const isReplaceAll = searchOptions.isReplaceAll;
|
||||
const hidden = {display: "none"};
|
||||
const searchQuery = this.state.searchQuery;
|
||||
const replaceQuery = this.state.replaceQuery;
|
||||
// const replaceQuery = this.state.replaceQuery;
|
||||
const isIos = Device.ios;
|
||||
const { _t } = this.props;
|
||||
|
||||
if(this.searchbar && this.searchbar.enabled) {
|
||||
usereplace ? this.searchbar.el.classList.add('replace') : this.searchbar.el.classList.remove('replace');
|
||||
usereplace || isReplaceAll ? this.searchbar.el.classList.add('replace') : this.searchbar.el.classList.remove('replace');
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -272,22 +279,30 @@ class SearchView extends Component {
|
|||
</div>
|
||||
<div className="searchbar-inner__center">
|
||||
<div className="searchbar-input-wrap">
|
||||
<input placeholder={_t.textSearch} type="search" maxLength="255" value={searchQuery}
|
||||
<input placeholder={_t.textSearch} type="search" maxLength="255"
|
||||
onChange={e => {this.changeSearchQuery(e.target.value)}} />
|
||||
{isIos ? <i className="searchbar-icon" /> : null}
|
||||
<span className="input-clear-button" />
|
||||
</div>
|
||||
<div className="searchbar-input-wrap" style={!usereplace ? hidden: null}>
|
||||
<input placeholder={_t.textReplace} type="search" maxLength="255" id="idx-replace-val" value={replaceQuery}
|
||||
onChange={e => {this.changeReplaceQuery(e.target.value)}} />
|
||||
{isIos ? <i className="searchbar-icon" /> : null}
|
||||
<span className="input-clear-button" />
|
||||
<span className="input-clear-button" onClick={() => this.changeSearchQuery('')} />
|
||||
</div>
|
||||
{/* {usereplace || isReplaceAll ? */}
|
||||
<div className="searchbar-input-wrap" style={usereplace || isReplaceAll ? null : hidden}>
|
||||
{/* style={!usereplace ? hidden: null} */}
|
||||
<input placeholder={_t.textReplace} type="search" maxLength="255" id="idx-replace-val"
|
||||
onChange={e => {this.changeReplaceQuery(e.target.value)}} />
|
||||
{isIos ? <i className="searchbar-icon" /> : null}
|
||||
<span className="input-clear-button" onClick={() => this.changeReplaceQuery('')} />
|
||||
</div>
|
||||
{/* */}
|
||||
</div>
|
||||
<div className="buttons-row searchbar-inner__right">
|
||||
<div className="buttons-row buttons-row-replace">
|
||||
<a id="replace-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
|
||||
<a id="replace-all-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a>
|
||||
{/* <a id="replace-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
|
||||
<a id="replace-all-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a> */}
|
||||
{isReplaceAll ? (
|
||||
<a id="replace-all-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a>
|
||||
) : usereplace ? (
|
||||
<a id="replace-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="buttons-row">
|
||||
<a className={"link icon-only prev " + (searchQuery.trim().length ? "" : "disabled")} onClick={() => this.onSearchClick(SEARCH_BACKWARD)}>
|
||||
|
|
|
@ -134,7 +134,7 @@ class CollaborationView extends Component {
|
|||
const show_popover = this.props.usePopover;
|
||||
return (
|
||||
show_popover ?
|
||||
<Popover id="coauth-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}>
|
||||
<Popover id="coauth-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()} closeByOutsideClick={false}>
|
||||
<PageCollaboration style={{height: '410px'}} page={this.props.page}/>
|
||||
</Popover> :
|
||||
<Sheet className="coauth__sheet" push onSheetClosed={() => this.props.onclosed()}>
|
||||
|
|
|
@ -292,6 +292,12 @@ const EditCommentDialog = inject("storeComments")(observer(({storeComments, comm
|
|||
done.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
},
|
||||
open: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.add('over-popover');
|
||||
},
|
||||
closed: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.remove('over-popover');
|
||||
}
|
||||
}
|
||||
}).open();
|
||||
|
@ -411,6 +417,12 @@ const AddReplyDialog = inject("storeComments")(observer(({storeComments, userInf
|
|||
}
|
||||
});
|
||||
done.classList.add('disabled');
|
||||
},
|
||||
open: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.add('over-popover');
|
||||
},
|
||||
closed: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.remove('over-popover');
|
||||
}
|
||||
}
|
||||
}).open();
|
||||
|
@ -536,6 +548,12 @@ const EditReplyDialog = inject("storeComments")(observer(({storeComments, commen
|
|||
done.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
},
|
||||
open: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.add('over-popover');
|
||||
},
|
||||
closed: () => {
|
||||
$$('.dialog-backdrop.backdrop-in')[0].classList.remove('over-popover');
|
||||
}
|
||||
}
|
||||
}).open();
|
||||
|
@ -825,7 +843,7 @@ const ViewCommentPopover = ({onCommentMenuClick, onResolveComment}) => {
|
|||
f7.popover.open('#view-comment-popover', '#btn-coauth');
|
||||
});
|
||||
return (
|
||||
<Popover id='view-comment-popover' style={{height: '410px'}}>
|
||||
<Popover id='view-comment-popover' style={{height: '410px'}} closeByOutsideClick={false}>
|
||||
<CommentList onCommentMenuClick={onCommentMenuClick} onResolveComment={onResolveComment} />
|
||||
</Popover>
|
||||
)
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#add-comment-dialog, #edit-comment-dialog, #add-reply-dialog, #edit-reply-dialog {
|
||||
.dialog {
|
||||
--f7-dialog-width: 400px;
|
||||
z-index: 13700;
|
||||
.dialog-inner {
|
||||
padding: 0;
|
||||
height: 400px;
|
||||
|
@ -195,3 +196,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-backdrop.backdrop-in {
|
||||
&.over-popover {
|
||||
z-index: 13600;
|
||||
}
|
||||
}
|
|
@ -435,6 +435,9 @@
|
|||
// Find and Replace
|
||||
|
||||
.navbar {
|
||||
.searchbar {
|
||||
background: var(--f7-navbar-bg-color);
|
||||
}
|
||||
.searchbar-input-wrap {
|
||||
margin-right: 10px;
|
||||
height: 28px;
|
||||
|
@ -462,6 +465,10 @@
|
|||
}
|
||||
|
||||
.searchbar-inner {
|
||||
&__left {
|
||||
margin-right: 10px;
|
||||
justify-content: center;
|
||||
}
|
||||
&__right {
|
||||
.buttons-row a.next {
|
||||
margin-left: 15px;
|
||||
|
@ -469,14 +476,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media(max-width: 550px)
|
||||
{
|
||||
.searchbar-expandable.searchbar-enabled {
|
||||
&.replace {
|
||||
.searchbar-inner {
|
||||
&__right {
|
||||
width: 28%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 550px) {
|
||||
.navbar {
|
||||
.searchbar-input-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.searchbar-expandable.searchbar-enabled {
|
||||
top: 0;
|
||||
.searchbar-inner {
|
||||
&__left {
|
||||
margin-right: 15px;
|
||||
}
|
||||
&__center {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
@ -494,6 +512,14 @@
|
|||
margin: 8px 0;
|
||||
}
|
||||
}
|
||||
&__right {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
justify-content: space-between;
|
||||
.buttons-row-replace {
|
||||
height: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -344,13 +344,9 @@
|
|||
&__center {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
&__left {
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons-row-replace a {
|
||||
color: @white;
|
||||
// &__left {
|
||||
// padding-top: 4px;
|
||||
// }
|
||||
}
|
||||
|
||||
.navbar {
|
||||
|
@ -434,6 +430,7 @@
|
|||
}
|
||||
.buttons-row-replace a {
|
||||
color: @white;
|
||||
padding: 0;
|
||||
}
|
||||
.searchbar .buttons-row {
|
||||
align-self: flex-start;
|
||||
|
|
|
@ -133,12 +133,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.dialog {
|
||||
.content-block {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.about {
|
||||
.content-block {
|
||||
margin: 0 auto 15px;
|
||||
|
@ -750,23 +744,28 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.picker-3d {
|
||||
.picker-item {
|
||||
.dlg-adv-options {
|
||||
z-index: 13700;
|
||||
.content-block {
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
span {
|
||||
}
|
||||
.picker-3d {
|
||||
.picker-item {
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
span {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.picker-center-highlight {
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.picker-center-highlight {
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,4 +20,9 @@ i.icon {
|
|||
&.icon-prev:after, &.icon-next:after {
|
||||
content: none;
|
||||
}
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,4 +25,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.navbar {
|
||||
i.icon {
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.9912 6C14.9912 8.18203 14.4464 9.76912 13.7789 10.7492C13.101 11.7447 12.4042 12 11.9912 12C11.5782 12 10.8814 11.7447 10.2035 10.7492C9.53601 9.76912 8.99121 8.18203 8.99121 6C8.99121 4.23017 10.4571 3 11.9912 3C13.5254 3 14.9912 4.23017 14.9912 6ZM13.4917 13.6397C13.0059 13.8771 12.4989 14 11.9912 14C11.4861 14 10.9817 13.8784 10.4983 13.6434C8.53188 14.3681 6.94518 15.0737 5.78927 15.7768C4.10512 16.8011 4 17.4079 4 17.5C4 17.7664 4.1014 18.3077 5.27104 18.8939C6.50029 19.5099 8.64545 19.9999 12 20C15.3546 20 17.4997 19.5099 18.7289 18.8939C19.8986 18.3078 20 17.7664 20 17.5C20 17.4079 19.8949 16.8011 18.2107 15.7768C17.0529 15.0726 15.4627 14.3657 13.4917 13.6397ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{navBarIconColor}"/></svg>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,10 +15,11 @@
|
|||
}
|
||||
|
||||
.searchbar-inner {
|
||||
justify-content: space-between;
|
||||
&__center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
width: 81%;
|
||||
}
|
||||
&__right {
|
||||
display: flex;
|
||||
|
@ -34,7 +35,9 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: max-content;
|
||||
// width: max-content;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
a {
|
||||
font-size: 15px;
|
||||
height: auto;
|
||||
|
|
|
@ -336,7 +336,9 @@
|
|||
"textHighlightResults": "Highlight Results",
|
||||
"textSearch": "Search",
|
||||
"textMarginsW": "Left and right margins are too high for a given page width",
|
||||
"textMarginsH": "Top and bottom margins are too high for a given page height"
|
||||
"textMarginsH": "Top and bottom margins are too high for a given page height",
|
||||
"textCollaboration": "Collaboration",
|
||||
"textFindAndReplaceAll": "Find and Replace All"
|
||||
},
|
||||
"Edit": {
|
||||
"textClose": "Close",
|
||||
|
|
|
@ -7,6 +7,9 @@ const LongActionsController = () => {
|
|||
const {t} = useTranslation();
|
||||
const _t = t("LongActions", { returnObjects: true });
|
||||
|
||||
const ApplyEditRights = -255;
|
||||
const LoadingDocument = -256;
|
||||
|
||||
const stackLongActions = new IrregularStack({
|
||||
strongCompare : function(obj1, obj2){return obj1.id === obj2.id && obj1.type === obj2.type;},
|
||||
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
|
||||
|
@ -18,7 +21,7 @@ const LongActionsController = () => {
|
|||
if (loadMask && loadMask.el) {
|
||||
f7.dialog.close(loadMask.el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect( () => {
|
||||
Common.Notifications.on('engineCreated', (api) => {
|
||||
|
|
|
@ -15,6 +15,7 @@ import About from '../../../../common/mobile/lib/view/About';
|
|||
import EditorUIController from '../lib/patch';
|
||||
import ErrorController from "./Error";
|
||||
import LongActionsController from "./LongActions";
|
||||
import PluginsController from '../../../../common/mobile/lib/controller/Plugins.jsx';
|
||||
|
||||
@inject(
|
||||
"storeAppOptions",
|
||||
|
@ -799,6 +800,7 @@ class MainController extends Component {
|
|||
<CommentsController />
|
||||
{EditorUIController.getEditCommentControllers && EditorUIController.getEditCommentControllers()}
|
||||
<ViewCommentsController />
|
||||
<PluginsController />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
</List>
|
||||
<List>
|
||||
<ListItem title={_t.textCaseSensitive}>
|
||||
|
|
|
@ -71,7 +71,7 @@ const Settings = props => {
|
|||
window.open(url, "_blank");
|
||||
};
|
||||
|
||||
return <SettingsView usePopover={!Device.phone} onclosed={onviewclosed} onReaderMode={onReaderMode} onPrint={onPrint} showHelp={showHelp}/>
|
||||
return <SettingsView usePopover={!Device.phone} openOptions={props.openOptions} onclosed={onviewclosed} onReaderMode={onReaderMode} onPrint={onPrint} showHelp={showHelp}/>
|
||||
};
|
||||
|
||||
export default inject("storeAppOptions")(observer(Settings));
|
|
@ -20,11 +20,6 @@
|
|||
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 d="M22,12H12v10h-1V12H1v-1h10V1h1v10h10V12z"/></g></svg>');
|
||||
}
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
&.icon-settings {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
@ -26,11 +26,6 @@
|
|||
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="@{navBarIconColor}"><g><path d="M12.1,2H9.9C9.6,2,9.4,2.2,9.3,2.5L8.8,4.9c0,0.2-0.2,0.3-0.3,0.3s-0.1,0-0.2-0.1L6.2,3.8C6.1,3.7,6,3.7,5.8,3.7c-0.1,0-0.3,0-0.4,0.1L3.8,5.4c-0.1,0.2-0.2,0.5,0,0.8l1.3,2.1c0.1,0.2,0.1,0.4-0.2,0.5L2.5,9.3C2.2,9.4,2,9.6,2,9.9v2.2c0,0.3,0.2,0.5,0.5,0.6l2.4,0.5c0.3,0.1,0.4,0.3,0.2,0.5l-1.3,2.1c-0.2,0.2-0.1,0.6,0.1,0.8l1.6,1.6c0.1,0.1,0.3,0.2,0.4,0.2s0.2,0,0.3-0.1L8.3,17c0.1-0.1,0.1-0.1,0.2-0.1s0.3,0.1,0.3,0.3l0.5,2.3C9.4,19.8,9.6,20,9.9,20h2.2c0.3,0,0.5-0.2,0.6-0.5l0.5-2.4c0-0.2,0.1-0.3,0.3-0.3c0.1,0,0.1,0,0.2,0.1l2.1,1.3c0.1,0.1,0.2,0.1,0.3,0.1c0.2,0,0.3-0.1,0.4-0.2l1.6-1.6c0.2-0.2,0.2-0.5,0.1-0.8l-1.3-2.1c-0.2-0.2-0.1-0.5,0.2-0.5l2.4-0.5c0.3-0.1,0.5-0.3,0.5-0.6V9.8c0-0.3-0.2-0.5-0.5-0.6l-2.4-0.5c-0.3-0.1-0.4-0.3-0.2-0.5l1.3-2.1c0.2-0.2,0.1-0.6-0.1-0.8l-1.6-1.6c-0.1-0.1-0.3-0.2-0.4-0.2s-0.2,0-0.3,0.1l-2.1,1.3C13.6,5,13.6,5,13.5,5s-0.3-0.1-0.3-0.3l-0.5-2.2C12.6,2.2,12.4,2,12.1,2L12.1,2z M11,14.5c-1.9,0-3.5-1.6-3.5-3.5S9.1,7.5,11,7.5s3.5,1.6,3.5,3.5S12.9,14.5,11,14.5L11,14.5z"/></g></svg>');
|
||||
}
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.9912 6C14.9912 8.18203 14.4464 9.76912 13.7789 10.7492C13.101 11.7447 12.4042 12 11.9912 12C11.5782 12 10.8814 11.7447 10.2035 10.7492C9.53601 9.76912 8.99121 8.18203 8.99121 6C8.99121 4.23017 10.4571 3 11.9912 3C13.5254 3 14.9912 4.23017 14.9912 6ZM13.4917 13.6397C13.0059 13.8771 12.4989 14 11.9912 14C11.4861 14 10.9817 13.8784 10.4983 13.6434C8.53188 14.3681 6.94518 15.0737 5.78927 15.7768C4.10512 16.8011 4 17.4079 4 17.5C4 17.7664 4.1014 18.3077 5.27104 18.8939C6.50029 19.5099 8.64545 19.9999 12 20C15.3546 20 17.4997 19.5099 18.7289 18.8939C19.8986 18.3078 20 17.7664 20 17.5C20 17.4079 19.8949 16.8011 18.2107 15.7768C17.0529 15.0726 15.4627 14.3657 13.4917 13.6397ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{navBarIconColor}"/></svg>');
|
||||
}
|
||||
&.icon-expand-down {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
|
@ -57,6 +52,11 @@
|
|||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 12C7 13.6569 5.65685 15 4 15C2.34315 15 1 13.6569 1 12C1 10.3431 2.34315 9 4 9C5.65685 9 7 10.3431 7 12ZM15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12ZM20 15C21.6569 15 23 13.6569 23 12C23 10.3431 21.6569 9 20 9C18.3431 9 17 10.3431 17 12C17 13.6569 18.3431 15 20 15Z" fill="@{navBarIconColor}"/></svg>');
|
||||
}
|
||||
&.icon-search {
|
||||
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="@{white}"><g><path d="M19.5,16.8L16,13.3c0.7-1.1,1.1-2.4,1.1-3.8C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.4,0,2.7-0.4,3.8-1.1l3.5,3.5c0.7,0.7,1.9,0.7,2.6,0C20.2,18.7,20.2,17.6,19.5,16.8z M9.5,15.3c-3.2,0-5.8-2.6-5.8-5.8s2.6-5.8,5.8-5.8s5.8,2.6,5.8,5.8S12.7,15.3,9.5,15.3z"/></g></svg>');
|
||||
}
|
||||
}
|
||||
}
|
||||
i.icon {
|
||||
|
|
|
@ -93,7 +93,7 @@ class MainPage extends Component {
|
|||
}
|
||||
{
|
||||
!this.state.settingsVisible ? null :
|
||||
<Settings onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
}
|
||||
{
|
||||
!this.state.collaborationVisible ? null :
|
||||
|
|
|
@ -36,7 +36,8 @@ export class storeTextSettings {
|
|||
resetTextColor: action,
|
||||
changeCustomTextColors: action,
|
||||
resetLineSpacing: action,
|
||||
resetBackgroundColor: action
|
||||
resetBackgroundColor: action,
|
||||
changeFontFamily: action
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -156,6 +157,10 @@ export class storeTextSettings {
|
|||
this.customTextColors = colors;
|
||||
}
|
||||
|
||||
changeFontFamily(name) {
|
||||
this.fontName = name;
|
||||
}
|
||||
|
||||
resetLineSpacing (vc) {
|
||||
let line = (vc.get_Line() === null || vc.get_LineRule() === null || vc.get_LineRule() != 1) ? -1 : vc.get_Line();
|
||||
this.lineSpacing = line;
|
||||
|
|
|
@ -9,7 +9,7 @@ const ToolbarView = props => {
|
|||
<Fragment>
|
||||
<NavLeft>
|
||||
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
|
||||
{props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
{Device.ios && props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
|
@ -18,13 +18,19 @@ const ToolbarView = props => {
|
|||
</NavLeft>
|
||||
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
|
||||
<NavRight>
|
||||
{Device.android && props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
onRedoClick: props.onRedo
|
||||
})}
|
||||
{props.isEdit && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
|
||||
disabled: disableEditBtn || props.disabledControls,
|
||||
onEditClick: e => props.openOptions('edit'),
|
||||
onAddClick: e => props.openOptions('add')
|
||||
})}
|
||||
{ Device.phone ? null : <Link className={(props.disabledControls || props.readerMode) && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
|
||||
{props.displayCollaboration && <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link>}
|
||||
{props.displayCollaboration && window.matchMedia("(min-width: 390px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link> : null}
|
||||
<Link className={(props.disabledSettings || props.disabledControls) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={e => props.openOptions('settings')}></Link>
|
||||
</NavRight>
|
||||
</Fragment>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, {Fragment, useState} from 'react';
|
||||
import {observer, inject} from "mobx-react";
|
||||
import {List, ListItem, Icon, Row, Page, Navbar, BlockTitle, Toggle, Range, ListButton, Link, Tabs, Tab} from 'framework7-react';
|
||||
import { f7 } from 'framework7-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {Device} from '../../../../../common/mobile/utils/device';
|
||||
import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx";
|
||||
|
@ -119,14 +120,19 @@ const PageStyle = props => {
|
|||
const _t = t('Edit', {returnObjects: true});
|
||||
const storeShapeSettings = props.storeShapeSettings;
|
||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||
const stroke = shapeObject.get_ShapeProperties().get_stroke();
|
||||
|
||||
let borderSize, borderType, transparent;
|
||||
if (shapeObject) {
|
||||
const stroke = shapeObject.get_ShapeProperties().get_stroke();
|
||||
borderSize = stroke.get_width() * 72.0 / 25.4;
|
||||
borderType = stroke.get_type();
|
||||
transparent = shapeObject.get_ShapeProperties().get_fill().asc_getTransparent();
|
||||
}
|
||||
|
||||
// Init border size
|
||||
const borderSizeTransform = storeShapeSettings.borderSizeTransform();
|
||||
const borderSize = stroke.get_width() * 72.0 / 25.4;
|
||||
const borderType = stroke.get_type();
|
||||
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
||||
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
||||
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
||||
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
||||
const [stateBorderSize, setBorderSize] = useState(displayBorderSize);
|
||||
const [stateTextBorderSize, setTextBorderSize] = useState(displayTextBorderSize);
|
||||
|
||||
|
@ -135,10 +141,14 @@ const PageStyle = props => {
|
|||
const displayBorderColor = borderColor !== 'transparent' ? `#${(typeof borderColor === "object" ? borderColor.color : borderColor)}` : borderColor;
|
||||
|
||||
// Init opacity
|
||||
const transparent = shapeObject.get_ShapeProperties().get_fill().asc_getTransparent();
|
||||
const opacity = transparent !== null && transparent !== undefined ? transparent / 2.55 : 100;
|
||||
const [stateOpacity, setOpacity] = useState(Math.round(opacity));
|
||||
|
||||
if (!shapeObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar backLink={_t.textBack}>
|
||||
|
@ -202,14 +212,17 @@ const PageStyleNoFill = props => {
|
|||
const _t = t('Edit', {returnObjects: true});
|
||||
const storeShapeSettings = props.storeShapeSettings;
|
||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||
const stroke = shapeObject.get_ShapeProperties().get_stroke();
|
||||
let borderSize, borderType;
|
||||
if (shapeObject) {
|
||||
const stroke = shapeObject.get_ShapeProperties().get_stroke();
|
||||
borderSize = stroke.get_width() * 72.0 / 25.4;
|
||||
borderType = stroke.get_type();
|
||||
}
|
||||
|
||||
// Init border size
|
||||
const borderSizeTransform = storeShapeSettings.borderSizeTransform();
|
||||
const borderSize = stroke.get_width() * 72.0 / 25.4;
|
||||
const borderType = stroke.get_type();
|
||||
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
||||
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
||||
const displayBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.indexSizeByValue(borderSize);
|
||||
const displayTextBorderSize = (borderType == Asc.c_oAscStrokeType.STROKE_NONE || borderType === undefined) ? 0 : borderSizeTransform.sizeByValue(borderSize);
|
||||
const [stateBorderSize, setBorderSize] = useState(displayBorderSize);
|
||||
const [stateTextBorderSize, setTextBorderSize] = useState(displayTextBorderSize);
|
||||
|
||||
|
@ -217,6 +230,11 @@ const PageStyleNoFill = props => {
|
|||
const borderColor = !storeShapeSettings.borderColorView ? storeShapeSettings.initBorderColorView(shapeObject) : storeShapeSettings.borderColorView;
|
||||
const displayBorderColor = borderColor !== 'transparent' ? `#${(typeof borderColor === "object" ? borderColor.color : borderColor)}` : borderColor;
|
||||
|
||||
if (!shapeObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar backLink={_t.textBack} title={_t.textBorder}></Navbar>
|
||||
|
@ -252,13 +270,20 @@ const PageWrap = props => {
|
|||
const _t = t('Edit', {returnObjects: true});
|
||||
const storeShapeSettings = props.storeShapeSettings;
|
||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||
const wrapType = storeShapeSettings.getWrapType(shapeObject);
|
||||
const align = storeShapeSettings.getAlign(shapeObject);
|
||||
const moveText = storeShapeSettings.getMoveText(shapeObject);
|
||||
const overlap = storeShapeSettings.getOverlap(shapeObject);
|
||||
const distance = Common.Utils.Metric.fnRecalcFromMM(storeShapeSettings.getWrapDistance(shapeObject));
|
||||
let wrapType, align, moveText, overlap, distance;
|
||||
if (shapeObject) {
|
||||
wrapType = storeShapeSettings.getWrapType(shapeObject);
|
||||
align = storeShapeSettings.getAlign(shapeObject);
|
||||
moveText = storeShapeSettings.getMoveText(shapeObject);
|
||||
overlap = storeShapeSettings.getOverlap(shapeObject);
|
||||
distance = Common.Utils.Metric.fnRecalcFromMM(storeShapeSettings.getWrapDistance(shapeObject));
|
||||
}
|
||||
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||
const [stateDistance, setDistance] = useState(distance);
|
||||
if (!shapeObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
||||
|
@ -352,6 +377,13 @@ const PageReplace = props => {
|
|||
const storeShapeSettings = props.storeShapeSettings;
|
||||
let shapes = storeShapeSettings.getStyleGroups();
|
||||
shapes.splice(0, 1); // Remove line shapes
|
||||
|
||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||
if (!shapeObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page className="shapes dataview">
|
||||
<Navbar title={_t.textReplace} backLink={_t.textBack} />
|
||||
|
@ -377,6 +409,13 @@ const PageReplace = props => {
|
|||
const PageReorder = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('Edit', {returnObjects: true});
|
||||
|
||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||
if (!shapeObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textReorder} backLink={_t.textBack} />
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, {Fragment, useState} from 'react';
|
||||
import {observer, inject} from "mobx-react";
|
||||
import {Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon, Link, Tabs, Tab} from 'framework7-react';
|
||||
import { f7 } from 'framework7-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {Device} from '../../../../../common/mobile/utils/device';
|
||||
import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx";
|
||||
|
@ -12,10 +13,20 @@ const PageTableOptions = props => {
|
|||
const storeFocusObjects = props.storeFocusObjects;
|
||||
const tableObject = storeFocusObjects.tableObject;
|
||||
const storeTableSettings = props.storeTableSettings;
|
||||
const distance = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getCellMargins(tableObject));
|
||||
|
||||
let distance, isRepeat, isResize;
|
||||
if (tableObject) {
|
||||
distance = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getCellMargins(tableObject));
|
||||
isRepeat = storeTableSettings.getRepeatOption(tableObject);
|
||||
isResize = storeTableSettings.getResizeOption(tableObject);
|
||||
}
|
||||
const [stateDistance, setDistance] = useState(distance);
|
||||
const isRepeat = storeTableSettings.getRepeatOption(tableObject);
|
||||
const isResize = storeTableSettings.getResizeOption(tableObject);
|
||||
|
||||
if (!tableObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textOptions} backLink={_t.textBack} />
|
||||
|
@ -60,12 +71,21 @@ const PageWrap = props => {
|
|||
const _t = t('Edit', {returnObjects: true});
|
||||
const storeTableSettings = props.storeTableSettings;
|
||||
const tableObject = props.storeFocusObjects.tableObject;
|
||||
const wrapType = storeTableSettings.getWrapType(tableObject);
|
||||
const align = storeTableSettings.getAlign(tableObject);
|
||||
const moveText = storeTableSettings.getMoveText(tableObject);
|
||||
const distance = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getWrapDistance(tableObject));
|
||||
let wrapType, align, moveText, distance;
|
||||
if (tableObject) {
|
||||
wrapType = storeTableSettings.getWrapType(tableObject);
|
||||
align = storeTableSettings.getAlign(tableObject);
|
||||
moveText = storeTableSettings.getMoveText(tableObject);
|
||||
distance = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getWrapDistance(tableObject));
|
||||
}
|
||||
const metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||
const [stateDistance, setDistance] = useState(distance);
|
||||
|
||||
if (!tableObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textWrap} backLink={_t.textBack} />
|
||||
|
@ -177,13 +197,17 @@ const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyle
|
|||
const PageStyleOptions = props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('Edit', {returnObjects: true});
|
||||
const tableLook = props.storeFocusObjects.tableObject.get_TableLook();
|
||||
const isFirstRow = tableLook.get_FirstRow();
|
||||
const isLastRow = tableLook.get_LastRow();
|
||||
const isBandHor = tableLook.get_BandHor();
|
||||
const isFirstCol = tableLook.get_FirstCol();
|
||||
const isLastCol = tableLook.get_LastCol();
|
||||
const isBandVer = tableLook.get_BandVer();
|
||||
const tableObject = props.storeFocusObjects.tableObject;
|
||||
let tableLook, isFirstRow, isLastRow, isBandHor, isFirstCol, isLastCol, isBandVer;
|
||||
if (tableObject) {
|
||||
tableLook = tableObject.get_TableLook();
|
||||
isFirstRow = tableLook.get_FirstRow();
|
||||
isLastRow = tableLook.get_LastRow();
|
||||
isBandHor = tableLook.get_BandHor();
|
||||
isFirstCol = tableLook.get_FirstCol();
|
||||
isLastCol = tableLook.get_LastCol();
|
||||
isBandVer = tableLook.get_BandVer();
|
||||
}
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textOptions} backLink={_t.textBack}/>
|
||||
|
@ -217,9 +241,12 @@ const PageCustomFillColor = props => {
|
|||
const { t } = useTranslation();
|
||||
const _t = t('Edit', {returnObjects: true});
|
||||
const tableObject = props.storeFocusObjects.tableObject;
|
||||
let fillColor = props.storeTableSettings.getFillColor(tableObject);
|
||||
if (typeof fillColor === 'object') {
|
||||
fillColor = fillColor.color;
|
||||
let fillColor;
|
||||
if (tableObject) {
|
||||
fillColor = props.storeTableSettings.getFillColor(tableObject);
|
||||
if (typeof fillColor === 'object') {
|
||||
fillColor = fillColor.color;
|
||||
}
|
||||
}
|
||||
const onAddNewColor = (colors, color) => {
|
||||
props.storePalette.changeCustomColors(colors);
|
||||
|
@ -405,6 +432,13 @@ const PageStyle = props => {
|
|||
const _t = t('Edit', {returnObjects: true});
|
||||
const storeTableSettings = props.storeTableSettings;
|
||||
const templates = storeTableSettings.styles;
|
||||
|
||||
const tableObject = props.storeFocusObjects.tableObject;
|
||||
if (!tableObject && Device.phone) {
|
||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar backLink={_t.textBack}>
|
||||
|
|
|
@ -28,6 +28,9 @@ const PageFonts = props => {
|
|||
}}
|
||||
});
|
||||
};
|
||||
|
||||
console.log(curFontName);
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={t('Edit.textFonts')} backLink={t('Edit.textBack')} />
|
||||
|
@ -60,7 +63,7 @@ const PageFonts = props => {
|
|||
checked={curFontName === item.name}
|
||||
title={item.name}
|
||||
style={{fontFamily: `${item.name}`}}
|
||||
onClick={() => {props.changeFontFamily(item.name)}}
|
||||
onClick={() => {storeTextSettings.changeFontFamily(item.name); props.changeFontFamily(item.name)}}
|
||||
></ListItem>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
@ -71,12 +71,17 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (Device.phone) {
|
||||
f7.sheet.close('.settings-popup', true);
|
||||
f7.sheet.close('.settings-popup', false);
|
||||
} else {
|
||||
f7.popover.close('#settings-popover');
|
||||
f7.popover.close('#settings-popover', false);
|
||||
}
|
||||
};
|
||||
|
||||
const onOpenCollaboration = async () => {
|
||||
await closeModal();
|
||||
await props.openOptions('coauth');
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
});
|
||||
|
||||
|
@ -117,6 +122,11 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
|||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{window.matchMedia("(max-width: 389px)").matches ?
|
||||
<ListItem title={_t.textCollaboration} link="#" onClick={onOpenCollaboration}>
|
||||
<Icon slot="media" icon="icon-collaboration"></Icon>
|
||||
</ListItem>
|
||||
: null}
|
||||
{_canReader &&
|
||||
<ListItem title={_t.textReaderMode}> {/*ToDo*/}
|
||||
<Icon slot="media" icon="icon-reader"></Icon>
|
||||
|
@ -182,10 +192,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} 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}/>
|
||||
</Popover> :
|
||||
<Popup className="settings-popup" onPopupClosed={() => this.props.onclosed()}>
|
||||
<SettingsList onOptionClick={this.onoptionclick} 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}/>
|
||||
</Popup>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -123,7 +123,9 @@
|
|||
"txtEditingMode": "Set editing mode...",
|
||||
"loadingDocumentTitleText": "Loading document",
|
||||
"loadingDocumentTextText": "Loading document...",
|
||||
"textLoadingDocument": "Loading document"
|
||||
"textLoadingDocument": "Loading document",
|
||||
"loadThemeTitleText": "Loading Theme",
|
||||
"loadThemeTextText": "Loading theme..."
|
||||
},
|
||||
"ContextMenu": {
|
||||
"menuViewComment": "View Comment",
|
||||
|
@ -148,7 +150,8 @@
|
|||
"Settings": {
|
||||
"textDone": "Done",
|
||||
"textSettings": "Settings",
|
||||
"textFindAndReplace": "Find and replace",
|
||||
"textFindAndReplace": "Find and Replace",
|
||||
"textFindAndReplaceAll": "Find and Replace All",
|
||||
"textPresentationSettings": "Presentation Settings",
|
||||
"textApplicationSettings": "Application Settings",
|
||||
"textDownload": "Download",
|
||||
|
@ -198,7 +201,8 @@
|
|||
"textCaseSensitive": "Case Sensitive",
|
||||
"textHighlight": "Highlight Results",
|
||||
"textReplace": "Replace",
|
||||
"textNoTextFound": "Text not Found"
|
||||
"textNoTextFound": "Text not Found",
|
||||
"textCollaboration": "Collaboration"
|
||||
},
|
||||
"Add": {
|
||||
"textSlide": "Slide",
|
||||
|
|
|
@ -7,6 +7,9 @@ const LongActionsController = () => {
|
|||
const {t} = useTranslation();
|
||||
const _t = t("LongActions", {returnObjects: true});
|
||||
|
||||
const ApplyEditRights = -255;
|
||||
const LoadingDocument = -256;
|
||||
|
||||
const stackLongActions = new IrregularStack({
|
||||
strongCompare : function(obj1, obj2){return obj1.id === obj2.id && obj1.type === obj2.type;},
|
||||
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
|
||||
|
@ -118,6 +121,11 @@ const LongActionsController = () => {
|
|||
text = _t.uploadImageTextText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscAsyncAction['LoadTheme']:
|
||||
title = _t.loadThemeTitleText;
|
||||
text = _t.loadThemeTextText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscAsyncAction['ApplyChanges']:
|
||||
title = _t.applyChangesTitleText;
|
||||
text = _t.applyChangesTextText;
|
||||
|
@ -151,7 +159,7 @@ const LongActionsController = () => {
|
|||
}
|
||||
|
||||
if (action.type === Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
if (action.id === Asc.c_oAscAsyncAction['ApplyChanges']) {
|
||||
if (action.id === Asc.c_oAscAsyncAction['ApplyChanges'] || action.id === Asc.c_oAscAsyncAction['LoadDocumentFonts']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -161,7 +169,6 @@ const LongActionsController = () => {
|
|||
loadMask = f7.dialog.preloader(title);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const onOpenDocument = (progress) => {
|
||||
|
|
|
@ -13,6 +13,7 @@ import ErrorController from "./Error";
|
|||
import LongActionsController from "./LongActions";
|
||||
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
|
||||
import About from '../../../../common/mobile/lib/view/About';
|
||||
import PluginsController from '../../../../common/mobile/lib/controller/Plugins.jsx';
|
||||
|
||||
@inject(
|
||||
"storeFocusObjects",
|
||||
|
@ -779,6 +780,7 @@ class MainController extends Component {
|
|||
<CommentsController />
|
||||
{EditorUIController.getEditCommentControllers && EditorUIController.getEditCommentControllers()}
|
||||
<ViewCommentsController />
|
||||
<PluginsController />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
</List>
|
||||
<List>
|
||||
<ListItem title={_t.textCaseSensitive}>
|
||||
|
|
|
@ -458,12 +458,6 @@
|
|||
}
|
||||
|
||||
// Collaboration
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
|
||||
&.icon-users {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
@ -416,12 +416,6 @@
|
|||
}
|
||||
|
||||
// Collaboration
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
|
||||
&.icon-users {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
@ -482,6 +476,11 @@
|
|||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.0235 7C18.4006 7 19.5743 7.49845 20.5446 8.49534C21.5149 9.46108 22 10.6293 22 12C22 13.3708 21.5149 14.5546 20.5446 15.5515C19.5743 16.5172 18.4006 17.0001 17.0235 17.0001H13V15H17C17.8451 15 18.5884 14.7882 19.1831 14.1963C19.8091 13.5733 20 12.8411 20 12C20 11.1589 19.8091 10.4424 19.1831 9.85049C18.5884 9.22743 17.8685 9 17.0235 9H13V7H17.0235ZM8.00939 12.9814V11.0187H15.9906V12.9814H8.00939ZM4.76995 9.85049C4.17527 10.4424 4 11.1589 4 12C4 12.8411 4.17527 13.5733 4.76995 14.1963C5.39593 14.7882 6.15493 15 7 15H11.0141V17.0001H6.97653C5.59937 17.0001 4.42567 16.5172 3.4554 15.5515C2.48513 14.5546 2 13.3708 2 12C2 10.6293 2.48513 9.46108 3.4554 8.49534C4.42567 7.49845 5.59937 7 6.97653 7H11.0141V9H6.97653C6.13146 9 5.39593 9.22743 4.76995 9.85049Z" fill="@{themeColor}"/></svg>');
|
||||
}
|
||||
&.icon-plus {
|
||||
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" x="0px" y="0px" viewBox="0 0 22 22" fill="@{navBarIconColor}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>');
|
||||
}
|
||||
}
|
||||
|
||||
// Overwrite color for toolbar
|
||||
|
@ -559,12 +558,6 @@
|
|||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{navBarIconColor}"><g><polygon points="10.9,16.9 2,8.1 4.1,6 11.1,12.8 17.9,6 20,8.1 11.2,16.9 11.1,17 "/></g></svg>');
|
||||
}
|
||||
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.9912 6C14.9912 8.18203 14.4464 9.76912 13.7789 10.7492C13.101 11.7447 12.4042 12 11.9912 12C11.5782 12 10.8814 11.7447 10.2035 10.7492C9.53601 9.76912 8.99121 8.18203 8.99121 6C8.99121 4.23017 10.4571 3 11.9912 3C13.5254 3 14.9912 4.23017 14.9912 6ZM13.4917 13.6397C13.0059 13.8771 12.4989 14 11.9912 14C11.4861 14 10.9817 13.8784 10.4983 13.6434C8.53188 14.3681 6.94518 15.0737 5.78927 15.7768C4.10512 16.8011 4 17.4079 4 17.5C4 17.7664 4.1014 18.3077 5.27104 18.8939C6.50029 19.5099 8.64545 19.9999 12 20C15.3546 20 17.4997 19.5099 18.7289 18.8939C19.8986 18.3078 20 17.7664 20 17.5C20 17.4079 19.8949 16.8011 18.2107 15.7768C17.0529 15.0726 15.4627 14.3657 13.4917 13.6397ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{navBarIconColor}"/></svg>');
|
||||
}
|
||||
|
||||
&.icon-add-slide {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
@ -95,7 +95,7 @@ class MainPage extends Component {
|
|||
}
|
||||
{
|
||||
!this.state.settingsVisible ? null :
|
||||
<Settings onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
}
|
||||
{
|
||||
!this.state.collaborationVisible ? null :
|
||||
|
|
|
@ -8,7 +8,7 @@ const ToolbarView = props => {
|
|||
<Fragment>
|
||||
<NavLeft>
|
||||
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
|
||||
{props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
{Device.ios && props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
|
@ -17,6 +17,12 @@ const ToolbarView = props => {
|
|||
</NavLeft>
|
||||
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
|
||||
<NavRight>
|
||||
{Device.android && props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
onRedoClick: props.onRedo
|
||||
})}
|
||||
<Link className={(props.disabledControls || props.disabledPreview) && 'disabled'} icon='icon-play' href={false} onClick={() => {props.openOptions('preview')}}></Link>
|
||||
{props.isEdit && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
|
||||
disabledAdd: props.disabledAdd || props.disabledControls,
|
||||
|
@ -25,7 +31,7 @@ const ToolbarView = props => {
|
|||
onAddClick: () => props.openOptions('add')
|
||||
})}
|
||||
{ Device.phone ? null : <Link className={props.disabledControls && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
|
||||
{props.displayCollaboration && <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link>}
|
||||
{props.displayCollaboration && window.matchMedia("(min-width: 390px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link> : null}
|
||||
<Link className={(props.disabledSettings || props.disabledControls) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={() => props.openOptions('settings')}></Link>
|
||||
</NavRight>
|
||||
</Fragment>
|
||||
|
|
|
@ -70,12 +70,17 @@ const SettingsList = withTranslation()(props => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (Device.phone) {
|
||||
f7.sheet.close('.settings-popup', true);
|
||||
f7.sheet.close('.settings-popup', false);
|
||||
} else {
|
||||
f7.popover.close('#settings-popover');
|
||||
f7.popover.close('#settings-popover', false);
|
||||
}
|
||||
};
|
||||
|
||||
const onOpenCollaboration = async () => {
|
||||
await closeModal();
|
||||
await props.openOptions('coauth');
|
||||
}
|
||||
|
||||
const onPrint = () => {
|
||||
closeModal();
|
||||
const api = Common.EditorApi.get();
|
||||
|
@ -112,6 +117,11 @@ const SettingsList = withTranslation()(props => {
|
|||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{window.matchMedia("(max-width: 389px)").matches ?
|
||||
<ListItem title={_t.textCollaboration} link="#" onClick={onOpenCollaboration}>
|
||||
<Icon slot="media" icon="icon-collaboration"></Icon>
|
||||
</ListItem>
|
||||
: null}
|
||||
<ListItem link="#" title={_t.textPresentationSettings} onClick={onoptionclick.bind(this, '/presentation-settings/')}>
|
||||
<Icon slot="media" icon="icon-setup"></Icon>
|
||||
</ListItem>
|
||||
|
@ -152,13 +162,14 @@ class SettingsView extends Component {
|
|||
|
||||
render() {
|
||||
const show_popover = this.props.usePopover;
|
||||
|
||||
return (
|
||||
show_popover ?
|
||||
<Popover id="settings-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}>
|
||||
<SettingsList inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} />
|
||||
<SettingsList inPopover={true} openOptions={this.props.openOptions} onOptionClick={this.onoptionclick} style={{height: '410px'}} />
|
||||
</Popover> :
|
||||
<Popup className="settings-popup" onPopupClosed={() => this.props.onclosed()}>
|
||||
<SettingsList onOptionClick={this.onoptionclick} />
|
||||
<SettingsList onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} />
|
||||
</Popup>
|
||||
)
|
||||
}
|
||||
|
@ -174,13 +185,12 @@ const Settings = props => {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
const onviewclosed = () => {
|
||||
if ( props.onclosed )
|
||||
if (props.onclosed)
|
||||
props.onclosed();
|
||||
};
|
||||
|
||||
return <SettingsView usePopover={!Device.phone} onclosed={onviewclosed} />
|
||||
return <SettingsView usePopover={!Device.phone} onclosed={onviewclosed} openOptions={props.openOptions} />
|
||||
};
|
||||
|
||||
export default Settings;
|
|
@ -2,8 +2,64 @@
|
|||
"Controller" : {
|
||||
"Main" : {
|
||||
"SDK": {
|
||||
"txtStyle_Normal": "Normal",
|
||||
"txtStyle_Heading_1": "Heading 1",
|
||||
"txtStyle_Heading_2": "Heading 2",
|
||||
"txtStyle_Heading_3": "Heading 3",
|
||||
"txtStyle_Heading_4": "Heading 4",
|
||||
"txtStyle_Title": "Title",
|
||||
"txtStyle_Neutral": "Neutral",
|
||||
"txtStyle_Bad": "Bad",
|
||||
"txtStyle_Good": "Good",
|
||||
"txtStyle_Input": "Input",
|
||||
"txtStyle_Output": "Output",
|
||||
"txtStyle_Calculation": "Calculation",
|
||||
"txtStyle_Check_Cell": "Check Cell",
|
||||
"txtStyle_Explanatory_Text": "Explanatory Text",
|
||||
"txtStyle_Note": "Note",
|
||||
"txtStyle_Linked_Cell": "Linked Cell",
|
||||
"txtStyle_Warning_Text": "Warning Text",
|
||||
"txtStyle_Total": "Total",
|
||||
"txtStyle_Currency": "Currency",
|
||||
"txtStyle_Percent": "Percent",
|
||||
"txtStyle_Comma": "Comma",
|
||||
"txtSeries": "Series",
|
||||
"txtDiagramTitle": "Chart Title",
|
||||
"txtXAxis": "X Axis",
|
||||
"txtYAxis": "Y Axis",
|
||||
"txtArt": "Your text here",
|
||||
"txtAccent": "Accent"
|
||||
},
|
||||
"textAnonymous": "Anonymous"
|
||||
"textGuest": "Guest",
|
||||
"textAnonymous": "Anonymous",
|
||||
"warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact your administrator to learn more.",
|
||||
"warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
|
||||
"warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.",
|
||||
"warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"textNoLicenseTitle": "License limit reached",
|
||||
"warnLicenseLimitedNoAccess": "License expired. You have no access to document editing functionality. Please contact your administrator.",
|
||||
"warnLicenseLimitedRenewed": "License needs to be renewed. You have a limited access to document editing functionality.<br>Please contact your administrator to get full access",
|
||||
"textBuyNow": "Visit website",
|
||||
"textContactUs": "Contact sales",
|
||||
"textPaidFeature": "Paid feature",
|
||||
"textCustomLoader": "Please note that according to the terms of the license you are not entitled to change the loader. Please contact our Sales Department to get a quote.",
|
||||
"textClose": "Close",
|
||||
|
||||
"notcriticalErrorTitle": "Warning",
|
||||
"textHasMacros": "The file contains automatic macros.<br>Do you want to run macros?",
|
||||
"textRemember": "Remember my choice",
|
||||
"textYes": "Yes",
|
||||
"textNo": "No",
|
||||
|
||||
"leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.",
|
||||
"errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
|
||||
"titleUpdateVersion": "Version changed",
|
||||
"errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.",
|
||||
"titleServerVersion": "Editor updated",
|
||||
"errorProcessSaveResult": "Saving is failed.",
|
||||
"criticalErrorTitle": "Error",
|
||||
"warnProcessRightsChange": "You have been denied the right to edit the file.",
|
||||
"errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator."
|
||||
}
|
||||
},
|
||||
"LongActions": {
|
||||
|
@ -346,6 +402,7 @@
|
|||
},
|
||||
"Settings": {
|
||||
"textFindAndReplace": "Find and Replace",
|
||||
"textFindAndReplaceAll": "Find and Replace All",
|
||||
"textSpreadsheetSettings": "Spreadsheet Settings",
|
||||
"textApplicationSettings": "Application Settings",
|
||||
"textDownload": "Download",
|
||||
|
@ -434,7 +491,8 @@
|
|||
"textFormulas": "Formulas",
|
||||
"textValues": "Values",
|
||||
"textNoTextFound": "Text not found",
|
||||
"textReplaceAll": "Replace All"
|
||||
"textReplaceAll": "Replace All",
|
||||
"textCollaboration": "Collaboration"
|
||||
}
|
||||
},
|
||||
"Statusbar": {
|
||||
|
|
|
@ -7,6 +7,9 @@ const LongActionsController = () => {
|
|||
const {t} = useTranslation();
|
||||
const _t = t("LongActions", { returnObjects: true });
|
||||
|
||||
const ApplyEditRights = -255;
|
||||
const LoadingDocument = -256;
|
||||
|
||||
const stackLongActions = new IrregularStack({
|
||||
strongCompare : function(obj1, obj2){return obj1.id === obj2.id && obj1.type === obj2.type;},
|
||||
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
|
||||
|
@ -18,7 +21,7 @@ const LongActionsController = () => {
|
|||
if (loadMask && loadMask.el) {
|
||||
f7.dialog.close(loadMask.el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect( () => {
|
||||
Common.Notifications.on('engineCreated', (api) => {
|
||||
|
|
|
@ -12,16 +12,39 @@ import {
|
|||
EditCommentController,
|
||||
ViewCommentsController
|
||||
} from "../../../../common/mobile/lib/controller/collaboration/Comments";
|
||||
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
|
||||
import LongActionsController from "./LongActions";
|
||||
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';
|
||||
|
||||
@inject("storeAppOptions", "storeFocusObjects", "storeCellSettings", "storeTextSettings", "storeChartSettings", "storeSpreadsheetSettings", "storeSpreadsheetInfo")
|
||||
@inject(
|
||||
"storeAppOptions",
|
||||
"storeFocusObjects",
|
||||
"storeCellSettings",
|
||||
"storeTextSettings",
|
||||
"storeChartSettings",
|
||||
"storeSpreadsheetSettings",
|
||||
"storeSpreadsheetInfo",
|
||||
"storeApplicationSettings"
|
||||
)
|
||||
class MainController extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
window.editorType = 'sse';
|
||||
|
||||
this.LoadingDocument = -256;
|
||||
|
||||
this._state = {
|
||||
licenseType: false,
|
||||
isDocModified: false
|
||||
};
|
||||
|
||||
this.defaultTitleText = __APP_TITLE_TEXT__;
|
||||
|
||||
const { t } = this.props;
|
||||
this._t = t('Controller.Main', {returnObjects:true});
|
||||
}
|
||||
|
||||
initSdk() {
|
||||
|
@ -56,46 +79,52 @@ class MainController extends Component {
|
|||
};
|
||||
|
||||
const loadConfig = data => {
|
||||
const _t = this._t;
|
||||
|
||||
EditorUIController.isSupportEditFeature();
|
||||
|
||||
let me = this;
|
||||
this.editorConfig = Object.assign({}, this.editorConfig, data.config);
|
||||
this.appOptions.lang = this.editorConfig.lang;
|
||||
|
||||
me.editorConfig = Object.assign({}, this.editorConfig, data.config);
|
||||
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, "Local.User"/*me.textAnonymous*/);
|
||||
/**/
|
||||
me.editorConfig.user =
|
||||
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, me.textAnonymous);
|
||||
me.appOptions.lang = me.editorConfig.lang;
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
appOptions.setConfigOptions(this.editorConfig, _t);
|
||||
|
||||
this.props.storeAppOptions.setConfigOptions(this.editorConfig);
|
||||
let value;
|
||||
if (appOptions.canRenameAnonymous) {
|
||||
value = LocalStorage.getItem("guest-username");
|
||||
//Common.Utils.InternalSettings.set("guest-username", value);
|
||||
//Common.Utils.InternalSettings.set("save-guest-username", !!value);
|
||||
}
|
||||
|
||||
// var value = Common.localStorage.getItem("sse-settings-regional");
|
||||
// if (value!==null)
|
||||
// this.api.asc_setLocale(parseInt(value));
|
||||
// else {
|
||||
// value = me.appOptions.region;
|
||||
// value = Common.util.LanguageInfo.getLanguages().hasOwnProperty(value) ? value : Common.util.LanguageInfo.getLocalLanguageCode(value);
|
||||
// if (value!==null)
|
||||
// value = parseInt(value);
|
||||
// else
|
||||
// value = (this.editorConfig.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.editorConfig.lang)) : 0x0409;
|
||||
// this.api.asc_setLocale(value);
|
||||
// }
|
||||
value = LocalStorage.getItem("sse-settings-regional");
|
||||
if (value !== null) {
|
||||
this.api.asc_setLocale(parseInt(value));
|
||||
} else {
|
||||
value = appOptions.region;
|
||||
value = Common.util.LanguageInfo.getLanguages().hasOwnProperty(value) ? value : Common.util.LanguageInfo.getLocalLanguageCode(value);
|
||||
if (value !== null) {
|
||||
value = parseInt(value);
|
||||
} else {
|
||||
value = (appOptions.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(appOptions.lang)) : 0x0409;
|
||||
}
|
||||
this.api.asc_setLocale(value);
|
||||
}
|
||||
|
||||
// if (me.appOptions.location == 'us' || me.appOptions.location == 'ca')
|
||||
// Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
|
||||
//
|
||||
// if (!me.editorConfig.customization || !(me.editorConfig.customization.loaderName || me.editorConfig.customization.loaderLogo))
|
||||
// $('#editor_sdk').append('<div class="doc-placeholder">' + '<div class="columns"></div>'.repeat(2) + '</div>');
|
||||
//
|
||||
// var value = Common.localStorage.getItem("sse-mobile-macros-mode");
|
||||
// if (value === null) {
|
||||
// value = this.editorConfig.customization ? this.editorConfig.customization.macrosMode : 'warn';
|
||||
// value = (value == 'enable') ? 1 : (value == 'disable' ? 2 : 0);
|
||||
// } else
|
||||
// value = parseInt(value);
|
||||
// Common.Utils.InternalSettings.set("sse-mobile-macros-mode", value);
|
||||
if (appOptions.location == 'us' || appOptions.location == 'ca') {
|
||||
Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
|
||||
}
|
||||
|
||||
//if (!appOptions.customization || !(appOptions.customization.loaderName || appOptions.customization.loaderLogo))
|
||||
//$('#editor_sdk').append('<div class="doc-placeholder">' + '<div class="columns"></div>'.repeat(2) + '</div>');
|
||||
|
||||
value = LocalStorage.getItem("sse-mobile-macros-mode");
|
||||
if (value === null) {
|
||||
value = appOptions.customization ? appOptions.customization.macrosMode : 'warn';
|
||||
value = (value === 'enable') ? 1 : (value === 'disable' ? 2 : 0);
|
||||
} else {
|
||||
value = parseInt(value);
|
||||
}
|
||||
this.props.storeApplicationSettings.changeMacrosSettings(value);
|
||||
};
|
||||
|
||||
const loadDocument = data => {
|
||||
|
@ -127,17 +156,16 @@ class MainController extends Component {
|
|||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
|
||||
|
||||
// var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
||||
// docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||
// enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
|
||||
// docInfo.asc_putIsEnabledPlugins(!!enable);
|
||||
|
||||
// SSE.getController('Toolbar').setDocumentTitle(data.doc.title);
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
let enable = !appOptions.customization || (appOptions.customization.macros !== false);
|
||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||
enable = !appOptions.customization || (appOptions.customization.plugins!==false);
|
||||
docInfo.asc_putIsEnabledPlugins(!!enable);
|
||||
}
|
||||
|
||||
this.api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
|
||||
// this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
|
||||
// this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this));
|
||||
this.api.asc_registerCallback('asc_onLicenseChanged', this.onLicenseChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onRunAutostartMacroses', this.onRunAutostartMacroses.bind(this));
|
||||
this.api.asc_setDocInfo(docInfo);
|
||||
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
|
||||
this.api.asc_enableKeyEvents(true);
|
||||
|
@ -152,21 +180,20 @@ class MainController extends Component {
|
|||
};
|
||||
|
||||
const onEditorPermissions = params => {
|
||||
let me = this;
|
||||
const licType = params.asc_getLicenseType();
|
||||
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
|
||||
me.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
appOptions.setPermissionOptions(this.document, licType, params, this.permissions);
|
||||
|
||||
this.props.storeAppOptions.setPermissionOptions(this.document, licType, params, this.permissions);
|
||||
// me.appOptions.canEdit = (me.permissions.edit !== false || me.permissions.review === true) && // can edit or review
|
||||
// (me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
|
||||
// (!me.appOptions.isReviewOnly || me.appOptions.canLicense) && // if isReviewOnly==true -> canLicense must be true
|
||||
// me.isSupportEditFeature();
|
||||
// me.appOptions.isEdit = me.appOptions.canLicense && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
|
||||
this.applyMode(appOptions);
|
||||
|
||||
// me.api.asc_setViewMode(!me.appOptions.isEdit);
|
||||
me.api.asc_setViewMode(false);
|
||||
me.api.asc_LoadDocument();
|
||||
this.api.asc_LoadDocument();
|
||||
|
||||
//if (!me.appOptions.isEdit) {
|
||||
//me.hidePreloader();
|
||||
//me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||
//}
|
||||
};
|
||||
|
||||
const _process_array = (array, fn) => {
|
||||
|
@ -184,30 +211,64 @@ class MainController extends Component {
|
|||
_process_array(dep_scripts, promise_get_script)
|
||||
.then ( result => {
|
||||
const {t} = this.props;
|
||||
const _t = t('Controller.Main.SDK', {returnObjects:true})
|
||||
const styleNames = ['Normal', 'Neutral', 'Bad', 'Good', 'Input', 'Output', 'Calculation', 'Check Cell', 'Explanatory Text', 'Note', 'Linked Cell', 'Warning Text',
|
||||
'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Title', 'Total', 'Currency', 'Percent', 'Comma'];
|
||||
const translate = {
|
||||
'Series': _t.txtSeries,
|
||||
'Diagram Title': _t.txtDiagramTitle,
|
||||
'X Axis': _t.txtXAxis,
|
||||
'Y Axis': _t.txtYAxis,
|
||||
'Your text here': _t.txtArt
|
||||
};
|
||||
styleNames.forEach(function(item){
|
||||
translate[item] = _t['txtStyle_' + item.replace(/ /g, '_')] || item;
|
||||
});
|
||||
translate['Currency [0]'] = _t.txtStyle_Currency + ' [0]';
|
||||
translate['Comma [0]'] = _t.txtStyle_Comma + ' [0]';
|
||||
|
||||
for (let i=1; i<7; i++) {
|
||||
translate['Accent'+i] = _t.txtAccent + i;
|
||||
translate['20% - Accent'+i] = '20% - ' + _t.txtAccent + i;
|
||||
translate['40% - Accent'+i] = '40% - ' + _t.txtAccent + i;
|
||||
translate['60% - Accent'+i] = '60% - ' + _t.txtAccent + i;
|
||||
}
|
||||
this.api = new Asc.spreadsheet_api({
|
||||
'id-view': 'editor_sdk',
|
||||
'id-input': 'idx-cell-content',
|
||||
'mobile': true
|
||||
// 'translate': translate
|
||||
'mobile': true,
|
||||
'translate': translate
|
||||
});
|
||||
|
||||
Common.Notifications.trigger('engineCreated', this.api);
|
||||
Common.EditorApi = {get: () => this.api};
|
||||
|
||||
this.appOptions = {};
|
||||
this.bindEvents();
|
||||
|
||||
let value = null /*Common.localStorage.getItem("sse-settings-fontrender")*/;
|
||||
if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3';
|
||||
let value = LocalStorage.getItem("sse-settings-fontrender");
|
||||
if (value === null) value = window.devicePixelRatio > 1 ? '1' : '3';
|
||||
this.api.asc_setFontRenderingMode(parseInt(value));
|
||||
|
||||
Common.Utils.Metric.setCurrentMetric(Common.Utils.Metric.c_MetricUnits.pt); // TODO: beautify c_MetricUnits
|
||||
|
||||
Common.Gateway.on('init', loadConfig);
|
||||
// Common.Gateway.on('showmessage', _.bind(me.onExternalMessage, me));
|
||||
Common.Gateway.on('init', loadConfig);
|
||||
Common.Gateway.on('showmessage', this.onExternalMessage.bind(this));
|
||||
Common.Gateway.on('opendocument', loadDocument);
|
||||
Common.Gateway.appReady();
|
||||
|
||||
Common.Notifications.trigger('engineCreated', this.api);
|
||||
Common.Gateway.on('internalcommand', function(data) {
|
||||
if (data.command === 'hardBack') {
|
||||
if ($$('.modal-in').length > 0) {
|
||||
if ( !($$('.error-dialog.modal-in').length > 0) ) {
|
||||
f7.dialog.close();
|
||||
}
|
||||
Common.Gateway.internalMessage('hardBack', false);
|
||||
} else
|
||||
Common.Gateway.internalMessage('hardBack', true);
|
||||
}
|
||||
});
|
||||
Common.Gateway.internalMessage('listenHardBack');
|
||||
}, error => {
|
||||
console.log('promise failed ' + error);
|
||||
});
|
||||
|
@ -221,18 +282,12 @@ class MainController extends Component {
|
|||
}
|
||||
|
||||
bindEvents() {
|
||||
const me = this;
|
||||
|
||||
// me.api.asc_registerCallback('asc_onError', _.bind(me.onError, me));
|
||||
me.api.asc_registerCallback('asc_onOpenDocumentProgress', me._onOpenDocumentProgress.bind(me));
|
||||
// me.api.asc_registerCallback('asc_onAdvancedOptions', _.bind(me.onAdvancedOptions, me));
|
||||
// me.api.asc_registerCallback('asc_onDocumentUpdateVersion', _.bind(me.onUpdateVersion, me));
|
||||
// me.api.asc_registerCallback('asc_onServerVersion', _.bind(me.onServerVersion, me));
|
||||
// me.api.asc_registerCallback('asc_onPrintUrl', _.bind(me.onPrintUrl, me));
|
||||
// me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onDocumentName, me));
|
||||
me.api.asc_registerCallback('asc_onEndAction', me._onLongActionEnd.bind(me));
|
||||
|
||||
EditorUIController.initThemeColors && EditorUIController.initThemeColors();
|
||||
this.api.asc_registerCallback('asc_onDocumentUpdateVersion', this.onUpdateVersion.bind(this));
|
||||
this.api.asc_registerCallback('asc_onServerVersion', this.onServerVersion.bind(this));
|
||||
this.api.asc_registerCallback('asc_onPrintUrl', this.onPrintUrl.bind(this));
|
||||
this.api.asc_registerCallback('asc_onPrint', this.onPrint.bind(this));
|
||||
this.api.asc_registerCallback('asc_onDocumentName', this.onDocumentName.bind(this));
|
||||
this.api.asc_registerCallback('asc_onEndAction', this._onLongActionEnd.bind(this));
|
||||
|
||||
EditorUIController.initCellInfo && EditorUIController.initCellInfo(this.props);
|
||||
|
||||
|
@ -263,42 +318,431 @@ class MainController extends Component {
|
|||
if ( type === Asc.c_oAscAsyncActionType.BlockInteraction && id == Asc.c_oAscAsyncAction.Open ) {
|
||||
Common.Gateway.internalMessage('documentReady', {});
|
||||
Common.Notifications.trigger('document:ready');
|
||||
this._onDocumentContentReady();
|
||||
this.onDocumentContentReady();
|
||||
}
|
||||
}
|
||||
|
||||
_onDocumentContentReady() {
|
||||
const me = this;
|
||||
onDocumentContentReady() {
|
||||
if (this._isDocReady)
|
||||
return;
|
||||
|
||||
me.api.asc_Resize();
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const appSettings = this.props.storeApplicationSettings;
|
||||
|
||||
let value = null /*(this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom")*/;
|
||||
var zf = (value !== null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1);
|
||||
this._isDocReady = true;
|
||||
|
||||
this.api.asc_showWorksheet(this.api.asc_getActiveWorksheetIndex());
|
||||
this.api.asc_Resize();
|
||||
|
||||
Common.Notifications.trigger('preloader:close');
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
|
||||
let value = (appOptions.isEditMailMerge || appOptions.isEditDiagram) ? 100 : LocalStorage.getItem("sse-settings-zoom");
|
||||
var zf = (value !== null) ? parseInt(value)/100 : (appOptions.customization && appOptions.customization.zoom ? parseInt(appOptions.customization.zoom)/100 : 1);
|
||||
this.api.asc_setZoom(zf>0 ? zf : 1);
|
||||
|
||||
// this.api.asc_SetFastCollaborative(false);
|
||||
this.updateWindowTitle(true);
|
||||
|
||||
me.api.asc_enableKeyEvents(true);
|
||||
me.api.asc_getWorksheetsCount();
|
||||
me.api.asc_showWorksheet(me.api.asc_getActiveWorksheetIndex());
|
||||
if (appOptions.isEdit) {
|
||||
if (this.needToUpdateVersion) {
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
}
|
||||
|
||||
if (appOptions.canAnalytics && false) {
|
||||
Common.component.Analytics.initialize('UA-12442749-13', 'Spreadsheet Editor');
|
||||
}
|
||||
|
||||
Common.Gateway.on('processsaveresult', this.onProcessSaveResult.bind(this));
|
||||
Common.Gateway.on('processrightschange', this.onProcessRightsChange.bind(this));
|
||||
Common.Gateway.on('downloadas', this.onDownloadAs.bind(this));
|
||||
Common.Gateway.on('requestclose', this.onRequestClose.bind(this));
|
||||
|
||||
Common.Gateway.sendInfo({
|
||||
mode: appOptions.isEdit ? 'edit' : 'view'
|
||||
});
|
||||
|
||||
this.applyLicense();
|
||||
|
||||
//R1C1 reference style
|
||||
value = LocalStorage.getBool('sse-settings-r1c1', false);
|
||||
appSettings.changeRefStyle(value);
|
||||
this.api.asc_setR1C1Mode(value);
|
||||
|
||||
Common.Gateway.documentReady();
|
||||
f7.emit('resize');
|
||||
}
|
||||
|
||||
_onOpenDocumentProgress(progress) {
|
||||
// if (this.loadMask) {
|
||||
// var $title = $$(this.loadMask).find('.modal-title'),
|
||||
// const proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
|
||||
applyMode (appOptions) {
|
||||
this.api.asc_enableKeyEvents(appOptions.isEdit);
|
||||
|
||||
// $title.text(this.textLoadingDocument + ': ' + Math.min(Math.round(proc * 100), 100) + '%');
|
||||
// }
|
||||
if (!appOptions.isEditMailMerge && !appOptions.isEditDiagram) {
|
||||
EditorUIController.initThemeColors && EditorUIController.initThemeColors();
|
||||
this.api.asc_registerCallback('asc_onDownloadUrl', this.onDownloadUrl.bind(this));
|
||||
}
|
||||
|
||||
this.api.asc_setViewMode(!appOptions.isEdit && !appOptions.isRestrictedEdit);
|
||||
(appOptions.isRestrictedEdit && appOptions.canComments) && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
|
||||
|
||||
let value = LocalStorage.getItem('sse-mobile-settings-unit');
|
||||
value = (value !== null) ? parseInt(value) : (appOptions.customization && appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
|
||||
(value === undefined) && (value = Common.Utils.Metric.getDefaultMetric());
|
||||
Common.Utils.Metric.setCurrentMetric(value);
|
||||
|
||||
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', this.onDocumentModifiedChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onDocumentCanSaveChanged', this.onDocumentCanSaveChanged.bind(this));
|
||||
|
||||
//if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType.BlockInteraction})) {
|
||||
//me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, ApplyEditRights);
|
||||
//} else if (!this._isDocReady) {
|
||||
//me.hidePreloader();
|
||||
//me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||
//}
|
||||
|
||||
// Message on window close
|
||||
window.onbeforeunload = this.onBeforeUnload.bind(this);
|
||||
window.onunload = this.onUnload.bind(this);
|
||||
}
|
||||
|
||||
onLicenseChanged (params) {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return;
|
||||
|
||||
const licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
||||
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
||||
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady && this._state.licenseType)
|
||||
this.applyLicense();
|
||||
}
|
||||
|
||||
applyLicense () {
|
||||
Common.Notifications.trigger('toolbar:activatecontrols');
|
||||
const _t = this._t;
|
||||
const warnNoLicense = _t.warnNoLicense.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnNoLicenseUsers = _t.warnNoLicenseUsers.replace(/%1/g, __COMPANY_NAME__);
|
||||
const textNoLicenseTitle = _t.textNoLicenseTitle.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnLicenseExceeded = _t.warnLicenseExceeded.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnLicenseUsersExceeded = _t.warnLicenseUsersExceeded.replace(/%1/g, __COMPANY_NAME__);
|
||||
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
if (appOptions.config.mode !== 'view' && !EditorUIController.isSupportEditFeature()) {
|
||||
let value = LocalStorage.getItem("sse-opensource-warning");
|
||||
value = (value !== null) ? parseInt(value) : 0;
|
||||
const now = (new Date).getTime();
|
||||
if (now - value > 86400000) {
|
||||
LocalStorage.setItem("sse-opensource-warning", now);
|
||||
f7.dialog.create({
|
||||
title: _t.notcriticalErrorTitle,
|
||||
text : _t.errorOpensource,
|
||||
buttons: [{text: 'OK'}]
|
||||
}).open();
|
||||
}
|
||||
Common.Notifications.trigger('toolbar:activatecontrols');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._state.licenseType) {
|
||||
let license = this._state.licenseType;
|
||||
let buttons = [{text: 'OK'}];
|
||||
if ((appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
|
||||
(license === Asc.c_oLicenseResult.SuccessLimit ||
|
||||
license === Asc.c_oLicenseResult.ExpiredLimited ||
|
||||
appOptions.permissionsLicense === Asc.c_oLicenseResult.SuccessLimit)
|
||||
) {
|
||||
license = (license === Asc.c_oLicenseResult.ExpiredLimited) ? _t.warnLicenseLimitedNoAccess : _t.warnLicenseLimitedRenewed;
|
||||
} else if (license === Asc.c_oLicenseResult.Connections || license === Asc.c_oLicenseResult.UsersCount) {
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? warnLicenseExceeded : warnLicenseUsersExceeded;
|
||||
} else {
|
||||
license = (license === Asc.c_oLicenseResult.ConnectionsOS) ? warnNoLicense : warnNoLicenseUsers;
|
||||
buttons = [{
|
||||
text: _t.textBuyNow,
|
||||
bold: true,
|
||||
onClick: function() {
|
||||
window.open(`${__PUBLISHER_URL__}`, "_blank");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: _t.textContactUs,
|
||||
onClick: function() {
|
||||
window.open(`mailto:${__SALES_EMAIL__}`, "_blank");
|
||||
}
|
||||
}];
|
||||
}
|
||||
if (this._state.licenseType === Asc.c_oLicenseResult.SuccessLimit) {
|
||||
Common.Notifications.trigger('toolbar:activatecontrols');
|
||||
} else {
|
||||
Common.Notifications.trigger('toolbar:activatecontrols');
|
||||
Common.Notifications.trigger('toolbar:deactivateeditcontrols');
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
let value = LocalStorage.getItem("sse-license-warning");
|
||||
value = (value !== null) ? parseInt(value) : 0;
|
||||
const now = (new Date).getTime();
|
||||
|
||||
if (now - value > 86400000) {
|
||||
LocalStorage.setItem("sse-license-warning", now);
|
||||
f7.dialog.create({
|
||||
title: textNoLicenseTitle,
|
||||
text : license,
|
||||
buttons: buttons
|
||||
}).open();
|
||||
}
|
||||
} else {
|
||||
if (!appOptions.isDesktopApp && !appOptions.canBrandingExt &&
|
||||
appOptions.config && appOptions.config.customization && (appOptions.config.customization.loaderName || appOptions.config.customization.loaderLogo)) {
|
||||
f7.dialog.create({
|
||||
title: _t.textPaidFeature,
|
||||
text : _t.textCustomLoader,
|
||||
buttons: [{
|
||||
text: _t.textContactUs,
|
||||
bold: true,
|
||||
onClick: () => {
|
||||
window.open(`mailto:${__SALES_EMAIL__}`, "_blank");
|
||||
}
|
||||
},
|
||||
{ text: _t.textClose }]
|
||||
}).open();
|
||||
}
|
||||
Common.Notifications.trigger('toolbar:activatecontrols');
|
||||
}
|
||||
}
|
||||
|
||||
onExternalMessage (msg) {
|
||||
if (msg && msg.msg) {
|
||||
msg.msg = (msg.msg).toString();
|
||||
f7.notification.create({
|
||||
//title: uiApp.params.modalTitle,
|
||||
text: [msg.msg.charAt(0).toUpperCase() + msg.msg.substring(1)],
|
||||
closeButton: true
|
||||
}).open();
|
||||
|
||||
Common.component.Analytics.trackEvent('External Error');
|
||||
}
|
||||
}
|
||||
|
||||
onRunAutostartMacroses () {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const enable = !appOptions.customization || (appOptions.customization.macros !== false);
|
||||
if (enable) {
|
||||
const value = this.props.storeApplicationSettings.macrosMode;
|
||||
if (value === 1) {
|
||||
this.api.asc_runAutostartMacroses();
|
||||
} else if (value === 0) {
|
||||
const _t = this._t;
|
||||
f7.dialog.create({
|
||||
title: _t.notcriticalErrorTitle,
|
||||
text: _t.textHasMacros,
|
||||
content: `<div class="checkbox-in-modal">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="checkbox-show-macros" />
|
||||
<i class="icon-checkbox"></i>
|
||||
</label>
|
||||
<span class="right-text">${_t.textRemember}</span>
|
||||
</div>`,
|
||||
buttons: [{
|
||||
text: _t.textYes,
|
||||
onClick: () => {
|
||||
const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked');
|
||||
if (dontshow) {
|
||||
this.props.storeApplicationSettings.changeMacrosSettings(1);
|
||||
LocalStorage.setItem("sse-mobile-macros-mode", 1);
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.api.asc_runAutostartMacroses();
|
||||
}, 1);
|
||||
}},
|
||||
{
|
||||
text: _t.textNo,
|
||||
onClick: () => {
|
||||
const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked');
|
||||
if (dontshow) {
|
||||
this.props.storeApplicationSettings.changeMacrosSettings(2);
|
||||
LocalStorage.setItem("sse-mobile-macros-mode", 2);
|
||||
}
|
||||
}
|
||||
}]
|
||||
}).open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onDownloadUrl () {
|
||||
if (this._state.isFromGatewayDownloadAs) {
|
||||
Common.Gateway.downloadAs(url);
|
||||
}
|
||||
|
||||
this._state.isFromGatewayDownloadAs = false;
|
||||
}
|
||||
|
||||
onBeforeUnload () {
|
||||
const _t = this._t;
|
||||
|
||||
LocalStorage.save();
|
||||
|
||||
const config = this.props.storeAppOptions.config;
|
||||
const isEdit = this.permissions.edit !== false && config.mode !== 'view' && config.mode !== 'editdiagram';
|
||||
if (isEdit && this.api.asc_isDocumentModified()) {
|
||||
this.api.asc_stopSaving();
|
||||
this.continueSavingTimer = window.setTimeout(() => {
|
||||
this.api.asc_continueSaving();
|
||||
}, 500);
|
||||
|
||||
return _t.leavePageText;
|
||||
}
|
||||
}
|
||||
|
||||
onUnload () {
|
||||
if (this.continueSavingTimer)
|
||||
clearTimeout(this.continueSavingTimer);
|
||||
}
|
||||
|
||||
onUpdateVersion (callback) {
|
||||
const _t = this._t;
|
||||
|
||||
this.needToUpdateVersion = true;
|
||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
|
||||
f7.dialog.alert(
|
||||
_t.errorUpdateVersion,
|
||||
_t.titleUpdateVersion,
|
||||
() => {
|
||||
Common.Gateway.updateVersion();
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||
});
|
||||
}
|
||||
|
||||
onServerVersion (buildVersion) {
|
||||
if (this.changeServerVersion) return true;
|
||||
const _t = this._t;
|
||||
|
||||
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
|
||||
this.changeServerVersion = true;
|
||||
f7.dialog.alert(
|
||||
_t.errorServerVersion,
|
||||
_t.titleServerVersion,
|
||||
() => {
|
||||
setTimeout(() => {Common.Gateway.updateVersion()}, 0);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
onPrintUrl (url) {
|
||||
if (this.iframePrint) {
|
||||
this.iframePrint.parentNode.removeChild(this.iframePrint);
|
||||
this.iframePrint = null;
|
||||
}
|
||||
|
||||
if (!this.iframePrint) {
|
||||
this.iframePrint = document.createElement("iframe");
|
||||
this.iframePrint.id = "id-print-frame";
|
||||
this.iframePrint.style.display = 'none';
|
||||
this.iframePrint.style.visibility = "hidden";
|
||||
this.iframePrint.style.position = "fixed";
|
||||
this.iframePrint.style.right = "0";
|
||||
this.iframePrint.style.bottom = "0";
|
||||
document.body.appendChild(this.iframePrint);
|
||||
this.iframePrint.onload = function() {
|
||||
this.iframePrint.contentWindow.focus();
|
||||
this.iframePrint.contentWindow.print();
|
||||
this.iframePrint.contentWindow.blur();
|
||||
window.focus();
|
||||
};
|
||||
}
|
||||
|
||||
if (url) {
|
||||
this.iframePrint.src = url;
|
||||
}
|
||||
}
|
||||
|
||||
onDocumentName (name) {
|
||||
this.updateWindowTitle(true);
|
||||
}
|
||||
|
||||
updateWindowTitle (force) {
|
||||
const isModified = this.api.asc_isDocumentModified();
|
||||
if (this._state.isDocModified !== isModified || force) {
|
||||
const title = this.defaultTitleText;
|
||||
|
||||
if (window.document.title !== title) {
|
||||
window.document.title = title;
|
||||
}
|
||||
|
||||
this._isDocReady && (this._state.isDocModified !== isModified) && Common.Gateway.setDocumentModified(isModified);
|
||||
this._state.isDocModified = isModified;
|
||||
}
|
||||
}
|
||||
|
||||
onDocumentModifiedChanged () {
|
||||
const isModified = this.api.asc_isDocumentCanSave();
|
||||
if (this._state.isDocModified !== isModified) {
|
||||
this._isDocReady && Common.Gateway.setDocumentModified(this.api.asc_isDocumentModified());
|
||||
}
|
||||
|
||||
this.updateWindowTitle();
|
||||
}
|
||||
|
||||
onDocumentCanSaveChanged (isCanSave) {
|
||||
//
|
||||
}
|
||||
|
||||
onPrint () {
|
||||
if (!this.props.storeAppOptions.canPrint) return;
|
||||
|
||||
if (this.api)
|
||||
this.api.asc_Print();
|
||||
Common.component.Analytics.trackEvent('Print');
|
||||
}
|
||||
|
||||
onProcessSaveResult (data) {
|
||||
this.api.asc_OnSaveEnd(data.result);
|
||||
|
||||
if (data && data.result === false) {
|
||||
const _t = this._t;
|
||||
f7.dialog.alert(
|
||||
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
||||
_t.criticalErrorTitle
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onProcessRightsChange (data) {
|
||||
if (data && data.enabled === false) {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const old_rights = appOptions.lostEditingRights;
|
||||
appOptions.changeEditingRights(!old_rights);
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
|
||||
if (!old_rights) {
|
||||
const _t = this._t;
|
||||
f7.dialog.alert(
|
||||
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
||||
_t.notcriticalErrorTitle,
|
||||
() => { appOptions.changeEditingRights(false); }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onDownloadAs () {
|
||||
if ( this.props.storeAppOptions.canDownload) {
|
||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this._t.errorAccessDeny);
|
||||
return;
|
||||
}
|
||||
this._state.isFromGatewayDownloadAs = true;
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
|
||||
}
|
||||
|
||||
onRequestClose () {
|
||||
Common.Gateway.requestClose();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -311,6 +755,7 @@ class MainController extends Component {
|
|||
<AddCommentController />
|
||||
<EditCommentController />
|
||||
<ViewCommentsController />
|
||||
<PluginsController />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
</List>
|
||||
<BlockTitle>{_t.textSearchIn}</BlockTitle>
|
||||
<List>
|
||||
|
|
|
@ -350,11 +350,6 @@
|
|||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22 17H16V18H22V17Z" fill="@{themeColor}"/><path d="M22 20H16V21H22V20Z" fill="@{themeColor}"/><path d="M22 14H16V15H22V14Z" fill="@{themeColor}"/><path d="M22 11H16V12H22V11Z" fill="@{themeColor}"/><path d="M22 8H16V9H22V8Z" fill="@{themeColor}"/><path d="M22 5H16V6H22V5Z" fill="@{themeColor}"/><path d="M22 2H16V3H22V2Z" fill="@{themeColor}"/><path d="M15 17H9V18H15V17Z" fill="@{themeColor}"/><path d="M15 20H9V21H15V20Z" fill="@{themeColor}"/><path d="M15 14H9V15H15V14Z" fill="@{themeColor}"/><path d="M15 11H9V12H15V11Z" fill="@{themeColor}"/><path d="M15 8H9V9H15V8Z" fill="@{themeColor}"/><path d="M15 5H9V6H15V5Z" fill="@{themeColor}"/><path d="M15 2H9V3H15V2Z" fill="@{themeColor}"/><path d="M8 17H2V18H8V17Z" fill="@{themeColor}"/><path d="M8 20H2V21H8V20Z" fill="@{themeColor}"/><path d="M8 14H2V15H8V14Z" fill="@{themeColor}"/><path d="M8 11H2V12H8V11Z" fill="@{themeColor}"/><path d="M8 8H2V9H8V8Z" fill="@{themeColor}"/><path d="M8 5H2V6H8V5Z" fill="@{themeColor}"/><path d="M8 2H2V3H8V2Z" fill="@{themeColor}"/></svg>');
|
||||
}
|
||||
// Collaboration
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
&.icon-users {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
@ -324,11 +324,6 @@
|
|||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22 17H16V18H22V17Z" fill="@{themeColor}"/><path d="M22 20H16V21H22V20Z" fill="@{themeColor}"/><path d="M22 14H16V15H22V14Z" fill="@{themeColor}"/><path d="M22 11H16V12H22V11Z" fill="@{themeColor}"/><path d="M22 8H16V9H22V8Z" fill="@{themeColor}"/><path d="M22 5H16V6H22V5Z" fill="@{themeColor}"/><path d="M22 2H16V3H22V2Z" fill="@{themeColor}"/><path d="M15 17H9V18H15V17Z" fill="@{themeColor}"/><path d="M15 20H9V21H15V20Z" fill="@{themeColor}"/><path d="M15 14H9V15H15V14Z" fill="@{themeColor}"/><path d="M15 11H9V12H15V11Z" fill="@{themeColor}"/><path d="M15 8H9V9H15V8Z" fill="@{themeColor}"/><path d="M15 5H9V6H15V5Z" fill="@{themeColor}"/><path d="M15 2H9V3H15V2Z" fill="@{themeColor}"/><path d="M8 17H2V18H8V17Z" fill="@{themeColor}"/><path d="M8 20H2V21H8V20Z" fill="@{themeColor}"/><path d="M8 14H2V15H8V14Z" fill="@{themeColor}"/><path d="M8 11H2V12H8V11Z" fill="@{themeColor}"/><path d="M8 8H2V9H8V8Z" fill="@{themeColor}"/><path d="M8 5H2V6H8V5Z" fill="@{themeColor}"/><path d="M8 2H2V3H8V2Z" fill="@{themeColor}"/></svg>');
|
||||
}
|
||||
// Collaboration
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M15.9912 6C15.9912 8.34102 15.4074 10.1346 14.6055 11.3121C13.7983 12.4974 12.8249 13 11.9912 13C11.1575 13 10.1841 12.4974 9.37695 11.3121C8.57501 10.1346 7.99121 8.34102 7.99121 6C7.99121 3.61508 9.96974 2 11.9912 2C14.0127 2 15.9912 3.61508 15.9912 6ZM14.5015 12.9506C13.7365 13.6361 12.8649 14 11.9912 14C11.1195 14 10.2499 13.6378 9.48619 12.9554C7.78363 13.6081 6.36015 14.2591 5.26963 14.9224C3.55256 15.9667 3 16.8326 3 17.5C3 18.2545 3.4257 19.0877 4.82302 19.7879C6.25015 20.5031 8.57272 20.9999 12 21C15.4273 21 17.7499 20.5031 19.177 19.7879C20.5743 19.0877 21 18.2545 21 17.5C21 16.8326 20.4474 15.9667 18.7304 14.9224C17.6372 14.2575 16.2095 13.605 14.5015 12.9506ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{themeColor}"/></g></svg>');
|
||||
}
|
||||
&.icon-users {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
@ -396,6 +391,11 @@
|
|||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.0213 21.5174L10.9355 18.1047L9.82839 17.1394L7.25058 19.3869L7.25059 2L5.68491 2L5.68491 19.3869L3.1071 17.1394L2 18.1047L5.91419 21.5174L6.46774 22L7.0213 21.5174Z" fill="@{themeColor}"/><path d="M13.4675 11.4058L13.4959 9.75035L15.4273 9.06091L15.479 6.04827L13.5695 5.45761L13.5972 3.84333L22 6.64062L21.9724 8.24976L13.4675 11.4058ZM16.8599 8.54922L20.0145 7.45944L16.8952 6.49282L16.8599 8.54922Z" fill="@{themeColor}"/><path d="M21.8957 12.9213L21.844 15.934C21.8338 16.5303 21.7974 16.9746 21.7347 17.2669C21.6758 17.5625 21.556 17.8266 21.3752 18.0591C21.1944 18.2951 20.9547 18.4926 20.656 18.6517C20.3612 18.8107 20.0312 18.8932 19.6661 18.8991C19.2701 18.9056 18.9085 18.8156 18.5812 18.6291C18.2538 18.446 18.0103 18.193 17.8506 17.8701C17.6928 18.3318 17.4311 18.689 17.0655 18.9417C16.7 19.1943 16.2731 19.3247 15.7849 19.3326C15.4005 19.3389 15.0271 19.2645 14.6646 19.1094C14.306 18.9577 14.0195 18.7448 13.8051 18.4707C13.5946 18.2001 13.4678 17.8629 13.4248 17.4593C13.3984 17.2062 13.3896 16.5947 13.3986 15.6249L13.3986 12.9213L21.8957 12.9213ZM20.4627 14.4661L18.508 14.498L18.4909 15.4954C18.4807 16.0883 18.484 16.4566 18.5007 16.6002C18.5309 16.8601 18.6273 17.0624 18.7901 17.2071C18.9566 17.3552 19.1764 17.4269 19.4493 17.4225C19.7107 17.4182 19.9232 17.3496 20.0869 17.2167C20.2544 17.0872 20.3576 16.8954 20.3965 16.6412C20.4184 16.4901 20.4354 16.0564 20.4477 15.34L20.4627 14.4661ZM17.101 14.521L14.8407 14.558L14.8166 15.9666C14.8071 16.515 14.8185 16.8626 14.8505 17.0094C14.8928 17.2349 15.0011 17.4164 15.1755 17.554C15.3537 17.695 15.5928 17.7631 15.8926 17.7582C16.1463 17.754 16.3625 17.6957 16.5412 17.5831C16.7199 17.4705 16.8514 17.3091 16.9358 17.0987C17.02 16.8917 17.0681 16.4421 17.08 15.7497L17.101 14.521Z" fill="@{themeColor}"/></svg>');
|
||||
}
|
||||
&.icon-plus {
|
||||
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" x="0px" y="0px" viewBox="0 0 22 22" fill="@{navBarIconColor}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>');
|
||||
}
|
||||
}
|
||||
|
||||
// Overwrite color for toolbar
|
||||
|
@ -456,11 +456,6 @@
|
|||
height: 22px;
|
||||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{navBarIconColor}"><g><polygon points="10.9,16.9 2,8.1 4.1,6 11.1,12.8 17.9,6 20,8.1 11.2,16.9 11.1,17 "/></g></svg>');
|
||||
}
|
||||
&.icon-collaboration {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.9912 6C14.9912 8.18203 14.4464 9.76912 13.7789 10.7492C13.101 11.7447 12.4042 12 11.9912 12C11.5782 12 10.8814 11.7447 10.2035 10.7492C9.53601 9.76912 8.99121 8.18203 8.99121 6C8.99121 4.23017 10.4571 3 11.9912 3C13.5254 3 14.9912 4.23017 14.9912 6ZM13.4917 13.6397C13.0059 13.8771 12.4989 14 11.9912 14C11.4861 14 10.9817 13.8784 10.4983 13.6434C8.53188 14.3681 6.94518 15.0737 5.78927 15.7768C4.10512 16.8011 4 17.4079 4 17.5C4 17.7664 4.1014 18.3077 5.27104 18.8939C6.50029 19.5099 8.64545 19.9999 12 20C15.3546 20 17.4997 19.5099 18.7289 18.8939C19.8986 18.3078 20 17.7664 20 17.5C20 17.4079 19.8949 16.8011 18.2107 15.7768C17.0529 15.0726 15.4627 14.3657 13.4917 13.6397ZM15.2272 12.1594C16.2765 10.7825 16.9912 8.67814 16.9912 6C16.9912 3 14.5 1 11.9912 1C9.48242 1 6.99121 3 6.99121 6C6.99121 8.68159 7.70777 10.7879 8.75931 12.1647C4.60309 13.7964 2 15.4951 2 17.5C2 19.9852 5 21.9999 12 22C19 22 22 19.9852 22 17.5C22 15.4929 19.3913 13.7927 15.2272 12.1594Z" fill="@{navBarIconColor}"/></svg>');
|
||||
}
|
||||
&.icon-add-chart {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
@ -88,7 +88,7 @@ class MainPage extends Component {
|
|||
}
|
||||
{
|
||||
!this.state.settingsVisible ? null :
|
||||
<Settings onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
}
|
||||
{
|
||||
!this.state.collaborationVisible ? null :
|
||||
|
|
|
@ -14,9 +14,18 @@ export class storeAppOptions {
|
|||
config = {};
|
||||
canViewComments = false;
|
||||
|
||||
setConfigOptions (config) {
|
||||
setConfigOptions (config, _t) {
|
||||
this.config = config;
|
||||
this.user = Common.Utils.fillUserInfo(config.user, config.lang, "Local.User"/*me.textAnonymous*/);
|
||||
this.customization = config.customization;
|
||||
this.canRenameAnonymous = !((typeof (this.customization) == 'object') && (typeof (this.customization.anonymous) == 'object') && (this.customization.anonymous.request===false));
|
||||
this.guestName = (typeof (this.customization) == 'object') && (typeof (this.customization.anonymous) == 'object') &&
|
||||
(typeof (this.customization.anonymous.label) == 'string') && this.customization.anonymous.label.trim()!=='' ?
|
||||
Common.Utils.String.htmlEncode(this.customization.anonymous.label) : _t.textGuest;
|
||||
|
||||
const value = this.canRenameAnonymous ? Common.localStorage.getItem("guest-username") : null;
|
||||
this.user = Common.Utils.fillUserInfo(config.user, config.lang, value ? (value + ' (' + this.guestName + ')' ) : _t.textAnonymous);
|
||||
|
||||
config.user = this.user;
|
||||
this.isDesktopApp = config.targetApp == 'desktop';
|
||||
this.canCreateNew = !!config.createUrl && !this.isDesktopApp;
|
||||
this.canOpenRecent = config.recent !== undefined && !this.isDesktopApp;
|
||||
|
|
|
@ -4,26 +4,28 @@ import { Device } from '../../../../common/mobile/utils/device';
|
|||
import EditorUIController from '../lib/patch'
|
||||
|
||||
const ToolbarView = props => {
|
||||
const undo_box = props.isEdit && EditorUIController.toolbarOptions ? EditorUIController.toolbarOptions.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
onRedoClick: props.onRedo
|
||||
}) : null;
|
||||
return (
|
||||
<Fragment>
|
||||
<NavLeft>
|
||||
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
|
||||
{props.isEdit && EditorUIController.toolbarOptions && EditorUIController.toolbarOptions.getUndoRedo({
|
||||
disabledUndo: !props.isCanUndo,
|
||||
disabledRedo: !props.isCanRedo,
|
||||
onUndoClick: props.onUndo,
|
||||
onRedoClick: props.onRedo
|
||||
})}
|
||||
{Device.ios && undo_box}
|
||||
</NavLeft>
|
||||
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
|
||||
<NavRight>
|
||||
{Device.android && undo_box}
|
||||
{props.isEdit && EditorUIController.toolbarOptions && EditorUIController.toolbarOptions.getEditOptions({
|
||||
disabled: props.disabledEditControls || props.disabledControls,
|
||||
onEditClick: () => props.openOptions('edit'),
|
||||
onAddClick: () => props.openOptions('add')
|
||||
})}
|
||||
{ Device.phone ? null : <Link className={props.disabledControls && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
|
||||
{props.displayCollaboration && <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link>}
|
||||
{props.displayCollaboration && window.matchMedia("(min-width: 390px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={() => props.openOptions('coauth')}></Link> : null}
|
||||
<Link className={(props.disabledSettings || props.disabledControls) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={() => props.openOptions('settings')}></Link>
|
||||
</NavRight>
|
||||
</Fragment>
|
||||
|
|
|
@ -78,12 +78,17 @@ const SettingsList = withTranslation()(props => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (Device.phone) {
|
||||
f7.sheet.close('.settings-popup', true);
|
||||
f7.sheet.close('.settings-popup', false);
|
||||
} else {
|
||||
f7.popover.close('#settings-popover');
|
||||
f7.popover.close('#settings-popover', false);
|
||||
}
|
||||
};
|
||||
|
||||
const onOpenCollaboration = async () => {
|
||||
await closeModal();
|
||||
await props.openOptions('coauth');
|
||||
}
|
||||
|
||||
const onPrint = () => {
|
||||
closeModal();
|
||||
const api = Common.EditorApi.get();
|
||||
|
@ -121,6 +126,11 @@ const SettingsList = withTranslation()(props => {
|
|||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{window.matchMedia("(max-width: 389px)").matches ?
|
||||
<ListItem title={_t.textCollaboration} link="#" onClick={onOpenCollaboration}>
|
||||
<Icon slot="media" icon="icon-collaboration"></Icon>
|
||||
</ListItem>
|
||||
: null}
|
||||
<ListItem link="#" title={_t.textSpreadsheetSettings} onClick={onoptionclick.bind(this, '/spreadsheet-settings/')}>
|
||||
<Icon slot="media" icon="icon-table-settings"></Icon>
|
||||
</ListItem>
|
||||
|
@ -164,10 +174,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} style={{height: '410px'}} />
|
||||
<SettingsList inPopover={true} openOptions={this.props.openOptions} onOptionClick={this.onoptionclick} style={{height: '410px'}} />
|
||||
</Popover> :
|
||||
<Popup className="settings-popup" onPopupClosed={() => this.props.onclosed()}>
|
||||
<SettingsList onOptionClick={this.onoptionclick} />
|
||||
<SettingsList onOptionClick={this.onoptionclick} openOptions={this.props.openOptions} />
|
||||
</Popup>
|
||||
)
|
||||
}
|
||||
|
@ -189,7 +199,7 @@ const Settings = props => {
|
|||
props.onclosed();
|
||||
};
|
||||
|
||||
return <SettingsView usePopover={!Device.phone} onclosed={onviewclosed} />
|
||||
return <SettingsView usePopover={!Device.phone} onclosed={onviewclosed} openOptions={props.openOptions} />
|
||||
};
|
||||
|
||||
export default Settings;
|
|
@ -102,6 +102,7 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-mocha');
|
||||
grunt.loadNpmTasks('grunt-inline');
|
||||
grunt.loadNpmTasks('grunt-svgmin');
|
||||
grunt.loadNpmTasks('grunt-exec');
|
||||
|
||||
function doRegisterTask(name, callbackConfig) {
|
||||
return grunt.registerTask(name + '-init', function() {
|
||||
|
@ -483,7 +484,10 @@ module.exports = function(grunt) {
|
|||
files:[]
|
||||
.concat(packageFile['mobile']['copy']['images-app'])
|
||||
.concat(packageFile['mobile']['copy']['images-common'])
|
||||
}
|
||||
},
|
||||
'webpack-dist': {
|
||||
files: packageFile.mobile.copy['assets']
|
||||
},
|
||||
},
|
||||
|
||||
replace: {
|
||||
|
@ -508,6 +512,25 @@ module.exports = function(grunt) {
|
|||
to: '../mobile'
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
exec: {
|
||||
webpack_app_build: {
|
||||
options: {
|
||||
cwd: '../vendor/framework7-react',
|
||||
},
|
||||
cmd: function() {
|
||||
const editor = packageFile.name == 'presentationeditor' ? 'slide' :
|
||||
packageFile.name == 'spreadsheeteditor' ? 'cell' : 'word';
|
||||
return `npm run deploy-${editor}`;
|
||||
},
|
||||
},
|
||||
webpack_install: {
|
||||
options: {
|
||||
cwd: '../vendor/framework7-react',
|
||||
},
|
||||
cmd: 'npm i',
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -597,10 +620,10 @@ module.exports = function(grunt) {
|
|||
'requirejs', 'concat', 'copy', 'svgmin', 'inline:index-page', 'inline:old-loader-page', 'json-minify',
|
||||
'replace:writeVersion', 'replace:prepareHelp', 'clean:postbuild']);
|
||||
|
||||
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', 'cssmin', 'copy:template-backup',
|
||||
'htmlmin', 'requirejs', 'concat', 'copy:template-restore',
|
||||
'clean:template-backup', 'copy:localization', 'copy:index-page',
|
||||
'copy:images-app', 'json-minify',
|
||||
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', /*'cssmin',*/ /*'copy:template-backup',*/
|
||||
'htmlmin', /*'requirejs',*/ 'exec:webpack_install', 'exec:webpack_app_build', /*'concat',*/ /*'copy:template-restore',*/
|
||||
/*'clean:template-backup',*/ 'copy:localization', 'copy:index-page',
|
||||
/*'copy:images-app',*/ 'copy:webpack-dist', 'json-minify',
|
||||
'replace:writeVersion', 'replace:fixResourceUrl']);
|
||||
|
||||
grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy',
|
||||
|
|
|
@ -353,8 +353,7 @@
|
|||
}
|
||||
],
|
||||
"index-page": {
|
||||
"../deploy/web-apps/apps/documenteditor/mobile/index.html": "../apps/documenteditor/mobile/index.html.deploy",
|
||||
"../deploy/web-apps/apps/documenteditor/mobile/index_loader.html": "../apps/documenteditor/mobile/index_loader.html.deploy"
|
||||
"../deploy/web-apps/apps/documenteditor/mobile/index.html": "../apps/documenteditor/mobile/index.html"
|
||||
},
|
||||
"localization": [
|
||||
{
|
||||
|
@ -379,6 +378,18 @@
|
|||
"src": "**",
|
||||
"dest": "../deploy/web-apps/apps/documenteditor/mobile/resources/img/"
|
||||
}
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"src": "../apps/documenteditor/mobile/css/app.css",
|
||||
"dest": "../deploy/web-apps/apps/documenteditor/mobile/css/app.css"
|
||||
},
|
||||
{
|
||||
"expand": true,
|
||||
"cwd": "../apps/documenteditor/mobile/dist",
|
||||
"src": "**",
|
||||
"dest": "../deploy/web-apps/apps/documenteditor/mobile/dist"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"chai": "1.9.1",
|
||||
"grunt-exec": "^3.0.0",
|
||||
"mocha": "^6.2.2",
|
||||
"grunt-mocha": "^1.0.0"
|
||||
}
|
||||
|
|
|
@ -337,6 +337,18 @@
|
|||
"files": "../deploy/web-apps/apps/presentationeditor/mobile/**/*.json"
|
||||
},
|
||||
"copy": {
|
||||
"assets": [
|
||||
{
|
||||
"src": "../apps/presentationeditor/mobile/css/app.css",
|
||||
"dest": "../deploy/web-apps/apps/presentationeditor/mobile/css/app.css"
|
||||
},
|
||||
{
|
||||
"expand": true,
|
||||
"cwd": "../apps/presentationeditor/mobile/dist",
|
||||
"src": "**",
|
||||
"dest": "../deploy/web-apps/apps/presentationeditor/mobile/dist"
|
||||
}
|
||||
],
|
||||
"template-backup": [
|
||||
{
|
||||
"expand": true,
|
||||
|
@ -356,8 +368,7 @@
|
|||
}
|
||||
],
|
||||
"index-page": {
|
||||
"../deploy/web-apps/apps/presentationeditor/mobile/index.html": "../apps/presentationeditor/mobile/index.html.deploy",
|
||||
"../deploy/web-apps/apps/presentationeditor/mobile/index_loader.html": "../apps/presentationeditor/mobile/index_loader.html.deploy"
|
||||
"../deploy/web-apps/apps/presentationeditor/mobile/index.html": "../apps/presentationeditor/mobile/index.html",
|
||||
},
|
||||
"localization": [
|
||||
{
|
||||
|
|
|
@ -343,6 +343,18 @@
|
|||
"files": "../deploy/web-apps/apps/spreadsheeteditor/mobile/**/*.json"
|
||||
},
|
||||
"copy": {
|
||||
"assets": [
|
||||
{
|
||||
"src": "../apps/spreadsheeteditor/mobile/css/app.css",
|
||||
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/css/app.css"
|
||||
},
|
||||
{
|
||||
"expand": true,
|
||||
"cwd": "../apps/spreadsheeteditor/mobile/dist",
|
||||
"src": "**",
|
||||
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/dist"
|
||||
}
|
||||
],
|
||||
"template-backup": [
|
||||
{
|
||||
"expand": true,
|
||||
|
@ -362,8 +374,7 @@
|
|||
}
|
||||
],
|
||||
"index-page": {
|
||||
"../deploy/web-apps/apps/spreadsheeteditor/mobile/index.html": "../apps/spreadsheeteditor/mobile/index.html.deploy",
|
||||
"../deploy/web-apps/apps/spreadsheeteditor/mobile/index_loader.html": "../apps/spreadsheeteditor/mobile/index_loader.html.deploy"
|
||||
"../deploy/web-apps/apps/spreadsheeteditor/mobile/index.html": "../apps/spreadsheeteditor/mobile/index.html"
|
||||
},
|
||||
"localization": [
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = {
|
|||
},
|
||||
modules: [path.resolve(__dirname, '..', 'node_modules'), 'node_modules'],
|
||||
},
|
||||
watch: true,
|
||||
watch: env == 'development',
|
||||
watchOptions: {
|
||||
aggregateTimeout: 600,
|
||||
poll: 1000,
|
||||
|
@ -50,7 +50,7 @@ module.exports = {
|
|||
jquery: 'jQuery'
|
||||
},
|
||||
|
||||
devtool: env === 'production' ? 'source-map' : 'source-map',
|
||||
devtool: env === 'production' ? false : 'source-map',
|
||||
optimization: {
|
||||
minimizer: [new TerserPlugin({
|
||||
sourceMap: true,
|
||||
|
|
3
vendor/framework7-react/package.json
vendored
3
vendor/framework7-react/package.json
vendored
|
@ -10,6 +10,9 @@
|
|||
"dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js",
|
||||
"build-dev": "cross-env NODE_ENV=development node ./build/build.js",
|
||||
"build-prod": "cross-env NODE_ENV=production node ./build/build.js",
|
||||
"deploy-word": "cross-env TARGET_EDITOR=word NODE_ENV=production node ./build/build.js",
|
||||
"deploy-cell": "cross-env TARGET_EDITOR=cell NODE_ENV=production node ./build/build.js",
|
||||
"deploy-slide": "cross-env TARGET_EDITOR=slide NODE_ENV=production node ./build/build.js",
|
||||
"postinstall": "cpy ./node_modules/framework7-icons/fonts/*.* ./src/fonts/",
|
||||
"build-word": "cross-env NODE_ENV=development node ./build/build.js",
|
||||
"build-slide": "cross-env NODE_ENV=development TARGET_EDITOR=slide node ./build/build.js",
|
||||
|
|
Loading…
Reference in a new issue