[DE] Show review changes in view mode. Add collaboration tab in view mode (change display mode)
This commit is contained in:
parent
d2ef029e98
commit
b8dc7d4017
|
@ -115,7 +115,7 @@ define([
|
||||||
if (api) {
|
if (api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
if (this.appConfig.canReview) {
|
if (this.appConfig.canReview || this.appConfig.canViewReview) {
|
||||||
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.onApiShowChange, this));
|
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.onApiShowChange, this));
|
||||||
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
|
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ define([
|
||||||
|
|
||||||
this.getPopover().showReview(animate, lock, lockUser);
|
this.getPopover().showReview(animate, lock, lockUser);
|
||||||
|
|
||||||
if (!this.appConfig.isReviewOnly && this._state.lock !== lock) {
|
if (this.appConfig.canReview && !this.appConfig.isReviewOnly && this._state.lock !== lock) {
|
||||||
this.view.btnAccept.setDisabled(lock==true);
|
this.view.btnAccept.setDisabled(lock==true);
|
||||||
this.view.btnReject.setDisabled(lock==true);
|
this.view.btnReject.setDisabled(lock==true);
|
||||||
if (this.dlgChanges) {
|
if (this.dlgChanges) {
|
||||||
|
@ -207,7 +207,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
getPopover: function () {
|
getPopover: function () {
|
||||||
if (this.appConfig.canReview && _.isUndefined(this.popover)) {
|
if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) {
|
||||||
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
|
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
|
||||||
reviewStore : this.popoverChanges,
|
reviewStore : this.popoverChanges,
|
||||||
renderTo : this.sdkViewName
|
renderTo : this.sdkViewName
|
||||||
|
@ -408,7 +408,8 @@ define([
|
||||||
lockuser : item.get_LockUserId(),
|
lockuser : item.get_LockUserId(),
|
||||||
type : item.get_Type(),
|
type : item.get_Type(),
|
||||||
changedata : item,
|
changedata : item,
|
||||||
scope : me.view
|
scope : me.view,
|
||||||
|
hint : !me.appConfig.canReview
|
||||||
});
|
});
|
||||||
|
|
||||||
arr.push(change);
|
arr.push(change);
|
||||||
|
@ -561,13 +562,16 @@ define([
|
||||||
|
|
||||||
disableEditing: function(disable) {
|
disableEditing: function(disable) {
|
||||||
var app = this.getApplication();
|
var app = this.getApplication();
|
||||||
app.getController('RightMenu').getView('RightMenu').clearSelection();
|
|
||||||
app.getController('Toolbar').DisableToolbar(disable, false, true);
|
app.getController('Toolbar').DisableToolbar(disable, false, true);
|
||||||
app.getController('RightMenu').SetDisabled(disable, false);
|
|
||||||
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
|
||||||
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
app.getController('DocumentHolder').getView().SetDisabled(disable);
|
||||||
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
|
|
||||||
app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
|
if (this.appConfig.canReview) {
|
||||||
|
app.getController('RightMenu').getView('RightMenu').clearSelection();
|
||||||
|
app.getController('RightMenu').SetDisabled(disable, false);
|
||||||
|
app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
|
||||||
|
app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
|
||||||
|
app.getController('Common.Controllers.Plugins').getView('Common.Views.Plugins').disableControls(disable);
|
||||||
|
}
|
||||||
|
|
||||||
var leftMenu = app.getController('LeftMenu').leftMenu;
|
var leftMenu = app.getController('LeftMenu').leftMenu;
|
||||||
leftMenu.btnComments.setDisabled(disable);
|
leftMenu.btnComments.setDisabled(disable);
|
||||||
|
@ -626,6 +630,8 @@ define([
|
||||||
me.dlgChanges.show(Math.max(10, offset.left + sdk.width() - 300), Math.max(10, offset.top + sdk.height() - 150));
|
me.dlgChanges.show(Math.max(10, offset.left + sdk.width() - 300), Math.max(10, offset.top + sdk.height() - 150));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
config.canViewReview && (config.canViewReview = me.api.asc_HaveRevisionsChanges());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.view && me.view.btnChat) {
|
if (me.view && me.view.btnChat) {
|
||||||
|
|
|
@ -62,6 +62,7 @@ define([
|
||||||
lockuser : '',
|
lockuser : '',
|
||||||
type : 0,
|
type : 0,
|
||||||
changedata : null,
|
changedata : null,
|
||||||
|
hint : false,
|
||||||
|
|
||||||
id : Common.UI.getId(), // internal
|
id : Common.UI.getId(), // internal
|
||||||
scope : null
|
scope : null
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=date%></div>
|
<div class="user-date"><%=date%></div>
|
||||||
<div class="user-message limit-height"><%=changetext%></div>
|
<div class="user-message limit-height"><%=changetext%></div>
|
||||||
|
<% if (!hint) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
<% if (scope.appConfig.isReviewOnly) { %>
|
<% if (scope.appConfig.isReviewOnly) { %>
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
|
@ -12,4 +13,5 @@
|
||||||
<div class="btn-reject img-commonctrl"></div>
|
<div class="btn-reject img-commonctrl"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
|
@ -126,11 +126,11 @@ define([
|
||||||
this.btnsTurnReview.forEach(function (button) {
|
this.btnsTurnReview.forEach(function (button) {
|
||||||
button.on('click', _click_turnpreview.bind(me));
|
button.on('click', _click_turnpreview.bind(me));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (this.appConfig.canViewReview)
|
||||||
this.btnReviewView.menu.on('item:click', function (menu, item, e) {
|
this.btnReviewView.menu.on('item:click', function (menu, item, e) {
|
||||||
me.fireEvent('reviewchanges:view', [menu, item]);
|
me.fireEvent('reviewchanges:view', [menu, item]);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
this.btnsSpelling.forEach(function(button) {
|
this.btnsSpelling.forEach(function(button) {
|
||||||
button.on('click', function (b, e) {
|
button.on('click', function (b, e) {
|
||||||
|
@ -206,7 +206,8 @@ define([
|
||||||
enableToggle: true
|
enableToggle: true
|
||||||
});
|
});
|
||||||
this.btnsTurnReview = [this.btnTurnOn];
|
this.btnsTurnReview = [this.btnTurnOn];
|
||||||
|
}
|
||||||
|
if (this.appConfig.canViewReview) {
|
||||||
this.btnReviewView = new Common.UI.Button({
|
this.btnReviewView = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-ic-reviewview',
|
iconCls: 'btn-ic-reviewview',
|
||||||
|
@ -223,7 +224,7 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.appConfig.isOffline && this.appConfig.canCoAuthoring) {
|
if (this.appConfig.isEdit && !this.appConfig.isOffline && this.appConfig.canCoAuthoring) {
|
||||||
this.btnCoAuthMode = new Common.UI.Button({
|
this.btnCoAuthMode = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-ic-coedit',
|
iconCls: 'btn-ic-coedit',
|
||||||
|
@ -311,6 +312,10 @@ define([
|
||||||
);
|
);
|
||||||
me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]);
|
me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]);
|
||||||
|
|
||||||
|
me.btnAccept.setDisabled(config.isReviewOnly);
|
||||||
|
me.btnReject.setDisabled(config.isReviewOnly);
|
||||||
|
}
|
||||||
|
if (me.appConfig.canViewReview) {
|
||||||
me.btnReviewView.setMenu(
|
me.btnReviewView.setMenu(
|
||||||
new Common.UI.Menu({
|
new Common.UI.Menu({
|
||||||
cls: 'ppm-toolbar',
|
cls: 'ppm-toolbar',
|
||||||
|
@ -345,11 +350,7 @@ define([
|
||||||
]
|
]
|
||||||
}));
|
}));
|
||||||
me.btnReviewView.updateHint(me.tipReviewView);
|
me.btnReviewView.updateHint(me.tipReviewView);
|
||||||
|
|
||||||
me.btnAccept.setDisabled(config.isReviewOnly);
|
|
||||||
me.btnReject.setDisabled(config.isReviewOnly);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
||||||
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
||||||
me.btnChat && me.btnChat.updateHint(me.txtChat + Common.Utils.String.platformKey('Alt+Q'));
|
me.btnChat && me.btnChat.updateHint(me.txtChat + Common.Utils.String.platformKey('Alt+Q'));
|
||||||
|
@ -392,7 +393,7 @@ define([
|
||||||
|
|
||||||
var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
|
var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
|
||||||
separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
|
separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
|
||||||
separator_review = !config.canReview ? me.$el.find('.separator.review') : '.separator.review',
|
separator_review = !(config.canReview || config.canViewReview) ? me.$el.find('.separator.review') : '.separator.review',
|
||||||
separator_chat = !me.btnChat ? me.$el.find('.separator.chat') : '.separator.chat',
|
separator_chat = !me.btnChat ? me.$el.find('.separator.chat') : '.separator.chat',
|
||||||
separator_last;
|
separator_last;
|
||||||
|
|
||||||
|
@ -419,7 +420,7 @@ define([
|
||||||
if (!me.btnHistory && separator_last)
|
if (!me.btnHistory && separator_last)
|
||||||
me.$el.find(separator_last).hide();
|
me.$el.find(separator_last).hide();
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('tab:visible', 'review', true);
|
Common.NotificationCenter.trigger('tab:visible', 'review', config.isEdit || config.canViewReview);
|
||||||
|
|
||||||
setEvents.call(me);
|
setEvents.call(me);
|
||||||
});
|
});
|
||||||
|
@ -434,8 +435,8 @@ define([
|
||||||
this.btnAccept.render(this.$el.find('#btn-change-accept'));
|
this.btnAccept.render(this.$el.find('#btn-change-accept'));
|
||||||
this.btnReject.render(this.$el.find('#btn-change-reject'));
|
this.btnReject.render(this.$el.find('#btn-change-reject'));
|
||||||
this.btnTurnOn.render(this.$el.find('#btn-review-on'));
|
this.btnTurnOn.render(this.$el.find('#btn-review-on'));
|
||||||
this.btnReviewView.render(this.$el.find('#btn-review-view'));
|
|
||||||
}
|
}
|
||||||
|
this.btnReviewView && this.btnReviewView.render(this.$el.find('#btn-review-view'));
|
||||||
|
|
||||||
this.btnSharing && this.btnSharing.render(this.$el.find('#slot-btn-sharing'));
|
this.btnSharing && this.btnSharing.render(this.$el.find('#slot-btn-sharing'));
|
||||||
this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
|
this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
|
||||||
|
|
|
@ -1105,6 +1105,7 @@ define([
|
||||||
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true
|
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true
|
||||||
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
||||||
this.appOptions.canReview = this.permissions.review === true && this.appOptions.canLicense && this.appOptions.isEdit;
|
this.appOptions.canReview = this.permissions.review === true && this.appOptions.canLicense && this.appOptions.isEdit;
|
||||||
|
this.appOptions.canViewReview = true;
|
||||||
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;
|
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;
|
||||||
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
|
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
|
||||||
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
|
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
|
||||||
|
@ -1210,21 +1211,19 @@ define([
|
||||||
this.contComments.setConfig({config: this.editorConfig}, this.api);
|
this.contComments.setConfig({config: this.editorConfig}, this.api);
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
if (this.appOptions.isEdit) {
|
var me = this,
|
||||||
var me = this,
|
application = this.getApplication(),
|
||||||
application = this.getApplication(),
|
reviewController = application.getController('Common.Controllers.ReviewChanges');
|
||||||
toolbarController = application.getController('Toolbar'),
|
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
rightmenuController = application.getController('RightMenu'),
|
|
||||||
fontsControllers = application.getController('Common.Controllers.Fonts'),
|
|
||||||
reviewController = application.getController('Common.Controllers.ReviewChanges');
|
|
||||||
|
|
||||||
|
if (this.appOptions.isEdit) {
|
||||||
|
var toolbarController = application.getController('Toolbar'),
|
||||||
|
rightmenuController = application.getController('RightMenu'),
|
||||||
|
fontsControllers = application.getController('Common.Controllers.Fonts');
|
||||||
fontsControllers && fontsControllers.setApi(me.api);
|
fontsControllers && fontsControllers.setApi(me.api);
|
||||||
toolbarController && toolbarController.setApi(me.api);
|
toolbarController && toolbarController.setApi(me.api);
|
||||||
|
|
||||||
rightmenuController && rightmenuController.setApi(me.api);
|
rightmenuController && rightmenuController.setApi(me.api);
|
||||||
|
|
||||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
|
||||||
|
|
||||||
if (this.appOptions.canProtect)
|
if (this.appOptions.canProtect)
|
||||||
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
|
|
|
@ -2718,7 +2718,7 @@ define([
|
||||||
|
|
||||||
toolbar._state.previewmode = reviewmode && disable;
|
toolbar._state.previewmode = reviewmode && disable;
|
||||||
if (reviewmode) {
|
if (reviewmode) {
|
||||||
toolbar._state.previewmode && toolbar.btnSave.setDisabled(true);
|
toolbar._state.previewmode && toolbar.btnSave && toolbar.btnSave.setDisabled(true);
|
||||||
|
|
||||||
if (toolbar.needShowSynchTip) {
|
if (toolbar.needShowSynchTip) {
|
||||||
toolbar.needShowSynchTip = false;
|
toolbar.needShowSynchTip = false;
|
||||||
|
@ -2768,15 +2768,14 @@ define([
|
||||||
|
|
||||||
me.toolbar.render(_.extend({isCompactView: compactview}, config));
|
me.toolbar.render(_.extend({isCompactView: compactview}, config));
|
||||||
|
|
||||||
|
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
||||||
|
var $panel = this.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||||
|
if ( $panel )
|
||||||
|
me.toolbar.addTab(tab, $panel, 4);
|
||||||
|
|
||||||
if ( config.isEdit ) {
|
if ( config.isEdit ) {
|
||||||
me.toolbar.setMode(config);
|
me.toolbar.setMode(config);
|
||||||
|
|
||||||
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
|
||||||
var $panel = this.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
|
||||||
|
|
||||||
if ( $panel )
|
|
||||||
me.toolbar.addTab(tab, $panel, 4);
|
|
||||||
|
|
||||||
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
|
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
|
||||||
if ( config.isDesktopApp ) {
|
if ( config.isDesktopApp ) {
|
||||||
// hide 'print' and 'save' buttons group and next separator
|
// hide 'print' and 'save' buttons group and next separator
|
||||||
|
|
Loading…
Reference in a new issue