[DE][DE mobile] Support review changes for selection
This commit is contained in:
parent
302c220ccf
commit
0d1549e56f
|
@ -179,10 +179,10 @@ define([
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
isSelectedChangesLocked: function(changes, fromSelection) {
|
isSelectedChangesLocked: function(changes, isShow) {
|
||||||
if (!changes || changes.length<1) return true;
|
if (!changes || changes.length<1) return true;
|
||||||
|
|
||||||
if (!fromSelection)
|
if (isShow)
|
||||||
return changes[0].get('lock') || !changes[0].get('editable');
|
return changes[0].get('lock') || !changes[0].get('editable');
|
||||||
|
|
||||||
for (var i=0; i<changes.length; i++) {
|
for (var i=0; i<changes.length; i++) {
|
||||||
|
@ -193,13 +193,13 @@ define([
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiShowChange: function (sdkchange, fromSelection) {
|
onApiShowChange: function (sdkchange, isShow) {
|
||||||
var btnlock = true,
|
var btnlock = true,
|
||||||
changes;
|
changes;
|
||||||
if (this.appConfig.canReview && !this.appConfig.isReviewOnly) {
|
if (this.appConfig.canReview && !this.appConfig.isReviewOnly) {
|
||||||
if (sdkchange && sdkchange.length>0) {
|
if (sdkchange && sdkchange.length>0) {
|
||||||
changes = this.readSDKChange(sdkchange);
|
changes = this.readSDKChange(sdkchange);
|
||||||
btnlock = this.isSelectedChangesLocked(changes, fromSelection);
|
btnlock = this.isSelectedChangesLocked(changes, isShow);
|
||||||
}
|
}
|
||||||
if (this._state.lock !== btnlock) {
|
if (this._state.lock !== btnlock) {
|
||||||
this.view.btnAccept.setDisabled(btnlock);
|
this.view.btnAccept.setDisabled(btnlock);
|
||||||
|
@ -214,7 +214,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getPopover()) {
|
if (this.getPopover()) {
|
||||||
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0 && !fromSelection) { // show changes balloon only for current position, not selection
|
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0 && isShow) { // show changes balloon only for current position, not selection
|
||||||
var i = 0,
|
var i = 0,
|
||||||
posX = sdkchange[0].get_X(),
|
posX = sdkchange[0].get_X(),
|
||||||
posY = sdkchange[0].get_Y(),
|
posY = sdkchange[0].get_Y(),
|
||||||
|
|
|
@ -52,7 +52,7 @@ class InitReview extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeReview (data) {
|
onChangeReview (data, isShow) {
|
||||||
const storeReview = this.props.storeReview;
|
const storeReview = this.props.storeReview;
|
||||||
storeReview.changeArrReview(data);
|
storeReview.changeArrReview(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1895,6 +1895,16 @@ define([
|
||||||
me.fireEvent('editcomplete', me);
|
me.fireEvent('editcomplete', me);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onAcceptRejectChange: function(item, e) {
|
||||||
|
if (this.api) {
|
||||||
|
if (item.value == 'accept')
|
||||||
|
this.api.asc_AcceptChanges();
|
||||||
|
else if (item.value == 'reject')
|
||||||
|
this.api.asc_RejectChanges();
|
||||||
|
}
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
},
|
||||||
|
|
||||||
onPrintSelection: function(item){
|
onPrintSelection: function(item){
|
||||||
if (this.api){
|
if (this.api){
|
||||||
var printopt = new Asc.asc_CAdjustPrint();
|
var printopt = new Asc.asc_CAdjustPrint();
|
||||||
|
@ -2516,6 +2526,20 @@ define([
|
||||||
value : 'cut'
|
value : 'cut'
|
||||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||||
|
|
||||||
|
var menuImgAccept = new Common.UI.MenuItem({
|
||||||
|
caption : me.textAccept,
|
||||||
|
value : 'accept'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuImgReject = new Common.UI.MenuItem({
|
||||||
|
caption : me.textReject,
|
||||||
|
value : 'reject'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuImgReviewSeparator = new Common.UI.MenuItem({
|
||||||
|
caption : '--'
|
||||||
|
});
|
||||||
|
|
||||||
var menuImgPrint = new Common.UI.MenuItem({
|
var menuImgPrint = new Common.UI.MenuItem({
|
||||||
iconCls: 'menu__icon btn-print',
|
iconCls: 'menu__icon btn-print',
|
||||||
caption : me.txtPrintSelection
|
caption : me.txtPrintSelection
|
||||||
|
@ -2745,6 +2769,11 @@ define([
|
||||||
menuImgPrint.setVisible(me.mode.canPrint);
|
menuImgPrint.setVisible(me.mode.canPrint);
|
||||||
menuImgPrint.setDisabled(!cancopy);
|
menuImgPrint.setDisabled(!cancopy);
|
||||||
|
|
||||||
|
var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock");
|
||||||
|
menuImgAccept.setVisible(!lockreview);
|
||||||
|
menuImgReject.setVisible(!lockreview);
|
||||||
|
menuImgReviewSeparator.setVisible(!lockreview);
|
||||||
|
|
||||||
var signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
var signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
||||||
isInSign = !!signGuid;
|
isInSign = !!signGuid;
|
||||||
menuSignatureEditSign.setVisible(isInSign);
|
menuSignatureEditSign.setVisible(isInSign);
|
||||||
|
@ -2767,6 +2796,9 @@ define([
|
||||||
menuImgPaste,
|
menuImgPaste,
|
||||||
menuImgPrint,
|
menuImgPrint,
|
||||||
{ caption: '--' },
|
{ caption: '--' },
|
||||||
|
menuImgAccept,
|
||||||
|
menuImgReject,
|
||||||
|
menuImgReviewSeparator,
|
||||||
menuSignatureEditSign,
|
menuSignatureEditSign,
|
||||||
menuSignatureEditSetup,
|
menuSignatureEditSetup,
|
||||||
menuEditSignSeparator,
|
menuEditSignSeparator,
|
||||||
|
@ -3081,6 +3113,20 @@ define([
|
||||||
value : 'cut'
|
value : 'cut'
|
||||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||||
|
|
||||||
|
var menuTableAccept = new Common.UI.MenuItem({
|
||||||
|
caption : me.textAccept,
|
||||||
|
value : 'accept'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuTableReject = new Common.UI.MenuItem({
|
||||||
|
caption : me.textReject,
|
||||||
|
value : 'reject'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuTableReviewSeparator = new Common.UI.MenuItem({
|
||||||
|
caption : '--'
|
||||||
|
});
|
||||||
|
|
||||||
var menuTablePrint = new Common.UI.MenuItem({
|
var menuTablePrint = new Common.UI.MenuItem({
|
||||||
iconCls: 'menu__icon btn-print',
|
iconCls: 'menu__icon btn-print',
|
||||||
caption : me.txtPrintSelection
|
caption : me.txtPrintSelection
|
||||||
|
@ -3787,6 +3833,20 @@ define([
|
||||||
value : 'cut'
|
value : 'cut'
|
||||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||||
|
|
||||||
|
var menuParaAccept = new Common.UI.MenuItem({
|
||||||
|
caption : me.textAccept,
|
||||||
|
value : 'accept'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuParaReject = new Common.UI.MenuItem({
|
||||||
|
caption : me.textReject,
|
||||||
|
value : 'reject'
|
||||||
|
}).on('click', _.bind(me.onAcceptRejectChange, me));
|
||||||
|
|
||||||
|
var menuParaReviewSeparator = new Common.UI.MenuItem({
|
||||||
|
caption : '--'
|
||||||
|
});
|
||||||
|
|
||||||
var menuParaPrint = new Common.UI.MenuItem({
|
var menuParaPrint = new Common.UI.MenuItem({
|
||||||
iconCls: 'menu__icon btn-print',
|
iconCls: 'menu__icon btn-print',
|
||||||
caption : me.txtPrintSelection
|
caption : me.txtPrintSelection
|
||||||
|
@ -3985,6 +4045,11 @@ define([
|
||||||
menuParaPrint.setVisible(me.mode.canPrint);
|
menuParaPrint.setVisible(me.mode.canPrint);
|
||||||
menuParaPrint.setDisabled(!cancopy);
|
menuParaPrint.setDisabled(!cancopy);
|
||||||
|
|
||||||
|
var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock");
|
||||||
|
menuParaAccept.setVisible(!lockreview);
|
||||||
|
menuParaReject.setVisible(!lockreview);
|
||||||
|
menuParaReviewSeparator.setVisible(!lockreview);
|
||||||
|
|
||||||
// spellCheck
|
// spellCheck
|
||||||
var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
|
var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
|
||||||
me.menuSpellPara.setVisible(spell);
|
me.menuSpellPara.setVisible(spell);
|
||||||
|
@ -4011,9 +4076,9 @@ define([
|
||||||
//equation menu
|
//equation menu
|
||||||
var eqlen = 0;
|
var eqlen = 0;
|
||||||
if (isEquation) {
|
if (isEquation) {
|
||||||
eqlen = me.addEquationMenu(true, 15);
|
eqlen = me.addEquationMenu(true, 18);
|
||||||
} else
|
} else
|
||||||
me.clearEquationMenu(true, 15);
|
me.clearEquationMenu(true, 18);
|
||||||
menuEquationSeparator.setVisible(isEquation && eqlen>0);
|
menuEquationSeparator.setVisible(isEquation && eqlen>0);
|
||||||
menuEquationInsertCaption.setVisible(isEquation);
|
menuEquationInsertCaption.setVisible(isEquation);
|
||||||
menuEquationInsertCaptionSeparator.setVisible(isEquation);
|
menuEquationInsertCaptionSeparator.setVisible(isEquation);
|
||||||
|
@ -4098,6 +4163,9 @@ define([
|
||||||
menuParaCopy,
|
menuParaCopy,
|
||||||
menuParaPaste,
|
menuParaPaste,
|
||||||
menuParaPrint,
|
menuParaPrint,
|
||||||
|
menuParaReviewSeparator,
|
||||||
|
menuParaAccept,
|
||||||
|
menuParaReject,
|
||||||
menuEquationInsertCaptionSeparator,
|
menuEquationInsertCaptionSeparator,
|
||||||
menuEquationInsertCaption,
|
menuEquationInsertCaption,
|
||||||
{ caption: '--' },
|
{ caption: '--' },
|
||||||
|
@ -4743,7 +4811,9 @@ define([
|
||||||
txtRemoveWarning: 'Do you want to remove this signature?<br>It can\'t be undone.',
|
txtRemoveWarning: 'Do you want to remove this signature?<br>It can\'t be undone.',
|
||||||
notcriticalErrorTitle: 'Warning',
|
notcriticalErrorTitle: 'Warning',
|
||||||
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
|
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
|
||||||
textEditPoints: 'Edit Points'
|
textEditPoints: 'Edit Points',
|
||||||
|
textAccept: 'Accept Change',
|
||||||
|
textReject: 'Reject Change'
|
||||||
|
|
||||||
}, DE.Views.DocumentHolder || {}));
|
}, DE.Views.DocumentHolder || {}));
|
||||||
});
|
});
|
|
@ -1629,6 +1629,8 @@
|
||||||
"DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
|
"DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
|
||||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||||
|
"DE.Views.DocumentHolder.textAccept": "Accept Change",
|
||||||
|
"DE.Views.DocumentHolder.textReject": "Reject Change",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap",
|
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",
|
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",
|
||||||
|
|
|
@ -63,8 +63,8 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.isComments = false;
|
this.isComments = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onApiShowChange(sdkchange) {
|
onApiShowChange(sdkchange, isShow) {
|
||||||
this.inRevisionChange = sdkchange && sdkchange.length>0;
|
this.inRevisionChange = isShow && sdkchange && sdkchange.length>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// onMenuClosed() {
|
// onMenuClosed() {
|
||||||
|
|
Loading…
Reference in a new issue