diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 0f4583993..74f4ca659 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -493,7 +493,7 @@ define([ footer.find('.dlg-btn').on('click', onBtnClick); chDontShow = new Common.UI.CheckBox({ el: win.$window.find('.dont-show-checkbox'), - labelText: win.textDontShow + labelText: options.textDontShow || win.textDontShow }); autoSize(obj); }, @@ -506,13 +506,14 @@ define([ }); win.show(); + return win; }; Common.UI.error = function(options) { options = options || {}; !options.title && (options.title = this.Window.prototype.textError); - Common.UI.alert( + return Common.UI.alert( _.extend(options, { iconCls: 'error' }) @@ -523,7 +524,7 @@ define([ options = options || {}; !options.title && (options.title = this.Window.prototype.textConfirmation); - Common.UI.alert( + return Common.UI.alert( _.extend(options, { iconCls: 'confirm' }) @@ -534,7 +535,7 @@ define([ options = options || {}; !options.title && (options.title = this.Window.prototype.textInformation); - Common.UI.alert( + return Common.UI.alert( _.extend(options, { iconCls: 'info' }) @@ -545,7 +546,7 @@ define([ options = options || {}; !options.title && (options.title = this.Window.prototype.textWarning); - Common.UI.alert( + return Common.UI.alert( _.extend(options, { iconCls: 'warn' }) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 6ae016dc0..a9eaa7219 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1343,6 +1343,7 @@ define([ /** coauthoring begin **/ me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); + me.api.asc_registerCallback('asc_onConvertEquationToMath',_.bind(me.onConvertEquationToMath, me)); /** coauthoring end **/ if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) { @@ -2192,6 +2193,30 @@ define([ this.appOptions.canUseHistory = false; }, + onConvertEquationToMath: function(equation) { + var me = this, + win; + var msg = this.textConvertEquation + '

' + this.textLearnMore + ''; + 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'); + }) + }, + 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', @@ -2538,7 +2563,10 @@ define([ txtChoose: 'Choose an item.', errorDirectUrl: 'Please verify the link to the document.
This link must be a direct link to the file for downloading.', txtStyle_Caption: 'Caption', - errorCompare: 'The Compare documents feature is not available in the co-editing mode.' + errorCompare: 'The Compare documents feature is not available in the co-editing mode.', + 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.
Do you want to convert this equation?', + textApplyAll: 'Apply to all equations', + textLearnMore: 'Learn More' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index bdb5fd2be..8424d3d9c 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -721,6 +721,9 @@ "DE.Controllers.Main.warnNoLicense": "This version of %1 editors has certain limitations for concurrent connections to the document server.
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.
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.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.
Do you want to convert this equation?", + "DE.Controllers.Main.textApplyAll": "Apply to all equations", + "DE.Controllers.Main.textLearnMore": "Learn More", "DE.Controllers.Navigation.txtBeginning": "Beginning of document", "DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",