mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
[DE PE SSE mobile] Added editor close button
This commit is contained in:
@ -1199,6 +1199,17 @@ input[type="number"]::-webkit-inner-spin-button {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
// Close editor button
|
||||
.close-editor-btn {
|
||||
.item-inner {
|
||||
padding-left: 36px;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
color: @text-error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -785,7 +785,8 @@
|
||||
"txtScheme6": "Concourse",
|
||||
"txtScheme7": "Equity",
|
||||
"txtScheme8": "Flow",
|
||||
"txtScheme9": "Foundry"
|
||||
"txtScheme9": "Foundry",
|
||||
"textClose": "Close"
|
||||
},
|
||||
"Toolbar": {
|
||||
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
|
||||
|
||||
@ -51,7 +51,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||
Common.Notifications.on('goback', goBack);
|
||||
Common.Notifications.on('close', onClose);
|
||||
Common.Notifications.on('close', onRequestClose);
|
||||
|
||||
if (isDisconnected) {
|
||||
f7.popover.close();
|
||||
@ -63,7 +63,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
||||
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||
Common.Notifications.off('goback', goBack);
|
||||
Common.Notifications.off('close', onClose);
|
||||
Common.Notifications.off('close', onRequestClose);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@ -119,12 +119,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
// Back button
|
||||
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
||||
const loadConfig = (data) => {
|
||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||
data.config.customization && data.config.customization.goback) {
|
||||
var _canback = data.config.customization.close===undefined ?
|
||||
if (data && data.config && data.config?.canBackToFolder !== false && data.config?.customization && data.config?.customization.goback) {
|
||||
const canback = data.config.customization.close === undefined ?
|
||||
data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose :
|
||||
data.config.customization.goback.url && !data.config.customization.goback.requestClose;
|
||||
_canback && setShowBack(true);
|
||||
canback && setShowBack(true);
|
||||
}
|
||||
};
|
||||
|
||||
@ -175,10 +174,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
}
|
||||
}
|
||||
|
||||
const onClose = () => {
|
||||
onRequestClose();
|
||||
}
|
||||
|
||||
const onUndo = () => {
|
||||
const api = Common.EditorApi.get();
|
||||
if (api) {
|
||||
|
||||
@ -129,20 +129,29 @@ export class storeAppOptions {
|
||||
this.canAnalytics = false;
|
||||
this.canRequestClose = config.canRequestClose;
|
||||
this.canCloseEditor = false;
|
||||
var _canback = false;
|
||||
if (typeof config.customization === 'object') {
|
||||
if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) {
|
||||
_canback = config.customization.close===undefined ?
|
||||
!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose :
|
||||
!!(config.customization.goback.url) && !config.customization.goback.requestClose;
|
||||
|
||||
if (config.customization.goback.requestClose)
|
||||
let canback = false;
|
||||
|
||||
if (typeof config.customization === 'object' && config.customization !== null) {
|
||||
const { goback, close } = config.customization;
|
||||
|
||||
if (typeof goback === 'object' && config.canBackToFolder !== false) {
|
||||
const hasUrl = !!goback.url;
|
||||
const requestClose = goback.requestClose && this.canRequestClose;
|
||||
|
||||
canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose;
|
||||
|
||||
if (goback.requestClose) {
|
||||
console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead.");
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof close === 'object' && close !== null) {
|
||||
this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
if (typeof config.customization.close === 'object')
|
||||
this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
this.canBack = this.canBackToFolder = !!_canback;
|
||||
|
||||
this.canBack = this.canBackToFolder = canback;
|
||||
this.canRequestSaveAs = config.canRequestSaveAs;
|
||||
this.canPlugins = false;
|
||||
this.canFeatureForms = !!Common.EditorApi.get().asc_isSupportFeature("forms");
|
||||
|
||||
@ -38,6 +38,8 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo
|
||||
const canFillForms = appOptions.canFillForms;
|
||||
const isEditableForms = isForm && canFillForms;
|
||||
const canSubmitForms = appOptions.canSubmitForms;
|
||||
const canCloseEditor = appOptions.canCloseEditor;
|
||||
const closeButtonText = canCloseEditor && appOptions.customization.close.text;
|
||||
|
||||
let _isEdit = false,
|
||||
_canDownload = false,
|
||||
@ -185,6 +187,9 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo
|
||||
<Icon slot="media" icon="icon-feedback"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{canCloseEditor &&
|
||||
<ListItem title={closeButtonText ?? t('Settings.textClose')} link="#" className='close-editor-btn no-indicator' onClick={() => Common.Notifications.trigger('close')}></ListItem>
|
||||
}
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
|
||||
@ -549,7 +549,8 @@
|
||||
"txtScheme6": "Concourse",
|
||||
"txtScheme7": "Equity",
|
||||
"txtScheme8": "Flow",
|
||||
"txtScheme9": "Foundry"
|
||||
"txtScheme9": "Foundry",
|
||||
"textClose": "Close"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||
Common.Notifications.on('goback', goBack);
|
||||
Common.Notifications.on('close', onClose);
|
||||
Common.Notifications.on('close', onRequestClose);
|
||||
|
||||
if (isDisconnected) {
|
||||
f7.popover.close();
|
||||
@ -47,7 +47,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||
Common.Notifications.off('toolbar:activatecontrols', activateControls);
|
||||
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||
Common.Notifications.off('goback', goBack);
|
||||
Common.Notifications.off('close', onClose);
|
||||
Common.Notifications.off('close', onRequestClose);
|
||||
}
|
||||
});
|
||||
|
||||
@ -56,10 +56,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||
const loadConfig = (data) => {
|
||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||
data.config.customization && data.config.customization.goback) {
|
||||
var _canback = data.config.customization.close===undefined ?
|
||||
const canback = data.config.customization.close === undefined ?
|
||||
data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose :
|
||||
data.config.customization.goback.url && !data.config.customization.goback.requestClose;
|
||||
_canback && setShowBack(true);
|
||||
canback && setShowBack(true);
|
||||
}
|
||||
};
|
||||
|
||||
@ -110,10 +110,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
|
||||
}
|
||||
}
|
||||
|
||||
const onClose = () => {
|
||||
onRequestClose();
|
||||
}
|
||||
|
||||
const onUndo = () => {
|
||||
const api = Common.EditorApi.get();
|
||||
if (api) {
|
||||
|
||||
@ -63,20 +63,29 @@ export class storeAppOptions {
|
||||
this.canAnalytics = false;
|
||||
this.canRequestClose = config.canRequestClose;
|
||||
this.canCloseEditor = false;
|
||||
var _canback = false;
|
||||
if (typeof config.customization === 'object') {
|
||||
if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) {
|
||||
_canback = config.customization.close===undefined ?
|
||||
!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose :
|
||||
!!(config.customization.goback.url) && !config.customization.goback.requestClose;
|
||||
|
||||
let canback = false;
|
||||
|
||||
if (config.customization.goback.requestClose)
|
||||
if (typeof config.customization === 'object' && config.customization !== null) {
|
||||
const { goback, close } = config.customization;
|
||||
|
||||
if (typeof goback === 'object' && config.canBackToFolder !== false) {
|
||||
const hasUrl = !!goback.url;
|
||||
const requestClose = goback.requestClose && this.canRequestClose;
|
||||
|
||||
canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose;
|
||||
|
||||
if (goback.requestClose) {
|
||||
console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead.");
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof close === 'object' && close !== null) {
|
||||
this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
if (typeof config.customization.close === 'object')
|
||||
this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
this.canBack = this.canBackToFolder = !!_canback;
|
||||
|
||||
this.canBack = this.canBackToFolder = canback;
|
||||
this.canPlugins = false;
|
||||
|
||||
AscCommon.UserInfoParser.setParser(true);
|
||||
|
||||
@ -16,6 +16,8 @@ const SettingsPage = inject('storeAppOptions', 'storeToolbarSettings', 'storePre
|
||||
const disabledPreview = storeToolbarSettings.countPages <= 0;
|
||||
const storePresentationInfo = props.storePresentationInfo;
|
||||
const docTitle = storePresentationInfo.dataDoc ? storePresentationInfo.dataDoc.title : '';
|
||||
const canCloseEditor = appOptions.canCloseEditor;
|
||||
const closeButtonText = canCloseEditor && appOptions.customization.close.text;
|
||||
const navbar =
|
||||
<Navbar>
|
||||
<div className="title" onClick={settingsContext.changeTitleHandler}>{docTitle}</div>
|
||||
@ -120,9 +122,12 @@ const SettingsPage = inject('storeAppOptions', 'storeToolbarSettings', 'storePre
|
||||
}
|
||||
{_canFeedback &&
|
||||
<ListItem title={t('View.Settings.textFeedback')} link="#" className='no-indicator' onClick={settingsContext.showFeedback}>
|
||||
<Icon slot="media" icon="icon-feedback"></Icon>
|
||||
<Icon slot="media" icon="icon-feedback"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{canCloseEditor &&
|
||||
<ListItem title={closeButtonText ?? t('View.Settings.textClose')} link="#" className='close-editor-btn no-indicator' onClick={() => Common.Notifications.trigger('close')}></ListItem>
|
||||
}
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
|
||||
@ -827,7 +827,8 @@
|
||||
"txtUk": "Ukrainian",
|
||||
"txtVi": "Vietnamese",
|
||||
"txtZh": "Chinese",
|
||||
"warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?"
|
||||
"warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
||||
"textClose": "Close"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -66,10 +66,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
|
||||
const loadConfig = (data) => {
|
||||
if (data && data.config && data.config.canBackToFolder !== false &&
|
||||
data.config.customization && data.config.customization.goback) {
|
||||
var _canback = data.config.customization.close===undefined ?
|
||||
const canback = data.config.customization.close === undefined ?
|
||||
data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose :
|
||||
data.config.customization.goback.url && !data.config.customization.goback.requestClose;
|
||||
_canback && setShowBack(true);
|
||||
canback && setShowBack(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -72,20 +72,29 @@ export class storeAppOptions {
|
||||
this.canAnalytics = false;
|
||||
this.canRequestClose = config.canRequestClose;
|
||||
this.canCloseEditor = false;
|
||||
var _canback = false;
|
||||
if (typeof config.customization === 'object') {
|
||||
if (typeof config.customization.goback == 'object' && config.canBackToFolder!==false) {
|
||||
_canback = config.customization.close===undefined ?
|
||||
!!(config.customization.goback.url) || config.customization.goback.requestClose && this.canRequestClose :
|
||||
!!(config.customization.goback.url) && !config.customization.goback.requestClose;
|
||||
|
||||
let canback = false;
|
||||
|
||||
if (config.customization.goback.requestClose)
|
||||
if (typeof config.customization === 'object' && config.customization !== null) {
|
||||
const { goback, close } = config.customization;
|
||||
|
||||
if (typeof goback === 'object' && config.canBackToFolder !== false) {
|
||||
const hasUrl = !!goback.url;
|
||||
const requestClose = goback.requestClose && this.canRequestClose;
|
||||
|
||||
canBack = close === undefined ? hasUrl || requestClose : hasUrl && !goback.requestClose;
|
||||
|
||||
if (goback.requestClose) {
|
||||
console.log("Obsolete: The 'requestClose' parameter of the 'customization.goback' section is deprecated. Please use 'close' parameter in the 'customization' section instead.");
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof close === 'object' && close !== null) {
|
||||
this.canCloseEditor = !!close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
if (typeof config.customization.close === 'object')
|
||||
this.canCloseEditor = !!config.customization.close.visible && this.canRequestClose && !this.isDesktopApp;
|
||||
}
|
||||
this.canBack = this.canBackToFolder = !!_canback;
|
||||
|
||||
this.canBack = this.canBackToFolder = canback;
|
||||
this.canPlugins = false;
|
||||
|
||||
AscCommon.UserInfoParser.setParser(true);
|
||||
|
||||
@ -14,6 +14,8 @@ const SettingsPage = inject('storeAppOptions', 'storeSpreadsheetInfo')(observer(
|
||||
const settingsContext = useContext(SettingsContext);
|
||||
const _t = t('View.Settings', {returnObjects: true});
|
||||
const docTitle = storeSpreadsheetInfo.dataDoc?.title ?? '';
|
||||
const canCloseEditor = appOptions.canCloseEditor;
|
||||
const closeButtonText = canCloseEditor && appOptions.customization.close.text;
|
||||
const navbar =
|
||||
<Navbar>
|
||||
<div className="title" onClick={settingsContext.changeTitleHandler}>{docTitle}</div>
|
||||
@ -123,6 +125,9 @@ const SettingsPage = inject('storeAppOptions', 'storeSpreadsheetInfo')(observer(
|
||||
<Icon slot="media" icon="icon-feedback"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{canCloseEditor &&
|
||||
<ListItem title={closeButtonText ?? t('View.Settings.textClose')} link="#" className='close-editor-btn no-indicator' onClick={() => Common.Notifications.trigger('close')}></ListItem>
|
||||
}
|
||||
</List>
|
||||
</Page>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user