Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE] Add customization->reviewDisplay parameter #188

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
help: true,
compactHeader: false,
toolbarNoTabs: false,
toolbarHideFileName: false
toolbarHideFileName: false,
reviewDisplay: 'original'
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
Expand Down
8 changes: 7 additions & 1 deletion apps/common/main/lib/controller/ReviewChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,13 @@ define([
});
} else if (config.canViewReview) {
config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users
config.canViewReview && me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : Common.localStorage.getItem(me.view.appPrefix + "review-mode") || 'original'); // load display mode only in viewer
if (config.canViewReview) {
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode");
if (val===null)
val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original';
me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); // load display mode only in viewer
me.view.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val);
}
}

if (me.view && me.view.btnChat) {
Expand Down
74 changes: 38 additions & 36 deletions apps/common/main/lib/view/ReviewChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,49 @@ define([
caption: this.txtNext
});

if (!this.appConfig.isRestrictedEdit) // hide Display mode option for fillForms and commenting mode
if (!this.appConfig.isRestrictedEdit) {// hide Display mode option for fillForms and commenting mode
var menuTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><%= caption %></div>' +
'<% if (options.description !== null) { %><label style="display: block;color: #a5a5a5;cursor: pointer;white-space: normal;"><%= options.description %></label>' +
'<% } %></a>');

this.btnReviewView = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-reviewview',
caption: this.txtView,
menu: true
menu: new Common.UI.Menu({
cls: 'ppm-toolbar',
items: [
{
caption: this.txtMarkupCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: true,
value: 'markup',
template: menuTemplate,
description: this.txtMarkup
},
{
caption: this.txtFinalCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: this.txtFinal,
value: 'final'
},
{
caption: this.txtOriginalCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: this.txtOriginal,
value: 'original'
}
]
})
});
}
}

if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
Expand Down Expand Up @@ -319,41 +355,7 @@ define([
me.btnPrev.updateHint(me.hintPrev);
me.btnNext.updateHint(me.hintNext);

me.btnReviewView && me.btnReviewView.setMenu(
new Common.UI.Menu({
cls: 'ppm-toolbar',
items: [
{
caption: me.txtMarkupCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: true,
value: 'markup',
template: menuTemplate,
description: me.txtMarkup
},
{
caption: me.txtFinalCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: me.txtFinal,
value: 'final'
},
{
caption: me.txtOriginalCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
template: menuTemplate,
description: me.txtOriginal,
value: 'original'
}
]
}));
me.btnReviewView && me.btnReviewView.updateHint(me.tipReviewView);
!me.appConfig.canReview && me.turnDisplayMode(Common.localStorage.getItem(me.appPrefix + "review-mode") || 'original');
}
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
Expand Down