Merge pull request #1864 from ONLYOFFICE/feature/equation-settings
Feature/equation settings
This commit is contained in:
commit
bb5d6cf388
|
@ -422,6 +422,8 @@ define([
|
||||||
view.menuTableTOC.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
view.menuTableTOC.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
||||||
view.menuParaTOCRefresh.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
view.menuParaTOCRefresh.menu.on('item:click', _.bind(me.onTOCMenu, me));
|
||||||
view.menuParaTOCSettings.on('click', _.bind(me.onParaTOCSettings, me));
|
view.menuParaTOCSettings.on('click', _.bind(me.onParaTOCSettings, me));
|
||||||
|
view.menuTableEquation.menu.on('item:click', _.bind(me.convertEquation, me));
|
||||||
|
view.menuParagraphEquation.menu.on('item:click', _.bind(me.convertEquation, me));
|
||||||
},
|
},
|
||||||
|
|
||||||
getView: function (name) {
|
getView: function (name) {
|
||||||
|
@ -2294,6 +2296,17 @@ define([
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
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);
|
||||||
|
else if (item.options.type=='mode')
|
||||||
|
this.api.asc_ConvertMathDisplayMode(item.checked);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
editComplete: function() {
|
editComplete: function() {
|
||||||
this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder);
|
this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1143,6 +1143,68 @@ define([
|
||||||
caption : '--'
|
caption : '--'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.menuTableEquation = new Common.UI.MenuItem({
|
||||||
|
caption : me.advancedEquationText,
|
||||||
|
menu : new Common.UI.Menu({
|
||||||
|
cls: 'ppm-toolbar shifted-right',
|
||||||
|
menuAlign: 'tl-tr',
|
||||||
|
items : [
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.unicodeText,
|
||||||
|
iconCls : 'menu__icon unicode',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : 'popupparaeqinput',
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.Unicode
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.latexText,
|
||||||
|
iconCls : 'menu__icon latex',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : 'popupparaeqinput',
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.LaTeX
|
||||||
|
}),
|
||||||
|
{ caption : '--' },
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.currProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.currLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: true}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.allProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.allLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: true}
|
||||||
|
}),
|
||||||
|
{ caption : '--' },
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.eqToInlineText,
|
||||||
|
checkable : true,
|
||||||
|
checked : false,
|
||||||
|
type : 'mode'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
me.menuTableSelectText = new Common.UI.MenuItem({
|
me.menuTableSelectText = new Common.UI.MenuItem({
|
||||||
caption : me.selectText,
|
caption : me.selectText,
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
|
@ -1388,6 +1450,15 @@ define([
|
||||||
me.clearEquationMenu(false, 10);
|
me.clearEquationMenu(false, 10);
|
||||||
menuEquationSeparatorInTable.setVisible(isEquation && eqlen>0);
|
menuEquationSeparatorInTable.setVisible(isEquation && eqlen>0);
|
||||||
|
|
||||||
|
me.menuTableEquation.setVisible(isEquation);
|
||||||
|
me.menuTableEquation.setDisabled(disabled);
|
||||||
|
if (isEquation) {
|
||||||
|
var eq = me.api.asc_GetMathInputType();
|
||||||
|
me.menuTableEquation.menu.items[0].setChecked(eq===Asc.c_oAscMathInputType.Unicode);
|
||||||
|
me.menuTableEquation.menu.items[1].setChecked(eq===Asc.c_oAscMathInputType.LaTeX);
|
||||||
|
me.menuTableEquation.menu.items[8].setChecked(me.api.asc_IsInlineMath());
|
||||||
|
}
|
||||||
|
|
||||||
var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
|
var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
|
||||||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
|
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
|
||||||
var in_toc = me.api.asc_GetTableOfContentsPr(true),
|
var in_toc = me.api.asc_GetTableOfContentsPr(true),
|
||||||
|
@ -1470,7 +1541,8 @@ define([
|
||||||
me.menuTableRemoveForm,
|
me.menuTableRemoveForm,
|
||||||
menuTableControl,
|
menuTableControl,
|
||||||
me.menuTableTOC,
|
me.menuTableTOC,
|
||||||
me.menuParagraphAdvancedInTable
|
me.menuParagraphAdvancedInTable,
|
||||||
|
me.menuTableEquation
|
||||||
]
|
]
|
||||||
}).on('hide:after', function(menu, e, isFromInputControl) {
|
}).on('hide:after', function(menu, e, isFromInputControl) {
|
||||||
if (me.suppressEditComplete) {
|
if (me.suppressEditComplete) {
|
||||||
|
@ -1584,6 +1656,68 @@ define([
|
||||||
caption : me.advancedDropCapText
|
caption : me.advancedDropCapText
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.menuParagraphEquation = new Common.UI.MenuItem({
|
||||||
|
caption : me.advancedEquationText,
|
||||||
|
menu : new Common.UI.Menu({
|
||||||
|
cls: 'ppm-toolbar shifted-right',
|
||||||
|
menuAlign: 'tl-tr',
|
||||||
|
items : [
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.unicodeText,
|
||||||
|
iconCls : 'menu__icon unicode',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : 'popupparaeqinput',
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.Unicode
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.latexText,
|
||||||
|
iconCls : 'menu__icon latex',
|
||||||
|
checkable : true,
|
||||||
|
checkmark : false,
|
||||||
|
checked : false,
|
||||||
|
toggleGroup : 'popupparaeqinput',
|
||||||
|
type : 'input',
|
||||||
|
value : Asc.c_oAscMathInputType.LaTeX
|
||||||
|
}),
|
||||||
|
{ caption : '--' },
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.currProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.currLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: false, linear: true}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.allProfText,
|
||||||
|
iconCls : 'menu__icon professional-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: false}
|
||||||
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.allLinearText,
|
||||||
|
iconCls : 'menu__icon linear-equation',
|
||||||
|
type : 'view',
|
||||||
|
value : {all: true, linear: true}
|
||||||
|
}),
|
||||||
|
{ caption : '--' },
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption : me.eqToInlineText,
|
||||||
|
checkable : true,
|
||||||
|
checked : false,
|
||||||
|
type : 'mode'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
var menuCommentSeparatorPara = new Common.UI.MenuItem({
|
var menuCommentSeparatorPara = new Common.UI.MenuItem({
|
||||||
caption : '--'
|
caption : '--'
|
||||||
|
@ -1954,6 +2088,15 @@ define([
|
||||||
me.menuEquationInsertCaption.setVisible(isEquation);
|
me.menuEquationInsertCaption.setVisible(isEquation);
|
||||||
menuEquationInsertCaptionSeparator.setVisible(isEquation);
|
menuEquationInsertCaptionSeparator.setVisible(isEquation);
|
||||||
|
|
||||||
|
me.menuParagraphEquation.setVisible(isEquation);
|
||||||
|
me.menuParagraphEquation.setDisabled(disabled);
|
||||||
|
if (isEquation) {
|
||||||
|
var eq = me.api.asc_GetMathInputType();
|
||||||
|
me.menuParagraphEquation.menu.items[0].setChecked(eq===Asc.c_oAscMathInputType.Unicode);
|
||||||
|
me.menuParagraphEquation.menu.items[1].setChecked(eq===Asc.c_oAscMathInputType.LaTeX);
|
||||||
|
me.menuParagraphEquation.menu.items[8].setChecked(me.api.asc_IsInlineMath());
|
||||||
|
}
|
||||||
|
|
||||||
var frame_pr = value.paraProps.value.get_FramePr();
|
var frame_pr = value.paraProps.value.get_FramePr();
|
||||||
me.menuFrameAdvanced.setVisible(frame_pr !== undefined);
|
me.menuFrameAdvanced.setVisible(frame_pr !== undefined);
|
||||||
me.menuDropCapAdvanced.setVisible(frame_pr !== undefined);
|
me.menuDropCapAdvanced.setVisible(frame_pr !== undefined);
|
||||||
|
@ -2057,6 +2200,7 @@ define([
|
||||||
me.menuParagraphAdvanced,
|
me.menuParagraphAdvanced,
|
||||||
me.menuFrameAdvanced,
|
me.menuFrameAdvanced,
|
||||||
me.menuDropCapAdvanced,
|
me.menuDropCapAdvanced,
|
||||||
|
me.menuParagraphEquation,
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
menuCommentSeparatorPara,
|
menuCommentSeparatorPara,
|
||||||
me.menuAddCommentPara,
|
me.menuAddCommentPara,
|
||||||
|
@ -3077,7 +3221,15 @@ define([
|
||||||
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
|
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
|
||||||
textEditPoints: 'Edit Points',
|
textEditPoints: 'Edit Points',
|
||||||
textAccept: 'Accept Change',
|
textAccept: 'Accept Change',
|
||||||
textReject: 'Reject Change'
|
textReject: 'Reject Change',
|
||||||
|
advancedEquationText: 'Equation Settings',
|
||||||
|
unicodeText: 'Unicode',
|
||||||
|
latexText: 'LaTeX',
|
||||||
|
currProfText: 'Current - Professional',
|
||||||
|
currLinearText: 'Current - Linear',
|
||||||
|
allProfText: 'All - Professional',
|
||||||
|
allLinearText: 'All - Linear',
|
||||||
|
eqToInlineText: 'Change to Inline'
|
||||||
|
|
||||||
}, DE.Views.DocumentHolder || {}));
|
}, DE.Views.DocumentHolder || {}));
|
||||||
});
|
});
|
|
@ -1657,6 +1657,14 @@
|
||||||
"DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
|
"DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
|
||||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||||
|
"DE.Views.DocumentHolder.advancedEquationText": "Equation Settings",
|
||||||
|
"DE.Views.DocumentHolder.unicodeText": "Unicode",
|
||||||
|
"DE.Views.DocumentHolder.latexText": "LaTeX",
|
||||||
|
"DE.Views.DocumentHolder.currProfText": "Current - Professional",
|
||||||
|
"DE.Views.DocumentHolder.currLinearText": "Current - Linear",
|
||||||
|
"DE.Views.DocumentHolder.allProfText": "All - Professional",
|
||||||
|
"DE.Views.DocumentHolder.allLinearText": "All - Linear",
|
||||||
|
"DE.Views.DocumentHolder.eqToInlineText": "Change to Inline",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap",
|
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",
|
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",
|
||||||
|
|
Loading…
Reference in a new issue