[DE] Add customization->reviewDisplay parameter (#188)
This commit is contained in:
parent
ca26ac977e
commit
3bfdd7ac32
|
@ -124,7 +124,8 @@
|
||||||
help: true,
|
help: true,
|
||||||
compactHeader: false,
|
compactHeader: false,
|
||||||
toolbarNoTabs: false,
|
toolbarNoTabs: false,
|
||||||
toolbarHideFileName: false
|
toolbarHideFileName: false,
|
||||||
|
reviewDisplay: 'original'
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
||||||
|
|
|
@ -671,7 +671,13 @@ define([
|
||||||
});
|
});
|
||||||
} else if (config.canViewReview) {
|
} else if (config.canViewReview) {
|
||||||
config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users
|
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) {
|
if (me.view && me.view.btnChat) {
|
||||||
|
|
|
@ -209,13 +209,49 @@ define([
|
||||||
caption: this.txtNext
|
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({
|
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',
|
||||||
caption: this.txtView,
|
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) {
|
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
|
||||||
|
@ -319,41 +355,7 @@ define([
|
||||||
me.btnPrev.updateHint(me.hintPrev);
|
me.btnPrev.updateHint(me.hintPrev);
|
||||||
me.btnNext.updateHint(me.hintNext);
|
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.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.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
||||||
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
||||||
|
|
Loading…
Reference in a new issue