[DE] show warning on locked document open

This commit is contained in:
Maxim Kadushkin 2020-04-23 19:57:36 +03:00
parent e582d74f32
commit 6892321fb5
4 changed files with 62 additions and 1 deletions

View file

@ -105,6 +105,10 @@ define([
applyPlacement: function () { applyPlacement: function () {
var showxy = this.target.offset(), var showxy = this.target.offset(),
innerHeight = Common.Utils.innerHeight(); innerHeight = Common.Utils.innerHeight();
if (this.placement == 'document') {
// this.cmpEl.css('top', $('#editor_sdk').offset().top);
} else
if (this.placement == 'top') if (this.placement == 'top')
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'}); this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
else {// left or right else {// left or right

View file

@ -1,10 +1,27 @@
.synch-tip-root { .synch-tip-root {
position: absolute; position: absolute;
z-index: @zindex-navbar + 2; z-index: @zindex-navbar + 2;
width: 300px;
&:not(.simple) {
width: 300px;
.tip-text { .tip-text {
width: 260px; width: 260px;
} }
}
&.simple {
max-width: 700px;
left: 50%;
transform: translate(-50%, 20px);
.tip-arrow {
display: none;
}
.asc-synchronizetip {
padding-right: 30px;
}
}
&.inc-index { &.inc-index {
z-index: @zindex-navbar + 4; z-index: @zindex-navbar + 4;

View file

@ -1058,6 +1058,10 @@ define([
Common.NotificationCenter.trigger('document:ready', 'main'); Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense(); me.applyLicense();
if ( me.api.asc_isReadOnly() ) {
me.warningDocumentIsLocked();
}
} }
}, 50); }, 50);
} else { } else {
@ -2219,6 +2223,41 @@ define([
}) })
}, },
warningDocumentIsLocked: function() {
var me = this;
var _disable_ui = function (disable) {
DE.getController('RightMenu').SetDisabled(disable, false, true);
DE.getController('Toolbar').DisableToolbar(disable, disable);
DE.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
DE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
DE.getController('Navigation') && DE.getController('Navigation').SetDisabled(disable);
DE.getController('LeftMenu').setPreviewMode(disable);
var comments = DE.getController('Common.Controllers.Comments');
if (comments) comments.setPreviewMode(disable);
}
_disable_ui(true);
var tip = new Common.UI.SynchronizeTip({
extCls : 'simple',
text : Common.Locale.get("warnFileLocked",{name:"DE.Controllers.Main"}),
textLink : Common.Locale.get("txtContinueEditing",{name:"DE.Views.SignatureSettings"}),
placement : 'document'
});
tip.on({
'dontshowclick': function() {
_disable_ui(false);
me.api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
}
});
tip.show();
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.', leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error', criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',

View file

@ -743,6 +743,7 @@
"DE.Controllers.Main.warnNoLicense": "This version of %1 editors has certain limitations for concurrent connections to the document server.<br>If you need more please consider purchasing a commercial license.", "DE.Controllers.Main.warnNoLicense": "This version of %1 editors has certain limitations for concurrent connections to the document server.<br>If you need more please consider purchasing a commercial license.",
"DE.Controllers.Main.warnNoLicenseUsers": "This version of %1 editors has certain limitations for concurrent users.<br>If you need more please consider purchasing a commercial license.", "DE.Controllers.Main.warnNoLicenseUsers": "This version of %1 editors has certain limitations for concurrent users.<br>If you need more please consider purchasing a commercial license.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Main.warnFileLocked": "Document is in use by another application. You can continue editing and save it as a copy.",
"DE.Controllers.Main.textConvertEquation": "This equation was created with an old version of equation editor which is no longer supported. Converting this equation to Office Math ML format will make it editable.<br>Do you want to convert this equation?", "DE.Controllers.Main.textConvertEquation": "This equation was created with an old version of equation editor which is no longer supported. Converting this equation to Office Math ML format will make it editable.<br>Do you want to convert this equation?",
"DE.Controllers.Main.textApplyAll": "Apply to all equations", "DE.Controllers.Main.textApplyAll": "Apply to all equations",
"DE.Controllers.Main.textLearnMore": "Learn More", "DE.Controllers.Main.textLearnMore": "Learn More",