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 @@
  • To delete an Accent, you can right-click on it and select the Remove accent character, Delete char or Remove bar option from the menu (the available options differ depending on the selected accent).
  • To delete a row or a column of a Matrix, you can right-click on the placeholder within the row/column you need to delete, select the Delete option from the menu, then select Delete Row/Column.
  • +

    Convert equations

    +

    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:

    +

    Convert equation

    +

    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.

    \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/help/en/images/convertequation.png b/apps/presentationeditor/main/resources/help/en/images/convertequation.png new file mode 100644 index 000000000..a97a5bea2 Binary files /dev/null and b/apps/presentationeditor/main/resources/help/en/images/convertequation.png differ diff --git a/apps/presentationeditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm b/apps/presentationeditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm index ef7946803..cb0d32904 100644 --- a/apps/presentationeditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm +++ b/apps/presentationeditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm @@ -91,6 +91,12 @@
  • Чтобы удалить Диакритический знак, можно щелкнуть по нему правой кнопкой мыши и выбрать из контекстного меню пункт Удалить диакритический знак, Удалить символ или Удалить черту (доступные опции отличаются в зависимости от выбранного диакритического знака).
  • Чтобы удалить строку или столбец Матрицы, можно щелкнуть правой кнопкой мыши по полю для заполнения внутри строки/столбца, который требуется удалить, выбрать из контекстного меню пункт Удалить, а затем - Удалить строку/столбец.
  • +

    Преобразование уравнений

    +

    Если вы открываете существующий документ с уравнениями, которые были созданы с помощью старой версии редактора уравнений (например, в версиях, предшествующих MS Office 2007), эти уравнения необходимо преобразовать в формат Office Math ML, чтобы иметь возможность их редактировать.

    +

    Чтобы преобразовать уравнение, дважды щелкните по нему. Откроется окно с предупреждением:

    +

    Преобразование уравнений

    +

    Чтобы преобразовать только выбранное уравнение, нажмите кнопку Да в окне предупреждения. Чтобы преобразовать все уравнения в документе, поставьте галочку Применить ко всем уравнениям и нажмите кнопку Да.

    +

    После преобразования уравнения вы сможете его редактировать.

    \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/help/ru/images/convertequation.png b/apps/presentationeditor/main/resources/help/ru/images/convertequation.png new file mode 100644 index 000000000..3ad46ae4e Binary files /dev/null and b/apps/presentationeditor/main/resources/help/ru/images/convertequation.png differ diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 539f90883..a84dad15a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1386,6 +1386,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.appOptions.isEditDiagram) me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onSelectionChanged, me)); @@ -2634,6 +2635,30 @@ define([ return true; }, + 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'); + }) + }, + 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', @@ -3036,7 +3061,10 @@ define([ txtOr: '%1 or %2', errorLang: 'The interface language is not loaded.
    Please contact your Document Server administrator.', confirmReplaceFormulaInTable: 'Formulas in the header row will be removed and converted to static text.
    Do you want to continue?', - 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' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index f1f6a6a12..7ea3c4651 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -288,7 +288,7 @@ define([ return this; }, - show: function(panel) { + show: function(panel, opts) { if (this.isVisible() && panel===undefined || !this.mode) return; if ( !this.rendered ) @@ -299,7 +299,7 @@ define([ panel = this.active || defPanel; this.$el.show(); this.scroller.update(); - this.selectMenu(panel, defPanel); + this.selectMenu(panel, opts, defPanel); this.api.asc_enableKeyEvents(false); @@ -426,7 +426,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]; @@ -439,7 +439,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/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 00f8c80a0..e4584ce2c 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -2346,6 +2346,7 @@ define([ this.menu = options.menu; this.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; + this.openUrl = null; this.en_data = [ {"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Spreadsheet Editor user interface", "headername": "Program Interface"}, @@ -2411,7 +2412,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'); @@ -2457,9 +2458,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'; @@ -2468,12 +2474,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/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 248bdbf94..fff9c972c 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -307,10 +307,10 @@ define([ this.btnSpellcheck.setDisabled(false); }, - 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/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 86156586d..22c7a3e75 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1009,6 +1009,9 @@ "SSE.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.", "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "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.
    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", diff --git a/apps/spreadsheeteditor/main/resources/help/en/UsageInstructions/InsertEquation.htm b/apps/spreadsheeteditor/main/resources/help/en/UsageInstructions/InsertEquation.htm index 5c9e82056..24c38680a 100644 --- a/apps/spreadsheeteditor/main/resources/help/en/UsageInstructions/InsertEquation.htm +++ b/apps/spreadsheeteditor/main/resources/help/en/UsageInstructions/InsertEquation.htm @@ -88,6 +88,12 @@
  • To delete an Accent, you can right-click on it and select the Remove accent character, Delete char or Remove bar option from the menu (the available options differ depending on the selected accent).
  • To delete a row or a column of a Matrix, you can right-click on the placeholder within the row/column you need to delete, select the Delete option from the menu, then select Delete Row/Column.
  • +

    Convert equations

    +

    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:

    +

    Convert equation

    +

    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.

    \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/resources/help/en/images/convertequation.png b/apps/spreadsheeteditor/main/resources/help/en/images/convertequation.png new file mode 100644 index 000000000..a97a5bea2 Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/help/en/images/convertequation.png differ diff --git a/apps/spreadsheeteditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm b/apps/spreadsheeteditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm index 430c05aed..77305fa76 100644 --- a/apps/spreadsheeteditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm +++ b/apps/spreadsheeteditor/main/resources/help/ru/UsageInstructions/InsertEquation.htm @@ -90,6 +90,12 @@
  • Чтобы удалить Диакритический знак, можно щелкнуть по нему правой кнопкой мыши и выбрать из контекстного меню пункт Удалить диакритический знак, Удалить символ или Удалить черту (доступные опции отличаются в зависимости от выбранного диакритического знака).
  • Чтобы удалить строку или столбец Матрицы, можно щелкнуть правой кнопкой мыши по полю для заполнения внутри строки/столбца, который требуется удалить, выбрать из контекстного меню пункт Удалить, а затем - Удалить строку/столбец.
  • +

    Преобразование уравнений

    +

    Если вы открываете существующий документ с уравнениями, которые были созданы с помощью старой версии редактора уравнений (например, в версиях, предшествующих MS Office 2007), эти уравнения необходимо преобразовать в формат Office Math ML, чтобы иметь возможность их редактировать.

    +

    Чтобы преобразовать уравнение, дважды щелкните по нему. Откроется окно с предупреждением:

    +

    Преобразование уравнений

    +

    Чтобы преобразовать только выбранное уравнение, нажмите кнопку Да в окне предупреждения. Чтобы преобразовать все уравнения в документе, поставьте галочку Применить ко всем уравнениям и нажмите кнопку Да.

    +

    После преобразования уравнения вы сможете его редактировать.

    \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/resources/help/ru/images/convertequation.png b/apps/spreadsheeteditor/main/resources/help/ru/images/convertequation.png new file mode 100644 index 000000000..3ad46ae4e Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/help/ru/images/convertequation.png differ