[SSE] Add new methods in sdk
This commit is contained in:
parent
b0a526c263
commit
5c1774efcf
|
@ -344,7 +344,7 @@ define([
|
|||
onApiChangeFontInternal: function(font) {
|
||||
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) {
|
||||
var record = this.store.findWhere({
|
||||
|
|
|
@ -1743,7 +1743,7 @@ define([
|
|||
ismultiselect = cellinfo.asc_getMultiselect();
|
||||
documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
|
||||
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.setCaption((isrowmenu) ? this.textInsertTop : this.textInsertLeft);
|
||||
|
|
|
@ -1964,36 +1964,36 @@ define([
|
|||
val;
|
||||
|
||||
/* read font name */
|
||||
var fontparam = fontobj.asc_getName();
|
||||
var fontparam = fontobj.asc_getFontName();
|
||||
if (fontparam != toolbar.cmbFontName.getValue()) {
|
||||
Common.NotificationCenter.trigger('fonts:change', fontobj);
|
||||
}
|
||||
|
||||
/* read font params */
|
||||
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
|
||||
val = fontobj.asc_getBold();
|
||||
val = fontobj.asc_getFontBold();
|
||||
if (this._state.bold !== val) {
|
||||
toolbar.btnBold.toggle(val === true, true);
|
||||
this._state.bold = val;
|
||||
}
|
||||
val = fontobj.asc_getItalic();
|
||||
val = fontobj.asc_getFontItalic();
|
||||
if (this._state.italic !== val) {
|
||||
toolbar.btnItalic.toggle(val === true, true);
|
||||
this._state.italic = val;
|
||||
}
|
||||
val = fontobj.asc_getUnderline();
|
||||
val = fontobj.asc_getFontUnderline();
|
||||
if (this._state.underline !== val) {
|
||||
toolbar.btnUnderline.toggle(val === true, true);
|
||||
this._state.underline = val;
|
||||
}
|
||||
val = fontobj.asc_getStrikeout();
|
||||
val = fontobj.asc_getFontStrikeout();
|
||||
if (this._state.strikeout !== val) {
|
||||
toolbar.btnStrikeout.toggle(val === true, true);
|
||||
this._state.strikeout = val;
|
||||
}
|
||||
|
||||
var subsc = fontobj.asc_getSubscript(),
|
||||
supersc = fontobj.asc_getSuperscript();
|
||||
var subsc = fontobj.asc_getFontSubscript(),
|
||||
supersc = fontobj.asc_getFontSuperscript();
|
||||
|
||||
if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
|
||||
var index = (supersc) ? 0 : (subsc ? 1 : -1),
|
||||
|
@ -2017,7 +2017,7 @@ define([
|
|||
}
|
||||
|
||||
/* read font size */
|
||||
var str_size = fontobj.asc_getSize();
|
||||
var str_size = fontobj.asc_getFontSize();
|
||||
if (this._state.fontsize !== str_size) {
|
||||
toolbar.cmbFontSize.setValue((str_size!==undefined) ? str_size : '');
|
||||
this._state.fontsize = str_size;
|
||||
|
@ -2029,7 +2029,7 @@ define([
|
|||
fontColorPicker = this.toolbar.mnuTextColorPicker;
|
||||
|
||||
if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) {
|
||||
color = fontobj.asc_getColor();
|
||||
color = fontobj.asc_getFontColor();
|
||||
if (color) {
|
||||
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() };
|
||||
|
@ -2075,17 +2075,17 @@ define([
|
|||
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
|
||||
me = this,
|
||||
toolbar = this.toolbar,
|
||||
fontobj = info.asc_getFont(),
|
||||
fontobj = info.asc_getXfs(),
|
||||
val, need_disable = false;
|
||||
|
||||
/* read font name */
|
||||
var fontparam = fontobj.asc_getName();
|
||||
var fontparam = fontobj.asc_getFontName();
|
||||
if (fontparam != toolbar.cmbFontName.getValue()) {
|
||||
Common.NotificationCenter.trigger('fonts:change', fontobj);
|
||||
}
|
||||
|
||||
/* read font size */
|
||||
var str_size = fontobj.asc_getSize();
|
||||
var str_size = fontobj.asc_getFontSize();
|
||||
if (this._state.fontsize !== str_size) {
|
||||
toolbar.cmbFontSize.setValue((str_size !== undefined) ? str_size : '');
|
||||
this._state.fontsize = str_size;
|
||||
|
@ -2124,29 +2124,29 @@ define([
|
|||
|
||||
/* read font params */
|
||||
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
|
||||
val = fontobj.asc_getBold();
|
||||
val = fontobj.asc_getFontBold();
|
||||
if (this._state.bold !== val) {
|
||||
toolbar.btnBold.toggle(val === true, true);
|
||||
this._state.bold = val;
|
||||
}
|
||||
val = fontobj.asc_getItalic();
|
||||
val = fontobj.asc_getFontItalic();
|
||||
if (this._state.italic !== val) {
|
||||
toolbar.btnItalic.toggle(val === true, true);
|
||||
this._state.italic = val;
|
||||
}
|
||||
val = fontobj.asc_getUnderline();
|
||||
val = fontobj.asc_getFontUnderline();
|
||||
if (this._state.underline !== val) {
|
||||
toolbar.btnUnderline.toggle(val === true, true);
|
||||
this._state.underline = val;
|
||||
}
|
||||
val = fontobj.asc_getStrikeout();
|
||||
val = fontobj.asc_getFontStrikeout();
|
||||
if (this._state.strikeout !== val) {
|
||||
toolbar.btnStrikeout.toggle(val === true, true);
|
||||
this._state.strikeout = val;
|
||||
}
|
||||
|
||||
var subsc = fontobj.asc_getSubscript(),
|
||||
supersc = fontobj.asc_getSuperscript();
|
||||
var subsc = fontobj.asc_getFontSubscript(),
|
||||
supersc = fontobj.asc_getFontSuperscript();
|
||||
|
||||
if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
|
||||
var index = (supersc) ? 0 : (subsc ? 1 : -1),
|
||||
|
@ -2176,7 +2176,7 @@ define([
|
|||
paragraphColorPicker = this.toolbar.mnuBackColorPicker;
|
||||
|
||||
if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) {
|
||||
color = fontobj.asc_getColor();
|
||||
color = fontobj.asc_getFontColor();
|
||||
if (color) {
|
||||
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() };
|
||||
|
@ -3025,7 +3025,7 @@ define([
|
|||
|
||||
_getApiTextSize: function() {
|
||||
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) {
|
||||
|
|
|
@ -955,38 +955,38 @@ define([
|
|||
val;
|
||||
|
||||
/* read font name */
|
||||
var fontparam = fontobj.asc_getName();
|
||||
var fontparam = fontobj.asc_getFontName();
|
||||
if (fontparam != this.cmbFonts[idx].getValue()) {
|
||||
Common.NotificationCenter.trigger('fonts:change', fontobj);
|
||||
}
|
||||
|
||||
/* read font params */
|
||||
val = fontobj.asc_getBold();
|
||||
val = fontobj.asc_getFontBold();
|
||||
if (this.btnBold[idx].isActive() !== val)
|
||||
this.btnBold[idx].toggle(val === true, true);
|
||||
|
||||
val = fontobj.asc_getItalic();
|
||||
val = fontobj.asc_getFontItalic();
|
||||
if (this.btnItalic[idx].isActive() !== val)
|
||||
this.btnItalic[idx].toggle(val === true, true);
|
||||
|
||||
val = fontobj.asc_getUnderline();
|
||||
val = fontobj.asc_getFontUnderline();
|
||||
if (this.btnUnderline[idx].isActive() !== val)
|
||||
this.btnUnderline[idx].toggle(val === true, true);
|
||||
|
||||
val = fontobj.asc_getStrikeout();
|
||||
val = fontobj.asc_getFontStrikeout();
|
||||
if (this.btnStrikeout[idx].isActive() !== val)
|
||||
this.btnStrikeout[idx].toggle(val === true, true);
|
||||
|
||||
val = fontobj.asc_getSubscript();
|
||||
val = fontobj.asc_getFontSubscript();
|
||||
if (this.btnSubscript[idx].isActive() !== val)
|
||||
this.btnSubscript[idx].toggle(val === true, true);
|
||||
|
||||
val = fontobj.asc_getSuperscript();
|
||||
val = fontobj.asc_getFontSuperscript();
|
||||
if (this.btnSuperscript[idx].isActive() !== val)
|
||||
this.btnSuperscript[idx].toggle(val === true, true);
|
||||
|
||||
/* read font size */
|
||||
var str_size = fontobj.asc_getSize();
|
||||
var str_size = fontobj.asc_getFontSize();
|
||||
if (this.cmbFontSize[idx].getValue() !== str_size)
|
||||
this.cmbFontSize[idx].setValue((str_size!==undefined) ? str_size : '');
|
||||
|
||||
|
@ -994,7 +994,7 @@ define([
|
|||
var clr,
|
||||
color,
|
||||
fontColorPicker = this.mnuTextColorPicker[idx];
|
||||
color = fontobj.asc_getColor();
|
||||
color = fontobj.asc_getFontColor();
|
||||
if (color) {
|
||||
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() };
|
||||
|
|
|
@ -278,20 +278,20 @@ define([
|
|||
var me = this;
|
||||
|
||||
// Init font name
|
||||
var fontName = fontObj.asc_getName() || this.textFonts;
|
||||
var fontName = fontObj.asc_getFontName() || this.textFonts;
|
||||
this._fontInfo.name = fontName;
|
||||
|
||||
$('#font-fonts .item-title').html(fontName);
|
||||
|
||||
|
||||
// Init font style
|
||||
$('#font-bold').toggleClass('active', fontObj.asc_getBold() === true);
|
||||
$('#font-italic').toggleClass('active', fontObj.asc_getItalic() === true);
|
||||
$('#font-underline').toggleClass('active', fontObj.asc_getUnderline() === true);
|
||||
$('#font-bold').toggleClass('active', fontObj.asc_getFontBold() === true);
|
||||
$('#font-italic').toggleClass('active', fontObj.asc_getFontItalic() === true);
|
||||
$('#font-underline').toggleClass('active', fontObj.asc_getFontUnderline() === true);
|
||||
|
||||
|
||||
// Init font size
|
||||
this._fontInfo.size = fontObj.asc_getSize();
|
||||
this._fontInfo.size = fontObj.asc_getFontSize();
|
||||
var displaySize = this._fontInfo.size;
|
||||
|
||||
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
|
||||
|
@ -301,7 +301,7 @@ define([
|
|||
|
||||
|
||||
// Init font color
|
||||
this._fontInfo.color = fontObj.asc_getColor();
|
||||
this._fontInfo.color = fontObj.asc_getFontColor();
|
||||
|
||||
var color = this._fontInfo.color,
|
||||
clr = me._sdkToThemeColor(color);
|
||||
|
@ -319,7 +319,7 @@ define([
|
|||
selectionType = cellInfo.asc_getSelectionType(),
|
||||
// coAuthDisable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (cellInfo.asc_getLocked()===true || cellInfo.asc_getLockedTable()===true) : false,
|
||||
// editOptionsDisabled = this._disableEditOptions(selectionType, coAuthDisable),
|
||||
_fontInfo = cellInfo.asc_getFont(),
|
||||
_fontInfo = cellInfo.asc_getXfs(),
|
||||
val,
|
||||
need_disable = false;
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ define([
|
|||
// ismultiselect = cellInfo.asc_getMultiselect();
|
||||
// documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
|
||||
// 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.setCaption((isRow) ? this.textInsertTop : this.textInsertLeft);
|
||||
|
|
|
@ -129,12 +129,12 @@ define([
|
|||
|
||||
|
||||
// Init font name
|
||||
var fontName = _fontInfo.asc_getName() || this.textFonts;
|
||||
var fontName = _fontInfo.asc_getFontName() || this.textFonts;
|
||||
$('#font-fonts .item-title').html(fontName);
|
||||
|
||||
|
||||
// Init font size
|
||||
var displaySize = _fontInfo.asc_getSize();
|
||||
var displaySize = _fontInfo.asc_getFontSize();
|
||||
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
|
||||
|
||||
$('#font-fonts .item-after span:first-child').html(displaySize);
|
||||
|
@ -142,13 +142,13 @@ define([
|
|||
|
||||
|
||||
// Init font style
|
||||
$('#font-bold').toggleClass('active', _fontInfo.asc_getBold() === true);
|
||||
$('#font-italic').toggleClass('active', _fontInfo.asc_getItalic() === true);
|
||||
$('#font-underline').toggleClass('active', _fontInfo.asc_getUnderline() === true);
|
||||
$('#font-bold').toggleClass('active', _fontInfo.asc_getFontBold() === true);
|
||||
$('#font-italic').toggleClass('active', _fontInfo.asc_getFontItalic() === true);
|
||||
$('#font-underline').toggleClass('active', _fontInfo.asc_getFontUnderline() === true);
|
||||
|
||||
|
||||
// Init font color
|
||||
var color = _fontInfo.asc_getColor(),
|
||||
var color = _fontInfo.asc_getFontColor(),
|
||||
clr = me._sdkToThemeColor(color);
|
||||
|
||||
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
|
||||
|
@ -322,7 +322,7 @@ define([
|
|||
}
|
||||
|
||||
_cellInfo = info;
|
||||
_fontInfo = info.asc_getFont();
|
||||
_fontInfo = info.asc_getXfs();
|
||||
|
||||
var selectType = info.asc_getSelectionType();
|
||||
|
||||
|
|
Loading…
Reference in a new issue