[DE] Add simple markup mode for display review changes

This commit is contained in:
Julia Radzhabova 2021-08-04 13:19:19 +03:00
parent 55ebf3b23f
commit 7dfb96f914
5 changed files with 51 additions and 30 deletions

View file

@ -155,7 +155,7 @@
compactHeader: false,
toolbarNoTabs: false,
toolbarHideFileName: false,
reviewDisplay: 'original',
reviewDisplay: 'original', // original for viewer, markup for editor
spellcheck: true,
compatibleFeatures: false,
unit: 'cm' // cm, pt, inch,

View file

@ -595,7 +595,10 @@ define([
onReviewViewClick: function(menu, item, e) {
this.turnDisplayMode(item.value);
!this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value);
if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit)
Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); // for viewer
else if (item.value=='markup' || item.value=='simple')
Common.localStorage.setItem(this.view.appPrefix + "review-mode-editor", item.value); // for editor save only markup modes
Common.NotificationCenter.trigger('edit:complete', this.view);
},
@ -690,7 +693,7 @@ define([
else if (mode === 'original')
this.api.asc_BeginViewModeInReview(false);
else
this.api.asc_EndViewModeInReview();
this.api.asc_EndViewModeInReview(mode=='simple');
}
this.disableEditing(mode == 'final' || mode == 'original');
this._state.previewMode = (mode == 'final' || mode == 'original');
@ -702,9 +705,9 @@ define([
this._state.previewMode = true;
},
onEndViewModeInReview: function() {
onEndViewModeInReview: function(mode) {
this.disableEditing(false);
this.view && this.view.turnDisplayMode('markup');
this.view && this.view.turnDisplayMode(mode ? 'simple' : 'markup');
this._state.previewMode = false;
},
@ -804,7 +807,11 @@ define([
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
// _setReviewStatus(state, global);
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor");
if (val===null)
val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'markup';
me.turnDisplayMode(val); // load display mode for all modes (viewer or editor)
me.view.turnDisplayMode(val);
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
@ -819,11 +826,11 @@ define([
} else if (config.canViewReview) {
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
if (config.canViewReview) {
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode");
var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "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.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer
me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val);
val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
me.turnDisplayMode(val);
me.view.turnDisplayMode(val);
}
}

View file

@ -298,6 +298,15 @@ define([
template: menuTemplate,
description: this.txtMarkup
},
{
caption: this.txtMarkupSimpleCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
value: 'simple',
template: menuTemplate,
description: this.txtMarkupSimple
},
{
caption: this.txtFinalCap,
checkable: true,
@ -750,8 +759,9 @@ define([
turnDisplayMode: function(mode) {
if (this.btnReviewView) {
this.btnReviewView.menu.items[0].setChecked(mode=='markup', true);
this.btnReviewView.menu.items[1].setChecked(mode=='final', true);
this.btnReviewView.menu.items[2].setChecked(mode=='original', true);
this.btnReviewView.menu.items[1].setChecked(mode=='simple', true);
this.btnReviewView.menu.items[2].setChecked(mode=='final', true);
this.btnReviewView.menu.items[3].setChecked(mode=='original', true);
}
},
@ -850,7 +860,9 @@ define([
txtOff: 'OFF for me',
textWarnTrackChangesTitle: 'Enable Track Changes for everyone?',
textWarnTrackChanges: 'Track Changes will be switched ON for all users with full access. The next time anyone opens the doc, Track Changes will remain enabled.',
textEnable: 'Enable'
textEnable: 'Enable',
txtMarkupSimpleCap: 'Simple Markup',
txtMarkupSimple: 'All changes (Editing)<br>Turn off pop-up windows with changes'
}
}()), Common.Views.ReviewChanges || {}));

View file

@ -22,24 +22,24 @@ class InitReview extends Component {
api.asc_SetTrackRevisions(appOptions.isReviewOnly || trackChanges===true || (trackChanges!==false) && LocalStorage.getBool("de-mobile-track-changes-" + (appOptions.fileKey || '')));
// Init display mode
if (!appOptions.canReview) {
const canViewReview = appOptions.isEdit || api.asc_HaveRevisionsChanges(true);
const canViewReview = appOptions.canReview || appOptions.isEdit || api.asc_HaveRevisionsChanges(true);
if (!appOptions.canReview)
appOptions.setCanViewReview(canViewReview);
if (canViewReview) {
let viewReviewMode = LocalStorage.getItem("de-view-review-mode");
if (viewReviewMode === null)
viewReviewMode = appOptions.customization && /^(original|final|markup)$/i.test(appOptions.customization.reviewDisplay) ? appOptions.customization.reviewDisplay.toLocaleLowerCase() : 'original';
viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? 'markup' : viewReviewMode;
const displayMode = viewReviewMode.toLocaleLowerCase();
if (displayMode === 'final') {
api.asc_BeginViewModeInReview(true);
} else if (displayMode === 'original') {
api.asc_BeginViewModeInReview(false);
} else {
api.asc_EndViewModeInReview();
}
props.storeReview.changeDisplayMode(displayMode);
if (canViewReview) {
let viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? null : LocalStorage.getItem("de-view-review-mode");
if (viewReviewMode === null)
viewReviewMode = appOptions.customization && /^(original|final|markup|simple)$/i.test(appOptions.customization.reviewDisplay) ? appOptions.customization.reviewDisplay.toLocaleLowerCase() : ( appOptions.isEdit || appOptions.isRestrictedEdit ? 'markup' : 'original');
let displayMode = viewReviewMode.toLocaleLowerCase();
if (displayMode === 'final') {
api.asc_BeginViewModeInReview(true);
} else if (displayMode === 'original') {
api.asc_BeginViewModeInReview(false);
} else {
(displayMode === 'simple') && (displayMode = 'markup');
api.asc_EndViewModeInReview();
}
props.storeReview.changeDisplayMode(displayMode);
}
});
}
@ -102,7 +102,7 @@ class Review extends Component {
} else {
api.asc_EndViewModeInReview();
}
!this.appConfig.canReview && LocalStorage.setItem("de-view-review-mode", mode);
!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit && LocalStorage.setItem("de-view-review-mode", mode);
this.props.storeReview.changeDisplayMode(mode);
}

View file

@ -398,6 +398,8 @@
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtMarkupSimpleCap": "Simple Markup",
"Common.Views.ReviewChanges.txtMarkupSimple": "All changes (Editing)<br>Turn off pop-up windows with changes",
"Common.Views.ReviewChangesDialog.textTitle": "Review Changes",
"Common.Views.ReviewChangesDialog.txtAccept": "Accept",
"Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",