diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 7efc10c76..11be3578f 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -433,6 +433,10 @@ define([ '' + '' + '' + + '
' + + '
' + + '' + + '
' + ''; function setEvents() { @@ -499,6 +503,10 @@ define([ this.btnCoAuthMode && this.btnCoAuthMode.menu.on('item:click', function (menu, item, e) { me.fireEvent('collaboration:coauthmode', [menu, item]); }); + + this.btnHistory && this.btnHistory.on('click', function (btn, e) { + Common.NotificationCenter.trigger('collaboration:history'); + }); } return { @@ -576,6 +584,14 @@ define([ this.btnsSpelling = []; this.btnsDocLang = []; + if (this.appConfig.canUseHistory && !this.appConfig.isDisconnected) { + this.btnHistory = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-ic-history', + caption: this.txtHistory + }); + } + Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -673,6 +689,8 @@ define([ me.btnSharing && me.btnSharing.updateHint(me.tipSharing); + me.btnHistory && me.btnHistory.updateHint(me.tipHistory); + if (me.btnCoAuthMode) { me.btnCoAuthMode.setMenu( new Common.UI.Menu({ @@ -722,6 +740,7 @@ define([ this.btnSharing && this.btnSharing.render(this.$el.find('#slot-btn-sharing')); this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode')); + this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history')); return this.$el; }, @@ -874,7 +893,9 @@ define([ txtCoAuthMode: 'Co-editing Mode', tipCoAuthMode: 'Set co-editing mode', strFast: 'Fast', - strStrict: 'Strict' + strStrict: 'Strict', + txtHistory: 'Version History', + tipHistory: 'Show version history' } }()), Common.Views.ReviewChanges || {})); diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index 5b02b5eff..6daee310b 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -275,6 +275,7 @@ .button-normal-icon(~'x-huge .btn-ic-docspell', 12, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-ic-review', 13, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size); +.button-normal-icon(~'x-huge .btn-ic-history', 30, @toolbar-big-icon-size); .button-normal-icon(review-save, 14, @toolbar-big-icon-size); .button-normal-icon(review-deny, 15, @toolbar-big-icon-size); .button-normal-icon(review-next, 16, @toolbar-big-icon-size); diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 31ecfc3e7..e84a6a95e 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -104,6 +104,10 @@ define([ Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this)); Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this)); + Common.NotificationCenter.on('collaboration:history', _.bind(function () { + if ( !this.leftMenu.panelHistory.isVisible() ) + this.clickMenuFileItem(null, 'history'); + }, this)); }, onLaunch: function() { @@ -267,7 +271,7 @@ define([ default: close_menu = false; } - if (close_menu) { + if (close_menu && menu) { menu.hide(); } }, diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index f15a493ba..75e4d9be1 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -219,6 +219,14 @@ "Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtView": "Display Mode", + "Common.Views.ReviewChanges.txtSharing": "Sharing", + "Common.Views.ReviewChanges.tipSharing": "Manage document access rights", + "Common.Views.ReviewChanges.txtCoAuthMode": "Co-editing Mode", + "Common.Views.ReviewChanges.tipCoAuthMode": "Set co-editing mode", + "Common.Views.ReviewChanges.strFast": "Fast", + "Common.Views.ReviewChanges.strStrict": "Strict", + "Common.Views.ReviewChanges.txtHistory": "Version History", + "Common.Views.ReviewChanges.tipHistory": "Show version history", "Common.Views.ReviewChangesDialog.textTitle": "Review Changes", "Common.Views.ReviewChangesDialog.txtAccept": "Accept", "Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",