mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 13:10:48 +08:00
Show errors as not-modal windows
This commit is contained in:
@ -238,7 +238,7 @@ define([
|
||||
|
||||
var _addTips = function(arr) {
|
||||
for (var step in arr) {
|
||||
if (arr.hasOwnProperty(step) && !Common.localStorage.getItem(arr[step].name)) {
|
||||
if (arr.hasOwnProperty(step) && !Common.localStorage.getItem(arr[step].name) && !(_helpTips[step] && _helpTips[step].tip && _helpTips[step].tip.isVisible())) { // don't replace tip when it's visible
|
||||
_helpTips[step] = arr[step];
|
||||
}
|
||||
}
|
||||
@ -263,6 +263,8 @@ define([
|
||||
if (step.step) {
|
||||
if (!_helpTips[step.step])
|
||||
_helpTips[step.step] = step;
|
||||
else
|
||||
_helpTips[step.step].text = step.text; // change text
|
||||
step = step.step;
|
||||
}
|
||||
}
|
||||
|
||||
@ -617,16 +617,11 @@ define([
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
maxwidth: 600,
|
||||
msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
callback: function(){
|
||||
me._state.lostEditingRights = false;
|
||||
me.onEditComplete();
|
||||
}
|
||||
});
|
||||
!old_rights && Common.UI.TooltipManager.showTip({ step: 'changeRights', text: _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
}
|
||||
},
|
||||
|
||||
@ -2093,6 +2088,20 @@ define([
|
||||
case Asc.c_oAscError.ID.SessionToken:
|
||||
Common.UI.TooltipManager.showTip('sessionToken');
|
||||
return;
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
var me = this;
|
||||
Common.UI.TooltipManager.showTip({ step: 'userDrop', text: this.errorUserDrop,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
return;
|
||||
}
|
||||
|
||||
this.hidePreloader();
|
||||
@ -2192,16 +2201,6 @@ define([
|
||||
config.msg = this.errorDatabaseConnection;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.MailMergeLoadFile:
|
||||
config.msg = this.errorMailMergeLoadFile;
|
||||
break;
|
||||
@ -2365,7 +2364,6 @@ define([
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print
|
||||
}
|
||||
this._state.lostEditingRights = false;
|
||||
this.onEditComplete();
|
||||
}, this);
|
||||
}
|
||||
|
||||
@ -537,16 +537,11 @@ define([
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
maxwidth: 600,
|
||||
msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
callback: function(){
|
||||
me._state.lostEditingRights = false;
|
||||
me.onEditComplete();
|
||||
}
|
||||
});
|
||||
!old_rights && Common.UI.TooltipManager.showTip({ step: 'changeRights', text: _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
}
|
||||
},
|
||||
|
||||
@ -1671,6 +1666,20 @@ define([
|
||||
case Asc.c_oAscError.ID.SessionToken:
|
||||
Common.UI.TooltipManager.showTip('sessionToken');
|
||||
return;
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
var me = this;
|
||||
Common.UI.TooltipManager.showTip({ step: 'userDrop', text: this.errorUserDrop,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
return;
|
||||
}
|
||||
|
||||
this.hidePreloader();
|
||||
@ -1770,16 +1779,6 @@ define([
|
||||
config.msg = this.errorDatabaseConnection;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.Warning:
|
||||
config.msg = this.errorConnectToServer;
|
||||
config.closable = false;
|
||||
@ -1904,7 +1903,6 @@ define([
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print
|
||||
}
|
||||
this._state.lostEditingRights = false;
|
||||
this.onEditComplete();
|
||||
}, this);
|
||||
}
|
||||
|
||||
@ -565,16 +565,11 @@ define([
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
maxwidth: 600,
|
||||
msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
callback: function(){
|
||||
me._state.lostEditingRights = false;
|
||||
me.onEditComplete();
|
||||
}
|
||||
});
|
||||
!old_rights && Common.UI.TooltipManager.showTip({ step: 'changeRights', text: _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
}
|
||||
},
|
||||
|
||||
@ -1648,6 +1643,20 @@ define([
|
||||
case Asc.c_oAscError.ID.SessionToken:
|
||||
Common.UI.TooltipManager.showTip('sessionToken');
|
||||
return;
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
var me = this;
|
||||
Common.UI.TooltipManager.showTip({ step: 'userDrop', text: this.errorUserDrop,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
return;
|
||||
}
|
||||
this.hidePreloader();
|
||||
this.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
@ -1734,16 +1743,6 @@ define([
|
||||
config.msg = this.errorDatabaseConnection;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.Warning:
|
||||
config.msg = this.errorConnectToServer;
|
||||
config.closable = false;
|
||||
@ -1873,7 +1872,6 @@ define([
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print
|
||||
}
|
||||
this._state.lostEditingRights = false;
|
||||
this.onEditComplete();
|
||||
}, this);
|
||||
}
|
||||
|
||||
@ -637,16 +637,11 @@ define([
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
maxwidth: 600,
|
||||
msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
callback: function(){
|
||||
me._state.lostEditingRights = false;
|
||||
me.onEditComplete();
|
||||
}
|
||||
});
|
||||
!old_rights && Common.UI.TooltipManager.showTip({ step: 'changeRights', text: _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
}
|
||||
},
|
||||
|
||||
@ -1782,6 +1777,20 @@ define([
|
||||
case Asc.c_oAscError.ID.SessionToken:
|
||||
Common.UI.TooltipManager.showTip('sessionToken');
|
||||
return;
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
var me = this;
|
||||
Common.UI.TooltipManager.showTip({ step: 'userDrop', text: this.errorUserDrop,
|
||||
target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true,
|
||||
callback: function() {
|
||||
me._state.lostEditingRights = false;
|
||||
}});
|
||||
return;
|
||||
}
|
||||
this.hidePreloader();
|
||||
this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||
@ -1945,16 +1954,6 @@ define([
|
||||
config.msg = this.errorFillRange;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
if (this._state.lostEditingRights) {
|
||||
this._state.lostEditingRights = false;
|
||||
return;
|
||||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.InvalidReferenceOrName:
|
||||
config.msg = this.errorInvalidRef;
|
||||
break;
|
||||
@ -2287,7 +2286,6 @@ define([
|
||||
} else if (id == Asc.c_oAscError.ID.FillAllRowsWarning && btn === 'fillOther' && _.isFunction(callback)) {
|
||||
callback();
|
||||
}
|
||||
this._state.lostEditingRights = false;
|
||||
this.onEditComplete();
|
||||
}, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user