diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 00504db9f..5f17aef78 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -309,6 +309,9 @@ define([ toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this)); toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); + toolbar.btnEditHeader.on('click', _.bind(this.onEditHeaderClick, this, 'header')); + toolbar.btnInsDateTime.on('click', _.bind(this.onEditHeaderClick, this, 'datetime')); + toolbar.btnInsSlideNum.on('click', _.bind(this.onEditHeaderClick, this, 'slidenum')); this.onSetupCopyStyleButton(); }, @@ -619,7 +622,7 @@ define([ this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnPrint, this.toolbar.btnCopy, this.toolbar.btnPaste, this.toolbar.btnCopyStyle, this.toolbar.btnInsertTable, this.toolbar.btnInsertChart, this.toolbar.btnColorSchemas, this.toolbar.btnShapeAlign, - this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme + this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme, this.toolbar.btnEditHeader, this.toolbar.btnInsDateTime, this.toolbar.btnInsSlideNum ]}); this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, { array: this.toolbar.btnsInsertImage.concat(this.toolbar.btnsInsertText, this.toolbar.btnsInsertShape, this.toolbar.btnInsertEquation, this.toolbar.btnInsertTextArt) }); @@ -674,13 +677,14 @@ define([ if (paragraph_locked!==undefined && this._state.prcontrolsdisable !== paragraph_locked) { if (this._state.activated) this._state.prcontrolsdisable = paragraph_locked; - this.toolbar.lockToolbar(PE.enumLock.paragraphLock, paragraph_locked, {array: me.toolbar.paragraphControls}); + this.toolbar.lockToolbar(PE.enumLock.paragraphLock, paragraph_locked, {array: me.toolbar.paragraphControls.concat(me.toolbar.btnInsDateTime, me.toolbar.btnInsSlideNum)}); } if (this._state.no_paragraph !== no_paragraph) { if (this._state.activated) this._state.no_paragraph = no_paragraph; this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: me.toolbar.paragraphControls}); this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: [me.toolbar.btnCopyStyle]}); + this.toolbar.lockToolbar(PE.enumLock.paragraphLock, !no_paragraph && this._state.prcontrolsdisable, {array: [me.toolbar.btnInsDateTime, me.toolbar.btnInsSlideNum]}); } if (this._state.no_text !== no_text) { @@ -1443,6 +1447,25 @@ define([ Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art'); }, + onEditHeaderClick: function(type, e) { + var selectedElements = this.api.getSelectedElements(), + in_text = false; + + for (var i=0; i < selectedElements.length; i++) { + if (selectedElements[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) { + in_text = true; + break; + } + } + if (in_text && type=='slidenum') { + this.api.asc_addSlideNumber(); + } else if (in_text && type=='datetime') { + //insert date time + } else { + //insert header/footer + } + }, + onClearStyleClick: function(btn, e) { if (this.api) this.api.ClearFormating(); diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 9bb562b76..0b8287bc6 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -121,6 +121,12 @@
+