Merge branch 'hotfix/v6.4.3' into release/v7.0.0
This commit is contained in:
commit
e14be4baec
|
@ -97,10 +97,13 @@ class SearchView extends Component {
|
||||||
|
|
||||||
componentDidMount(){
|
componentDidMount(){
|
||||||
this.$replace = $$('#idx-replace-val');
|
this.$replace = $$('#idx-replace-val');
|
||||||
|
|
||||||
const $editor = $$('#editor_sdk');
|
const $editor = $$('#editor_sdk');
|
||||||
$editor.on('pointerdown', this.onEditorTouchStart.bind(this));
|
|
||||||
$editor.on('pointerup', this.onEditorTouchEnd.bind(this));
|
this.onEditorTouchStart = this.onEditorTouchStart.bind(this);
|
||||||
|
this.onEditorTouchEnd = this.onEditorTouchEnd.bind(this);
|
||||||
|
|
||||||
|
$editor.on('pointerdown', this.onEditorTouchStart);
|
||||||
|
$editor.on('pointerup', this.onEditorTouchEnd);
|
||||||
|
|
||||||
if( !this.searchbar ) {
|
if( !this.searchbar ) {
|
||||||
this.searchbar = f7.searchbar.get('.searchbar');
|
this.searchbar = f7.searchbar.get('.searchbar');
|
||||||
|
@ -123,11 +126,8 @@ class SearchView extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
const $$ = Dom7;
|
$$('#editor_sdk').off('pointerdown', this.onEditorTouchStart)
|
||||||
const $editor = $$('#editor_sdk');
|
.off('pointerup', this.onEditorTouchEnd);
|
||||||
|
|
||||||
$editor.off('pointerdown', this.onEditorTouchStart.bind(this));
|
|
||||||
$editor.off('pointerup', this.onEditorTouchEnd.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSettingsClick(e) {
|
onSettingsClick(e) {
|
||||||
|
@ -192,6 +192,7 @@ class SearchView extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditorTouchStart(e) {
|
onEditorTouchStart(e) {
|
||||||
|
console.log('taouch start');
|
||||||
this.startPoint = this.pointerPosition(e);
|
this.startPoint = this.pointerPosition(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-about-logo {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -4,10 +4,9 @@ import { f7 } from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ToolbarView from "../view/Toolbar";
|
import ToolbarView from "../view/Toolbar";
|
||||||
|
|
||||||
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings')(observer(props => {
|
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
const _t = t("Toolbar", { returnObjects: true });
|
const _t = t("Toolbar", { returnObjects: true });
|
||||||
|
|
||||||
const appOptions = props.storeAppOptions;
|
const appOptions = props.storeAppOptions;
|
||||||
const isDisconnected = props.users.isDisconnected;
|
const isDisconnected = props.users.isDisconnected;
|
||||||
const displayMode = props.storeReview.displayMode;
|
const displayMode = props.storeReview.displayMode;
|
||||||
|
@ -20,11 +19,16 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||||
const storeToolbarSettings = props.storeToolbarSettings;
|
const storeToolbarSettings = props.storeToolbarSettings;
|
||||||
const isCanUndo = storeToolbarSettings.isCanUndo;
|
const isCanUndo = storeToolbarSettings.isCanUndo;
|
||||||
const isCanRedo = storeToolbarSettings.isCanRedo;
|
const isCanRedo = storeToolbarSettings.isCanRedo;
|
||||||
|
const disabledControls = storeToolbarSettings.disabledControls;
|
||||||
|
const disabledEditControls = storeToolbarSettings.disabledEditControls;
|
||||||
|
const disabledSettings = storeToolbarSettings.disabledSettings;
|
||||||
|
|
||||||
const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights;
|
const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights;
|
||||||
|
|
||||||
|
const docInfo = props.storeDocumentInfo;
|
||||||
|
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Common.Notifications.on('setdoctitle', setDocTitle);
|
|
||||||
Common.Gateway.on('init', loadConfig);
|
Common.Gateway.on('init', loadConfig);
|
||||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
|
@ -37,24 +41,19 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
Common.Notifications.off('setdoctitle', setDocTitle);
|
|
||||||
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
Common.Notifications.off('goback', goBack);
|
Common.Notifications.off('goback', goBack);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const [docTitle, resetDocTitle] = useState('');
|
|
||||||
const setDocTitle = (title) => {
|
|
||||||
resetDocTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Back button
|
// Back button
|
||||||
const [isShowBack, setShowBack] = useState(false);
|
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
||||||
const loadConfig = (data) => {
|
const loadConfig = (data) => {
|
||||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||||
data.config.customization && data.config.customization.goback &&
|
data.config.customization && data.config.customization.goback &&
|
||||||
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
|
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose))
|
||||||
|
{
|
||||||
setShowBack(true);
|
setShowBack(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -108,20 +107,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [disabledEditControls, setDisabledEditControls] = useState(false);
|
|
||||||
const [disabledSettings, setDisabledSettings] = useState(false);
|
|
||||||
const deactivateEditControls = (enableDownload) => {
|
const deactivateEditControls = (enableDownload) => {
|
||||||
setDisabledEditControls(true);
|
storeToolbarSettings.setDisabledEditControls(true);
|
||||||
if (enableDownload) {
|
if (enableDownload) {
|
||||||
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||||
} else {
|
} else {
|
||||||
setDisabledSettings(true);
|
storeToolbarSettings.setDisabledSettings(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const [disabledControls, setDisabledControls] = useState(true);
|
|
||||||
const activateControls = () => {
|
const activateControls = () => {
|
||||||
setDisabledControls(false);
|
storeToolbarSettings.setDisabledControls(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEditDocument = () => {
|
const onEditDocument = () => {
|
||||||
|
|
|
@ -97,7 +97,7 @@ class MainPage extends Component {
|
||||||
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
||||||
{/* Top Navbar */}
|
{/* Top Navbar */}
|
||||||
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
||||||
{showLogo && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
{showLogo && appOptions.canBranding !== undefined && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
||||||
<Subnavbar>
|
<Subnavbar>
|
||||||
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
||||||
<Search useSuspense={false}/>
|
<Search useSuspense={false}/>
|
||||||
|
|
|
@ -6,10 +6,34 @@ export class storeToolbarSettings {
|
||||||
isCanUndo: observable,
|
isCanUndo: observable,
|
||||||
setCanUndo: action,
|
setCanUndo: action,
|
||||||
isCanRedo: observable,
|
isCanRedo: observable,
|
||||||
setCanRedo: action
|
setCanRedo: action,
|
||||||
|
disabledControls: observable,
|
||||||
|
setDisabledControls: action,
|
||||||
|
disabledEditControls: observable,
|
||||||
|
setDisabledEditControls: action,
|
||||||
|
disabledSettings: observable,
|
||||||
|
setDisabledSettings: action
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disabledControls = true;
|
||||||
|
|
||||||
|
setDisabledControls(value) {
|
||||||
|
this.disabledControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledEditControls = false;
|
||||||
|
|
||||||
|
setDisabledEditControls(value) {
|
||||||
|
this.disabledEditControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledSettings = false;
|
||||||
|
|
||||||
|
setDisabledSettings(value) {
|
||||||
|
this.disabledSettings = value;
|
||||||
|
}
|
||||||
|
|
||||||
isCanUndo = false;
|
isCanUndo = false;
|
||||||
|
|
||||||
setCanUndo(can) {
|
setCanUndo(can) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { f7 } from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ToolbarView from "../view/Toolbar";
|
import ToolbarView from "../view/Toolbar";
|
||||||
|
|
||||||
const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects', 'storeToolbarSettings')(observer(props => {
|
const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects', 'storeToolbarSettings', 'storePresentationInfo')(observer(props => {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
const _t = t("Toolbar", { returnObjects: true });
|
const _t = t("Toolbar", { returnObjects: true });
|
||||||
|
|
||||||
|
@ -20,9 +20,14 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||||
const isCanUndo = storeToolbarSettings.isCanUndo;
|
const isCanUndo = storeToolbarSettings.isCanUndo;
|
||||||
const isCanRedo = storeToolbarSettings.isCanRedo;
|
const isCanRedo = storeToolbarSettings.isCanRedo;
|
||||||
const disabledPreview = storeToolbarSettings.countPages <= 0;
|
const disabledPreview = storeToolbarSettings.countPages <= 0;
|
||||||
|
const disabledControls = storeToolbarSettings.disabledControls;
|
||||||
|
const disabledEditControls = storeToolbarSettings.disabledEditControls;
|
||||||
|
const disabledSettings = storeToolbarSettings.disabledSettings;
|
||||||
|
|
||||||
|
const docInfo = props.storePresentationInfo;
|
||||||
|
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Common.Notifications.on('setdoctitle', setDocTitle);
|
|
||||||
Common.Gateway.on('init', loadConfig);
|
Common.Gateway.on('init', loadConfig);
|
||||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
|
@ -35,24 +40,19 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
Common.Notifications.off('setdoctitle', setDocTitle);
|
|
||||||
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
Common.Notifications.off('goback', goBack);
|
Common.Notifications.off('goback', goBack);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const [docTitle, resetDocTitle] = useState('');
|
|
||||||
const setDocTitle = (title) => {
|
|
||||||
resetDocTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Back button
|
// Back button
|
||||||
const [isShowBack, setShowBack] = useState(false);
|
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
||||||
const loadConfig = (data) => {
|
const loadConfig = (data) => {
|
||||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||||
data.config.customization && data.config.customization.goback &&
|
data.config.customization && data.config.customization.goback &&
|
||||||
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
|
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose))
|
||||||
|
{
|
||||||
setShowBack(true);
|
setShowBack(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -108,21 +108,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [disabledEditControls, setDisabledEditControls] = useState(false);
|
|
||||||
const [disabledSettings, setDisabledSettings] = useState(false);
|
|
||||||
const deactivateEditControls = (enableDownload) => {
|
const deactivateEditControls = (enableDownload) => {
|
||||||
setDisabledEditControls(true);
|
storeToolbarSettings.setDisabledEditControls(true);
|
||||||
if (enableDownload) {
|
if (enableDownload) {
|
||||||
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||||
} else {
|
} else {
|
||||||
setDisabledSettings(true);
|
storeToolbarSettings.setDisabledSettings(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const [disabledControls, setDisabledControls] = useState(true);
|
|
||||||
const activateControls = () => {
|
const activateControls = () => {
|
||||||
setDisabledControls(false);
|
storeToolbarSettings.setDisabledControls(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEditDocument = () => {
|
const onEditDocument = () => {
|
||||||
|
|
|
@ -139,4 +139,4 @@
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
.encoded-svg-background('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 22 22" fill="#aa5252"><g><circle fill="#fff" cx="11" cy="11" r="11"/><path d="M11,21A10,10,0,1,1,21,11,10,10,0,0,1,11,21h0ZM17.4,7.32L17.06,7a0.48,0.48,0,0,0-.67,0l-7,6.84L6.95,11.24a0.51,0.51,0,0,0-.59.08L6,11.66a0.58,0.58,0,0,0,0,.65l3.19,3.35a0.38,0.38,0,0,0,.39,0L17.4,8a0.48,0.48,0,0,0,0-.67h0Z"/></g></svg>');
|
.encoded-svg-background('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 22 22" fill="#aa5252"><g><circle fill="#fff" cx="11" cy="11" r="11"/><path d="M11,21A10,10,0,1,1,21,11,10,10,0,0,1,11,21h0ZM17.4,7.32L17.06,7a0.48,0.48,0,0,0-.67,0l-7,6.84L6.95,11.24a0.51,0.51,0,0,0-.59.08L6,11.66a0.58,0.58,0,0,0,0,.65l3.19,3.35a0.38,0.38,0,0,0,.39,0L17.4,8a0.48,0.48,0,0,0,0-.67h0Z"/></g></svg>');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -105,7 +105,7 @@ class MainPage extends Component {
|
||||||
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
||||||
{/* Top Navbar */}
|
{/* Top Navbar */}
|
||||||
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
||||||
{showLogo && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
{showLogo && appOptions.canBranding && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
||||||
<Subnavbar>
|
<Subnavbar>
|
||||||
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
||||||
<Search useSuspense={false}/>
|
<Search useSuspense={false}/>
|
||||||
|
|
|
@ -11,6 +11,7 @@ export class storeAppOptions {
|
||||||
|
|
||||||
lostEditingRights: observable,
|
lostEditingRights: observable,
|
||||||
changeEditingRights: action,
|
changeEditingRights: action,
|
||||||
|
canBrandingExt: observable,
|
||||||
|
|
||||||
isDocReady: observable,
|
isDocReady: observable,
|
||||||
changeDocReady: action
|
changeDocReady: action
|
||||||
|
@ -19,6 +20,7 @@ export class storeAppOptions {
|
||||||
|
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
canViewComments = false;
|
canViewComments = false;
|
||||||
|
canBrandingExt = false;
|
||||||
config = {};
|
config = {};
|
||||||
|
|
||||||
lostEditingRights = false;
|
lostEditingRights = false;
|
||||||
|
|
|
@ -8,10 +8,34 @@ export class storeToolbarSettings {
|
||||||
isCanRedo: observable,
|
isCanRedo: observable,
|
||||||
setCanRedo: action,
|
setCanRedo: action,
|
||||||
countPages: observable,
|
countPages: observable,
|
||||||
setCountPages: action
|
setCountPages: action,
|
||||||
|
disabledControls: observable,
|
||||||
|
setDisabledControls: action,
|
||||||
|
disabledEditControls: observable,
|
||||||
|
setDisabledEditControls: action,
|
||||||
|
disabledSettings: observable,
|
||||||
|
setDisabledSettings: action
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disabledControls = true;
|
||||||
|
|
||||||
|
setDisabledControls(value) {
|
||||||
|
this.disabledControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledEditControls = false;
|
||||||
|
|
||||||
|
setDisabledEditControls(value) {
|
||||||
|
this.disabledEditControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledSettings = false;
|
||||||
|
|
||||||
|
setDisabledSettings(value) {
|
||||||
|
this.disabledSettings = value;
|
||||||
|
}
|
||||||
|
|
||||||
isCanUndo = false;
|
isCanUndo = false;
|
||||||
|
|
||||||
setCanUndo(can) {
|
setCanUndo(can) {
|
||||||
|
|
|
@ -29,10 +29,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
|
||||||
const storeToolbarSettings = props.storeToolbarSettings;
|
const storeToolbarSettings = props.storeToolbarSettings;
|
||||||
const isCanUndo = storeToolbarSettings.isCanUndo;
|
const isCanUndo = storeToolbarSettings.isCanUndo;
|
||||||
const isCanRedo = storeToolbarSettings.isCanRedo;
|
const isCanRedo = storeToolbarSettings.isCanRedo;
|
||||||
|
const disabledControls = storeToolbarSettings.disabledControls;
|
||||||
|
const disabledEditControls = storeToolbarSettings.disabledEditControls;
|
||||||
|
const disabledSettings = storeToolbarSettings.disabledSettings;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Common.Gateway.on('init', loadConfig);
|
Common.Gateway.on('init', loadConfig);
|
||||||
|
|
||||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
Common.Notifications.on('goback', goBack);
|
Common.Notifications.on('goback', goBack);
|
||||||
|
@ -53,11 +55,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
|
||||||
});
|
});
|
||||||
|
|
||||||
// Back button
|
// Back button
|
||||||
const [isShowBack, setShowBack] = useState(false);
|
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
||||||
const loadConfig = (data) => {
|
const loadConfig = (data) => {
|
||||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||||
data.config.customization && data.config.customization.goback &&
|
data.config.customization && data.config.customization.goback &&
|
||||||
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
|
(data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose))
|
||||||
|
{
|
||||||
setShowBack(true);
|
setShowBack(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -113,26 +116,21 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [disabledEditControls, setDisabledEditControls] = useState(false);
|
|
||||||
|
|
||||||
const onApiActiveSheetChanged = (index) => {
|
const onApiActiveSheetChanged = (index) => {
|
||||||
Common.Notifications.trigger('comments:filterchange', ['doc', 'sheet' + Common.EditorApi.get().asc_getWorksheetId(index)], false );
|
Common.Notifications.trigger('comments:filterchange', ['doc', 'sheet' + Common.EditorApi.get().asc_getWorksheetId(index)], false );
|
||||||
};
|
};
|
||||||
|
|
||||||
const [disabledSettings, setDisabledSettings] = useState(false);
|
|
||||||
const deactivateEditControls = (enableDownload) => {
|
const deactivateEditControls = (enableDownload) => {
|
||||||
setDisabledEditControls(true);
|
storeToolbarSettings.setDisabledEditControls(true);
|
||||||
if (enableDownload) {
|
if (enableDownload) {
|
||||||
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||||
} else {
|
} else {
|
||||||
setDisabledSettings(true);
|
storeToolbarSettings.setDisabledSettings(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const [disabledControls, setDisabledControls] = useState(true);
|
|
||||||
const activateControls = () => {
|
const activateControls = () => {
|
||||||
setDisabledControls(false);
|
storeToolbarSettings.setDisabledControls(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEditDocument = () => {
|
const onEditDocument = () => {
|
||||||
|
|
|
@ -104,7 +104,7 @@ class MainPage extends Component {
|
||||||
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
||||||
{/* Top Navbar */}
|
{/* Top Navbar */}
|
||||||
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
<Navbar id='editor-navbar' className={`main-navbar${showLogo ? ' navbar-with-logo' : ''}`}>
|
||||||
{showLogo && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
{showLogo && appOptions.canBranding !== undefined && <div className="main-logo"><Icon icon="icon-logo"></Icon></div>}
|
||||||
<Subnavbar>
|
<Subnavbar>
|
||||||
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
<Toolbar openOptions={this.handleClickToOpenOptions} closeOptions={this.handleOptionsViewClosed}/>
|
||||||
<Search useSuspense={false}/>
|
<Search useSuspense={false}/>
|
||||||
|
|
|
@ -11,6 +11,7 @@ export class storeAppOptions {
|
||||||
|
|
||||||
lostEditingRights: observable,
|
lostEditingRights: observable,
|
||||||
changeEditingRights: action,
|
changeEditingRights: action,
|
||||||
|
canBranding: observable,
|
||||||
|
|
||||||
isDocReady: observable,
|
isDocReady: observable,
|
||||||
changeDocReady: action
|
changeDocReady: action
|
||||||
|
@ -25,6 +26,7 @@ export class storeAppOptions {
|
||||||
this.canViewComments = value;
|
this.canViewComments = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canBranding = undefined;
|
||||||
lostEditingRights = false;
|
lostEditingRights = false;
|
||||||
changeEditingRights (value) {
|
changeEditingRights (value) {
|
||||||
this.lostEditingRights = value;
|
this.lostEditingRights = value;
|
||||||
|
@ -76,6 +78,8 @@ export class storeAppOptions {
|
||||||
setPermissionOptions (document, licType, params, permissions, isSupportEditFeature) {
|
setPermissionOptions (document, licType, params, permissions, isSupportEditFeature) {
|
||||||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||||
permissions.edit = false;
|
permissions.edit = false;
|
||||||
|
this.canBranding = params.asc_getCustomization();
|
||||||
|
this.canBrandingExt = params.asc_getCanBranding() && (typeof this.customization == 'object');
|
||||||
this.canAutosave = true;
|
this.canAutosave = true;
|
||||||
this.canAnalytics = params.asc_getIsAnalyticsEnable();
|
this.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||||
this.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
this.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
|
||||||
|
@ -98,8 +102,6 @@ export class storeAppOptions {
|
||||||
this.trialMode = params.asc_getLicenseMode();
|
this.trialMode = params.asc_getLicenseMode();
|
||||||
this.canDownloadOrigin = permissions.download !== false;
|
this.canDownloadOrigin = permissions.download !== false;
|
||||||
this.canDownload = permissions.download !== false;
|
this.canDownload = permissions.download !== false;
|
||||||
this.canBranding = params.asc_getCustomization();
|
|
||||||
this.canBrandingExt = params.asc_getCanBranding() && (typeof this.customization == 'object');
|
|
||||||
this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization
|
this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization
|
||||||
&& this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object'));
|
&& this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object'));
|
||||||
this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups;
|
this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups;
|
||||||
|
|
|
@ -6,10 +6,34 @@ export class storeToolbarSettings {
|
||||||
isCanUndo: observable,
|
isCanUndo: observable,
|
||||||
setCanUndo: action,
|
setCanUndo: action,
|
||||||
isCanRedo: observable,
|
isCanRedo: observable,
|
||||||
setCanRedo: action
|
setCanRedo: action,
|
||||||
|
disabledControls: observable,
|
||||||
|
setDisabledControls: action,
|
||||||
|
disabledEditControls: observable,
|
||||||
|
setDisabledEditControls: action,
|
||||||
|
disabledSettings: observable,
|
||||||
|
setDisabledSettings: action
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disabledControls = true;
|
||||||
|
|
||||||
|
setDisabledControls(value) {
|
||||||
|
this.disabledControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledEditControls = false;
|
||||||
|
|
||||||
|
setDisabledEditControls(value) {
|
||||||
|
this.disabledEditControls = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
disabledSettings = false;
|
||||||
|
|
||||||
|
setDisabledSettings(value) {
|
||||||
|
this.disabledSettings = value;
|
||||||
|
}
|
||||||
|
|
||||||
isCanUndo = false;
|
isCanUndo = false;
|
||||||
|
|
||||||
setCanUndo(can) {
|
setCanUndo(can) {
|
||||||
|
|
|
@ -173,7 +173,8 @@ module.exports = {
|
||||||
__PUBLISHER_NAME__: JSON.stringify(process.env.PUBLISHER_NAME || 'Ascensio System SIA'),
|
__PUBLISHER_NAME__: JSON.stringify(process.env.PUBLISHER_NAME || 'Ascensio System SIA'),
|
||||||
__APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE'),
|
__APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE'),
|
||||||
__COMPANY_NAME__: JSON.stringify(process.env.COMPANY_NAME ? process.env.COMPANY_NAME : 'ONLYOFFICE'),
|
__COMPANY_NAME__: JSON.stringify(process.env.COMPANY_NAME ? process.env.COMPANY_NAME : 'ONLYOFFICE'),
|
||||||
__HELP_URL__: JSON.stringify(process.env.HELP_URL || 'https://helpcenter.onlyoffice.com')
|
__HELP_URL__: JSON.stringify(process.env.HELP_URL || 'https://helpcenter.onlyoffice.com'),
|
||||||
|
__SALES_EMAIL__: JSON.stringify(process.env.__SALES_EMAIL__ || 'sales@onlyoffice.com'),
|
||||||
}),
|
}),
|
||||||
new webpack.BannerPlugin(`\n* Version: ${process.env.PRODUCT_VERSION} (build: ${process.env.BUILD_NUMBER})\n`),
|
new webpack.BannerPlugin(`\n* Version: ${process.env.PRODUCT_VERSION} (build: ${process.env.BUILD_NUMBER})\n`),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue