[DE PE SSE mobile] Fix Bug 50794

This commit is contained in:
ShimaginAndrey 2021-06-23 14:50:39 +03:00
parent 7a3aca5c8f
commit a09aaaf883
8 changed files with 48 additions and 7 deletions

View file

@ -330,6 +330,7 @@
"advDRMOptions": "Protected File", "advDRMOptions": "Protected File",
"txtProtected": "Once you enter the password and open the file, the current password to the file will be reset", "txtProtected": "Once you enter the password and open the file, the current password to the file will be reset",
"textOpenFile": "Enter a password to open the file", "textOpenFile": "Enter a password to open the file",
"txtIncorrectPwd": "Password is incorrect",
"textNoTextFound": "Text not found", "textNoTextFound": "Text not found",
"textReplace": "Replace", "textReplace": "Replace",
"textReplaceAll": "Replace All", "textReplaceAll": "Replace All",

View file

@ -611,7 +611,8 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => { this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => {
const {t} = this.props; const {t} = this.props;
const _t = t("Settings", { returnObjects: true }); const _t = t("Settings", { returnObjects: true });
onAdvancedOptions(type, advOptions, mode, formatOptions, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose); onAdvancedOptions(type, advOptions, mode, formatOptions, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose, this.isDRM);
if(type == Asc.c_oAscAdvancedOptionsID.DRM) this.isDRM = true;
}); });
} }

View file

@ -32,7 +32,7 @@ class DownloadController extends Component {
() => { () => {
if (format == Asc.c_oAscFileType.TXT) { if (format == Asc.c_oAscFileType.TXT) {
const isDocReady = this.props.storeAppOptions.isDocReady; const isDocReady = this.props.storeAppOptions.isDocReady;
onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.TXT, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, isDocReady); onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.TXT, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, isDocReady, isDRM);
} }
else { else {
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
@ -57,7 +57,7 @@ class DownloadController extends Component {
const DownloadWithTranslation = inject("storeAppOptions")(observer(withTranslation()(DownloadController))); const DownloadWithTranslation = inject("storeAppOptions")(observer(withTranslation()(DownloadController)));
const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady, canRequestClose) => { const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady, canRequestClose, isDRM) => {
if ($$('.dlg-adv-options.modal-in').length > 0) return; if ($$('.dlg-adv-options.modal-in').length > 0) return;
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
@ -134,6 +134,17 @@ const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady
} }
} }
}]; }];
if(isDRM) {
f7.dialog.create({
text: _t.txtIncorrectPwd,
buttons : [{
text: 'OK',
bold: true,
}]
}).open();
}
if (canRequestClose) if (canRequestClose)
buttons.push({ buttons.push({
text: _t.closeButtonText, text: _t.closeButtonText,

View file

@ -29,6 +29,7 @@
"advDRMPassword": "Password", "advDRMPassword": "Password",
"txtProtected": "Once you enter the password and open the file, the current password to the file will be reset", "txtProtected": "Once you enter the password and open the file, the current password to the file will be reset",
"textOpenFile": "Enter a password to open the file", "textOpenFile": "Enter a password to open the file",
"txtIncorrectPwd": "Password is incorrect",
"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.", "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.",
"titleLicenseExp": "License expired", "titleLicenseExp": "License expired",
"warnLicenseExp": "Your license has expired. Please update your license and refresh the page.", "warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",

View file

@ -300,7 +300,6 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onDocumentContentReady', this.onDocumentContentReady.bind(this)); this.api.asc_registerCallback('asc_onDocumentContentReady', this.onDocumentContentReady.bind(this));
this.api.asc_registerCallback('asc_onDocumentUpdateVersion', this.onUpdateVersion.bind(this)); 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_onServerVersion', this.onServerVersion.bind(this));
this.api.asc_registerCallback('asc_onAdvancedOptions', this.onAdvancedOptions.bind(this));
this.api.asc_registerCallback('asc_onDocumentName', this.onDocumentName.bind(this)); this.api.asc_registerCallback('asc_onDocumentName', this.onDocumentName.bind(this));
this.api.asc_registerCallback('asc_onPrintUrl', this.onPrintUrl.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_onPrint', this.onPrint.bind(this));
@ -310,6 +309,10 @@ class MainController extends Component {
const storePresentationSettings = this.props.storePresentationSettings; const storePresentationSettings = this.props.storePresentationSettings;
this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions) => {
this.onAdvancedOptions(type, advOptions);
});
this.api.asc_registerCallback('asc_onPresentationSize', (width, height) => { this.api.asc_registerCallback('asc_onPresentationSize', (width, height) => {
storePresentationSettings.changeSizeIndex(width, height); storePresentationSettings.changeSizeIndex(width, height);
}); });
@ -604,6 +607,17 @@ class MainController extends Component {
} }
} }
}]; }];
if(this.isDRM) {
f7.dialog.create({
text: _t.txtIncorrectPwd,
buttons : [{
text: 'OK',
bold: true,
}]
}).open();
}
if (this.props.storeAppOptions.canRequestClose) if (this.props.storeAppOptions.canRequestClose)
buttons.push({ buttons.push({
text: _t.closeButtonText, text: _t.closeButtonText,
@ -620,6 +634,7 @@ class MainController extends Component {
buttons: buttons, buttons: buttons,
cssClass: 'dlg-adv-options' cssClass: 'dlg-adv-options'
}).open(); }).open();
this.isDRM = true;
} }
} }

View file

@ -460,6 +460,7 @@
"closeButtonText": "Close File", "closeButtonText": "Close File",
"txtProtected": "Once you enter the password and open the file, the current password to the file will be reset", "txtProtected": "Once you enter the password and open the file, the current password to the file will be reset",
"textOpenFile": "Enter a password to open the file", "textOpenFile": "Enter a password to open the file",
"txtIncorrectPwd": "Password is incorrect",
"textCancel": "Cancel", "textCancel": "Cancel",
"textUnitOfMeasurement": "Unit Of Measurement", "textUnitOfMeasurement": "Unit Of Measurement",
"textCentimeter": "Centimeter", "textCentimeter": "Centimeter",

View file

@ -323,7 +323,8 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => { this.api.asc_registerCallback('asc_onAdvancedOptions', (type, advOptions, mode, formatOptions) => {
const {t} = this.props; const {t} = this.props;
const _t = t("View.Settings", { returnObjects: true }); const _t = t("View.Settings", { returnObjects: true });
onAdvancedOptions(type, advOptions, mode, formatOptions, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose); onAdvancedOptions(type, advOptions, mode, formatOptions, _t, this._isDocReady, this.props.storeAppOptions.canRequestClose,this.isDRM);
if(type == Asc.c_oAscAdvancedOptionsID.DRM) this.isDRM = true;
}); });
} }

View file

@ -39,7 +39,7 @@ class DownloadController extends Component {
const DownloadWithTranslation = withTranslation()(DownloadController); const DownloadWithTranslation = withTranslation()(DownloadController);
const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady, canRequestClose) => { const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady, canRequestClose, isDRM) => {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
if (type == Asc.c_oAscAdvancedOptionsID.CSV) { if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
@ -136,6 +136,16 @@ const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady
} }
}]; }];
if(isDRM) {
f7.dialog.create({
text: _t.txtIncorrectPwd,
buttons : [{
text: 'OK',
bold: true,
}]
}).open();
}
if (canRequestClose) if (canRequestClose)
buttons.push({ buttons.push({
text: _t.closeButtonText, text: _t.closeButtonText,