diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index d7f23db01..c46aae89d 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -1289,6 +1289,7 @@ define([
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_onConnectionStateChanged', _.bind(me.onUserConnection, me));
+ me.api.asc_registerCallback('asc_onConvertEquationToMath', _.bind(me.onConvertEquationToMath, me));
/** coauthoring end **/
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
@@ -2421,6 +2422,30 @@ define([
this.getApplication().getController('DocumentHolder').getView().focus();
},
+ 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#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',
@@ -2789,7 +2814,10 @@ define([
leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.',
textTryUndoRedoWarn: 'The Undo/Redo functions are disabled for the Fast co-editing mode.',
txtNone: 'None',
- textDisconnect: 'Connection is lost'
+ textDisconnect: 'Connection is lost',
+ 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'
}
})(), PE.Controllers.Main || {}))
});
diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js
index 86f323c31..c7de276c4 100644
--- a/apps/presentationeditor/main/app/view/FileMenu.js
+++ b/apps/presentationeditor/main/app/view/FileMenu.js
@@ -313,7 +313,7 @@ define([
return this;
},
- show: function(panel) {
+ show: function(panel, opts) {
if (this.isVisible() && panel===undefined || !this.mode) return;
if ( !this.rendered )
@@ -324,7 +324,7 @@ define([
panel = this.active || defPanel;
this.$el.show();
this.scroller.update();
- this.selectMenu(panel, defPanel);
+ this.selectMenu(panel, opts, defPanel);
this.api && this.api.asc_enableKeyEvents(false);
@@ -450,7 +450,7 @@ define([
this.document = data.doc;
},
- selectMenu: function(menu, defMenu) {
+ selectMenu: function(menu, opts, defMenu) {
if ( menu ) {
var item = this._getMenuItem(menu),
panel = this.panels[menu];
@@ -463,7 +463,7 @@ define([
item.$el.addClass('active');
this.$el.find('.content-box:visible').hide();
- panel.show();
+ panel.show(opts);
if (this.scroller) {
var itemTop = item.$el.position().top,
diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js
index 7a67b4062..bb76447f0 100644
--- a/apps/presentationeditor/main/app/view/FileMenuPanels.js
+++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js
@@ -1383,6 +1383,7 @@ define([
this.menu = options.menu;
this.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
+ this.openUrl = null;
this.en_data = [
{"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Presentation Editor user interface", "headername": "Program Interface"},
@@ -1446,7 +1447,7 @@ define([
});
this.viewHelpPicker.on('item:select', function(dataview, itemview, record) {
- me.iFrame.src = me.urlPref + record.get('src');
+ me.onSelectItem(record.get('src'));
});
this.iFrame = document.createElement('iframe');
@@ -1492,9 +1493,14 @@ define([
}
},
success: function () {
- var rec = store.at(0);
- me.viewHelpPicker.selectRecord(rec);
- me.iFrame.src = me.urlPref + rec.get('src');
+ var rec = me.openUrl ? store.find(function(record){
+ return (me.openUrl.indexOf(record.get('src'))>=0);
+ }) : store.at(0);
+ if (rec) {
+ me.viewHelpPicker.selectRecord(rec, true);
+ me.viewHelpPicker.scrollToRecord(rec);
+ }
+ me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src'));
}
};
store.url = 'resources/help/' + lang + '/Contents.json';
@@ -1503,12 +1509,29 @@ define([
}
},
- show: function () {
+ show: function (url) {
Common.UI.BaseView.prototype.show.call(this);
if (!this._scrollerInited) {
this.viewHelpPicker.scroller.update();
this._scrollerInited = true;
}
+ if (url) {
+ if (this.viewHelpPicker.store.length>0) {
+ var rec = this.viewHelpPicker.store.find(function(record){
+ return (url.indexOf(record.get('src'))>=0);
+ });
+ if (rec) {
+ this.viewHelpPicker.selectRecord(rec, true);
+ this.viewHelpPicker.scrollToRecord(rec);
+ }
+ this.onSelectItem(url);
+ } else
+ this.openUrl = url;
+ }
+ },
+
+ onSelectItem: function(src) {
+ this.iFrame.src = this.urlPref + src;
}
});
diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js
index c39fa0106..c1868b7db 100644
--- a/apps/presentationeditor/main/app/view/LeftMenu.js
+++ b/apps/presentationeditor/main/app/view/LeftMenu.js
@@ -320,10 +320,10 @@ define([
this.btnPlugins.setDisabled(disable);
},
- showMenu: function(menu) {
+ showMenu: function(menu, opts) {
var re = /^(\w+):?(\w*)$/.exec(menu);
if ( re[1] == 'file' ) {
- this.menuFile.show(re[2].length ? re[2] : undefined);
+ this.menuFile.show(re[2].length ? re[2] : undefined, opts);
} else {
/** coauthoring begin **/
if (menu == 'chat') {
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index 05d49feb3..29c8e7c0e 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -740,6 +740,9 @@
"PE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.",
"PE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"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.
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.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?",
"PE.Controllers.Toolbar.textAccent": "Accents",
diff --git a/apps/presentationeditor/main/resources/help/en/UsageInstructions/InsertEquation.htm b/apps/presentationeditor/main/resources/help/en/UsageInstructions/InsertEquation.htm
index dff87269e..207637a01 100644
--- a/apps/presentationeditor/main/resources/help/en/UsageInstructions/InsertEquation.htm
+++ b/apps/presentationeditor/main/resources/help/en/UsageInstructions/InsertEquation.htm
@@ -89,6 +89,12 @@
If you open an existing document containing equations which were created with an old version of equation editor (for example, with MS Office versions before 2007), you need to convert these equations to the Office Math ML format to be able to edit them.
+To convert an equation, double-click it. The warning window will appear:
+ +To convert the selected equation only, click the Yes button in the warning window. To convert all equations in this document, check the Apply to all equations box and click Yes.
+Once the equation is converted, you can edit it.