Merge branch 'develop' into feature/de-forms

This commit is contained in:
Julia Radzhabova 2022-04-13 15:02:12 +03:00
commit 9c0ebd29b5
7 changed files with 75 additions and 73 deletions
apps
documenteditor
main/app/controller
mobile/src/controller
presentationeditor
main/app/controller
mobile/src/controller
spreadsheeteditor
main/app/controller
mobile/src/controller

View file

@ -472,9 +472,7 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -1345,7 +1343,7 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (this._isDocReady)
this.applyLicense();
},
@ -1547,9 +1545,12 @@ define([
Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this));
Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this));
// change = true by default in editor, change = false by default in viewer
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
this.loadCoAuthSettings();
this.applyModeCommonElements();
@ -1597,13 +1598,11 @@ define([
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
} else {
value = Common.localStorage.getItem("de-settings-view-coauthmode");
if (value===null) {
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
}
value = Common.localStorage.getItem("de-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
}
fastCoauth = (parseInt(value) == 1);
} else {

View file

@ -724,21 +724,23 @@ define([
plain_del_lock = (frame_pr) ? !frame_pr.can_DeleteInlineContentControl() : false,
plain_edit_lock = (frame_pr) ? !frame_pr.can_EditInlineContentControl() : false;
this.toolbar.lockToolbar(Common.enumLock.cantAddQuotedComment, !this.api.can_AddQuotedComment(), {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.imageLock, image_locked, {array: this.btnsComment});
this.mode.compatibleFeatures && this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: this.btnsComment});
if (this.api.asc_IsContentControl()) {
var control_props = this.api.asc_GetContentControlProperties(),
spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
this.toolbar.lockToolbar(Common.enumLock.inSpecificForm, spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime, {array: this.btnsComment});
if (this.btnsComment) {
this.toolbar.lockToolbar(Common.enumLock.cantAddQuotedComment, !this.api.can_AddQuotedComment(), {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.imageLock, image_locked, {array: this.btnsComment});
this.mode.compatibleFeatures && this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: this.btnsComment});
if (this.api.asc_IsContentControl()) {
var control_props = this.api.asc_GetContentControlProperties(),
spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
this.toolbar.lockToolbar(Common.enumLock.inSpecificForm, spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime, {array: this.btnsComment});
}
this.toolbar.lockToolbar(Common.enumLock.paragraphLock, paragraph_locked, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.headerLock, header_locked, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.richEditLock, rich_edit_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.plainEditLock, plain_edit_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.richDelLock, rich_del_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.plainDelLock, plain_del_lock, {array: this.btnsComment});
}
this.toolbar.lockToolbar(Common.enumLock.paragraphLock, paragraph_locked, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.headerLock, header_locked, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.richEditLock, rich_edit_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.plainEditLock, plain_edit_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.richDelLock, rich_del_lock, {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.plainDelLock, plain_del_lock, {array: this.btnsComment});
},
onApiFocusObject: function(selectedObjects) {
@ -814,9 +816,9 @@ define([
this.toolbar.lockToolbar(Common.enumLock.richEditLock, rich_edit_lock, {array: this.toolbar.paragraphControls.concat([toolbar.btnClearStyle])});
this.toolbar.lockToolbar(Common.enumLock.plainEditLock, plain_edit_lock, {array: this.toolbar.paragraphControls.concat([toolbar.btnClearStyle])});
this.toolbar.lockToolbar(Common.enumLock.richDelLock, rich_del_lock, {array: this.btnsComment.concat(toolbar.btnsPageBreak).concat([toolbar.btnInsertTable, toolbar.btnInsertImage, toolbar.btnInsertChart, toolbar.btnInsertTextArt,
this.toolbar.lockToolbar(Common.enumLock.richDelLock, rich_del_lock, {array: toolbar.btnsPageBreak.concat(this.btnsComment).concat([toolbar.btnInsertTable, toolbar.btnInsertImage, toolbar.btnInsertChart, toolbar.btnInsertTextArt,
toolbar.btnInsDateTime, toolbar.btnBlankPage, toolbar.btnInsertEquation, toolbar.btnInsertSymbol ])});
this.toolbar.lockToolbar(Common.enumLock.plainDelLock, plain_del_lock, {array: this.btnsComment.concat(toolbar.btnsPageBreak).concat([toolbar.btnInsertTable, toolbar.btnInsertImage, toolbar.btnInsertChart, toolbar.btnInsertTextArt,
this.toolbar.lockToolbar(Common.enumLock.plainDelLock, plain_del_lock, {array: toolbar.btnsPageBreak.concat(this.btnsComment).concat([toolbar.btnInsertTable, toolbar.btnInsertImage, toolbar.btnInsertChart, toolbar.btnInsertTextArt,
toolbar.btnInsDateTime, toolbar.btnBlankPage, toolbar.btnInsertEquation, toolbar.btnInsertSymbol ])});
this.toolbar.lockToolbar(Common.enumLock.inChart, in_chart, {array: toolbar.textOnlyControls.concat([toolbar.btnClearStyle, toolbar.btnInsertEquation])});
@ -888,15 +890,17 @@ define([
if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled())
toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined);
// comments
this.toolbar.lockToolbar(Common.enumLock.cantAddQuotedComment, !this.api.can_AddQuotedComment(), {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.imageLock, image_locked, {array: this.btnsComment});
this.mode.compatibleFeatures && this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: this.btnsComment});
if (control_props) {
var spectype = control_props.get_SpecificType();
this.toolbar.lockToolbar(Common.enumLock.inSpecificForm, spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime,
{array: this.btnsComment});
if (this.btnsComment) {
// comments
this.toolbar.lockToolbar(Common.enumLock.cantAddQuotedComment, !this.api.can_AddQuotedComment(), {array: this.btnsComment});
this.toolbar.lockToolbar(Common.enumLock.imageLock, image_locked, {array: this.btnsComment});
this.mode.compatibleFeatures && this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: this.btnsComment});
if (control_props) {
var spectype = control_props.get_SpecificType();
this.toolbar.lockToolbar(Common.enumLock.inSpecificForm, spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime,
{array: this.btnsComment});
}
}
if (frame_pr) {
this._state.suppress_num = !!frame_pr.get_SuppressLineNumbers();
@ -3217,6 +3221,7 @@ define([
var me = this;
me.appOptions = config;
this.btnsComment = [];
if ( config.canCoAuthoring && config.canComments ) {
this.btnsComment = Common.Utils.injectButtons(this.toolbar.$el.find('.slot-comment'), 'tlbtn-addcomment-', 'toolbar__icon btn-menu-comments', this.toolbar.capBtnComment,
[ Common.enumLock.paragraphLock, Common.enumLock.headerLock, Common.enumLock.richEditLock, Common.enumLock.plainEditLock, Common.enumLock.richDelLock, Common.enumLock.plainDelLock,

View file

@ -133,8 +133,8 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
docInfo.put_CoEditingMode('strict'); // need to change!!!
let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false);
docInfo.asc_putIsEnabledMacroses(!!enable);

View file

@ -429,9 +429,7 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -966,7 +964,7 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (this._isDocReady)
this.applyLicense();
},
@ -1194,9 +1192,12 @@ define([
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
// change = true by default in editor, change = false by default in viewer
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
this.loadCoAuthSettings();
this.applyModeCommonElements();
@ -1239,13 +1240,11 @@ define([
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
} else {
value = Common.localStorage.getItem("pe-settings-view-coauthmode");
if (value===null) {
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
}
value = Common.localStorage.getItem("pe-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
}
fastCoauth = (parseInt(value) == 1);
} else {

View file

@ -124,8 +124,8 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
docInfo.put_CoEditingMode('strict'); // need to change!!!
let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false);
docInfo.asc_putIsEnabledMacroses(!!enable);

View file

@ -503,9 +503,7 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -1053,7 +1051,7 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (this._isDocReady)
this.applyLicense();
},
@ -1282,10 +1280,13 @@ define([
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
// change = true by default in editor, change = false by default in viewer
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring &&
!(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) {
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -1343,13 +1344,11 @@ define([
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
} else {
value = Common.localStorage.getItem("sse-settings-view-coauthmode");
if (value===null) {
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
}
value = Common.localStorage.getItem("sse-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
}
fastCoauth = (parseInt(value) == 1);
} else {

View file

@ -171,8 +171,8 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
docInfo.put_CoEditingMode('strict'); // need to change!!!
const appOptions = this.props.storeAppOptions;
let enable = !appOptions.customization || (appOptions.customization.macros !== false);