[SSE] Add new methods in sdk

This commit is contained in:
Julia Radzhabova 2020-05-15 11:32:21 +03:00
parent b0a526c263
commit 5c1774efcf
7 changed files with 46 additions and 46 deletions

View file

@ -344,7 +344,7 @@ define([
onApiChangeFontInternal: function(font) { onApiChangeFontInternal: function(font) {
if (this.inFormControl) return; if (this.inFormControl) return;
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName()); var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
if (this.getRawValue() !== name) { if (this.getRawValue() !== name) {
var record = this.store.findWhere({ var record = this.store.findWhere({

View file

@ -1743,7 +1743,7 @@ define([
ismultiselect = cellinfo.asc_getMultiselect(); ismultiselect = cellinfo.asc_getMultiselect();
documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
documentHolder.ssMenu.cellColor = cellinfo.asc_getFillColor(); documentHolder.ssMenu.cellColor = cellinfo.asc_getFillColor();
documentHolder.ssMenu.fontColor = cellinfo.asc_getFont().asc_getColor(); documentHolder.ssMenu.fontColor = cellinfo.asc_getXfs().asc_getFontColor();
documentHolder.pmiInsertEntire.setVisible(isrowmenu||iscolmenu); documentHolder.pmiInsertEntire.setVisible(isrowmenu||iscolmenu);
documentHolder.pmiInsertEntire.setCaption((isrowmenu) ? this.textInsertTop : this.textInsertLeft); documentHolder.pmiInsertEntire.setCaption((isrowmenu) ? this.textInsertTop : this.textInsertLeft);

View file

@ -1964,36 +1964,36 @@ define([
val; val;
/* read font name */ /* read font name */
var fontparam = fontobj.asc_getName(); var fontparam = fontobj.asc_getFontName();
if (fontparam != toolbar.cmbFontName.getValue()) { if (fontparam != toolbar.cmbFontName.getValue()) {
Common.NotificationCenter.trigger('fonts:change', fontobj); Common.NotificationCenter.trigger('fonts:change', fontobj);
} }
/* read font params */ /* read font params */
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) { if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
val = fontobj.asc_getBold(); val = fontobj.asc_getFontBold();
if (this._state.bold !== val) { if (this._state.bold !== val) {
toolbar.btnBold.toggle(val === true, true); toolbar.btnBold.toggle(val === true, true);
this._state.bold = val; this._state.bold = val;
} }
val = fontobj.asc_getItalic(); val = fontobj.asc_getFontItalic();
if (this._state.italic !== val) { if (this._state.italic !== val) {
toolbar.btnItalic.toggle(val === true, true); toolbar.btnItalic.toggle(val === true, true);
this._state.italic = val; this._state.italic = val;
} }
val = fontobj.asc_getUnderline(); val = fontobj.asc_getFontUnderline();
if (this._state.underline !== val) { if (this._state.underline !== val) {
toolbar.btnUnderline.toggle(val === true, true); toolbar.btnUnderline.toggle(val === true, true);
this._state.underline = val; this._state.underline = val;
} }
val = fontobj.asc_getStrikeout(); val = fontobj.asc_getFontStrikeout();
if (this._state.strikeout !== val) { if (this._state.strikeout !== val) {
toolbar.btnStrikeout.toggle(val === true, true); toolbar.btnStrikeout.toggle(val === true, true);
this._state.strikeout = val; this._state.strikeout = val;
} }
var subsc = fontobj.asc_getSubscript(), var subsc = fontobj.asc_getFontSubscript(),
supersc = fontobj.asc_getSuperscript(); supersc = fontobj.asc_getFontSuperscript();
if (this._state.subscript !== subsc || this._state.superscript !== supersc) { if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
var index = (supersc) ? 0 : (subsc ? 1 : -1), var index = (supersc) ? 0 : (subsc ? 1 : -1),
@ -2017,7 +2017,7 @@ define([
} }
/* read font size */ /* read font size */
var str_size = fontobj.asc_getSize(); var str_size = fontobj.asc_getFontSize();
if (this._state.fontsize !== str_size) { if (this._state.fontsize !== str_size) {
toolbar.cmbFontSize.setValue((str_size!==undefined) ? str_size : ''); toolbar.cmbFontSize.setValue((str_size!==undefined) ? str_size : '');
this._state.fontsize = str_size; this._state.fontsize = str_size;
@ -2029,7 +2029,7 @@ define([
fontColorPicker = this.toolbar.mnuTextColorPicker; fontColorPicker = this.toolbar.mnuTextColorPicker;
if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) { if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) {
color = fontobj.asc_getColor(); color = fontobj.asc_getFontColor();
if (color) { if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() }; clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() };
@ -2075,17 +2075,17 @@ define([
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable), editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
me = this, me = this,
toolbar = this.toolbar, toolbar = this.toolbar,
fontobj = info.asc_getFont(), fontobj = info.asc_getXfs(),
val, need_disable = false; val, need_disable = false;
/* read font name */ /* read font name */
var fontparam = fontobj.asc_getName(); var fontparam = fontobj.asc_getFontName();
if (fontparam != toolbar.cmbFontName.getValue()) { if (fontparam != toolbar.cmbFontName.getValue()) {
Common.NotificationCenter.trigger('fonts:change', fontobj); Common.NotificationCenter.trigger('fonts:change', fontobj);
} }
/* read font size */ /* read font size */
var str_size = fontobj.asc_getSize(); var str_size = fontobj.asc_getFontSize();
if (this._state.fontsize !== str_size) { if (this._state.fontsize !== str_size) {
toolbar.cmbFontSize.setValue((str_size !== undefined) ? str_size : ''); toolbar.cmbFontSize.setValue((str_size !== undefined) ? str_size : '');
this._state.fontsize = str_size; this._state.fontsize = str_size;
@ -2124,29 +2124,29 @@ define([
/* read font params */ /* read font params */
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) { if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
val = fontobj.asc_getBold(); val = fontobj.asc_getFontBold();
if (this._state.bold !== val) { if (this._state.bold !== val) {
toolbar.btnBold.toggle(val === true, true); toolbar.btnBold.toggle(val === true, true);
this._state.bold = val; this._state.bold = val;
} }
val = fontobj.asc_getItalic(); val = fontobj.asc_getFontItalic();
if (this._state.italic !== val) { if (this._state.italic !== val) {
toolbar.btnItalic.toggle(val === true, true); toolbar.btnItalic.toggle(val === true, true);
this._state.italic = val; this._state.italic = val;
} }
val = fontobj.asc_getUnderline(); val = fontobj.asc_getFontUnderline();
if (this._state.underline !== val) { if (this._state.underline !== val) {
toolbar.btnUnderline.toggle(val === true, true); toolbar.btnUnderline.toggle(val === true, true);
this._state.underline = val; this._state.underline = val;
} }
val = fontobj.asc_getStrikeout(); val = fontobj.asc_getFontStrikeout();
if (this._state.strikeout !== val) { if (this._state.strikeout !== val) {
toolbar.btnStrikeout.toggle(val === true, true); toolbar.btnStrikeout.toggle(val === true, true);
this._state.strikeout = val; this._state.strikeout = val;
} }
var subsc = fontobj.asc_getSubscript(), var subsc = fontobj.asc_getFontSubscript(),
supersc = fontobj.asc_getSuperscript(); supersc = fontobj.asc_getFontSuperscript();
if (this._state.subscript !== subsc || this._state.superscript !== supersc) { if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
var index = (supersc) ? 0 : (subsc ? 1 : -1), var index = (supersc) ? 0 : (subsc ? 1 : -1),
@ -2176,7 +2176,7 @@ define([
paragraphColorPicker = this.toolbar.mnuBackColorPicker; paragraphColorPicker = this.toolbar.mnuBackColorPicker;
if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) { if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) {
color = fontobj.asc_getColor(); color = fontobj.asc_getFontColor();
if (color) { if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() }; clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() };
@ -3025,7 +3025,7 @@ define([
_getApiTextSize: function() { _getApiTextSize: function() {
var cellInfo = this.api.asc_getCellInfo(); var cellInfo = this.api.asc_getCellInfo();
return cellInfo ? cellInfo.asc_getFont().asc_getSize() : 12; return cellInfo ? cellInfo.asc_getXfs().asc_getFontSize() : 12;
}, },
_setTableFormat: function(fmtname) { _setTableFormat: function(fmtname) {

View file

@ -955,38 +955,38 @@ define([
val; val;
/* read font name */ /* read font name */
var fontparam = fontobj.asc_getName(); var fontparam = fontobj.asc_getFontName();
if (fontparam != this.cmbFonts[idx].getValue()) { if (fontparam != this.cmbFonts[idx].getValue()) {
Common.NotificationCenter.trigger('fonts:change', fontobj); Common.NotificationCenter.trigger('fonts:change', fontobj);
} }
/* read font params */ /* read font params */
val = fontobj.asc_getBold(); val = fontobj.asc_getFontBold();
if (this.btnBold[idx].isActive() !== val) if (this.btnBold[idx].isActive() !== val)
this.btnBold[idx].toggle(val === true, true); this.btnBold[idx].toggle(val === true, true);
val = fontobj.asc_getItalic(); val = fontobj.asc_getFontItalic();
if (this.btnItalic[idx].isActive() !== val) if (this.btnItalic[idx].isActive() !== val)
this.btnItalic[idx].toggle(val === true, true); this.btnItalic[idx].toggle(val === true, true);
val = fontobj.asc_getUnderline(); val = fontobj.asc_getFontUnderline();
if (this.btnUnderline[idx].isActive() !== val) if (this.btnUnderline[idx].isActive() !== val)
this.btnUnderline[idx].toggle(val === true, true); this.btnUnderline[idx].toggle(val === true, true);
val = fontobj.asc_getStrikeout(); val = fontobj.asc_getFontStrikeout();
if (this.btnStrikeout[idx].isActive() !== val) if (this.btnStrikeout[idx].isActive() !== val)
this.btnStrikeout[idx].toggle(val === true, true); this.btnStrikeout[idx].toggle(val === true, true);
val = fontobj.asc_getSubscript(); val = fontobj.asc_getFontSubscript();
if (this.btnSubscript[idx].isActive() !== val) if (this.btnSubscript[idx].isActive() !== val)
this.btnSubscript[idx].toggle(val === true, true); this.btnSubscript[idx].toggle(val === true, true);
val = fontobj.asc_getSuperscript(); val = fontobj.asc_getFontSuperscript();
if (this.btnSuperscript[idx].isActive() !== val) if (this.btnSuperscript[idx].isActive() !== val)
this.btnSuperscript[idx].toggle(val === true, true); this.btnSuperscript[idx].toggle(val === true, true);
/* read font size */ /* read font size */
var str_size = fontobj.asc_getSize(); var str_size = fontobj.asc_getFontSize();
if (this.cmbFontSize[idx].getValue() !== str_size) if (this.cmbFontSize[idx].getValue() !== str_size)
this.cmbFontSize[idx].setValue((str_size!==undefined) ? str_size : ''); this.cmbFontSize[idx].setValue((str_size!==undefined) ? str_size : '');
@ -994,7 +994,7 @@ define([
var clr, var clr,
color, color,
fontColorPicker = this.mnuTextColorPicker[idx]; fontColorPicker = this.mnuTextColorPicker[idx];
color = fontobj.asc_getColor(); color = fontobj.asc_getFontColor();
if (color) { if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() }; clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() };

View file

@ -278,20 +278,20 @@ define([
var me = this; var me = this;
// Init font name // Init font name
var fontName = fontObj.asc_getName() || this.textFonts; var fontName = fontObj.asc_getFontName() || this.textFonts;
this._fontInfo.name = fontName; this._fontInfo.name = fontName;
$('#font-fonts .item-title').html(fontName); $('#font-fonts .item-title').html(fontName);
// Init font style // Init font style
$('#font-bold').toggleClass('active', fontObj.asc_getBold() === true); $('#font-bold').toggleClass('active', fontObj.asc_getFontBold() === true);
$('#font-italic').toggleClass('active', fontObj.asc_getItalic() === true); $('#font-italic').toggleClass('active', fontObj.asc_getFontItalic() === true);
$('#font-underline').toggleClass('active', fontObj.asc_getUnderline() === true); $('#font-underline').toggleClass('active', fontObj.asc_getFontUnderline() === true);
// Init font size // Init font size
this._fontInfo.size = fontObj.asc_getSize(); this._fontInfo.size = fontObj.asc_getFontSize();
var displaySize = this._fontInfo.size; var displaySize = this._fontInfo.size;
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt; _.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
@ -301,7 +301,7 @@ define([
// Init font color // Init font color
this._fontInfo.color = fontObj.asc_getColor(); this._fontInfo.color = fontObj.asc_getFontColor();
var color = this._fontInfo.color, var color = this._fontInfo.color,
clr = me._sdkToThemeColor(color); clr = me._sdkToThemeColor(color);
@ -319,7 +319,7 @@ define([
selectionType = cellInfo.asc_getSelectionType(), selectionType = cellInfo.asc_getSelectionType(),
// coAuthDisable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (cellInfo.asc_getLocked()===true || cellInfo.asc_getLockedTable()===true) : false, // coAuthDisable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (cellInfo.asc_getLocked()===true || cellInfo.asc_getLockedTable()===true) : false,
// editOptionsDisabled = this._disableEditOptions(selectionType, coAuthDisable), // editOptionsDisabled = this._disableEditOptions(selectionType, coAuthDisable),
_fontInfo = cellInfo.asc_getFont(), _fontInfo = cellInfo.asc_getXfs(),
val, val,
need_disable = false; need_disable = false;

View file

@ -498,7 +498,7 @@ define([
// ismultiselect = cellInfo.asc_getMultiselect(); // ismultiselect = cellInfo.asc_getMultiselect();
// documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; // documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
// documentHolder.ssMenu.cellColor = cellInfo.asc_getFill().asc_getColor(); // documentHolder.ssMenu.cellColor = cellInfo.asc_getFill().asc_getColor();
// documentHolder.ssMenu.fontColor = cellInfo.asc_getFont().asc_getColor(); // documentHolder.ssMenu.fontColor = cellInfo.asc_getXfs().asc_getFontColor();
// //
// documentHolder.pmiInsertEntire.setVisible(isRow||isCol); // documentHolder.pmiInsertEntire.setVisible(isRow||isCol);
// documentHolder.pmiInsertEntire.setCaption((isRow) ? this.textInsertTop : this.textInsertLeft); // documentHolder.pmiInsertEntire.setCaption((isRow) ? this.textInsertTop : this.textInsertLeft);

View file

@ -129,12 +129,12 @@ define([
// Init font name // Init font name
var fontName = _fontInfo.asc_getName() || this.textFonts; var fontName = _fontInfo.asc_getFontName() || this.textFonts;
$('#font-fonts .item-title').html(fontName); $('#font-fonts .item-title').html(fontName);
// Init font size // Init font size
var displaySize = _fontInfo.asc_getSize(); var displaySize = _fontInfo.asc_getFontSize();
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt; _.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
$('#font-fonts .item-after span:first-child').html(displaySize); $('#font-fonts .item-after span:first-child').html(displaySize);
@ -142,13 +142,13 @@ define([
// Init font style // Init font style
$('#font-bold').toggleClass('active', _fontInfo.asc_getBold() === true); $('#font-bold').toggleClass('active', _fontInfo.asc_getFontBold() === true);
$('#font-italic').toggleClass('active', _fontInfo.asc_getItalic() === true); $('#font-italic').toggleClass('active', _fontInfo.asc_getFontItalic() === true);
$('#font-underline').toggleClass('active', _fontInfo.asc_getUnderline() === true); $('#font-underline').toggleClass('active', _fontInfo.asc_getFontUnderline() === true);
// Init font color // Init font color
var color = _fontInfo.asc_getColor(), var color = _fontInfo.asc_getFontColor(),
clr = me._sdkToThemeColor(color); clr = me._sdkToThemeColor(color);
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr)); $('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
@ -322,7 +322,7 @@ define([
} }
_cellInfo = info; _cellInfo = info;
_fontInfo = info.asc_getFont(); _fontInfo = info.asc_getXfs();
var selectType = info.asc_getSelectionType(); var selectType = info.asc_getSelectionType();