[SSE] Add equation settings
This commit is contained in:
parent
33381b79ee
commit
98684a0c8b
|
@ -268,6 +268,7 @@ define([
|
||||||
view.menuImgMacro.on('click', _.bind(me.onImgMacro, me));
|
view.menuImgMacro.on('click', _.bind(me.onImgMacro, me));
|
||||||
view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me));
|
view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me));
|
||||||
view.pmiGetRangeList.on('click', _.bind(me.onGetLink, me));
|
view.pmiGetRangeList.on('click', _.bind(me.onGetLink, me));
|
||||||
|
view.menuParagraphEquation.menu.on('item:click', _.bind(me.convertEquation, me));
|
||||||
|
|
||||||
if (!me.permissions.isEditMailMerge && !me.permissions.isEditDiagram && !me.permissions.isEditOle) {
|
if (!me.permissions.isEditMailMerge && !me.permissions.isEditDiagram && !me.permissions.isEditOle) {
|
||||||
var oleEditor = me.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
|
var oleEditor = me.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
|
||||||
|
@ -2284,6 +2285,14 @@ define([
|
||||||
} else
|
} else
|
||||||
this.clearEquationMenu(4);
|
this.clearEquationMenu(4);
|
||||||
|
|
||||||
|
documentHolder.menuParagraphEquation.setVisible(isEquation);
|
||||||
|
documentHolder.menuParagraphEquation.setDisabled(isObjLocked);
|
||||||
|
if (isEquation) {
|
||||||
|
var eq = this.api.asc_GetMathInputType();
|
||||||
|
documentHolder.menuParagraphEquation.menu.items[0].setChecked(eq===Asc.c_oAscMathInputType.Unicode);
|
||||||
|
documentHolder.menuParagraphEquation.menu.items[1].setChecked(eq===Asc.c_oAscMathInputType.LaTeX);
|
||||||
|
}
|
||||||
|
|
||||||
if (showMenu) this.showPopupMenu(documentHolder.textInShapeMenu, {}, event);
|
if (showMenu) this.showPopupMenu(documentHolder.textInShapeMenu, {}, event);
|
||||||
|
|
||||||
documentHolder.menuParagraphBullets.setDisabled(isSmartArt || isSmartArtInternal);
|
documentHolder.menuParagraphBullets.setDisabled(isSmartArt || isSmartArtInternal);
|
||||||
|
@ -4311,8 +4320,8 @@ define([
|
||||||
var style = 'margin-right: 8px;' + (i==0 ? 'margin-left: 5px;' : '');
|
var style = 'margin-right: 8px;' + (i==0 ? 'margin-left: 5px;' : '');
|
||||||
eqStr += '<span id="id-document-holder-btn-equation-' + i + '" style="' + style +'"></span>';
|
eqStr += '<span id="id-document-holder-btn-equation-' + i + '" style="' + style +'"></span>';
|
||||||
}
|
}
|
||||||
// eqStr += '<div class="separator"></div>';
|
eqStr += '<div class="separator"></div>';
|
||||||
// eqStr += '<span id="id-document-holder-btn-equation-settings" style="margin-right: 5px; margin-left: 8px;"></span>';
|
eqStr += '<span id="id-document-holder-btn-equation-settings" style="margin-right: 5px; margin-left: 8px;"></span>';
|
||||||
eqStr += '</div>';
|
eqStr += '</div>';
|
||||||
eqContainer = $(eqStr);
|
eqContainer = $(eqStr);
|
||||||
documentHolder.cmpEl.append(eqContainer);
|
documentHolder.cmpEl.append(eqContainer);
|
||||||
|
@ -4349,7 +4358,7 @@ define([
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
cls: 'menu-shapes',
|
cls: 'menu-shapes',
|
||||||
value: i,
|
value: i,
|
||||||
// restoreHeight: equationGroup.get('groupHeight') ? parseInt(equationGroup.get('groupHeight')) : true,
|
restoreHeight: equationGroup.get('groupHeight') ? parseInt(equationGroup.get('groupHeight')) : true,
|
||||||
items: [
|
items: [
|
||||||
{ template: _.template('<div id="id-document-holder-btn-equation-menu-' + i +
|
{ template: _.template('<div id="id-document-holder-btn-equation-menu-' + i +
|
||||||
'" class="menu-shape" style="width:' + (equationGroup.get('groupWidth') + 8) + 'px; ' +
|
'" class="menu-shape" style="width:' + (equationGroup.get('groupWidth') + 8) + 'px; ' +
|
||||||
|
@ -4361,7 +4370,6 @@ define([
|
||||||
me.equationBtns.push(btn);
|
me.equationBtns.push(btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
me.equationSettingsBtn = new Common.UI.Button({
|
me.equationSettingsBtn = new Common.UI.Button({
|
||||||
parentEl: $('#id-document-holder-btn-equation-settings', documentHolder.cmpEl),
|
parentEl: $('#id-document-holder-btn-equation-settings', documentHolder.cmpEl),
|
||||||
cls : 'btn-toolbar no-caret',
|
cls : 'btn-toolbar no-caret',
|
||||||
|
@ -4374,13 +4382,11 @@ define([
|
||||||
var menu = me.equationSettingsBtn.menu;
|
var menu = me.equationSettingsBtn.menu;
|
||||||
menu.items[0].setChecked(eq===Asc.c_oAscMathInputType.Unicode);
|
menu.items[0].setChecked(eq===Asc.c_oAscMathInputType.Unicode);
|
||||||
menu.items[1].setChecked(eq===Asc.c_oAscMathInputType.LaTeX);
|
menu.items[1].setChecked(eq===Asc.c_oAscMathInputType.LaTeX);
|
||||||
menu.items[8].setChecked(me.api.asc_IsInlineMath());
|
|
||||||
};
|
};
|
||||||
me.equationSettingsBtn.menu.on('item:click', _.bind(me.convertEquation, me));
|
me.equationSettingsBtn.menu.on('item:click', _.bind(me.convertEquation, me));
|
||||||
me.equationSettingsBtn.menu.on('show:before', function(menu) {
|
me.equationSettingsBtn.menu.on('show:before', function(menu) {
|
||||||
menu.options.initMenu();
|
menu.options.initMenu();
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!me.tooltips.coauth.XY)
|
if (!me.tooltips.coauth.XY)
|
||||||
|
@ -4389,17 +4395,17 @@ define([
|
||||||
var showPoint = [(me.tooltips.coauth.apiWidth - eqContainer.outerWidth())/2, 0];
|
var showPoint = [(me.tooltips.coauth.apiWidth - eqContainer.outerWidth())/2, 0];
|
||||||
eqContainer.css({left: showPoint[0], top : showPoint[1]});
|
eqContainer.css({left: showPoint[0], top : showPoint[1]});
|
||||||
if (eqContainer.is(':visible')) {
|
if (eqContainer.is(':visible')) {
|
||||||
// if (me.equationSettingsBtn.menu.isVisible()) {
|
if (me.equationSettingsBtn.menu.isVisible()) {
|
||||||
// me.equationSettingsBtn.menu.options.initMenu();
|
me.equationSettingsBtn.menu.options.initMenu();
|
||||||
// me.equationSettingsBtn.menu.alignPosition();
|
me.equationSettingsBtn.menu.alignPosition();
|
||||||
// }
|
}
|
||||||
} else {
|
} else {
|
||||||
eqContainer.show();
|
eqContainer.show();
|
||||||
}
|
}
|
||||||
me.equationBtns.forEach(function(item){
|
me.equationBtns.forEach(function(item){
|
||||||
item && item.setDisabled(!!disabled);
|
item && item.setDisabled(!!disabled);
|
||||||
});
|
});
|
||||||
// me.equationSettingsBtn.setDisabled(!!disabled);
|
me.equationSettingsBtn.setDisabled(!!disabled);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEquationPanelHide: function() {
|
onEquationPanelHide: function() {
|
||||||
|
@ -4409,6 +4415,15 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
convertEquation: function(menu, item, e) {
|
||||||
|
if (this.api) {
|
||||||
|
if (item.options.type=='input')
|
||||||
|
this.api.asc_SetMathInputType(item.value);
|
||||||
|
else if (item.options.type=='view')
|
||||||
|
this.api.asc_ConvertMathView(item.value.linear, item.value.all);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getUserName: function(id){
|
getUserName: function(id){
|
||||||
var usersStore = SSE.getCollection('Common.Collections.Users');
|
var usersStore = SSE.getCollection('Common.Collections.Users');
|
||||||
if (usersStore){
|
if (usersStore){
|
||||||
|
|
|
@ -1074,6 +1074,11 @@ define([
|
||||||
value : 'paste'
|
value : 'paste'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.menuParagraphEquation = new Common.UI.MenuItem({
|
||||||
|
caption : me.advancedEquationText,
|
||||||
|
menu : me.createEquationMenu('popupparaeqinput', 'tl-tr')
|
||||||
|
});
|
||||||
|
|
||||||
this.textInShapeMenu = new Common.UI.Menu({
|
this.textInShapeMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
items: [
|
items: [
|
||||||
|
@ -1087,7 +1092,8 @@ define([
|
||||||
me.menuAddHyperlinkShape,
|
me.menuAddHyperlinkShape,
|
||||||
me.menuHyperlinkShape,
|
me.menuHyperlinkShape,
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
me.pmiTextAdvanced
|
me.pmiTextAdvanced,
|
||||||
|
me.menuParagraphEquation
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1167,6 +1173,60 @@ define([
|
||||||
item.setCaption(add ? this.txtAddComment : (editable ? this.txtEditComment : this.txtShowComment), true);
|
item.setCaption(add ? this.txtAddComment : (editable ? this.txtEditComment : this.txtShowComment), true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createEquationMenu: function(toggleGroup, menuAlign) {
|
||||||
|
return new Common.UI.Menu({
|
||||||
|
cls: 'ppm-toolbar shifted-right',
|
||||||
|
menuAlign: menuAlign,
|
||||||
|
items : [
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.unicodeText,
|
||||||
|
iconCls : 'menu__icon unicode',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : toggleGroup,
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.Unicode
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.latexText,
|
||||||
|
iconCls : 'menu__icon latex',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : toggleGroup,
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.LaTeX
|
||||||
|
}),
|
||||||
|
{ caption : '--' },
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.currProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.currLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: true}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.allProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : this.allLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: true}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
txtSort: 'Sort',
|
txtSort: 'Sort',
|
||||||
txtAscending: 'Ascending',
|
txtAscending: 'Ascending',
|
||||||
txtDescending: 'Descending',
|
txtDescending: 'Descending',
|
||||||
|
@ -1325,7 +1385,14 @@ define([
|
||||||
chartDataText: 'Select Chart Data',
|
chartDataText: 'Select Chart Data',
|
||||||
chartTypeText: 'Change Chart Type',
|
chartTypeText: 'Change Chart Type',
|
||||||
txtGetLink: 'Get link to this range',
|
txtGetLink: 'Get link to this range',
|
||||||
txtRefresh: 'Refresh'
|
txtRefresh: 'Refresh',
|
||||||
|
advancedEquationText: 'Equation Settings',
|
||||||
|
unicodeText: 'Unicode',
|
||||||
|
latexText: 'LaTeX',
|
||||||
|
currProfText: 'Current - Professional',
|
||||||
|
currLinearText: 'Current - Linear',
|
||||||
|
allProfText: 'All - Professional',
|
||||||
|
allLinearText: 'All - Linear'
|
||||||
|
|
||||||
}, SSE.Views.DocumentHolder || {}));
|
}, SSE.Views.DocumentHolder || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue