Merge branch 'release/v7.1.0' of https://github.com/ONLYOFFICE/web-apps into release/v7.1.0
|
@ -66,17 +66,18 @@
|
|||
<div class="padding-small">
|
||||
<label class="header"><%= scope.textReplaceText %></label>
|
||||
</div>
|
||||
<div class="padding-large">
|
||||
<div class="padding-small">
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-quotes"></div>
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyphens"></div>
|
||||
<div id="id-autocorrect-dialog-chk-hyperlink"></div>
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyperlink"></div>
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-double-space"></div>
|
||||
</div>
|
||||
<div class="padding-small">
|
||||
<label class="header"><%= scope.textApplyText %></label>
|
||||
</div>
|
||||
<div class="padding-large">
|
||||
<div class="padding-small">
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-bulleted"></div>
|
||||
<div id="id-autocorrect-dialog-chk-numbered"></div>
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-numbered"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -85,14 +86,14 @@
|
|||
<div class="padding-small">
|
||||
<label class="header"><%= scope.textReplaceText %></label>
|
||||
</div>
|
||||
<div class="padding-large">
|
||||
<div id="id-autocorrect-dialog-chk-hyperlink"></div>
|
||||
<div class="padding-small">
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyperlink"></div>
|
||||
</div>
|
||||
<div class="padding-small">
|
||||
<label class="header"><%= scope.textApplyAsWork %></label>
|
||||
</div>
|
||||
<div class="padding-large">
|
||||
<div id="id-autocorrect-dialog-chk-new-rows"></div>
|
||||
<div class="padding-small">
|
||||
<div class="padding-small" id="id-autocorrect-dialog-chk-new-rows"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -101,7 +102,7 @@
|
|||
<div class="padding-small">
|
||||
<div id="id-autocorrect-dialog-chk-fl-sentence"></div>
|
||||
</div>
|
||||
<div class="padding-large">
|
||||
<div class="padding-small">
|
||||
<div id="id-autocorrect-dialog-chk-fl-cells"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -325,6 +325,17 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||
me.api.asc_SetAutomaticNumberedLists(checked);
|
||||
});
|
||||
this.chDoubleSpaces = new Common.UI.CheckBox({
|
||||
el: panelAutoFormat.find('#id-autocorrect-dialog-chk-double-space'),
|
||||
labelText: this.textDoubleSpaces,
|
||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-double-space")
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
var checked = (field.getValue()==='checked');
|
||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-double-space", checked);
|
||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-double-space", checked);
|
||||
me.api.asc_SetAutoCorrectDoubleSpaceWithPeriod(checked);
|
||||
});
|
||||
this.chDoubleSpaces.setVisible(this.appPrefix=='de-');
|
||||
// AutoCorrect
|
||||
this.chFLSentence = new Common.UI.CheckBox({
|
||||
el: $window.find('#id-autocorrect-dialog-chk-fl-sentence'),
|
||||
|
@ -841,7 +852,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
|||
textAutoCorrect: 'AutoCorrect',
|
||||
textFLSentence: 'Capitalize first letter of sentences',
|
||||
textHyperlink: 'Internet and network paths with hyperlinks',
|
||||
textFLCells: 'Capitalize first letter of table cells'
|
||||
textFLCells: 'Capitalize first letter of table cells',
|
||||
textDoubleSpaces: 'Add period with double-space'
|
||||
|
||||
}, Common.Views.AutoCorrectDialog || {}))
|
||||
});
|
||||
|
|
|
@ -1464,7 +1464,7 @@ define([
|
|||
var type = /^(?:(djvu))$/.exec(this.document.fileType);
|
||||
this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||
this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
||||
this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType);
|
||||
this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType);
|
||||
this.appOptions.canDownloadForms = this.appOptions.canLicense && this.appOptions.canDownload;
|
||||
|
||||
this.appOptions.fileKey = this.document.key;
|
||||
|
@ -2663,6 +2663,10 @@ define([
|
|||
value = Common.localStorage.getBool("de-settings-autoformat-fl-cells", true);
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-fl-cells", value);
|
||||
me.api.asc_SetAutoCorrectFirstLetterOfCells(value);
|
||||
|
||||
value = Common.localStorage.getBool("de-settings-autoformat-double-space", Common.Utils.isMac); // add period with double-space in MacOs by default
|
||||
Common.Utils.InternalSettings.set("de-settings-autoformat-double-space", value);
|
||||
me.api.asc_SetAutoCorrectDoubleSpaceWithPeriod(value);
|
||||
},
|
||||
|
||||
showRenameUserDialog: function() {
|
||||
|
|
|
@ -119,6 +119,9 @@ define([
|
|||
} else {
|
||||
me.statusbar.$el.find('.el-edit, .el-review').hide();
|
||||
}
|
||||
if (cfg.canUseSelectHandTools) {
|
||||
me.statusbar.$el.find('.hide-select-tools').removeClass('hide-select-tools');
|
||||
}
|
||||
});
|
||||
|
||||
Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me));
|
||||
|
@ -131,6 +134,12 @@ define([
|
|||
resolve();
|
||||
})).then(function () {
|
||||
me.bindViewEvents(me.statusbar, me.events);
|
||||
if (config.canUseSelectHandTools) {
|
||||
me.statusbar.btnSelectTool.on('click', _.bind(me.onSelectTool, me, 'select'));
|
||||
me.statusbar.btnHandTool.on('click', _.bind(me.onSelectTool, me, 'hand'));
|
||||
me.statusbar.btnHandTool.toggle(true, true);
|
||||
me.api.asc_setViewerTargetType('hand');
|
||||
}
|
||||
|
||||
var statusbarIsHidden = Common.localStorage.getBool("de-hidden-status");
|
||||
if ( config.canReview && !statusbarIsHidden ) {
|
||||
|
@ -344,6 +353,12 @@ define([
|
|||
this.disconnectTip = null;
|
||||
},
|
||||
|
||||
onSelectTool: function (type, btn, e) {
|
||||
if (this.api) {
|
||||
this.api.asc_setViewerTargetType(type);
|
||||
}
|
||||
},
|
||||
|
||||
zoomText : 'Zoom {0}%',
|
||||
textHasChanges : 'New changes have been tracked',
|
||||
textTrackChanges: 'The document is opened with the Track Changes mode enabled',
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
<div class="separator short el-edit el-lang"></div>
|
||||
<div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div>
|
||||
<div class="separator short el-edit el-review"></div>
|
||||
<div class="separator short hide-select-tools"></div>
|
||||
<button id="btn-select-tool" type="button" class="btn small btn-toolbar hide-select-tools" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-select-tool"> </span></button>
|
||||
<button id="btn-hand-tool" type="button" class="btn small btn-toolbar hide-select-tools" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-hand-tool"> </span></button>
|
||||
<div class="separator short hide-select-tools"></div>
|
||||
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-ic-zoomtopage"> </span></button>
|
||||
<button id="btn-zoom-towidth" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-ic-zoomtowidth"> </span></button>
|
||||
<button id="btn-zoom-down" type="button" class="btn small btn-toolbar"><span class="icon toolbar__icon btn-zoomdown"> </span></button>
|
||||
|
|
|
@ -79,6 +79,11 @@ define([
|
|||
me.btnZoomDown.updateHint(me.tipZoomOut + Common.Utils.String.platformKey('Ctrl+-'));
|
||||
me.btnZoomUp.updateHint(me.tipZoomIn + Common.Utils.String.platformKey('Ctrl++'));
|
||||
|
||||
if (config.canUseSelectHandTools) {
|
||||
me.btnSelectTool.updateHint(me.tipSelectTool);
|
||||
me.btnHandTool.updateHint(me.tipHandTool);
|
||||
}
|
||||
|
||||
if (me.btnLanguage && me.btnLanguage.cmpEl) {
|
||||
me.btnLanguage.updateHint(me.tipSetLang);
|
||||
me.langMenu.on('item:click', _.bind(_clickLanguage, this));
|
||||
|
@ -179,6 +184,20 @@ define([
|
|||
textPageNumber: Common.Utils.String.format(this.pageIndexText, 1, 1)
|
||||
}));
|
||||
|
||||
this.btnSelectTool = new Common.UI.Button({
|
||||
hintAnchor: 'top',
|
||||
toggleGroup: 'select-tools',
|
||||
enableToggle: true,
|
||||
allowDepress: false
|
||||
});
|
||||
|
||||
this.btnHandTool = new Common.UI.Button({
|
||||
hintAnchor: 'top',
|
||||
toggleGroup: 'select-tools',
|
||||
enableToggle: true,
|
||||
allowDepress: false
|
||||
});
|
||||
|
||||
this.btnZoomToPage = new Common.UI.Button({
|
||||
hintAnchor: 'top',
|
||||
toggleGroup: 'status-zoom',
|
||||
|
@ -292,6 +311,11 @@ define([
|
|||
me.langMenu.prevTip = 'en';
|
||||
}
|
||||
|
||||
if (config.canUseSelectHandTools) {
|
||||
_btn_render(me.btnSelectTool, $('#btn-select-tool', me.$layout));
|
||||
_btn_render(me.btnHandTool, $('#btn-hand-tool', me.$layout));
|
||||
}
|
||||
|
||||
me.zoomMenu.render($('.cnt-zoom',me.$layout));
|
||||
me.zoomMenu.cmpEl.attr({tabindex: -1});
|
||||
|
||||
|
@ -394,7 +418,9 @@ define([
|
|||
tipSetLang : 'Set Text Language',
|
||||
txtPageNumInvalid : 'Page number invalid',
|
||||
textTrackChanges : 'Track Changes',
|
||||
textChangesPanel : 'Changes panel'
|
||||
textChangesPanel : 'Changes panel',
|
||||
tipSelectTool : 'Select tool',
|
||||
tipHandTool : 'Hand tool'
|
||||
}, DE.Views.Statusbar || {}));
|
||||
}
|
||||
);
|
|
@ -234,6 +234,7 @@
|
|||
"Common.Views.AutoCorrectDialog.warnReplace": "The autocorrect entry for %1 already exists. Do you want to replace it?",
|
||||
"Common.Views.AutoCorrectDialog.warnReset": "Any autocorrect you added will be removed and the changed ones will be restored to their original values. Do you want to continue?",
|
||||
"Common.Views.AutoCorrectDialog.warnRestore": "The autocorrect entry for %1 will be reset to its original value. Do you want to continue?",
|
||||
"Common.Views.AutoCorrectDialog.textDoubleSpaces": "Add period with double-space",
|
||||
"Common.Views.Chat.textSend": "Send",
|
||||
"Common.Views.Comments.mniAuthorAsc": "Author A to Z",
|
||||
"Common.Views.Comments.mniAuthorDesc": "Author Z to A",
|
||||
|
@ -2383,6 +2384,8 @@
|
|||
"DE.Views.Statusbar.tipZoomIn": "Zoom in",
|
||||
"DE.Views.Statusbar.tipZoomOut": "Zoom out",
|
||||
"DE.Views.Statusbar.txtPageNumInvalid": "Page number invalid",
|
||||
"DE.Views.Statusbar.tipSelectTool": "Select tool",
|
||||
"DE.Views.Statusbar.tipHandTool": "Hand tool",
|
||||
"DE.Views.StyleTitleDialog.textHeader": "Create New Style",
|
||||
"DE.Views.StyleTitleDialog.textNextStyle": "Next paragraph style",
|
||||
"DE.Views.StyleTitleDialog.textTitle": "Title",
|
||||
|
|
After Width: | Height: | Size: 386 B |
After Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 449 B |
After Width: | Height: | Size: 350 B |
After Width: | Height: | Size: 298 B |
After Width: | Height: | Size: 677 B |
After Width: | Height: | Size: 557 B |
|
@ -164,4 +164,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hide-select-tools {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#btn-select-tool {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ class ContextMenu extends ContextMenuController {
|
|||
|
||||
initMenuItems() {
|
||||
if ( !Common.EditorApi ) return [];
|
||||
const { isEdit, canFillForms } = this.props;
|
||||
const { isEdit, canFillForms, isDisconnected } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -259,32 +259,34 @@ class ContextMenu extends ContextMenuController {
|
|||
});
|
||||
}
|
||||
|
||||
if ( canFillForms && canCopy && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'cut',
|
||||
icon: 'icon-cut'
|
||||
});
|
||||
}
|
||||
if(!isDisconnected) {
|
||||
if ( canFillForms && canCopy && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'cut',
|
||||
icon: 'icon-cut'
|
||||
});
|
||||
}
|
||||
|
||||
if ( canFillForms && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'paste',
|
||||
icon: 'icon-paste'
|
||||
});
|
||||
}
|
||||
if ( canFillForms && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'paste',
|
||||
icon: 'icon-paste'
|
||||
});
|
||||
}
|
||||
|
||||
if ( canViewComments && this.isComments ) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
if ( canViewComments && this.isComments ) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked && !(!isText && isObject)) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
if (api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked && !(!isText && isObject)) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ( isLink ) {
|
||||
|
|
|
@ -407,7 +407,8 @@ class MainController extends Component {
|
|||
onLicenseChanged (params) {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
||||
|
||||
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||
(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 && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
@ -558,6 +559,9 @@ class MainController extends Component {
|
|||
});
|
||||
|
||||
this.api.asc_registerCallback('asc_onShowContentControlsActions', (obj, x, y) => {
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
if (!storeAppOptions.isEdit && !(storeAppOptions.isRestrictedEdit && storeAppOptions.canFillForms) || this.props.users.isDisconnected) return;
|
||||
|
||||
switch (obj.type) {
|
||||
case Asc.c_oAscContentControlSpecificType.DateTime:
|
||||
this.onShowDateActions(obj, x, y);
|
||||
|
@ -705,19 +709,20 @@ class MainController extends Component {
|
|||
|
||||
onShowDateActions(obj, x, y) {
|
||||
const { t } = this.props;
|
||||
const boxSdk = $$('#editor_sdk');
|
||||
|
||||
let props = obj.pr,
|
||||
specProps = props.get_DateTimePr(),
|
||||
isPhone = Device.isPhone;
|
||||
isPhone = Device.isPhone,
|
||||
controlsContainer = boxSdk.find('#calendar-target-element'),
|
||||
_dateObj = props;
|
||||
|
||||
this.controlsContainer = this.boxSdk.find('#calendar-target-element');
|
||||
this._dateObj = props;
|
||||
|
||||
if (this.controlsContainer.length < 1) {
|
||||
this.controlsContainer = $$('<div id="calendar-target-element" style="position: absolute;"></div>');
|
||||
this.boxSdk.append(this.controlsContainer);
|
||||
if (controlsContainer.length < 1) {
|
||||
controlsContainer = $$('<div id="calendar-target-element" style="position: absolute;"></div>');
|
||||
boxSdk.append(controlsContainer);
|
||||
}
|
||||
|
||||
this.controlsContainer.css({left: `${x}px`, top: `${y}px`});
|
||||
controlsContainer.css({left: `${x}px`, top: `${y}px`});
|
||||
|
||||
this.cmpCalendar = f7.calendar.create({
|
||||
inputEl: '#calendar-target-element',
|
||||
|
@ -730,7 +735,7 @@ class MainController extends Component {
|
|||
on: {
|
||||
change: (calendar, value) => {
|
||||
if(calendar.initialized && value[0]) {
|
||||
let specProps = this._dateObj.get_DateTimePr();
|
||||
let specProps = _dateObj.get_DateTimePr();
|
||||
specProps.put_FullDate(new Date(value[0]));
|
||||
this.api.asc_SetContentControlDatePickerDate(specProps);
|
||||
calendar.close();
|
||||
|
@ -747,14 +752,15 @@ class MainController extends Component {
|
|||
|
||||
onShowListActions(obj, x, y) {
|
||||
if(!Device.isPhone) {
|
||||
this.dropdownListTarget = this.boxSdk.find('#dropdown-list-target');
|
||||
const boxSdk = $$('#editor_sdk');
|
||||
let dropdownListTarget = boxSdk.find('#dropdown-list-target');
|
||||
|
||||
if (this.dropdownListTarget.length < 1) {
|
||||
this.dropdownListTarget = $$('<div id="dropdown-list-target" style="position: absolute;"></div>');
|
||||
this.boxSdk.append(this.dropdownListTarget);
|
||||
if (dropdownListTarget.length < 1) {
|
||||
dropdownListTarget = $$('<div id="dropdown-list-target" style="position: absolute;"></div>');
|
||||
boxSdk.append(dropdownListTarget);
|
||||
}
|
||||
|
||||
this.dropdownListTarget.css({left: `${x}px`, top: `${y}px`});
|
||||
dropdownListTarget.css({left: `${x}px`, top: `${y}px`});
|
||||
}
|
||||
|
||||
Common.Notifications.trigger('openDropdownList', obj);
|
||||
|
|
|
@ -196,7 +196,7 @@ class ContextMenu extends ContextMenuController {
|
|||
initMenuItems() {
|
||||
if ( !Common.EditorApi ) return [];
|
||||
|
||||
const { isEdit } = this.props;
|
||||
const { isEdit, isDisconnected } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -253,18 +253,20 @@ class ContextMenu extends ContextMenuController {
|
|||
icon: 'icon-copy'
|
||||
});
|
||||
}
|
||||
if (canViewComments && this.isComments && !isEdit) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (!isChart && api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
if(!isDisconnected) {
|
||||
if (canViewComments && this.isComments && !isEdit) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (!isChart && api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isLink) {
|
||||
|
|
|
@ -489,7 +489,7 @@ class MainController extends Component {
|
|||
onLicenseChanged (params) {
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
||||
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||
(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 && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
|
|
@ -209,7 +209,7 @@ class ContextMenu extends ContextMenuController {
|
|||
const { t } = this.props;
|
||||
const _t = t("ContextMenu", { returnObjects: true });
|
||||
|
||||
const { isEdit } = this.props;
|
||||
const { isEdit, isDisconnected } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -249,18 +249,20 @@ class ContextMenu extends ContextMenuController {
|
|||
event: 'openlink'
|
||||
});
|
||||
}
|
||||
if (canViewComments && hasComments && hasComments.length>0) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
if(!isDisconnected) {
|
||||
if (canViewComments && hasComments && hasComments.length>0) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return itemsIcon.concat(itemsText);
|
||||
|
|
|
@ -426,11 +426,16 @@ class MainController extends Component {
|
|||
this.api.asc_registerCallback('asc_onActiveSheetChanged', this.onChangeProtectSheet.bind(this));
|
||||
|
||||
this.api.asc_registerCallback('asc_onRenameCellTextEnd', this.onRenameText.bind(this));
|
||||
|
||||
this.api.asc_registerCallback('asc_onEntriesListMenu', this.onEntriesListMenu.bind(this, false));
|
||||
this.api.asc_registerCallback('asc_onValidationListMenu', this.onEntriesListMenu.bind(this, true));
|
||||
}
|
||||
|
||||
onEntriesListMenu(validation, textArr, addArr) {
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
|
||||
if (!storeAppOptions.isEdit && !storeAppOptions.isRestrictedEdit || this.props.users.isDisconnected) return;
|
||||
|
||||
const { t } = this.props;
|
||||
const boxSdk = $$('#editor_sdk');
|
||||
|
||||
|
@ -606,7 +611,7 @@ class MainController extends Component {
|
|||
if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return;
|
||||
|
||||
const licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
||||
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||
(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 && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
|
|
@ -33,7 +33,7 @@ module.exports = function(grunt) {
|
|||
return !!string && !!iconv_lite ? iconv_lite.encode(string,encoding) : string;
|
||||
};
|
||||
|
||||
var jsreplacements = [
|
||||
global.jsreplacements = [
|
||||
{
|
||||
from: /\{\{SUPPORT_EMAIL\}\}/g,
|
||||
to: _encode(process.env.SUPPORT_EMAIL) || 'support@onlyoffice.com'
|
||||
|
@ -355,12 +355,12 @@ module.exports = function(grunt) {
|
|||
replacements: [{
|
||||
from: /\{\{PRODUCT_VERSION\}\}/g,
|
||||
to: packageFile.version
|
||||
}]
|
||||
}, ...global.jsreplacements]
|
||||
},
|
||||
prepareHelp: {
|
||||
src: ['<%= pkg.main.copy.help[0].dest %>/ru/**/*.htm*'],
|
||||
overwrite: true,
|
||||
replacements: []
|
||||
replacements: [...helpreplacements]
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -427,10 +427,10 @@ module.exports = function(grunt) {
|
|||
}
|
||||
});
|
||||
|
||||
var replace = grunt.config.get('replace');
|
||||
replace.writeVersion.replacements.push(...jsreplacements);
|
||||
replace.prepareHelp.replacements.push(...helpreplacements);
|
||||
grunt.config.set('replace', replace);
|
||||
// var replace = grunt.config.get('replace');
|
||||
// replace.writeVersion.replacements.push(...global.jsreplacements);
|
||||
// replace.prepareHelp.replacements.push(...helpreplacements);
|
||||
// grunt.config.set('replace', replace);
|
||||
});
|
||||
|
||||
grunt.registerTask('deploy-reporter', function(){
|
||||
|
|
|
@ -65,6 +65,17 @@ module.exports = (grunt) => {
|
|||
}
|
||||
},
|
||||
|
||||
replace: {
|
||||
varsEnviroment: {
|
||||
src: ['<%= pkg.forms.js.requirejs.options.out %>'],
|
||||
overwrite: true,
|
||||
replacements: [{
|
||||
from: /\{\{PRODUCT_VERSION\}\}/g,
|
||||
to: packageFile.version
|
||||
}, ...global.jsreplacements]
|
||||
},
|
||||
},
|
||||
|
||||
inline: {
|
||||
dist: {
|
||||
src: packageFile.forms.inline.src
|
||||
|
@ -76,5 +87,5 @@ module.exports = (grunt) => {
|
|||
|
||||
grunt.registerTask('deploy-app-forms', ['forms-app-init', 'clean:prebuild', /*'imagemin',*/ 'less',
|
||||
'requirejs', 'concat', 'copy', 'inline', /*'json-minify',*/
|
||||
/*'replace:writeVersion',*/ /*'replace:prepareHelp',*/ 'clean:postbuild']);
|
||||
'replace:varsEnviroment', /*'replace:prepareHelp',*/ 'clean:postbuild']);
|
||||
}
|