Merge branch 'develop' into feature/sse-new-cell-settings

This commit is contained in:
Julia Radzhabova 2019-11-26 14:41:17 +03:00
commit c6f251a22a
17 changed files with 107 additions and 57 deletions

View file

@ -782,7 +782,14 @@
if (config.frameEditorId)
params += "&frameEditorId=" + config.frameEditorId;
if (config.editorConfig && config.editorConfig.mode == 'view' ||
config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review ))
params += "&mode=view";
if (config.editorConfig && config.editorConfig.customization && !!config.editorConfig.customization.compactHeader)
params += "&compact=true";
return params;
}

View file

@ -130,7 +130,8 @@ define([
in_header = false,
in_equation = false,
in_image = false,
in_table = false;
in_table = false,
frame_pr = null;
while (++i < selectedObjects.length) {
type = selectedObjects[i].get_ObjectType();
@ -138,6 +139,7 @@ define([
if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
paragraph_locked = pr.get_Locked();
frame_pr = pr;
} else if (type === Asc.c_oAscTypeSelectElement.Header) {
header_locked = pr.get_Locked();
in_header = true;
@ -154,12 +156,19 @@ define([
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
control_plain = (control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
var rich_del_lock = (frame_pr) ? !frame_pr.can_DeleteBlockContentControl() : true,
rich_edit_lock = (frame_pr) ? !frame_pr.can_EditBlockContentControl() : true,
plain_del_lock = (frame_pr) ? !frame_pr.can_DeleteInlineContentControl() : true,
plain_edit_lock = (frame_pr) ? !frame_pr.can_EditInlineContentControl() : true;
var need_disable = paragraph_locked || in_equation || in_image || in_header || control_plain;
var need_disable = paragraph_locked || in_equation || in_image || in_header || control_plain || rich_edit_lock || plain_edit_lock;
this.view.btnsNotes.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_header || control_plain;
this.view.btnBookmarks.setDisabled(need_disable);
need_disable = in_header || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock;
this.view.btnsContents.setDisabled(need_disable);
},
onApiCanAddHyperlink: function(value) {

View file

@ -382,8 +382,8 @@ define([
this.api.asc_registerCallback('asc_onChangeSdtGlobalSettings', _.bind(this.onChangeSdtGlobalSettings, this));
this.api.asc_registerCallback('asc_onTextLanguage', _.bind(this.onTextLanguage, this));
Common.NotificationCenter.on('fonts:change', _.bind(this.onApiChangeFont, this));
this.api.asc_registerCallback('asc_TableDrawModeCallback', _.bind(this.onTableDraw, this));
this.api.asc_registerCallback('asc_TableEraseModeCallback', _.bind(this.onTableErase, this));
this.api.asc_registerCallback('asc_onTableDrawModeChanged', _.bind(this.onTableDraw, this));
this.api.asc_registerCallback('asc_onTableEraseModeChanged', _.bind(this.onTableErase, this));
} else if (this.mode.isRestrictedEdit) {
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObjectRestrictedEdit, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
@ -739,7 +739,11 @@ define([
if (sh)
this.onParagraphColor(sh);
var need_disable = paragraph_locked || header_locked;
var rich_del_lock = (frame_pr) ? !frame_pr.can_DeleteBlockContentControl() : true,
rich_edit_lock = (frame_pr) ? !frame_pr.can_EditBlockContentControl() : true,
plain_del_lock = (frame_pr) ? !frame_pr.can_DeleteInlineContentControl() : true,
plain_edit_lock = (frame_pr) ? !frame_pr.can_EditInlineContentControl() : true;
var need_disable = paragraph_locked || header_locked || rich_edit_lock || plain_edit_lock;
if (this._state.prcontrolsdisable != need_disable) {
if (this._state.activated) this._state.prcontrolsdisable = need_disable;
@ -753,16 +757,18 @@ define([
lock_type = (in_control&&control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
control_plain = (in_control&&control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
if (!paragraph_locked && !header_locked) {
var control_disable = control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
toolbar.btnContentControls.setDisabled(paragraph_locked || header_locked);
if (!(paragraph_locked || header_locked)) {
var control_disable = control_plain || content_locked;
for (var i=0; i<7; i++)
toolbar.btnContentControls.menu.items[i].setDisabled(control_disable);
toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
toolbar.btnContentControls.menu.items[10].setDisabled(!in_control);
}
var need_text_disable = paragraph_locked || header_locked || in_chart;
var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock;
if (this._state.textonlycontrolsdisable != need_text_disable) {
if (this._state.activated) this._state.textonlycontrolsdisable = need_text_disable;
if (!need_disable) {
@ -770,7 +776,7 @@ define([
item.setDisabled(need_text_disable);
}, this);
}
toolbar.btnCopyStyle.setDisabled(need_text_disable);
// toolbar.btnCopyStyle.setDisabled(need_text_disable);
toolbar.btnClearStyle.setDisabled(need_text_disable);
}
@ -796,22 +802,22 @@ define([
if ( !toolbar.btnDropCap.isDisabled() )
toolbar.mnuDropCapAdvanced.setDisabled(disable_dropcapadv);
need_disable = !can_add_table || header_locked || in_equation || control_plain;
need_disable = !can_add_table || header_locked || in_equation || control_plain || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock;
toolbar.btnInsertTable.setDisabled(need_disable);
need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled() || control_plain;
toolbar.mnuInsertPageNum.setDisabled(need_disable);
var in_footnote = this.api.asc_IsCursorInFootnote();
need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || in_footnote || in_control;
need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || in_footnote || in_control || rich_edit_lock || plain_edit_lock || rich_del_lock;
toolbar.btnsPageBreak.setDisabled(need_disable);
toolbar.btnBlankPage.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_equation || control_plain;
need_disable = paragraph_locked || header_locked || in_equation || control_plain || content_locked;
toolbar.btnInsertShape.setDisabled(need_disable);
toolbar.btnInsertText.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_para && !can_add_image || in_equation || control_plain;
need_disable = paragraph_locked || header_locked || in_para && !can_add_image || in_equation || control_plain || rich_del_lock || plain_del_lock || content_locked;
toolbar.btnInsertImage.setDisabled(need_disable);
toolbar.btnInsertTextArt.setDisabled(need_disable || in_footnote);
@ -820,28 +826,28 @@ define([
this._state.in_chart = in_chart;
}
need_disable = in_chart && image_locked || !in_chart && need_disable || control_plain;
need_disable = in_chart && image_locked || !in_chart && need_disable || control_plain || rich_del_lock || plain_del_lock || content_locked;
toolbar.btnInsertChart.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation || control_plain;
need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation || control_plain || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock;
toolbar.btnInsertEquation.setDisabled(need_disable);
toolbar.btnInsertSymbol.setDisabled(!in_para || paragraph_locked || header_locked);
toolbar.btnInsertSymbol.setDisabled(!in_para || paragraph_locked || header_locked || rich_edit_lock || plain_edit_lock || rich_del_lock || plain_del_lock);
need_disable = paragraph_locked || header_locked || in_equation;
need_disable = paragraph_locked || header_locked || in_equation || rich_edit_lock || plain_edit_lock;
toolbar.btnSuperscript.setDisabled(need_disable);
toolbar.btnSubscript.setDisabled(need_disable);
toolbar.btnEditHeader.setDisabled(in_equation);
need_disable = paragraph_locked || header_locked || in_image || control_plain;
need_disable = paragraph_locked || header_locked || in_image || control_plain || rich_edit_lock || plain_edit_lock;
if (need_disable != toolbar.btnColumns.isDisabled())
toolbar.btnColumns.setDisabled(need_disable);
if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled())
toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined);
need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked;
need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked || rich_del_lock || rich_edit_lock || plain_del_lock || plain_edit_lock;
if (this.mode.compatibleFeatures) {
need_disable = need_disable || in_image;
}

View file

@ -105,10 +105,10 @@ define([
updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
},
createDelayedControls: function() {
@ -316,13 +316,13 @@ define([
value = props.get_Width();
if ( Math.abs(this._state.Width-value)>0.001 ) {
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Width = value;
}
value = props.get_Height();
if ( Math.abs(this._state.Height-value)>0.001 ) {
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Height = value;
}
@ -396,8 +396,8 @@ define([
var w = imgsize.get_ImageWidth();
var h = imgsize.get_ImageHeight();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(w);
@ -428,8 +428,8 @@ define([
h = pageh;
}
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(w);

View file

@ -704,7 +704,7 @@ define([
]
})
});
this.paragraphControls.push(this.btnContentControls);
// this.paragraphControls.push(this.btnContentControls);
this.btnColumns = new Common.UI.Button({
id: 'tlbtn-columns',
@ -1955,8 +1955,7 @@ define([
this.btnMailRecepients.setVisible(mode.canCoAuthoring == true && mode.canUseMailMerge);
this.listStylesAdditionalMenuItem.setVisible(mode.canEditStyles);
this.btnContentControls.menu.items[4].setVisible(mode.canEditContentControl);
this.btnContentControls.menu.items[5].setVisible(mode.canEditContentControl);
this.btnContentControls.menu.items[10].setVisible(mode.canEditContentControl);
this.mnuInsertImage.items[2].setVisible(this.mode.canRequestInsertImage || this.mode.fileChoiceUrl && this.mode.fileChoiceUrl.indexOf("{documentType}")>-1);
},

View file

@ -18,7 +18,7 @@
width: 100%;
overflow: hidden;
border: none;
background: #f1f1f1;
background: #e2e2e2;
z-index: 1001;
}
@ -101,10 +101,10 @@
.loadmask > .placeholder {
background: #fbfbfb;
width: 796px;
width: 794px;
margin: 46px auto;
height: 100%;
border: 1px solid #dfdfdf;
border: 1px solid #bebebe;
padding-top: 50px;
}
@ -223,10 +223,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -19,7 +19,7 @@
width: 100%;
overflow: hidden;
border: none;
background: #f1f1f1;
background: #e2e2e2;
z-index: 1001;
}
@ -102,10 +102,10 @@
.loadmask > .placeholder {
background: #fbfbfb;
width: 796px;
width: 794px;
margin: 46px auto;
height: 100%;
border: 1px solid #dfdfdf;
border: 1px solid #bebebe;
padding-top: 50px;
}
@ -209,11 +209,17 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}
if (stopLoading) {
document.body.removeChild(document.getElementById('loading-mask'));
} else {

View file

@ -152,10 +152,10 @@
.doc-placeholder {
background: #fbfbfb;
width: 796px;
margin: 40px auto;
width: 794px;
margin: 46px auto;
height: 100%;
border: 1px solid #dfdfdf;
border: 1px solid #bebebe;
padding-top: 50px;
position: absolute;
left: 0;
@ -164,11 +164,6 @@
bottom: 0;
z-index: 1;
-webkit-animation: flickerAnimation 2s infinite ease-in-out;
-moz-animation: flickerAnimation 2s infinite ease-in-out;
-o-animation: flickerAnimation 2s infinite ease-in-out;
animation: flickerAnimation 2s infinite ease-in-out;
> .line {
height: 15px;
margin: 30px 80px;

View file

@ -77,6 +77,10 @@ label {
display: none;
}
#editor-container {
background: #e2e2e2;
}
#editor_sdk {
width: 100%;
height: 100%;

View file

@ -171,7 +171,9 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Drawing/mobileTouchManager.js",
"../../../../sdkjs/word/apiCommon.js",
"../../../../sdkjs/common/apiBase.js",
"../../../../sdkjs/common/apiBase_plugins.js",
"../../../../sdkjs/word/api.js",
"../../../../sdkjs/word/api_plugins.js",
"../../../../sdkjs/word/document/empty.js",
"../../../../sdkjs/word/Editor/CollaborativeEditing.js",
"../../../../sdkjs/word/Math/mathTypes.js",

View file

@ -102,10 +102,10 @@ define([
updateMetricUnit: function() {
var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width);
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height);
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
},
createDelayedControls: function() {
@ -249,13 +249,13 @@ define([
var value = props.get_Width();
if ( Math.abs(this._state.Width-value)>0.001 ) {
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Width = value;
}
value = props.get_Height();
if ( Math.abs(this._state.Height-value)>0.001 ) {
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this._state.Height = value;
}
@ -291,8 +291,8 @@ define([
var w = imgsize.get_ImageWidth();
var h = imgsize.get_ImageHeight();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(w);

View file

@ -252,10 +252,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -258,10 +258,14 @@
<script>
var params = getUrlParams(),
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -151,6 +151,7 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/StructuredDocumentTags/SdtPrChanges.js",
"../../../../sdkjs/slide/apiCommon.js",
"../../../../sdkjs/common/apiBase.js",
"../../../../sdkjs/common/apiBase_plugins.js",
"../../../../sdkjs/slide/api.js",
"../../../../sdkjs/word/Editor/ParagraphContentBase.js",
"../../../../sdkjs/word/Editor/Hyperlink.js",

View file

@ -224,6 +224,7 @@
<script>
var params = getUrlParams(),
internal = params["internal"] == 'true',
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (internal) {
@ -231,8 +232,11 @@
document.querySelector('.sktoolbar').remove();
}
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -229,6 +229,7 @@
<script>
var params = getUrlParams(),
internal = params["internal"] == 'true',
compact = params["compact"] == 'true',
view = params["mode"] == 'view';
if (internal) {
@ -236,8 +237,11 @@
document.querySelector('.sktoolbar').remove();
}
if (view) {
if (compact || view) {
document.querySelector('.brendpanel > :nth-child(2)').remove();
document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px';
}
if (view) {
document.querySelector('.sktoolbar').remove();
}

View file

@ -20,6 +20,7 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/cell/view/HandlerList.js",
"../../../../sdkjs/cell/model/CollaborativeEditing.js",
"../../../../sdkjs/common/apiBase.js",
"../../../../sdkjs/common/apiBase_plugins.js",
"../../../../sdkjs/word/apiCommon.js",
"../../../../sdkjs/cell/api.js",
"../../../../sdkjs/common/downloaderfiles.js",