Bug 44511

This commit is contained in:
Julia Radzhabova 2021-07-22 12:40:13 +03:00
commit 009779620d
18 changed files with 156 additions and 24 deletions

View file

@ -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 + '<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',
@ -2789,7 +2814,10 @@ define([
leavePageTextOnClose: 'All unsaved changes in this document will be lost.<br> 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.<br>Do you want to convert this equation?',
textApplyAll: 'Apply to all equations',
textLearnMore: 'Learn More'
}
})(), PE.Controllers.Main || {}))
});

View file

@ -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,

View file

@ -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;
}
});

View file

@ -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') {

View file

@ -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.<br>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.<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

@ -89,6 +89,12 @@
<li>To delete an <em>Accent</em>, you can right-click on it and select the <b>Remove accent character</b>, <b>Delete char</b> or <b>Remove bar</b> option from the menu (the available options differ depending on the selected accent).</li>
<li>To delete a row or a column of a <em>Matrix</em>, you can right-click on the placeholder within the row/column you need to delete, select the <b>Delete</b> option from the menu, then select <b>Delete Row/Column</b>.</li>
</ul>
<h3 id="convertequation">Convert equations</h3>
<p>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.</p>
<p>To convert an equation, double-click it. The warning window will appear:</p>
<p><img alt="Convert equation" src="../images/convertequation.png" /></p>
<p>To convert the selected equation only, click the <b>Yes</b> button in the warning window. To convert all equations in this document, check the <b>Apply to all equations</b> box and click <b>Yes</b>.</p>
<p>Once the equation is converted, you can edit it.</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -91,6 +91,12 @@
<li>Чтобы удалить <em>Диакритический знак</em>, можно щелкнуть по нему правой кнопкой мыши и выбрать из контекстного меню пункт <b>Удалить диакритический знак</b>, <b>Удалить символ</b> или <b>Удалить черту</b> (доступные опции отличаются в зависимости от выбранного диакритического знака).</li>
<li>Чтобы удалить строку или столбец <em>Матрицы</em>, можно щелкнуть правой кнопкой мыши по полю для заполнения внутри строки/столбца, который требуется удалить, выбрать из контекстного меню пункт <b>Удалить</b>, а затем - <b>Удалить строку/столбец</b>.</li>
</ul>
<h3 id="convertequation">Преобразование уравнений</h3>
<p>Если вы открываете существующий документ с уравнениями, которые были созданы с помощью старой версии редактора уравнений (например, в версиях, предшествующих MS Office 2007), эти уравнения необходимо преобразовать в формат Office Math ML, чтобы иметь возможность их редактировать.</p>
<p>Чтобы преобразовать уравнение, дважды щелкните по нему. Откроется окно с предупреждением:</p>
<p><img alt="Преобразование уравнений" src="../images/convertequation.png" /></p>
<p>Чтобы преобразовать только выбранное уравнение, нажмите кнопку <b>Да</b> в окне предупреждения. Чтобы преобразовать все уравнения в документе, поставьте галочку <b>Применить ко всем уравнениям</b> и нажмите кнопку <b>Да</b>.</p>
<p>После преобразования уравнения вы сможете его редактировать.</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -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 + '<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',
@ -3036,7 +3061,10 @@ define([
txtOr: '%1 or %2',
errorLang: 'The interface language is not loaded.<br>Please contact your Document Server administrator.',
confirmReplaceFormulaInTable: 'Formulas in the header row will be removed and converted to static text.<br>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.<br>Do you want to convert this equation?',
textApplyAll: 'Apply to all equations',
textLearnMore: 'Learn More'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -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,

View file

@ -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;
}
});

View file

@ -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') {

View file

@ -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.<br>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.<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",

View file

@ -88,6 +88,12 @@
<li>To delete an <em>Accent</em>, you can right-click on it and select the <b>Remove accent character</b>, <b>Delete char</b> or <b>Remove bar</b> option from the menu (the available options differ depending on the selected accent).</li>
<li>To delete a row or a column of a <em>Matrix</em>, you can right-click on the placeholder within the row/column you need to delete, select the <b>Delete</b> option from the menu, then select <b>Delete Row/Column</b>.</li>
</ul>
<h3 id="convertequation">Convert equations</h3>
<p>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.</p>
<p>To convert an equation, double-click it. The warning window will appear:</p>
<p><img alt="Convert equation" src="../images/convertequation.png" /></p>
<p>To convert the selected equation only, click the <b>Yes</b> button in the warning window. To convert all equations in this document, check the <b>Apply to all equations</b> box and click <b>Yes</b>.</p>
<p>Once the equation is converted, you can edit it.</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -90,6 +90,12 @@
<li>Чтобы удалить <em>Диакритический знак</em>, можно щелкнуть по нему правой кнопкой мыши и выбрать из контекстного меню пункт <b>Удалить диакритический знак</b>, <b>Удалить символ</b> или <b>Удалить черту</b> (доступные опции отличаются в зависимости от выбранного диакритического знака).</li>
<li>Чтобы удалить строку или столбец <em>Матрицы</em>, можно щелкнуть правой кнопкой мыши по полю для заполнения внутри строки/столбца, который требуется удалить, выбрать из контекстного меню пункт <b>Удалить</b>, а затем - <b>Удалить строку/столбец</b>.</li>
</ul>
<h3 id="convertequation">Преобразование уравнений</h3>
<p>Если вы открываете существующий документ с уравнениями, которые были созданы с помощью старой версии редактора уравнений (например, в версиях, предшествующих MS Office 2007), эти уравнения необходимо преобразовать в формат Office Math ML, чтобы иметь возможность их редактировать.</p>
<p>Чтобы преобразовать уравнение, дважды щелкните по нему. Откроется окно с предупреждением:</p>
<p><img alt="Преобразование уравнений" src="../images/convertequation.png" /></p>
<p>Чтобы преобразовать только выбранное уравнение, нажмите кнопку <b>Да</b> в окне предупреждения. Чтобы преобразовать все уравнения в документе, поставьте галочку <b>Применить ко всем уравнениям</b> и нажмите кнопку <b>Да</b>.</p>
<p>После преобразования уравнения вы сможете его редактировать.</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB