diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 42f974ffb..422a8a1fa 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -287,6 +287,7 @@ define([ toolbar.mnuNumbersPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnNumbers)); toolbar.mnuMultilevelPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnMultilevels)); toolbar.mnuMarkerSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 0)); + toolbar.mnuNumberSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 1)); toolbar.btnHighlightColor.on('click', _.bind(this.onBtnHighlightColor, this)); toolbar.btnFontColor.on('click', _.bind(this.onBtnFontColor, this)); toolbar.btnParagraphColor.on('click', _.bind(this.onBtnParagraphColor, this)); @@ -500,10 +501,14 @@ define([ else this.toolbar.mnuMarkersPicker.deselectAll(true); this.toolbar.mnuMultilevelPicker.deselectAll(true); + this.toolbar.mnuMarkerSettings && this.toolbar.mnuMarkerSettings.setDisabled(this._state.bullets.subtype<0); break; case 1: - var idx = 0; + var idx; switch(this._state.bullets.subtype) { + case 0: + idx = 0; + break; case 1: idx = 4; break; @@ -527,11 +532,12 @@ define([ break; } this.toolbar.btnNumbers.toggle(true, true); - if (this._state.bullets.subtype!==undefined) + if (idx!==undefined) this.toolbar.mnuNumbersPicker.selectByIndex(idx, true); else this.toolbar.mnuNumbersPicker.deselectAll(true); this.toolbar.mnuMultilevelPicker.deselectAll(true); + this.toolbar.mnuNumberSettings && this.toolbar.mnuNumberSettings.setDisabled(idx==0); break; case 2: this.toolbar.btnMultilevels.toggle(true, true); @@ -1326,11 +1332,13 @@ define([ var listId = me.api.asc_GetCurrentNumberingId(), level = me.api.asc_GetCurrentNumberingLvl(), props = (listId !== null) ? me.api.asc_GetNumberingPr(listId).get_Lvl(level) : null; - if (props && props.get_Format() == Asc.c_oAscNumberingFormat.Bullet) { + if (props) { + var type = props.get_Format(); (new DE.Views.BulletSettingsDialog({ api: me.api, props: props, level: level, + type: type, interfaceLang: me.mode.lang, handler: function(result, value) { if (result == 'ok') { @@ -2207,6 +2215,8 @@ define([ this.toolbar.mnuMarkersPicker.selectByIndex(0, true); this.toolbar.mnuNumbersPicker.selectByIndex(0, true); this.toolbar.mnuMultilevelPicker.selectByIndex(0, true); + this.toolbar.mnuMarkerSettings && this.toolbar.mnuMarkerSettings.setDisabled(true); + this.toolbar.mnuNumberSettings && this.toolbar.mnuNumberSettings.setDisabled(true); }, _getApiTextSize: function () { diff --git a/apps/documenteditor/main/app/view/BulletSettingsDialog.js b/apps/documenteditor/main/app/view/BulletSettingsDialog.js index 34160ac6a..d944d13d4 100644 --- a/apps/documenteditor/main/app/view/BulletSettingsDialog.js +++ b/apps/documenteditor/main/app/view/BulletSettingsDialog.js @@ -52,6 +52,7 @@ define([ DE.Views.BulletSettingsDialog = Common.UI.Window.extend(_.extend({ options: { + type: Asc.c_oAscNumberingFormat.Bullet, width: 300, height: 334, style: 'min-width: 240px;', @@ -61,6 +62,8 @@ define([ }, initialize : function(options) { + this.type = (options.type!==undefined) ? options.type : Asc.c_oAscNumberingFormat.Bullet; + _.extend(this.options, { title: this.txtTitle }, options || {}); @@ -70,8 +73,13 @@ define([ '
', + '<% if (type == Asc.c_oAscNumberingFormat.Bullet) { %>', '', '', + '<% } else { %>', + '', + '', + '<% } %>', ' | ', '', '', @@ -160,6 +168,27 @@ define([ }); this.btnEdit.on('click', _.bind(this.onEditBullet, this)); + this.cmbFormat = new Common.UI.ComboBox({ + el : $window.find('#id-dlg-numbering-format'), + menuStyle : 'min-width: 100%;', + editable : false, + cls : 'input-group-nr', + data : [ + { displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal }, + { displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter }, + { displayValue: 'A, B, C,...', value: Asc.c_oAscNumberingFormat.UpperLetter }, + { displayValue: 'i, ii, iii,...', value: Asc.c_oAscNumberingFormat.LowerRoman }, + { displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman } + ] + }); + this.cmbFormat.on('selected', _.bind(function (combo, record) { + if (this._changedProps) + this._changedProps.put_Format(record.value); + if (this.api) { + //this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps); + } + }, this)); + this.cmbAlign = new Common.UI.ComboBox({ el : $window.find('#id-dlg-bullet-align'), menuStyle : 'min-width: 100%;', @@ -185,7 +214,7 @@ define([ editable : false, cls : 'input-group-nr', data : [ - { value: -1, displayValue: this.textAuto }, + { value: -1, displayValue: this.txtLikeText }, { value: 8, displayValue: "8" }, { value: 9, displayValue: "9" }, { value: 10, displayValue: "10" }, @@ -316,6 +345,7 @@ define([ this.bulletProps = {}; if (props) { this.cmbAlign.setValue(props.get_Align() || ''); + this.cmbFormat.setValue(props.get_Format() || ''); var textPr = props.get_TextPr(), text = props.get_Text(); if (text) { @@ -356,7 +386,7 @@ define([ this._changedProps = props || new Asc.CAscNumberingLvl(this.level); }, - txtTitle: 'Define New Bullet', + txtTitle: 'List Settings', txtSize: 'Size', txtColor: 'Color', textNewColor: 'Add New Custom Color', @@ -367,6 +397,8 @@ define([ textCenter: 'Center', textRight: 'Right', textAuto: 'Auto', - textPreview: 'Preview' + textPreview: 'Preview', + txtType: 'Type', + txtLikeText: 'Like a text' }, DE.Views.BulletSettingsDialog || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 4a0f35530..7df4f2399 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1608,10 +1608,10 @@ define([ new Common.UI.Menu({ style: 'min-width: 139px', items: [ - {template: _.template('')}, + {template: _.template('')}, this.mnuMarkerSettings = new Common.UI.MenuItem({ - caption: this.textBulletSettings, - // disabled: (this.mnuMarkersPicker.conf.index || 0)==0, + caption: this.textListSettings, + disabled: (this.mnuMarkersPicker.conf.index || 0)==0, value: 'settings' }) ] @@ -1621,7 +1621,12 @@ define([ this.btnNumbers.setMenu( new Common.UI.Menu({ items: [ - {template: _.template('')} + {template: _.template('')}, + this.mnuNumberSettings = new Common.UI.MenuItem({ + caption: this.textListSettings, + disabled: (this.mnuNumbersPicker.conf.index || 0)==0, + value: 'settings' + }) ] }) ); @@ -2295,7 +2300,7 @@ define([ tipInsertSymbol: 'Insert symbol', mniDrawTable: 'Draw Table', mniEraseTable: 'Erase Table', - textBulletSettings: 'Define New Bullet' + textListSettings: 'List Settings' } })(), DE.Views.Toolbar || {})); }); |