diff --git a/apps/common/main/resources/img/toolbar/1.5x/big/btn-audio.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-audio.png new file mode 100644 index 000000000..50ccbacdc Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.5x/big/btn-audio.png differ diff --git a/apps/common/main/resources/img/toolbar/1.5x/big/btn-video.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-video.png new file mode 100644 index 000000000..544d7ea4a Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.5x/big/btn-video.png differ diff --git a/apps/common/main/resources/img/toolbar/1x/big/btn-audio.png b/apps/common/main/resources/img/toolbar/1x/big/btn-audio.png new file mode 100644 index 000000000..dbd36e819 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/big/btn-audio.png differ diff --git a/apps/common/main/resources/img/toolbar/1x/big/btn-video.png b/apps/common/main/resources/img/toolbar/1x/big/btn-video.png new file mode 100644 index 000000000..13f5d8a77 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/big/btn-video.png differ diff --git a/apps/common/main/resources/img/toolbar/2x/big/btn-audio.png b/apps/common/main/resources/img/toolbar/2x/big/btn-audio.png new file mode 100644 index 000000000..6eeea5c8a Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/big/btn-audio.png differ diff --git a/apps/common/main/resources/img/toolbar/2x/big/btn-video.png b/apps/common/main/resources/img/toolbar/2x/big/btn-video.png new file mode 100644 index 000000000..a5044fee8 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/big/btn-video.png differ diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 1314ae1c3..7635ab778 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -316,6 +316,8 @@ define([ toolbar.btnInsDateTime.on('click', _.bind(this.onEditHeaderClick, this, 'datetime')); toolbar.btnInsSlideNum.on('click', _.bind(this.onEditHeaderClick, this, 'slidenum')); Common.Gateway.on('insertimage', _.bind(this.insertImage, this)); + toolbar.btnInsAudio && toolbar.btnInsAudio.on('click', _.bind(this.onAddAudio, this)); + toolbar.btnInsVideo && toolbar.btnInsVideo.on('click', _.bind(this.onAddVideo, this)); this.onSetupCopyStyleButton(); }, @@ -639,7 +641,7 @@ define([ 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) }); + { array: this.toolbar.btnsInsertImage.concat(this.toolbar.btnsInsertText, this.toolbar.btnsInsertShape, this.toolbar.btnInsertEquation, this.toolbar.btnInsertTextArt, this.toolbar.btnInsAudio, this.toolbar.btnInsVideo) }); if (this.btnsComment) this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, { array: this.btnsComment }); } @@ -2228,6 +2230,14 @@ define([ this._state.lang = langId; }, + onAddAudio: function() { + this.api && this.api.asc_AddAudio(); + }, + + onAddVideo: function() { + this.api && this.api.asc_AddVideo(); + }, + textEmptyImgUrl : 'You need to specify image URL.', textWarning : 'Warning', textFontSizeErr : 'The entered value must be more than 0', diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 4d5e1c3d2..56b59459a 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -131,6 +131,11 @@ +
+
+ + +
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 26051856c..8257848f8 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -610,6 +610,26 @@ define([ }); me.slideOnlyControls.push(me.btnInsSlideNum); + if (window["AscDesktopEditor"] && window["AscDesktopEditor"]["IsSupportMedia"] && window["AscDesktopEditor"]["IsSupportMedia"]()) { + me.btnInsAudio = new Common.UI.Button({ + id: 'tlbtn-insaudio', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-audio', + caption: me.capInsertAudio, + lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart] + }); + me.slideOnlyControls.push(me.btnInsAudio); + + me.btnInsVideo = new Common.UI.Button({ + id: 'tlbtn-insvideo', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-video', + caption: me.capInsertVideo, + lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart] + }); + me.slideOnlyControls.push(me.btnInsVideo); + } + me.btnColorSchemas = new Common.UI.Button({ id: 'id-toolbar-btn-colorschemas', cls: 'btn-toolbar', @@ -961,6 +981,12 @@ define([ _injectComponent('#slot-btn-datetime', this.btnInsDateTime); _injectComponent('#slot-btn-slidenum', this.btnInsSlideNum); + this.btnInsAudio && _injectComponent('#slot-btn-insaudio', this.btnInsAudio); + this.btnInsVideo && _injectComponent('#slot-btn-insvideo', this.btnInsVideo); + if (!this.btnInsAudio && !this.btnInsVideo) { + $host.find('#slot-btn-insaudio').parents('.group').hide().prev().hide(); + } + this.btnsInsertImage = Common.Utils.injectButtons($host.find('.slot-insertimg'), 'tlbtn-insertimage-', 'toolbar__icon btn-insertimage', this.capInsertImage, [PE.enumLock.slideDeleted, PE.enumLock.lostConnect, PE.enumLock.noSlides, PE.enumLock.disableOnStart], false, true); this.btnsInsertText = Common.Utils.injectButtons($host.find('.slot-instext'), 'tlbtn-inserttext-', 'toolbar__icon btn-text', this.capInsertText, @@ -1064,6 +1090,8 @@ define([ this.btnInsertSymbol.updateHint(this.tipInsertSymbol); this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')); this.btnInsertTextArt.updateHint(this.tipInsertTextArt); + this.btnInsAudio && this.btnInsAudio.updateHint(this.tipInsertAudio); + this.btnInsVideo && this.btnInsVideo.updateHint(this.tipInsertVideo); this.btnColorSchemas.updateHint(this.tipColorSchemas); this.btnShapeAlign.updateHint(this.tipShapeAlign); this.btnShapeArrange.updateHint(this.tipShapeArrange); @@ -1645,7 +1673,11 @@ define([ textListSettings: 'List Settings', capBtnAddComment: 'Add Comment', capBtnInsSymbol: 'Symbol', - tipInsertSymbol: 'Insert symbol' + tipInsertSymbol: 'Insert symbol', + capInsertAudio: 'Audio', + capInsertVideo: 'Video', + tipInsertAudio: 'Insert audio', + tipInsertVideo: 'Insert video' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index c0c1a31c3..ae851767f 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1819,5 +1819,9 @@ "PE.Views.Toolbar.txtScheme8": "Flow", "PE.Views.Toolbar.txtScheme9": "Foundry", "PE.Views.Toolbar.txtSlideAlign": "Align to Slide", - "PE.Views.Toolbar.txtUngroup": "Ungroup" + "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.capInsertAudio": "Audio", + "PE.Views.Toolbar.capInsertVideo": "Video", + "PE.Views.Toolbar.tipInsertAudio": "Insert audio", + "PE.Views.Toolbar.tipInsertVideo": "Insert video" } \ No newline at end of file