[SSE] Change toolbar for ole editing

This commit is contained in:
Julia Radzhabova 2022-05-31 11:34:43 +03:00
parent ea86ef5c73
commit cbb8545bf7
6 changed files with 539 additions and 83 deletions

View file

@ -2500,7 +2500,7 @@ define([
me.getApplication().getController('RightMenu').UpdateThemeColors(); me.getApplication().getController('RightMenu').UpdateThemeColors();
}, 50); }, 50);
!me.appOptions.isEditOle && setTimeout(function(){ setTimeout(function(){
me.getApplication().getController('Toolbar').updateThemeColors(); me.getApplication().getController('Toolbar').updateThemeColors();
}, 50); }, 50);

View file

@ -308,20 +308,42 @@ define([
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true)); toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false)); toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
toolbar.btnSearch.on('click', _.bind(this.onSearch, this)); toolbar.btnSearch.on('click', _.bind(this.onSearch, this));
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
toolbar.btnInsertFormula.on('click', _.bind(this.onInsertFormulaMenu, this)); toolbar.btnInsertFormula.on('click', _.bind(this.onInsertFormulaMenu, this));
toolbar.btnInsertFormula.menu.on('item:click', _.bind(this.onInsertFormulaMenu, this)); toolbar.btnInsertFormula.menu.on('item:click', _.bind(this.onInsertFormulaMenu, this));
toolbar.btnDecDecimal.on('click', _.bind(this.onDecrement, this));
toolbar.btnIncDecimal.on('click', _.bind(this.onIncrement, this));
toolbar.cmbNumberFormat.on('selected', _.bind(this.onNumberFormatSelect, this)); toolbar.cmbNumberFormat.on('selected', _.bind(this.onNumberFormatSelect, this));
toolbar.cmbNumberFormat.on('show:before', _.bind(this.onNumberFormatOpenBefore, this, true)); toolbar.cmbNumberFormat.on('show:before', _.bind(this.onNumberFormatOpenBefore, this, true));
if (toolbar.cmbNumberFormat.cmpEl) if (toolbar.cmbNumberFormat.cmpEl)
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this)); toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
toolbar.btnWrap.on('click', _.bind(this.onWrap, this));
toolbar.btnTextColor.on('click', _.bind(this.onTextColor, this));
toolbar.btnTextColor.on('color:select', _.bind(this.onTextColorSelect, this));
toolbar.btnTextColor.on('auto:select', _.bind(this.onAutoFontColor, this));
toolbar.btnBackColor.on('click', _.bind(this.onBackColor, this));
toolbar.btnBackColor.on('color:select', _.bind(this.onBackColorSelect, this));
toolbar.btnBorders.on('click', _.bind(this.onBorders, this));
if (toolbar.btnBorders.rendered) {
toolbar.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this));
toolbar.mnuBorderWidth.on('item:toggle', _.bind(this.onBordersWidth, this));
toolbar.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this));
$('#id-toolbar-menu-auto-bordercolor').on('click', _.bind(this.onAutoBorderColor, this));
}
toolbar.btnMerge.on('click', _.bind(this.onMergeCellsMenu, this, toolbar.btnMerge.menu, toolbar.btnMerge.menu.items[0]));
toolbar.btnMerge.menu.on('item:click', _.bind(this.onMergeCellsMenu, this));
toolbar.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this));
toolbar.btnVisibleArea.menu.on('item:click', _.bind(this.onVisibleAreaMenu, this)); toolbar.btnVisibleArea.menu.on('item:click', _.bind(this.onVisibleAreaMenu, this));
toolbar.btnVisibleAreaClose.on('click', _.bind(this.onVisibleAreaClose, this)); toolbar.btnVisibleAreaClose.on('click', _.bind(this.onVisibleAreaClose, this));
toolbar.cmbFontName.on('selected', _.bind(this.onFontNameSelect, this));
toolbar.cmbFontName.on('show:after', _.bind(this.onComboOpen, this, true));
toolbar.cmbFontName.on('hide:after', _.bind(this.onHideMenus, this));
toolbar.cmbFontName.on('combo:blur', _.bind(this.onComboBlur, this));
toolbar.cmbFontName.on('combo:focusin', _.bind(this.onComboOpen, this, false));
toolbar.cmbFontSize.on('selected', _.bind(this.onFontSizeSelect, this));
toolbar.cmbFontSize.on('changed:before', _.bind(this.onFontSizeChanged, this, true));
toolbar.cmbFontSize.on('changed:after', _.bind(this.onFontSizeChanged, this, false));
toolbar.cmbFontSize.on('show:after', _.bind(this.onComboOpen, this, true));
toolbar.cmbFontSize.on('hide:after', _.bind(this.onHideMenus, this));
toolbar.cmbFontSize.on('combo:blur', _.bind(this.onComboBlur, this));
toolbar.cmbFontSize.on('combo:focusin', _.bind(this.onComboOpen, this, false));
} else { } else {
toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled'));
@ -456,6 +478,8 @@ define([
this.api.asc_registerCallback('asc_onUnLockCFManager', _.bind(this.onUnLockCFManager, this)); this.api.asc_registerCallback('asc_onUnLockCFManager', _.bind(this.onUnLockCFManager, this));
this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this)); this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this));
Common.NotificationCenter.on('fonts:change', _.bind(this.onApiChangeFont, this)); Common.NotificationCenter.on('fonts:change', _.bind(this.onApiChangeFont, this));
} else if (config.isEditOle) {
Common.NotificationCenter.on('fonts:change', _.bind(this.onApiChangeFont, this));
} else if (config.isRestrictedEdit) { } else if (config.isRestrictedEdit) {
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChangedRestricted, this)); this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChangedRestricted, this));
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this)); Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
@ -1877,7 +1901,9 @@ define([
this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this)); this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this));
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this)); Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
} }
if ( this.appConfig.isEditOle ) {
this.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(this.onApiEditorSelectionChanged_OleEditor, this));
}
if ( !this.appConfig.isEditMailMerge ) { if ( !this.appConfig.isEditMailMerge ) {
this.applyFormulaSettings(); this.applyFormulaSettings();
} }
@ -3132,11 +3158,14 @@ define([
me.toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked); me.toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked);
me._state.controlsdisabled.filters = is_image || is_mode_2;
return is_image; return is_image;
}; };
var selectionType = info.asc_getSelectionType(), var selectionType = info.asc_getSelectionType(),
xfs = info.asc_getXfs(), xfs = info.asc_getXfs(),
toolbar = this.toolbar,
coauth_disable = false, coauth_disable = false,
editOptionsDisabled = _disableEditOptions(selectionType, coauth_disable), editOptionsDisabled = _disableEditOptions(selectionType, coauth_disable),
val, need_disable = false; val, need_disable = false;
@ -3145,24 +3174,195 @@ define([
if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText) if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText)
return; return;
if ( !me.toolbar.mode.isEditDiagram ) { Common.NotificationCenter.trigger('fonts:change', xfs);
var filterInfo = info.asc_getAutoFilterInfo();
val = filterInfo ? filterInfo.asc_getIsAutoFilter() : null; /* read font size */
if ( this._state.filter !== val ) { var str_size = xfs.asc_getFontSize();
me.toolbar.btnSetAutofilter.toggle(val===true, true); if (this._state.fontsize !== str_size) {
toolbar.cmbFontSize.setValue((str_size !== undefined) ? str_size : '');
this._state.fontsize = str_size;
}
/* read font color */
var clr,
color,
fontColorPicker = toolbar.mnuTextColorPicker,
paragraphColorPicker = toolbar.mnuBackColorPicker;
if (!fontColorPicker.isDummy) {
color = xfs.asc_getFontColor();
if (color) {
if (color.get_auto()) {
if (this._state.clrtext !== 'auto') {
fontColorPicker.clearSelection();
toolbar.btnTextColor.setAutoColor(true);
this._state.clrtext = 'auto';
}
} else {
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() };
} else {
clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
var type1 = typeof(clr),
type2 = typeof(this._state.clrtext);
if ( (this._state.clrtext == 'auto') || (type1 !== type2) || (type1=='object' &&
(clr.effectValue!==this._state.clrtext.effectValue || this._state.clrtext.color.indexOf(clr.color)<0)) ||
(type1!='object' && this._state.clrtext!==undefined && this._state.clrtext.indexOf(clr)<0 )) {
toolbar.btnTextColor.setAutoColor(false);
if (_.isObject(clr)) {
var isselected = false;
for (var i = 0; i < 10; i++) {
if (Common.Utils.ThemeColor.ThemeValues[i] == clr.effectValue) {
fontColorPicker.select(clr, true);
isselected = true;
break;
}
}
if (!isselected) fontColorPicker.clearSelection();
} else {
fontColorPicker.select(clr, true);
}
this._state.clrtext = clr;
}
}
}
this._state.clrtext_asccolor = color;
}
/* read cell background color */
if (!paragraphColorPicker.isDummy) {
color = xfs.asc_getFillColor();
if (color && !color.get_auto()) {
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() };
} else {
clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else {
clr = 'transparent';
}
type1 = typeof(clr);
type2 = typeof(this._state.clrback);
if ( (type1 !== type2) || (type1=='object' &&
(clr.effectValue!==this._state.clrback.effectValue || this._state.clrback.color.indexOf(clr.color)<0)) ||
(type1!='object' && this._state.clrback!==undefined && this._state.clrback.indexOf(clr)<0 )) {
if (_.isObject(clr)) {
var isselected = false;
for (i = 0; i < 10; i++) {
if (Common.Utils.ThemeColor.ThemeValues[i] == clr.effectValue) {
paragraphColorPicker.select(clr, true);
isselected = true;
break;
}
}
if (!isselected) paragraphColorPicker.clearSelection();
} else {
paragraphColorPicker.select(clr, true);
}
this._state.clrback = clr;
}
this._state.clrshd_asccolor = color;
}
var filterInfo = info.asc_getAutoFilterInfo(),
formatTableInfo = info.asc_getFormatTableInfo();
/* read cell horizontal align */
/*
var fontparam = xfs.asc_getHorAlign();
if (this._state.pralign !== fontparam) {
this._state.pralign = fontparam;
var index = -1, align;
switch (fontparam) {
case AscCommon.align_Left: index = 0; align = 'btn-align-left'; break;
case AscCommon.align_Center: index = 1; align = 'btn-align-center'; break;
case AscCommon.align_Right: index = 2; align = 'btn-align-right'; break;
case AscCommon.align_Justify: index = 3; align = 'btn-align-just'; break;
default: index = -255; align = 'btn-align-left'; break;
}
if (!(index < 0)) {
toolbar.btnAlignRight.toggle(index===2, true);
toolbar.btnAlignLeft.toggle(index===0, true);
toolbar.btnAlignCenter.toggle(index===1, true);
toolbar.btnAlignJust.toggle(index===3, true);
} else if (index == -255) {
toolbar.btnAlignRight.toggle(false, true);
toolbar.btnAlignLeft.toggle(false, true);
toolbar.btnAlignCenter.toggle(false, true);
toolbar.btnAlignJust.toggle(false, true);
}
}
// read cell vertical align
fontparam = xfs.asc_getVertAlign();
if (this._state.valign !== fontparam) {
this._state.valign = fontparam;
index = -1; align = '';
switch (fontparam) {
case Asc.c_oAscVAlign.Top: index = 0; align = 'btn-valign-top'; break;
case Asc.c_oAscVAlign.Center: index = 1; align = 'btn-valign-middle'; break;
case Asc.c_oAscVAlign.Bottom: index = 2; align = 'btn-valign-bottom'; break;
}
toolbar.btnAlignTop.toggle(index===0, true);
toolbar.btnAlignMiddle.toggle(index===1, true);
toolbar.btnAlignBottom.toggle(index===2, true);
}
*/
need_disable = this._state.controlsdisabled.filters || formatTableInfo!==null || filterInfo && filterInfo.asc_getIsAutoFilter()===null;
toolbar.lockToolbar(Common.enumLock.ruleMerge, need_disable, {array:[toolbar.btnMerge]});
val = info.asc_getMerge();
if (this._state.merge !== val) {
toolbar.btnMerge.toggle(val===Asc.c_oAscMergeOptions.Merge, true);
this._state.merge = val;
}
/* read cell text wrapping */
if (!toolbar.btnWrap.isDisabled()) {
val = xfs.asc_getWrapText();
if (this._state.wrap !== val) {
toolbar.btnWrap.toggle(val===true, true);
this._state.wrap = val;
}
}
val = (filterInfo) ? filterInfo.asc_getIsAutoFilter() : null;
this._state.filter = val; this._state.filter = val;
}
need_disable = this._state.controlsdisabled.filters || (val===null); need_disable = this._state.controlsdisabled.filters || (val===null);
me.toolbar.lockToolbar(Common.enumLock.ruleFilter, need_disable, toolbar.lockToolbar(Common.enumLock.ruleFilter, need_disable, { array: [toolbar.btnTableTemplate] });
{ array: [me.toolbar.btnSetAutofilter, me.toolbar.btnSortDown, me.toolbar.btnSortUp] });
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true); val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
me.toolbar.lockToolbar(Common.enumLock.ruleDelFilter, need_disable, {array: [me.toolbar.btnClearAutofilter]}); if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
val = this.toolbar.mnuTableTemplatePicker.store.findWhere({name: val});
if (val) {
this.toolbar.mnuTableTemplatePicker.selectRecord(val);
this._state.tablestylename = val.get('name');
} else {
toolbar.mnuTableTemplatePicker.deselectAll();
this._state.tablestylename = null;
}
} }
var val = xfs.asc_getNumFormatInfo(); this._state.tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined;
this._state.filterapplied = this._state.filter && filterInfo.asc_getIsApplyAutoFilter();
this._state.multiselect = info.asc_getMultiselect();
toolbar.lockToolbar(Common.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate]});
this._state.inpivot = !!info.asc_getPivotTableInfo();
toolbar.lockToolbar(Common.enumLock.editPivot, this._state.inpivot, { array: [toolbar.btnMerge]});
need_disable = !this.appConfig.canModifyFilter;
toolbar.lockToolbar(Common.enumLock.cantModifyFilter, need_disable, { array: [toolbar.btnTableTemplate]});
val = xfs.asc_getNumFormatInfo();
if ( val ) { if ( val ) {
this._state.numformat = xfs.asc_getNumFormat(); this._state.numformat = xfs.asc_getNumFormat();
this._state.numformatinfo = val; this._state.numformatinfo = val;
@ -3174,6 +3374,118 @@ define([
} }
}, },
onApiEditorSelectionChanged_OleEditor: function(fontobj) {
if (!this.editMode || $('.asc-window.enable-key-events:visible').length>0) return;
var toolbar = this.toolbar,
val;
/* read font name */
Common.NotificationCenter.trigger('fonts:change', fontobj);
/* read font params */
// if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
// val = fontobj.asc_getFontBold();
// if (this._state.bold !== val) {
// toolbar.btnBold.toggle(val === true, true);
// this._state.bold = val;
// }
// val = fontobj.asc_getFontItalic();
// if (this._state.italic !== val) {
// toolbar.btnItalic.toggle(val === true, true);
// this._state.italic = val;
// }
// val = fontobj.asc_getFontUnderline();
// if (this._state.underline !== val) {
// toolbar.btnUnderline.toggle(val === true, true);
// this._state.underline = val;
// }
// val = fontobj.asc_getFontStrikeout();
// if (this._state.strikeout !== val) {
// toolbar.btnStrikeout.toggle(val === true, true);
// this._state.strikeout = val;
// }
//
// 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),
// btnSubscript = toolbar.btnSubscript;
//
// btnSubscript.toggle(index>-1, true);
// if (index < 0) {
// btnSubscript.menu.clearAll();
// } else {
// btnSubscript.menu.items[index].setChecked(true);
// if ( btnSubscript.rendered && btnSubscript.$icon ) {
// btnSubscript.$icon.removeClass(btnSubscript.options.icls);
// btnSubscript.options.icls = btnSubscript.menu.items[index].options.icls;
// btnSubscript.$icon.addClass(btnSubscript.options.icls);
// }
// }
//
// this._state.subscript = subsc;
// this._state.superscript = supersc;
// }
// }
/* read font size */
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;
}
/* read font color */
// var clr,
// color,
// fontColorPicker = this.toolbar.mnuTextColorPicker;
//
// if (!fontColorPicker.isDummy) {
// color = fontobj.asc_getFontColor();
// if (color) {
// if (color.get_auto()) {
// if (this._state.clrtext !== 'auto') {
// fontColorPicker.clearSelection();
// this.toolbar.btnTextColor.setAutoColor(true);
// this._state.clrtext = 'auto';
// }
// } else {
// 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() };
// } else {
// clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
// }
// var type1 = typeof(clr),
// type2 = typeof(this._state.clrtext);
// if ( (this._state.clrtext == 'auto') || (type1 !== type2) || (type1=='object' &&
// (clr.effectValue!==this._state.clrtext.effectValue || this._state.clrtext.color.indexOf(clr.color)<0)) ||
// (type1!='object' && this._state.clrtext!==undefined && this._state.clrtext.indexOf(clr)<0 )) {
//
// this.toolbar.btnTextColor.setAutoColor(false);
// if (_.isObject(clr)) {
// var isselected = false;
// for (var i = 0; i < 10; i++) {
// if (Common.Utils.ThemeColor.ThemeValues[i] == clr.effectValue) {
// fontColorPicker.select(clr, true);
// isselected = true;
// break;
// }
// }
// if (!isselected) fontColorPicker.clearSelection();
// } else {
// fontColorPicker.select(clr, true);
// }
// this._state.clrtext = clr;
// }
// }
// }
// this._state.clrtext_asccolor = color;
// }
},
onApiStyleChange: function() { onApiStyleChange: function() {
this.toolbar.btnCopyStyle.toggle(false, true); this.toolbar.btnCopyStyle.toggle(false, true);
this.modeAlwaysSetStyle = false; this.modeAlwaysSetStyle = false;

View file

@ -31,7 +31,7 @@
<section class="panel" data-tab="home"> <section class="panel" data-tab="home">
<div class="group small"> <div class="group small">
<div class="elset font-attr-top"> <div class="elset font-attr-top">
<span class="btn-slot" id="slot-field-fontname"></span> <span class="btn-slot" id="slot-field-fontname" style="width: 127px;"></span>
<span class="btn-slot" id="slot-field-fontsize"></span> <span class="btn-slot" id="slot-field-fontsize"></span>
<span class="btn-slot" id="slot-btn-incfont"></span> <span class="btn-slot" id="slot-btn-incfont"></span>
<span class="btn-slot" id="slot-btn-decfont"></span> <span class="btn-slot" id="slot-btn-decfont"></span>

View file

@ -78,41 +78,48 @@
<section class="simple-bar"> <section class="simple-bar">
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot split" id="slot-btn-copy"></span> <span class="btn-slot split-small" id="slot-btn-copy"></span>
<span class="btn-slot split" id="slot-btn-paste"></span> <span class="btn-slot split-small" id="slot-btn-paste"></span>
<span class="btn-slot split" id="slot-btn-undo"></span> <span class="btn-slot split-small" id="slot-btn-undo"></span>
<span class="btn-slot" id="slot-btn-redo"></span> <span class="btn-slot" id="slot-btn-redo"></span>
</div> </div>
</div> </div>
<div class="separator short"></div> <div class="separator short"></div>
<div class="group small">
<div class="elset" style="width: 182px;">
<span class="btn-slot" id="slot-field-fontname" style="width: 100px;float: left;"></span>
<span class="btn-slot" id="slot-field-fontsize" style="margin-left: 2px;float: left;"></span>
<span class="btn-slot split" id="slot-btn-fontcolor" style="margin-left: 2px;float: left;"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split-small" id="slot-btn-wrap"></span>
<span class="btn-slot split" id="slot-btn-merge"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset font-attr">
<span class="btn-slot split" id="slot-btn-borders"></span>
<span class="btn-slot split" id="slot-btn-fillparag"></span>
<span class="btn-slot split" id="slot-btn-table-tpl"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot" id="slot-btn-format" style="width: 84px; vertical-align: middle;"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot split" id="slot-btn-formula"></span> <span class="btn-slot split" id="slot-btn-formula"></span>
</div> </div>
</div> </div>
<div class="separator short"></div> <div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-sortdesc"></span>
<span class="btn-slot" id="slot-btn-sortasc"></span>
</div>
</div>
<div class="separator short" style="margin-left: 5px;"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-setfilter"></span>
<span class="btn-slot" id="slot-btn-clear-filter"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-digit-dec"></span>
<span class="btn-slot split" id="slot-btn-digit-inc"></span>
<span class="btn-slot" id="slot-btn-format" style="width: 84px; vertical-align: middle;"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small"> <div class="group small">
<div class="elset"> <div class="elset">
<span class="btn-slot" id="slot-btn-search"></span> <span class="btn-slot" id="slot-btn-search"></span>

View file

@ -266,24 +266,6 @@ define([
dataHintOffset: 'big' dataHintOffset: 'big'
}); });
me.btnDecDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-decdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-decdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnIncDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-incdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-incdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
dataHint : '1',
dataHintDirection: 'bottom'
});
var formatTemplate = var formatTemplate =
_.template([ _.template([
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
@ -309,7 +291,35 @@ define([
dataHintOffset: 'big' dataHintOffset: 'big'
}); });
} }
if ( config.isEditMailMerge || config.isEditOle ) {
me.btnSearch = new Common.UI.Button({
id : 'id-toolbar-btn-search',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-search',
lock : [_set.lostConnect],
dataHint : '1',
dataHintDirection: 'bottom'
});
}
if ( config.isEditDiagram ) { if ( config.isEditDiagram ) {
me.btnDecDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-decdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-decdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnIncDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-incdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-incdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnEditChart = new Common.UI.Button({ me.btnEditChart = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart', id : 'id-toolbar-rtn-edit-chart',
cls : 'btn-toolbar btn-text-default auto', cls : 'btn-toolbar btn-text-default auto',
@ -344,16 +354,7 @@ define([
dataHintOffset: 'medium' dataHintOffset: 'medium'
}); });
} }
if ( config.isEditMailMerge || config.isEditOle ) { if ( config.isEditMailMerge) {
me.btnSearch = new Common.UI.Button({
id : 'id-toolbar-btn-search',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-search',
lock : [_set.lostConnect],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnSortDown = new Common.UI.Button({ me.btnSortDown = new Common.UI.Button({
id : 'id-toolbar-btn-sort-down', id : 'id-toolbar-btn-sort-down',
cls : 'btn-toolbar', cls : 'btn-toolbar',
@ -392,6 +393,147 @@ define([
}); });
} }
if ( config.isEditOle ) { if ( config.isEditOle ) {
me.cmbFontSize = new Common.UI.ComboBox({
cls : 'input-group-nr',
menuStyle : 'min-width: 55px;',
hint : me.tipFontSize,
lock : [_set.selImage, _set.editFormula, _set.selRangeEdit, _set.selSlicer, _set.coAuth, _set.coAuthText, _set.lostConnect],
data : [
{ value: 8, displayValue: "8" },
{ value: 9, displayValue: "9" },
{ value: 10, displayValue: "10" },
{ value: 11, displayValue: "11" },
{ value: 12, displayValue: "12" },
{ value: 14, displayValue: "14" },
{ value: 16, displayValue: "16" },
{ value: 18, displayValue: "18" },
{ value: 20, displayValue: "20" },
{ value: 22, displayValue: "22" },
{ value: 24, displayValue: "24" },
{ value: 26, displayValue: "26" },
{ value: 28, displayValue: "28" },
{ value: 36, displayValue: "36" },
{ value: 48, displayValue: "48" },
{ value: 72, displayValue: "72" },
{ value: 96, displayValue: "96" }
],
dataHint: '1',
dataHintDirection: 'bottom'
});
me.cmbFontName = new Common.UI.ComboBoxFonts({
cls : 'input-group-nr',
menuCls : 'scrollable-menu',
menuStyle : 'min-width: 325px;',
hint : me.tipFontName,
lock : [_set.selImage, _set.editFormula, _set.selRangeEdit, _set.selSlicer, _set.coAuth, _set.coAuthText, _set.lostConnect],
store : new Common.Collections.Fonts(),
recent : 0,
dataHint: '1',
dataHintDirection: 'bottom'
});
me.btnWrap = new Common.UI.Button({
id : 'id-toolbar-rtn-wrap',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-wrap',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells']],
enableToggle: true,
allowDepress: true,
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnMerge = new Common.UI.Button({
id : 'id-toolbar-rtn-merge',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-merge-and-center',
enableToggle: true,
allowDepress: true,
split : true,
lock : [_set.editCell, _set.selShape, _set.selShapeText, _set.selChart, _set.selChartText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set.ruleMerge, _set.editPivot, _set.wsLock],
menu : new Common.UI.Menu({
items: [
{
caption : me.txtMergeCenter,
iconCls : 'menu__icon btn-merge-and-center',
value : Asc.c_oAscMergeOptions.MergeCenter
},
{
caption : me.txtMergeAcross,
iconCls : 'menu__icon btn-merge-across',
value : Asc.c_oAscMergeOptions.MergeAcross
},
{
caption : me.txtMergeCells,
iconCls : 'menu__icon btn-merge-cells',
value : Asc.c_oAscMergeOptions.Merge
},
{
caption : me.txtUnmerge,
iconCls : 'menu__icon btn-unmerge-cells',
value : Asc.c_oAscMergeOptions.None
}
]
}),
dataHint : '1',
dataHintDirection: 'bottom'
});
me.mnuTextColorPicker = dummyCmp();
me.btnTextColor = new Common.UI.ButtonColored({
id : 'id-toolbar-btn-fontcolor',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-fontcolor',
split : true,
lock : [_set.selImage, _set.editFormula, _set.selRangeEdit, _set.selSlicer, _set.coAuth, _set.coAuthText, _set.lostConnect, _set.wsLockFormat],
menu: true,
auto: true,
dataHint : '1',
dataHintDirection: 'bottom'
});
me.mnuBackColorPicker = dummyCmp();
me.btnBackColor = new Common.UI.ButtonColored({
id : 'id-toolbar-btn-fillparag',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-paracolor',
split : true,
lock : [_set.selImage, _set.editCell, _set.selSlicer, _set.coAuth, _set.coAuthText, _set.lostConnect, _set.wsLockFormatFill],
transparent: true,
menu: true,
dataHint: '1',
dataHintDirection: 'bottom'
});
me.btnBorders = new Common.UI.Button({
id : 'id-toolbar-btn-borders',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-border-out',
icls : 'btn-border-out',
borderId : 'outer',
borderswidth: Asc.c_oAscBorderStyles.Thin,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells']],
split : true,
menu : true,
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnTableTemplate = new Common.UI.Button({
id : 'id-toolbar-btn-ttempl',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-table',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.multiselect, _set.cantModifyFilter, _set.wsLock],
menu : new Common.UI.Menu({
items: [
{ template: _.template('<div id="id-toolbar-menu-table-templates" style="width: 487px; height: 300px; margin: 0px 4px;"></div>') }
]
}),
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnVisibleArea = new Common.UI.Button({ me.btnVisibleArea = new Common.UI.Button({
id : 'id-toolbar-btn-visible-area', id : 'id-toolbar-btn-visible-area',
cls : 'btn-toolbar btn-icon-default', cls : 'btn-toolbar btn-icon-default',
@ -416,8 +558,7 @@ define([
visible : false, visible : false,
// style : 'min-width: 120px;', // style : 'min-width: 120px;',
dataHint : '1', dataHint : '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom'
dataHintOffset: 'big'
}); });
} }

View file

@ -113,10 +113,6 @@
border: @scaled-one-px-value solid @border-regular-control; border: @scaled-one-px-value solid @border-regular-control;
} }
#slot-field-fontname {
width: 127px;
}
#slot-field-fontsize { #slot-field-fontsize {
width: 45px; width: 45px;
} }