1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 14× 1× 14× 14× 1× 1× 1× 1× 1× 1× 1× 388× 388× 388× 388× 105× 388× 12× 12× 376× 376× 1× 1× | /* istanbul ignore next */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); define(["require", "exports", "../ribbon-interfaces"], function (require, exports, ribbon_interfaces_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TRACKING_GROUP = '_tracking_group'; exports.TRACK_CHANGES_ID = '_track_changes'; exports.ACCEPT_ALL_ID = '_accept_all'; exports.REJECT_ALL_ID = '_reject_all'; var TrackingGroup = (function (_super) { __extends(TrackingGroup, _super); function TrackingGroup(container) { return _super.call(this, container) || this; } TrackingGroup.prototype.getGroupModel = function () { var locale = this.localObj; return { id: this.ribbonId + exports.TRACKING_GROUP, header: locale.getConstant('Tracking'), enableGroupOverflow: true, overflowHeader: locale.getConstant('Tracking'), collections: [{ items: [ { id: this.ribbonId + exports.TRACK_CHANGES_ID, type: 'Button', keyTip: 'G', buttonSettings: { content: locale.getConstant('TrackChanges'), iconCss: 'e-icons e-de-cnt-track', isToggle: true, clicked: this.trackChangesHandler.bind(this) }, ribbonTooltipSettings: { content: locale.getConstant('TrackChanges') } } ] }, { items: [ { id: this.ribbonId + exports.ACCEPT_ALL_ID, type: 'Button', keyTip: 'A2', buttonSettings: { content: locale.getConstant('Accept All'), iconCss: 'e-icons e-de-ctnr-changes-accept', isToggle: false, clicked: this.acceptAllHandler.bind(this) }, ribbonTooltipSettings: { content: locale.getConstant('Accept all changes in the document') } }, { id: this.ribbonId + exports.REJECT_ALL_ID, type: 'Button', keyTip: 'J', buttonSettings: { content: locale.getConstant('Reject All'), iconCss: 'e-icons e-de-ctnr-changes-reject', isToggle: false, clicked: this.rejectAllHandler.bind(this) }, ribbonTooltipSettings: { content: locale.getConstant('Reject all changes in the document') } } ] }] }; }; TrackingGroup.prototype.trackChangesHandler = function () { this.container.enableTrackChanges = !this.container.enableTrackChanges; }; TrackingGroup.prototype.acceptAllHandler = function () { this.documentEditor.revisions.acceptAll(); }; TrackingGroup.prototype.rejectAllHandler = function () { this.documentEditor.revisions.rejectAll(); }; TrackingGroup.prototype.updateSelection = function () { var isTrackingEnabled = this.container.enableTrackChanges && this.documentEditor.revisions.length > 0 && (!this.container.restrictEditing && !this.documentEditor.documentHelper.isDocumentProtected); var ribbon = this.container.ribbon.ribbon; var trackChangesElement = document.getElementById(this.ribbonId + exports.TRACK_CHANGES_ID); if (trackChangesElement) { trackChangesElement.classList.toggle('e-active', this.container.enableTrackChanges); } if (isTrackingEnabled) { ribbon.enableItem(this.ribbonId + exports.ACCEPT_ALL_ID); ribbon.enableItem(this.ribbonId + exports.REJECT_ALL_ID); } else { ribbon.disableItem(this.ribbonId + exports.ACCEPT_ALL_ID); ribbon.disableItem(this.ribbonId + exports.REJECT_ALL_ID); } }; return TrackingGroup; }(ribbon_interfaces_1.RibbonGroupBase)); exports.TrackingGroup = TrackingGroup; }); |