Merge pull request #2251 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
maxkadushkin
2023-02-22 23:33:37 +03:00
committed by GitHub
4 changed files with 66 additions and 32 deletions

View File

@ -906,6 +906,15 @@ input[type="number"]::-webkit-inner-spin-button {
box-shadow: inset 0 2px red;
}
.statusbar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
z-index: 10000;
}
// Fonts List
.font-item {

View File

@ -566,7 +566,8 @@
"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.",
"warnProcessRightsChange": "You don't have permission to edit this file."
"warnProcessRightsChange": "You don't have permission to edit this file.",
"warnDownloadAsPdf": "Your {0} will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original {0}, especially if the original file contained lots of graphics."
},
"Settings": {
"advDRMOptions": "Protected File",

View File

@ -626,7 +626,9 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onShowContentControlsActions', (obj, x, y) => {
const storeAppOptions = this.props.storeAppOptions;
if (!storeAppOptions.isEdit && !(storeAppOptions.isRestrictedEdit && storeAppOptions.canFillForms) || this.props.users.isDisconnected) return;
const isViewer = storeAppOptions.isViewer;
if (!storeAppOptions.isEdit && !(storeAppOptions.isRestrictedEdit && storeAppOptions.canFillForms) || this.props.users.isDisconnected || isViewer) return;
switch (obj.type) {
case Asc.c_oAscContentControlSpecificType.DateTime:

View File

@ -21,41 +21,63 @@ class DownloadController extends Component {
onSaveFormat(format) {
const api = Common.EditorApi.get();
const storeDocumentInfo = this.props.storeDocumentInfo;
const dataDoc = storeDocumentInfo.dataDoc;
const fileType = dataDoc.fileType;
const { t } = this.props;
const _t = t("Settings", { returnObjects: true });
if(format) {
this.closeModal();
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: (format === Asc.c_oAscFileType.TXT) ? _t.textDownloadTxt : _t.textDownloadRtf,
buttons: [
{
text: _t.textCancel
},
{
text: _t.textOk,
onClick: () => {
if (format == Asc.c_oAscFileType.TXT) {
const advOptions = api.asc_getAdvancedOptions();
Common.Notifications.trigger('openEncoding', Asc.c_oAscAdvancedOptionsID.TXT, advOptions, 2, new Asc.asc_CDownloadOptions(format));
}
else {
setTimeout(() => {
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}, 400);
if(/^pdf|xps|oxps|djvu$/.test(fileType)) {
if(format) {
this.closeModal();
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: (format === Asc.c_oAscFileType.TXT) ? _t.textDownloadTxt : _t.textDownloadRtf,
buttons: [
{
text: _t.textCancel
},
{
text: _t.textOk,
onClick: () => {
if (format == Asc.c_oAscFileType.TXT) {
const advOptions = api.asc_getAdvancedOptions();
Common.Notifications.trigger('openEncoding', Asc.c_oAscAdvancedOptionsID.TXT, advOptions, 2, new Asc.asc_CDownloadOptions(format));
} else {
setTimeout(() => {
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}, 400);
}
}
}
}
],
}).open();
}
else {
setTimeout(() => {
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}, 400);
],
}).open();
} else {
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: t('Main.warnDownloadAsPdf').replaceAll('{0}', fileType.toUpperCase()),
buttons: [
{
text: _t.textCancel
},
{
text: _t.textOk,
onClick: () => {
const options = new Asc.asc_CDownloadOptions(format);
options.asc_setTextParams(new AscCommon.asc_CTextParams(Asc.c_oAscTextAssociation.PlainLine));
api.asc_DownloadAs(options);
}
}
],
}).open();
}
}
} else {
setTimeout(() => {
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}, 400);
}
}
@ -66,7 +88,7 @@ class DownloadController extends Component {
}
}
const DownloadWithTranslation = inject("storeAppOptions")(observer(withTranslation()(DownloadController)));
const DownloadWithTranslation = inject("storeAppOptions", "storeDocumentInfo")(observer(withTranslation()(DownloadController)));
const onAdvancedOptions = (type, _t, isDocReady, canRequestClose, isDRM) => {
if ($$('.dlg-adv-options.modal-in').length > 0) return;