/* * (c) Copyright Ascensio System SIA 2010-2024 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ /** * Toolbar.js * * Toolbar view * * Created on 4/16/14 * */ define([ 'backbone', 'text!presentationeditor/main/app/template/Toolbar.template', 'text!presentationeditor/main/app/template/ToolbarView.template', 'common/main/lib/collection/Fonts', 'common/main/lib/component/Button', 'common/main/lib/component/ComboBox', 'common/main/lib/component/DataView', 'common/main/lib/component/ColorPalette', 'common/main/lib/component/ThemeColorPalette', 'common/main/lib/component/Menu', 'common/main/lib/component/DimensionPicker', 'common/main/lib/component/Window', 'common/main/lib/component/ComboBoxFonts', 'common/main/lib/component/ComboDataView' ,'common/main/lib/component/SynchronizeTip' ,'common/main/lib/component/Mixtbar', 'common/main/lib/component/ComboDataViewShape' ], function (Backbone, template, template_view) { 'use strict'; if (!Common.enumLock) Common.enumLock = {}; var enumLock = { paragraphLock: 'para-lock', shapeLock: 'shape-lock', slideLock: 'slide-lock', slideDeleted: 'slide-deleted', noSlides: 'no-slides', lostConnect: 'disconnect', incIndentLock: 'can-inc-indent', decIndentLock: 'can-dec-indent', hyperlinkLock: 'can-hyperlink', undoLock: 'can-undo', redoLock: 'can-redo', docPropsLock: 'doc-props-lock', themeLock: 'theme-lock', menuFileOpen: 'menu-file-open', noParagraphSelected: 'no-paragraph', noObjectSelected: 'no-object', // no objects in stack from asc_onFocusObject event noDrawingObjects: 'no-drawing-object', // asc_getSelectedDrawingObjectsCount<1 (2 selected tables: noObjectSelected=true, noDrawingObjects = false) disableOnStart: 'on-start', cantPrint: 'cant-print', noTextSelected: 'no-text', inEquation: 'in-equation', commentLock: 'can-comment', noColumns: 'no-columns', transitLock: 'transit-lock', inSmartart: 'in-smartart', inSmartartInternal: 'in-smartart-internal', noGraphic: 'no-graphic', noAnimation: 'no-animation', noAnimationParam: 'no-animation-params', noTriggerObjects: 'no-trigger-objects', noMoveAnimationEarlier: 'no-move-animation-earlier', noMoveAnimationLater: 'no-move-animation-later', noAnimationPreview: 'no-animation-preview', noAnimationRepeat: 'no-animation-repeat', noAnimationDuration: 'no-animation-duration', timingLock: 'timing-lock', copyLock: 'can-copy', fileMenuOpened: 'file-menu-opened', noParagraphObject: 'no-paragraph-obj', inSlideMaster: 'in-slide-master', slideMasterMode: 'slide-master-mode', cantMergeShape: 'merge-shape-lock', cantSave: 'cant-save', macrosStopped: 'macros-stopped' }; for (var key in enumLock) { if (enumLock.hasOwnProperty(key)) { Common.enumLock[key] = enumLock[key]; } } PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){ return { el: '#toolbar', // Delegated events for creating new items, and clearing completed ones. events: { // }, initialize: function () { var me = this; me.paragraphControls = []; me.shapeControls = []; me.slideOnlyControls = []; me.synchTooltip = undefined; me.needShowSynchTip = false; me.shortcutHints = {}; me._state = { hasCollaborativeChanges: undefined }; me.binding = {}; Common.NotificationCenter.on('app:ready', me.onAppReady.bind(this)); return this; }, applyLayout: function (config) { var me = this; me.lockControls = []; me.nolockControls = []; if ( config.isEdit ) { Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template), tabs: [ {caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false, dataHintTitle: 'F'}, {caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'}, {caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'}, {caption: me.textTabDesign, action: 'design', extcls: 'canedit', dataHintTitle: 'D'}, {caption: me.textTabTransitions, action: 'transit', extcls: 'canedit', dataHintTitle: 'N'}, {caption: me.textTabAnimation, action: 'animate', extcls: 'canedit', dataHintTitle: 'A'} // undefined, undefined, undefined, ] } ); me.btnSaveCls = 'btn-save'; me.btnSaveTip = this.tipSave; /** * UI Components */ var _set = Common.enumLock; me.btnPrint = new Common.UI.Button({ id: 'id-toolbar-btn-print', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-print no-mask', lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint, _set.disableOnStart], signals: ['disabled'], split: config.canQuickPrint, menu: config.canQuickPrint, dataHint: '1', dataHintDirection: 'bottom', dataHintTitle: 'P', printType: 'print' }); me.slideOnlyControls.push(me.btnPrint); me.nolockControls.push(me.btnPrint); me.shortcutHints.PrintPreviewAndPrint = { btn: me.btnPrint, label: me.tipPrint }; me.btnSave = new Common.UI.Button({ id: 'id-toolbar-btn-save', cls: 'btn-toolbar', iconCls: 'toolbar__icon no-mask ' + me.btnSaveCls, lock: [_set.cantSave, _set.lostConnect], signals: ['disabled'], dataHint: '1', dataHintDirection: 'top', dataHintTitle: 'S' }); me.btnCollabChanges = me.btnSave; me.lockControls.push(me.btnSave); me.shortcutHints.Save = { applyCallback: function(item, hintText) { me.btnSave.updateHint(me.btnSaveTip + hintText); } }; me.btnUndo = new Common.UI.Button({ id: 'id-toolbar-btn-undo', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-undo icon-rtl', lock: [_set.undoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart], signals: ['disabled'], dataHint: '1', dataHintDirection: 'bottom', dataHintTitle: 'Z' }); me.slideOnlyControls.push(me.btnUndo); me.lockControls.push(me.btnUndo); me.shortcutHints.EditUndo = { btn: me.btnUndo, label: me.tipUndo }; me.btnRedo = new Common.UI.Button({ id: 'id-toolbar-btn-redo', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-redo icon-rtl', lock: [_set.redoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart], signals: ['disabled'], dataHint: '1', dataHintDirection: 'bottom', dataHintTitle: 'Y' }); me.slideOnlyControls.push(me.btnRedo); me.lockControls.push(me.btnRedo); me.shortcutHints.EditRedo = { btn: me.btnRedo, label: me.tipRedo }; me.btnCopy = new Common.UI.Button({ id: 'id-toolbar-btn-copy', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-copy', lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart, _set.copyLock], dataHint: '1', dataHintDirection: 'top', dataHintTitle: 'C' }); me.slideOnlyControls.push(me.btnCopy); me.lockControls.push(me.btnCopy); me.shortcutHints.Copy = { btn: me.btnCopy, label: me.tipCopy }; me.btnPaste = new Common.UI.Button({ id: 'id-toolbar-btn-paste', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-paste', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides], dataHint: '1', dataHintDirection: 'top', dataHintTitle: 'V' }); me.paragraphControls.push(me.btnPaste); me.lockControls.push(me.btnPaste); me.shortcutHints.Paste = { btn: me.btnPaste, label: me.tipPaste }; me.btnCut = new Common.UI.Button({ id: 'id-toolbar-btn-cut', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-cut', lock: [_set.slideDeleted, _set.paragraphLock, _set.shapeLock, _set.slideLock, _set.lostConnect, _set.noSlides, _set.disableOnStart, _set.copyLock], dataHint: '1', dataHintDirection: 'top', dataHintTitle: 'X' }); me.paragraphControls.push(me.btnCut); me.lockControls.push(me.btnCut); me.shortcutHints.Cut = { btn: me.btnCut, label: me.tipCut }; me.btnAddSlide = new Common.UI.Button({ id: 'id-toolbar-btn-add-slide', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-addslide', caption: this.capAddSlide, lock: [_set.menuFileOpen, _set.lostConnect, _set.disableOnStart], split: true, menu: true, action: 'add-slide', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.btnAddSlide.on('click', function (btn, e) { me.fireEvent('add:slide'); }); me.slideOnlyControls.push(me.btnAddSlide); me.lockControls.push(me.btnAddSlide); me.shortcutHints.NewSlide = { btn: me.btnAddSlide, label: me.tipAddSlide }; me.btnChangeSlide = new Common.UI.Button({ id: 'id-toolbar-button-change-slide', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-changeslide', lock: [_set.menuFileOpen, _set.slideDeleted, _set.slideLock, _set.lostConnect, _set.noSlides, _set.disableOnStart], menu: true, action: 'change-slide', dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -6' }); me.slideOnlyControls.push(me.btnChangeSlide); me.lockControls.push(me.btnChangeSlide); me.btnPreview = new Common.UI.Button({ id: 'id-toolbar-btn-preview', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-preview', lock: [_set.menuFileOpen, _set.slideDeleted, _set.noSlides, _set.disableOnStart], split: true, menu: true, signals: ['disabled'], action: 'preview-slide', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.slideOnlyControls.push(me.btnPreview); me.nolockControls.push(me.btnPreview); me.btnSelectAll = new Common.UI.Button({ id: 'id-toolbar-btn-select-all', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-select-all', lock: [_set.noSlides, _set.disableOnStart], dataHint: '1', dataHintDirection: 'bottom' }); me.slideOnlyControls.push(me.btnSelectAll); me.lockControls.push(me.btnSelectAll); me.shortcutHints.EditSelectAll = { btn: me.btnSelectAll, label: me.tipSelectAll }; me.btnReplace = new Common.UI.Button({ id: 'id-toolbar-btn-replace', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-replace', lock: [_set.noSlides, _set.disableOnStart], dataHint: '1', dataHintDirection: 'top' }); me.slideOnlyControls.push(me.btnReplace); me.lockControls.push(me.btnReplace); me.shortcutHints.OpenFindAndReplaceMenu = { btn: me.btnReplace, label: me.tipReplace }; me.cmbFontName = new Common.UI.ComboBoxFonts({ cls: 'input-group-nr', menuCls: 'scrollable-menu', menuStyle: 'min-width: 325px;', hint: me.tipFontName, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], store: new Common.Collections.Fonts(), dataHint: '1', dataHintDirection: 'top' }); me.paragraphControls.push(me.cmbFontName); me.lockControls.push(me.cmbFontName); me.cmbFontSize = new Common.UI.ComboBox({ cls: 'input-group-nr', menuStyle: 'min-width: 55px;', hint: me.tipFontSize, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], 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: 'top' }); me.paragraphControls.push(me.cmbFontSize); me.lockControls.push(me.cmbFontSize); me.btnIncFontSize = new Common.UI.Button({ id: 'id-toolbar-btn-incfont', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-incfont', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], dataHint: '1', dataHintDirection: 'top' }); me.paragraphControls.push(me.btnIncFontSize); me.lockControls.push(me.btnIncFontSize); me.shortcutHints.IncreaseFontSize = { btn: me.btnIncFontSize, label: me.tipIncFont }; me.btnDecFontSize = new Common.UI.Button({ id: 'id-toolbar-btn-decfont', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-decfont', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], dataHint: '1', dataHintDirection: 'top' }); me.paragraphControls.push(me.btnDecFontSize); me.lockControls.push(me.btnDecFontSize); me.shortcutHints.DecreaseFontSize = { btn: me.btnDecFontSize, label: me.tipDecFont }; me.btnBold = new Common.UI.Button({ id: 'id-toolbar-btn-bold', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-bold', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], enableToggle: true, dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnBold); me.lockControls.push(me.btnBold); me.shortcutHints.Bold = { btn: me.btnBold, label: me.textBold }; me.btnItalic = new Common.UI.Button({ id: 'id-toolbar-btn-italic', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-italic', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], enableToggle: true, dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnItalic); me.lockControls.push(me.btnItalic); me.shortcutHints.Italic = { btn: me.btnItalic, label: me.textItalic }; me.btnUnderline = new Common.UI.Button({ id: 'id-toolbar-btn-underline', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-underline', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], enableToggle: true, dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnUnderline); me.lockControls.push(me.btnUnderline); me.shortcutHints.Underline = { btn: me.btnUnderline, label: me.textUnderline }; me.btnStrikeout = new Common.UI.Button({ id: 'id-toolbar-btn-strikeout', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-strikeout', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], enableToggle: true, dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnStrikeout); me.lockControls.push(me.btnStrikeout); me.shortcutHints.Strikeout = { btn: me.btnStrikeout, label: me.textStrikeout }; me.btnSuperscript = new Common.UI.Button({ id: 'id-toolbar-btn-superscript', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-superscript', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock, _set.inEquation], enableToggle: true, toggleGroup: 'superscriptGroup', dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnSuperscript); me.lockControls.push(me.btnSuperscript); me.shortcutHints.Superscript = { btn: me.btnSuperscript, label: me.textSuperscript }; me.btnSubscript = new Common.UI.Button({ id: 'id-toolbar-btn-subscript', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-subscript', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock, _set.inEquation], enableToggle: true, toggleGroup: 'superscriptGroup', dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnSubscript); me.lockControls.push(me.btnSubscript); me.shortcutHints.Subscript = { btn: me.btnSubscript, label: me.textSubscript }; me.btnHighlightColor = new Common.UI.ButtonColored({ id: 'id-toolbar-btn-highlight', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-highlight', enableToggle: true, allowDepress: true, split: true, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ {template: _.template('
')}, {caption: '--'}, me.mnuHighlightTransparent = new Common.UI.MenuItem({ caption: me.strMenuNoFill, checkable: true }) ] }), dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -16' }); me.paragraphControls.push(me.btnHighlightColor); me.lockControls.push(me.btnHighlightColor); me.btnFontColor = new Common.UI.ButtonColored({ id: 'id-toolbar-btn-fontcolor', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-fontcolor', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], split: true, menu: true, eyeDropper: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -16' }); me.paragraphControls.push(me.btnFontColor); me.lockControls.push(me.btnFontColor); me.btnChangeCase = new Common.UI.Button({ id: 'id-toolbar-btn-case', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-change-case', action: 'change-case', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], menu: new Common.UI.Menu({ items: [ {caption: me.mniSentenceCase, value: Asc.c_oAscChangeTextCaseType.SentenceCase}, {caption: me.mniLowerCase, value: Asc.c_oAscChangeTextCaseType.LowerCase}, {caption: me.mniUpperCase, value: Asc.c_oAscChangeTextCaseType.UpperCase}, {caption: me.mniCapitalizeWords, value: Asc.c_oAscChangeTextCaseType.CapitalizeWords}, {caption: me.mniToggleCase, value: Asc.c_oAscChangeTextCaseType.ToggleCase} ] }), dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnChangeCase); me.lockControls.push(me.btnChangeCase); me.mnuChangeCase = me.btnChangeCase.menu; me.btnClearStyle = new Common.UI.Button({ id: 'id-toolbar-btn-clearstyle', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-clearstyle', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], dataHint: '1', dataHintDirection: 'bottom' }); me.paragraphControls.push(me.btnClearStyle); me.lockControls.push(me.btnClearStyle); me.btnCopyStyle = new Common.UI.Button({ id: 'id-toolbar-btn-copystyle', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-copystyle', lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.disableOnStart], enableToggle: true, dataHint: '1', dataHintDirection: 'bottom' }); me.slideOnlyControls.push(me.btnCopyStyle); me.lockControls.push(me.btnCopyStyle); me.shortcutHints.CopyFormat = { btn: me.btnCopyStyle, label: me.tipCopyStyle }; me.btnMarkers = new Common.UI.Button({ id: 'id-toolbar-btn-markers', cls: 'btn-toolbar', iconCls: 'toolbar__icon ' + (!Common.UI.isRTL() ? 'btn-setmarkers' : 'btn-setmarkers-rtl'), lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], enableToggle: true, toggleGroup: 'markersGroup', split: true, menu: true, dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -16' }); me.paragraphControls.push(me.btnMarkers); me.lockControls.push(me.btnMarkers); me.btnNumbers = new Common.UI.Button({ id: 'id-toolbar-btn-numbering', cls: 'btn-toolbar', iconCls: 'toolbar__icon ' + (!Common.UI.isRTL() ? 'btn-numbering' : 'btn-numbering-rtl'), lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], enableToggle: true, toggleGroup: 'markersGroup', split: true, menu: true, dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -16' }); me.paragraphControls.push(me.btnNumbers); me.lockControls.push(me.btnNumbers); var clone = function (source) { var obj = {}; for (var prop in source) obj[prop] = (typeof(source[prop]) == 'object') ? clone(source[prop]) : source[prop]; return obj; }; this.mnuMarkersPicker = { conf: {index: 0}, selectByIndex: function (idx) { this.conf.index = idx; } }; this.mnuNumbersPicker = clone(this.mnuMarkersPicker); me.btnHorizontalAlign = new Common.UI.Button({ id: 'id-toolbar-btn-halign', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-align-left', icls: 'btn-align-left', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], menu: new Common.UI.Menu({ items: [ { caption: me.textAlignLeft, iconCls: 'menu__icon btn-align-left', icls: 'btn-align-left', checkable: true, checkmark: false, toggleGroup: 'halignGroup', checked: true, value: 1 }, { caption: me.textAlignCenter, iconCls: 'menu__icon btn-align-center', icls: 'btn-align-center', checkable: true, checkmark: false, toggleGroup: 'halignGroup', value: 2 }, { caption: me.textAlignRight, iconCls: 'menu__icon btn-align-right', icls: 'btn-align-right', checkable: true, checkmark: false, toggleGroup: 'halignGroup', value: 0 }, { caption: me.textAlignJust, iconCls: 'menu__icon btn-align-just', icls: 'btn-align-just', checkable: true, checkmark: false, toggleGroup: 'halignGroup', value: 3 } ] }), action: 'align-horizontal', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnHorizontalAlign); me.lockControls.push(me.btnHorizontalAlign); me.shortcutHints.LeftPara = { btn: me.btnHorizontalAlign.menu.items[0], label: me.textAlignLeft, applyCallback: function(item, hintText) { item.btn.setCaption(hintText); } }; me.shortcutHints.CenterPara = { btn: me.btnHorizontalAlign.menu.items[1], label: me.textAlignCenter, applyCallback: function(item, hintText) { item.btn.setCaption(hintText); } }; me.shortcutHints.RightPara = { btn: me.btnHorizontalAlign.menu.items[2], label: me.textAlignRight, applyCallback: function(item, hintText) { item.btn.setCaption(hintText); } }; me.shortcutHints.JustifyPara = { btn: me.btnHorizontalAlign.menu.items[3], label: me.textAlignJust, applyCallback: function(item, hintText) { item.btn.setCaption(hintText); } }; me.btnVerticalAlign = new Common.UI.Button({ id: 'id-toolbar-btn-valign', cls: 'btn-toolbar', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noObjectSelected], iconCls: 'toolbar__icon btn-align-middle', icls: 'btn-align-middle', menu: new Common.UI.Menu({ items: [ { caption: me.textAlignTop, iconCls: 'menu__icon btn-align-top', icls: 'btn-align-top', checkable: true, checkmark: false, toggleGroup: 'valignGroup', value: Asc.c_oAscVAlign.Top }, { caption: me.textAlignMiddle, iconCls: 'menu__icon btn-align-middle', icls: 'btn-align-middle', checkable: true, checkmark: false, toggleGroup: 'valignGroup', value: Asc.c_oAscVAlign.Center, checked: true }, { caption: me.textAlignBottom, iconCls: 'menu__icon btn-align-bottom', icls: 'btn-align-bottom', checkable: true, checkmark: false, toggleGroup: 'valignGroup', value: Asc.c_oAscVAlign.Bottom } ] }), action: 'align-vertical', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnVerticalAlign); me.lockControls.push(me.btnVerticalAlign); me.btnDecLeftOffset = new Common.UI.Button({ id: 'id-toolbar-btn-decoffset', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-decoffset', lock: [_set.decIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], dataHint: '1', dataHintDirection: 'top' }); me.paragraphControls.push(me.btnDecLeftOffset); me.lockControls.push(me.btnDecLeftOffset); me.shortcutHints.UnIndent = { btn: me.btnDecLeftOffset, label: me.tipDecPrLeft }; me.btnIncLeftOffset = new Common.UI.Button({ id: 'id-toolbar-btn-incoffset', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-incoffset', lock: [_set.incIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], dataHint: '1', dataHintDirection: 'top' }); me.paragraphControls.push(me.btnIncLeftOffset); me.lockControls.push(me.btnIncLeftOffset); me.shortcutHints.Indent = { btn: me.btnIncLeftOffset, label: me.tipIncPrLeft }; me.btnLineSpace = new Common.UI.Button({ id: 'id-toolbar-btn-linespace', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-linespace', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noParagraphObject], menu: new Common.UI.Menu({ style: 'min-width: 60px;', items: [ {caption: '1.0', value: 1.0, checkable: true, toggleGroup: 'linesize'}, {caption: '1.15', value: 1.15, checkable: true, toggleGroup: 'linesize'}, {caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'}, {caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'}, {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ me.mnuLineSpaceOptions = new Common.UI.MenuItem({caption: me.textLineSpaceOptions, value: 'options'}) ]) }), action: 'line-space', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnLineSpace); me.lockControls.push(me.btnLineSpace); me.btnColumns = new Common.UI.Button({ id: 'id-toolbar-btn-columns', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-columns-two', lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noColumns], menu: new Common.UI.Menu({ cls: 'ppm-toolbar shifted-right', items: [ { caption: this.textColumnsOne, iconCls: 'menu__icon btn-columns-one', checkable: true, checkmark: false, toggleGroup: 'menuColumns', value: 0 }, { caption: this.textColumnsTwo, iconCls: 'menu__icon btn-columns-two', checkable: true, checkmark: false, toggleGroup: 'menuColumns', value: 1 }, { caption: this.textColumnsThree, iconCls: 'menu__icon btn-columns-three', checkable: true, checkmark: false, toggleGroup: 'menuColumns', value: 2 }, {caption: '--'}, {caption: this.textColumnsCustom, value: 'advanced'} ] }), action: 'insert-columns', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnColumns); me.lockControls.push(me.btnColumns); me.btnTextDir = new Common.UI.Button({ id: 'id-toolbar-btn-direction', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-ltr', icls: 'btn-ltr', action: 'text-direction', dirRtl: false, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noParagraphObject], menu: new Common.UI.Menu({ items: [ {caption: me.textDirLtr, value: false, iconCls: 'menu__icon btn-ltr'}, {caption: me.textDirRtl, value: true, iconCls: 'menu__icon btn-rtl'}, ] }), dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.paragraphControls.push(me.btnTextDir); me.lockControls.push(me.btnLineSpace); me.btnInsertTable = new Common.UI.Button({ id: 'tlbtn-inserttable', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-inserttable', caption: me.capInsertTable, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], menu: new Common.UI.Menu({ cls: 'shifted-left', items: [ {template: _.template('')}, {caption: me.mniCustomTable, value: 'custom'}, {caption: me.mniInsertSSE, value: 'sse'} ] }), action: 'insert-table', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnInsertTable); me.lockControls.push(me.btnInsertTable); me.btnInsertChart = new Common.UI.Button({ id: 'tlbtn-insertchart', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-insertchart', caption: me.capInsertChart, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], menu: true, action: 'insert-chart', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnInsertChart); me.lockControls.push(me.btnInsertChart); this.btnInsertSmartArt = new Common.UI.Button({ id: 'tlbtn-insertsmartart', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-smart-art', lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], caption: me.capBtnInsSmartArt, menu: true, action: 'insert-smartart', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(this.btnInsertSmartArt); me.lockControls.push(this.btnInsertSmartArt); me.btnInsertEquation = new Common.UI.Button({ id: 'tlbtn-insertequation', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-insertequation', caption: me.capInsertEquation, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.disableOnStart], split: true, menu: new Common.UI.Menu(), action: 'insert-equation', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(this.btnInsertEquation); me.lockControls.push(this.btnInsertEquation); me.btnInsertSymbol = new Common.UI.Button({ id: 'tlbtn-insertsymbol', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-symbol', caption: me.capBtnInsSymbol, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ {template: _.template('')}, {caption: '--'}, new Common.UI.MenuItem({ caption: this.textMoreSymbols }) ] }), action: 'insert-symbol', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.paragraphControls.push(me.btnInsertSymbol); me.lockControls.push(me.btnInsertSymbol); me.btnInsertHyperlink = new Common.UI.Button({ id: 'tlbtn-insertlink', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-big-inserthyperlink', caption: me.capInsertHyperlink, lock: [_set.hyperlinkLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.slideMasterMode], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.paragraphControls.push(me.btnInsertHyperlink); me.lockControls.push(me.btnInsertHyperlink); me.shortcutHints.InsertHyperlink = { btn: me.btnInsertHyperlink, label: me.tipInsertHyperlink }; me.btnInsertTextArt = new Common.UI.Button({ id: 'tlbtn-inserttextart', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-textart', caption: me.capInsertTextArt, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], menu: new Common.UI.Menu({ cls: 'menu-shapes', items: [ {template: _.template('')} ] }), action: 'insert-textart', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnInsertTextArt); me.lockControls.push(me.btnInsertTextArt); me.btnEditHeader = new Common.UI.Button({ id: 'id-toolbar-btn-editheader', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-editheader', caption: me.capBtnInsHeaderFooter, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnEditHeader); me.lockControls.push(me.btnEditHeader); me.btnInsDateTime = new Common.UI.Button({ id: 'id-toolbar-btn-datetime', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-datetime', caption: me.capBtnDateTime, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.paragraphLock, _set.disableOnStart], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnInsDateTime); me.lockControls.push(me.btnInsDateTime); me.btnInsSlideNum = new Common.UI.Button({ id: 'id-toolbar-btn-slidenum', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-pagenum', caption: me.capBtnSlideNum, lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.paragraphLock, _set.disableOnStart], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnInsSlideNum); me.lockControls.push(me.btnInsSlideNum); if (Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.isFeatureAvailable("IsSupportMedia") && Common.Controllers.Desktop.call("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.lockControls.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.lockControls.push(me.btnInsVideo); } me.btnColorSchemas = new Common.UI.Button({ id: 'id-toolbar-btn-colorschemas', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-big-colorschemas', lock: [_set.themeLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], caption: me.txtColors, menu: new Common.UI.Menu({ cls: 'shifted-left', items: [], restoreHeight: true }), action: 'theme-colors', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnColorSchemas); me.lockControls.push(me.btnColorSchemas); me.mniAlignToSlide = new Common.UI.MenuItem({ caption: me.txtSlideAlign, checkable: true, toggleGroup: 'slidealign', value: -1 }).on('click', function (mnu) { Common.Utils.InternalSettings.set("pe-align-to-slide", true); }); me.mniAlignObjects = new Common.UI.MenuItem({ caption: me.txtObjectsAlign, checkable: true, toggleGroup: 'slidealign', value: -1 }).on('click', function (mnu) { Common.Utils.InternalSettings.set("pe-align-to-slide", false); }); me.mniDistribHor = new Common.UI.MenuItem({ caption: me.txtDistribHor, iconCls: 'menu__icon btn-shape-distribute-hor', value: 6 }); me.mniDistribVert = new Common.UI.MenuItem({ caption: me.txtDistribVert, iconCls: 'menu__icon btn-shape-distribute-vert', value: 7 }); me.btnShapeAlign = new Common.UI.Button({ id: 'id-toolbar-btn-shape-align', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-shape-align-left', lock: [_set.slideDeleted, _set.shapeLock, _set.lostConnect, _set.noSlides, _set.noDrawingObjects, _set.disableOnStart], menu: new Common.UI.Menu({ cls: 'shifted-right', items: [ { caption: me.textShapeAlignLeft, iconCls: 'menu__icon btn-shape-align-left', value: Asc.c_oAscAlignShapeType.ALIGN_LEFT }, { caption: me.textShapeAlignCenter, iconCls: 'menu__icon btn-shape-align-center', value: Asc.c_oAscAlignShapeType.ALIGN_CENTER }, { caption: me.textShapeAlignRight, iconCls: 'menu__icon btn-shape-align-right', value: Asc.c_oAscAlignShapeType.ALIGN_RIGHT }, { caption: me.textShapeAlignTop, iconCls: 'menu__icon btn-shape-align-top', value: Asc.c_oAscAlignShapeType.ALIGN_TOP }, { caption: me.textShapeAlignMiddle, iconCls: 'menu__icon btn-shape-align-middle', value: Asc.c_oAscAlignShapeType.ALIGN_MIDDLE }, { caption: me.textShapeAlignBottom, iconCls: 'menu__icon btn-shape-align-bottom', value: Asc.c_oAscAlignShapeType.ALIGN_BOTTOM }, {caption: '--'}, me.mniDistribHor, me.mniDistribVert, {caption: '--'}, me.mniAlignToSlide, me.mniAlignObjects ] }), action: 'object-align', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -6' }); me.shapeControls.push(me.btnShapeAlign); me.slideOnlyControls.push(me.btnShapeAlign); me.lockControls.push(me.btnShapeAlign); me.btnShapeArrange = new Common.UI.Button({ id: 'id-toolbar-btn-shape-arrange', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-arrange-front', lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.noDrawingObjects, _set.disableOnStart], menu: new Common.UI.Menu({ items: [ me.mnuArrangeFront = new Common.UI.MenuItem({ caption: me.textArrangeFront, iconCls: 'menu__icon btn-arrange-front', value: 1 }), me.mnuArrangeBack = new Common.UI.MenuItem({ caption: me.textArrangeBack, iconCls: 'menu__icon btn-arrange-back', value: 2 }), me.mnuArrangeForward = new Common.UI.MenuItem({ caption: me.textArrangeForward, iconCls: 'menu__icon btn-arrange-forward', value: 3 }), me.mnuArrangeBackward = new Common.UI.MenuItem({ caption: me.textArrangeBackward, iconCls: 'menu__icon btn-arrange-backward', value: 4 }), {caption: '--'}, me.mnuGroupShapes = new Common.UI.MenuItem({ caption: me.txtGroup, iconCls: 'menu__icon btn-shape-group', value: 5 }), me.mnuUnGroupShapes = new Common.UI.MenuItem({ caption: me.txtUngroup, iconCls: 'menu__icon btn-shape-ungroup', value: 6 }) ] }), action: 'object-arrange', dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -6' }); me.slideOnlyControls.push(me.btnShapeArrange); me.lockControls.push(me.btnShapeArrange); me.btnShapesMerge = new Common.UI.Button({ id: 'id-toolbar-btn-merge-shapes', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-combine-shapes', lock: [_set.slideDeleted, _set.shapeLock, _set.lostConnect, _set.noSlides, _set.noDrawingObjects, _set.disableOnStart, _set.cantMergeShape], menu: new Common.UI.Menu({ cls: 'shifted-right', items: [ { caption: me.textShapesUnion, iconCls: 'menu__icon btn-union-shapes', value: 'unite', }, { caption: me.textShapesCombine, iconCls: 'menu__icon btn-combine-shapes', value: 'exclude', }, { caption: me.textShapesFragment, iconCls: 'menu__icon btn-fragment-shapes', value: 'divide', }, { caption: me.textShapesIntersect, iconCls: 'menu__icon btn-intersect-shapes', value: 'intersect', }, { caption: me.textShapesSubstract, iconCls: 'menu__icon btn-substract-shapes', value: 'subtract', }, ] }), action: 'object-merge', dataHint: '1', dataHintDirection: 'top', dataHintOffset: '0, -6' }); me.shapeControls.push(me.btnShapesMerge); me.slideOnlyControls.push(me.btnShapesMerge); me.lockControls.push(me.btnShapesMerge); me.btnSlideSize = new Common.UI.Button({ id: 'id-toolbar-btn-slide-size', cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-slidesize', lock: [_set.docPropsLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart], caption: me.txtSlideSize, menu: new Common.UI.Menu({ items: [ { caption: me.mniSlideStandard, checkable: true, toggleGroup: 'slidesize', value: 0 }, { caption: me.mniSlideWide, checkable: true, toggleGroup: 'slidesize', value: 1 }, {caption: '--'}, { caption: me.mniSlideAdvanced, value: 'advanced' } ] }), action: 'slide-size', dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); me.slideOnlyControls.push(me.btnSlideSize); me.lockControls.push(me.btnSlideSize); me.listTheme = new Common.UI.ComboDataView({ cls: 'combo-styles', itemWidth: 88, enableKeyEvents: true, itemHeight: 40, style: 'min-width:123px;', lock: [_set.themeLock, _set.lostConnect, _set.noSlides], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '-16, -4', delayRenderTips: true, autoWidth: true, itemTemplate: _.template([ '