[PE][SSE] Bug 44511

This commit is contained in:
Julia Radzhabova 2020-08-25 19:09:31 +03:00
parent 4aac4837f2
commit 1a1e6c6f04
4 changed files with 64 additions and 2 deletions

View file

@ -1069,6 +1069,7 @@ define([
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
me.api.asc_registerCallback('asc_onConvertEquationToMath', _.bind(me.onConvertEquationToMath, me));
/** coauthoring end **/
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
@ -1936,6 +1937,30 @@ define([
}
},
onConvertEquationToMath: function(equation) {
var me = this,
win;
var msg = this.textConvertEquation + '<br><br><a id="id-equation-convert-help" style="cursor: pointer;">' + this.textLearnMore + '</a>';
win = Common.UI.warning({
width: 500,
msg: msg,
buttons: ['yes', 'cancel'],
primary: 'yes',
dontshow: true,
textDontShow: this.textApplyAll,
callback: _.bind(function(btn, dontshow){
if (btn == 'yes') {
this.api.asc_ConvertEquationToMath(equation, dontshow);
}
this.onEditComplete();
}, this)
});
win.$window.find('#id-equation-convert-help').on('click', function (e) {
win && win.close();
me.getApplication().getController('LeftMenu').getView('LeftMenu').showMenu('file:help', 'UsageInstructions\/InsertEquation.htm#convertequation');
})
},
// Translation
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',
@ -2289,7 +2314,10 @@ define([
errorFileSizeExceed: 'The file size exceeds the limitation set for your server.<br>Please contact your Document Server administrator for details.',
errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.<br>Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.',
textHasMacros: 'The file contains automatic macros.<br>Do you want to run macros?',
textRemember: 'Remember my choice'
textRemember: 'Remember my choice',
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?',
textApplyAll: 'Apply to all equations',
textLearnMore: 'Learn More'
}
})(), PE.Controllers.Main || {}))
});

View file

@ -637,6 +637,9 @@
"PE.Controllers.Main.warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact your administrator to learn more.",
"PE.Controllers.Main.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Main.textConvertEquation": "This equation was created with an old version of the equation editor which is no longer supported. To edit it, convert the equation to the Office Math ML format.<br>Convert now?",
"PE.Controllers.Main.textLearnMore": "Learn More",
"PE.Controllers.Main.textApplyAll": "Apply to all equations",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
"PE.Controllers.Toolbar.textAccent": "Accents",

View file

@ -1168,6 +1168,7 @@ define([
/** coauthoring begin **/
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
me.api.asc_registerCallback('asc_onConvertEquationToMath', _.bind(me.onConvertEquationToMath, me));
/** coauthoring end **/
if (me.appOptions.isEditDiagram)
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onSelectionChanged, me));
@ -2251,6 +2252,30 @@ define([
}
},
onConvertEquationToMath: function(equation) {
var me = this,
win;
var msg = this.textConvertEquation + '<br><br><a id="id-equation-convert-help" style="cursor: pointer;">' + this.textLearnMore + '</a>';
win = Common.UI.warning({
width: 500,
msg: msg,
buttons: ['yes', 'cancel'],
primary: 'yes',
dontshow: true,
textDontShow: this.textApplyAll,
callback: _.bind(function(btn, dontshow){
if (btn == 'yes') {
this.api.asc_ConvertEquationToMath(equation, dontshow);
}
this.onEditComplete();
}, this)
});
win.$window.find('#id-equation-convert-help').on('click', function (e) {
win && win.close();
me.getApplication().getController('LeftMenu').getView('LeftMenu').showMenu('file:help', 'UsageInstructions\/InsertEquation.htm#convertequation');
})
},
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',
notcriticalErrorTitle: 'Warning',
@ -2624,7 +2649,10 @@ define([
textRemember: 'Remember my choice',
errorPasteSlicerError: 'Table slicers cannot be copied from one workbook to another.<br>Try again by selecting the entire table and the slicers.',
errorFrmlMaxLength: 'You cannot add this formula as its length exceeded the allowed number of characters.<br>Please edit it and try again.',
errorFrmlMaxReference: 'You cannot enter this formula because it has too many values,<br>cell references, and/or names.'
errorFrmlMaxReference: 'You cannot enter this formula because it has too many values,<br>cell references, and/or names.',
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?',
textApplyAll: 'Apply to all equations',
textLearnMore: 'Learn More'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -832,6 +832,9 @@
"SSE.Controllers.Main.warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact your administrator to learn more.",
"SSE.Controllers.Main.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.textConvertEquation": "This equation was created with an old version of the equation editor which is no longer supported. To edit it, convert the equation to the Office Math ML format.<br>Convert now?",
"SSE.Controllers.Main.textLearnMore": "Learn More",
"SSE.Controllers.Main.textApplyAll": "Apply to all equations",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textFirstCol": "First column",
"SSE.Controllers.Print.textFirstRow": "First row",