[SSE] Fix hyperlinks editing. Add errors

This commit is contained in:
Julia Radzhabova 2021-08-08 23:10:52 +03:00
parent 4fecc63ba0
commit 85882cf113
4 changed files with 26 additions and 13 deletions

View file

@ -237,7 +237,7 @@ define([
view.menuParagraphBullets.menu.on('show:after', _.bind(me.onBulletMenuShowAfter, me));
view.menuAddHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
view.menuEditHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
view.menuRemoveHyperlinkShape.on('click', _.bind(me.onRemoveHyperlinkShape, me));
view.menuRemoveHyperlinkShape.on('click', _.bind(me.onDelHyperlink, me));
view.pmiTextAdvanced.on('click', _.bind(me.onTextAdvanced, me));
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
@ -638,6 +638,10 @@ define([
},
onDelHyperlink: function(item) {
Common.NotificationCenter.trigger('protect:check', this.onDelHyperlinkCallback, this);
},
onDelHyperlinkCallback: function(item) {
if (this.api) {
this.api.asc_removeHyperlink();
@ -898,15 +902,6 @@ define([
Common.component.Analytics.trackEvent('DocumentHolder', 'List Type');
},
onRemoveHyperlinkShape: function(item) {
if (this.api) {
this.api.asc_removeHyperlink();
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Remove Hyperlink');
}
},
onTextAdvanced: function(item) {
var me = this;

View file

@ -1800,6 +1800,18 @@ define([
config.msg = this.errorLocationOrDataRangeError;
break;
case Asc.c_oAscError.ID.PasswordIsNotCorrect:
config.msg = this.errorPasswordIsNotCorrect;
break;
case Asc.c_oAscError.ID.DeleteColumnContainsLockedCell:
config.msg = this.errorDeleteColumnContainsLockedCell;
break;
case Asc.c_oAscError.ID.DeleteRowContainsLockedCell:
config.msg = this.errorDeleteRowContainsLockedCell;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@ -2164,7 +2176,7 @@ define([
},
checkProtectedRange: function(callback, scope, args) {
var result = this.api.asc_checkActiveCellProtectedRange();
var result = this.api.asc_isProtectedSheet() ? this.api.asc_checkActiveCellProtectedRange() : false;
if (result===null) {
this.onError(Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical);
return;
@ -3311,7 +3323,10 @@ define([
textLearnMore: 'Learn More',
errorSingleColumnOrRowError: 'Location reference is not valid because the cells are not all in the same column or row.<br>Select cells that are all in a single column or row.',
errorLocationOrDataRangeError: 'The reference for the location or data range is not valid.',
txtErrorLoadHistory: 'Loading history failed'
txtErrorLoadHistory: 'Loading history failed',
errorPasswordIsNotCorrect: 'The password you supplied is not correct.<br>Verify that the CAPS LOCK key is off and be sure to use the correct capitalization.',
errorDeleteColumnContainsLockedCell: 'You are trying to delete a column that contains a locked cell. Locked cells cannot be deleted while the worksheet is protected.<br>To delete a locked cell, unprotect the sheet. You might be requested to enter a password.',
errorDeleteRowContainsLockedCell: 'You are trying to delete a row that contains a locked cell. Locked cells cannot be deleted while the worksheet is protected.<br>To delete a locked cell, unprotect the sheet. You might be requested to enter a password.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -1219,7 +1219,7 @@ define([
cls : 'btn-toolbar x-huge icon-top',
iconCls : 'toolbar__icon btn-colorschemas',
caption : me.capBtnColorSchemas,
lock : [_set.editCell, _set.lostConnect, _set.coAuth],
lock : [_set.editCell, _set.lostConnect, _set.coAuth, _set.wsLock],
menu : new Common.UI.Menu({
cls: 'shifted-left',
items: [],

View file

@ -707,6 +707,9 @@
"SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print it until the connection is restored and page is reloaded.",
"SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.<br>Wrong number of brackets is used.",
"SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error.",
"SSE.Controllers.Main.errorPasswordIsNotCorrect": "The password you supplied is not correct.<br>Verify that the CAPS LOCK key is off and be sure to use the correct capitalization.",
"SSE.Controllers.Main.errorDeleteColumnContainsLockedCell": "You are trying to delete a column that contains a locked cell. Locked cells cannot be deleted while the worksheet is protected.<br>To delete a locked cell, unprotect the sheet. You might be requested to enter a password.",
"SSE.Controllers.Main.errorDeleteRowContainsLockedCell": "You are trying to delete a row that contains a locked cell. Locked cells cannot be deleted while the worksheet is protected.<br>To delete a locked cell, unprotect the sheet. You might be requested to enter a password.",
"SSE.Controllers.Main.errRemDuplicates": "Duplicate values found and deleted: {0}, unique values left: {1}.",
"SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.",
"SSE.Controllers.Main.leavePageTextOnClose": "All unsaved changes in this spreadsheet will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",