diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less
index a033d840c..83ffd0b6f 100644
--- a/apps/common/mobile/resources/less/common-ios.less
+++ b/apps/common/mobile/resources/less/common-ios.less
@@ -391,6 +391,10 @@
}
}
+ .content-block {
+ color: @blockTitleColor;
+ }
+
.dataview, #add-table, #add-shape, #add-slide, #add-chart {
&.page-content, .page-content {
background-color: @white;
diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less
index eeb8cdaa6..ad82957bc 100644
--- a/apps/common/mobile/resources/less/common.less
+++ b/apps/common/mobile/resources/less/common.less
@@ -84,6 +84,15 @@
}
}
+.about {
+ .content-block {
+ margin: 0 auto 15px;
+ a {
+ color: @black;
+ }
+ }
+}
+
.content-block {
margin: 32px 0;
padding: 0 16px;
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index c4854a275..d85eb309c 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -386,5 +386,14 @@
"textStartAt": "Start At",
"textLocation": "Location",
"textFormat": "Format"
+ },
+ "About": {
+ "textAbout": "About",
+ "textVersion": "Version",
+ "textEmail": "Email",
+ "textAddress": "Address",
+ "textTel": "Tel",
+ "textPoweredBy": "Powered By",
+ "textBack": "Back"
}
}
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx
index 564edf439..53d23e567 100644
--- a/apps/documenteditor/mobile/src/controller/Main.jsx
+++ b/apps/documenteditor/mobile/src/controller/Main.jsx
@@ -13,6 +13,8 @@ import {
ViewCommentsController
} from "../../../../common/mobile/lib/controller/collaboration/Comments";
+import patch from '../lib/patch'
+
@inject(
"storeAppOptions",
"storeDocumentSettings",
@@ -56,6 +58,7 @@ class MainController extends Component {
};
const loadConfig = data => {
+ patch.isSupportEditFeature();
console.log('load config');
this.editorConfig = Object.assign({}, this.editorConfig, data.config);
diff --git a/apps/documenteditor/mobile/src/lib/patch.jsx b/apps/documenteditor/mobile/src/lib/patch.jsx
new file mode 100644
index 000000000..89603acd7
--- /dev/null
+++ b/apps/documenteditor/mobile/src/lib/patch.jsx
@@ -0,0 +1,10 @@
+
+const patch = () => {
+ return null
+};
+
+patch.isSupportEditFeature = () => {
+ return false
+};
+
+export default patch;
diff --git a/apps/documenteditor/mobile/src/view/settings/Settings.jsx b/apps/documenteditor/mobile/src/view/settings/Settings.jsx
index a199d82e3..afe8b68e0 100644
--- a/apps/documenteditor/mobile/src/view/settings/Settings.jsx
+++ b/apps/documenteditor/mobile/src/view/settings/Settings.jsx
@@ -11,6 +11,7 @@ import { DownloadController } from "../../controller/settings/Download";
import ApplicationSettingsController from "../../controller/settings/ApplicationSettings";
import { DocumentFormats, DocumentMargins, DocumentColorSchemes } from "./DocumentSettings";
import { MacrosSettings } from "./ApplicationSettings";
+import About from '../../../../../common/mobile/lib/view/About';
const routes = [
{
@@ -48,6 +49,10 @@ const routes = [
{
path: '/color-schemes/',
component: DocumentColorSchemes
+ },
+ {
+ path: '/about/',
+ component: About
}
];
@@ -151,7 +156,7 @@ const SettingsList = inject("storeAppOptions")( observer( withTranslation()( pro
}
{_canAbout &&
-
+
}
diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json
index 6d6abedc4..b90038922 100644
--- a/apps/presentationeditor/mobile/locale/en.json
+++ b/apps/presentationeditor/mobile/locale/en.json
@@ -303,5 +303,14 @@
"textEditComment": "Edit Comment",
"textEditReply": "Edit Reply"
}
+ },
+ "About": {
+ "textAbout": "About",
+ "textVersion": "Version",
+ "textEmail": "Email",
+ "textAddress": "Address",
+ "textTel": "Tel",
+ "textPoweredBy": "Powered By",
+ "textBack": "Back"
}
}
\ No newline at end of file
diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx
index 6e4c92d74..0db776dcc 100644
--- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx
+++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx
@@ -157,7 +157,7 @@ class ContextMenu extends ContextMenuController {
const { t } = this.props;
const _t = t("ContextMenu", { returnObjects: true });
- const { isEdit, canViewComments, canReview, isDisconnected } = this.props;
+ const { isEdit, canViewComments, isDisconnected } = this.props;
const api = Common.EditorApi.get();
const stack = api.getSelectedElements();
@@ -264,7 +264,7 @@ class ContextMenu extends ContextMenuController {
});
}
- var hideAddComment = (isText && isChart) || api.can_AddQuotedComment() === false || !canViewComments;
+ const hideAddComment = (isText && isChart) || api.can_AddQuotedComment() === false || !canViewComments;
if (!hideAddComment) {
itemsText.push({
caption: _t.menuAddComment,
diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx
index 8b75c19fa..0156bf227 100644
--- a/apps/presentationeditor/mobile/src/controller/Main.jsx
+++ b/apps/presentationeditor/mobile/src/controller/Main.jsx
@@ -15,6 +15,7 @@ import {
class MainController extends Component {
constructor(props) {
super(props)
+ window.editorType = 'pe';
}
initSdk() {
diff --git a/apps/presentationeditor/mobile/src/controller/settings/PresentationAbout.jsx b/apps/presentationeditor/mobile/src/controller/settings/PresentationAbout.jsx
deleted file mode 100644
index db46185db..000000000
--- a/apps/presentationeditor/mobile/src/controller/settings/PresentationAbout.jsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { Component } from "react";
-import PresentationAbout from "../../view/settings/PresentationAbout";
-
-class PresentationAboutController extends Component {
- constructor(props) {
- super(props);
- }
-
- render() {
- return (
-
- );
- }
-}
-
-
-export default PresentationAboutController;
\ No newline at end of file
diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js
index 166ea204f..c68baecff 100644
--- a/apps/presentationeditor/mobile/src/store/appOptions.js
+++ b/apps/presentationeditor/mobile/src/store/appOptions.js
@@ -4,12 +4,14 @@ export class storeAppOptions {
constructor() {
makeObservable(this, {
isEdit: observable,
+ canViewComments: observable,
setConfigOptions: action,
setPermissionOptions: action
});
}
isEdit = false;
+ canViewComments = false;
config = {};
setConfigOptions (config) {
diff --git a/apps/presentationeditor/mobile/src/view/settings/PresentationAbout.jsx b/apps/presentationeditor/mobile/src/view/settings/PresentationAbout.jsx
deleted file mode 100644
index 82a36a6d2..000000000
--- a/apps/presentationeditor/mobile/src/view/settings/PresentationAbout.jsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import React, { Fragment } from 'react';
-import { observer, inject } from "mobx-react";
-import { Page, Navbar, Link } from "framework7-react";
-import { useTranslation } from "react-i18next";
-
-const PagePresentationAbout = props => {
- const { t } = useTranslation();
- const _t = t("View.Settings", { returnObjects: true });
- const store = props.storeAppOptions;
- const isCanBranding = store.canBranding;
- const licInfo = isCanBranding ? store.customization : null;
- const customer = licInfo ? licInfo.customer : null;
- const nameCustomer = customer ? customer.name : null;
- const mailCustomer = customer ? customer.mail : null;
- const addressCustomer = customer ? customer.address : null;
- const urlCustomer = customer ? customer.www : null;
- const infoCustomer = customer ? customer.info : null;
- const logoCustomer = customer ? customer.logo : null;
-
- const publisherUrl = __PUBLISHER_URL__,
- publisherPrintUrl = publisherUrl.replace(/https?:\/{2}|\/$/,"");
- return (
-
-
-
- {licInfo && typeof licInfo == 'object' && typeof(customer)=='object' ? null : (
-
- )}
- {logoCustomer && logoCustomer.length ? (
-
-
-
- ) : null}
-
-
-
PRESENTATION EDITOR
- {_t.textVersion} {__PRODUCT_VERSION__}
-
-
-
- {nameCustomer && nameCustomer.length ? (
-
{nameCustomer}
- ) : null}
- {addressCustomer && addressCustomer.length ? (
-
-
- {addressCustomer}
-
- ) : null}
- {mailCustomer && mailCustomer.length ? (
-
-
- {mailCustomer}
-
- ) : null}
- {licInfo && typeof licInfo == 'object' && typeof(customer)=='object' ? null : (
-
-
- +371 633-99867
-
- )}
- {urlCustomer && urlCustomer.length ? (
-
-
- {urlCustomer}
-
-
- ) : null}
- {infoCustomer && infoCustomer.length ? (
-
-
-
- ) : null}
-
- {licInfo && typeof licInfo == 'object' && typeof(customer)=='object' ? (
-
-
-
-
-
-
Ascensio System SIA
-
- www.onlyoffice.com
-
-
- ) : null}
-
- );
-};
-
-const PresentationAbout = inject("storeAppOptions")(observer(PagePresentationAbout));
-
-export default PresentationAbout;
\ No newline at end of file
diff --git a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx
index 43deb4bdf..e3c671144 100644
--- a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx
+++ b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx
@@ -9,7 +9,8 @@ import DownloadController from "../../controller/settings/Download";
import PresentationInfoController from "../../controller/settings/PresentationInfo";
import PresentationSettingsController from "../../controller/settings/PresentationSettings";
import { PresentationColorSchemes } from "./PresentationSettings";
-import PresentationAboutController from '../../controller/settings/PresentationAbout';
+// import PresentationAboutController from '../../controller/settings/PresentationAbout';
+import About from '../../../../../common/mobile/lib/view/About';
const routes = [
{
@@ -42,7 +43,7 @@ const routes = [
},
{
path: '/about/',
- component: PresentationAboutController
+ component: About
}
/*{
path: '/presentation-settings/',
diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json
index 35c8b9ef6..e8781f41a 100644
--- a/apps/spreadsheeteditor/mobile/locale/en.json
+++ b/apps/spreadsheeteditor/mobile/locale/en.json
@@ -6,6 +6,29 @@
"textAnonymous": "Anonymous"
}
},
+ "ContextMenu": {
+ "menuViewComment": "View Comment",
+ "menuAddComment": "Add Comment",
+ "menuMore": "More",
+ "menuCancel": "Cancel",
+ "textCopyCutPasteActions": "Copy, Cut and Paste Actions",
+ "errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.",
+ "textDoNotShowAgain": "Don't show again",
+ "warnMergeLostData": "Operation can destroy data in the selected cells. Continue?",
+ "notcriticalErrorTitle": "Warning",
+ "menuAddLink": "Add Link",
+ "menuOpenLink": "Open Link",
+ "menuUnfreezePanes": "Unfreeze Panes",
+ "menuFreezePanes": "Freeze Panes",
+ "menuUnwrap": "Unwrap",
+ "menuWrap": "Wrap",
+ "menuUnmerge": "Unmerge",
+ "menuCell": "Cell",
+ "menuShow": "Show",
+ "menuHide": "Hide",
+ "menuEdit": "Edit",
+ "menuDelete": "Delete"
+ },
"View" : {
"Add" : {
"textChart": "Chart",
@@ -46,7 +69,8 @@
"textInsert": "Insert",
"textInvalidRange": "ERROR! Invalid cells range",
"textSortAndFilter": "Sort and Filter",
- "textFilter": "Filter"
+ "textFilter": "Filter",
+ "textComment": "Comment"
},
"Edit" : {
"textSelectObjectToEdit": "Select object to edit",
@@ -340,7 +364,30 @@
"textBack": "Back",
"textUsers": "Users",
"textEditUser": "Users who are editing the file:",
- "textComments": "Comments"
+ "textComments": "Comments",
+ "textAddComment": "Add Comment",
+ "textCancel": "Cancel",
+ "textDone": "Done",
+ "textNoComments": "This document doesn't contain comments",
+ "textEdit": "Edit",
+ "textResolve": "Resolve",
+ "textReopen": "Reopen",
+ "textAddReply": "Add Reply",
+ "textDeleteComment": "Delete Comment",
+ "textMessageDeleteComment": "Do you really want to delete this comment?",
+ "textMessageDeleteReply": "Do you really want to delete this reply?",
+ "textDeleteReply": "Delete Reply",
+ "textEditComment": "Edit Comment",
+ "textEditReply": "Edit Reply"
}
+ },
+ "About": {
+ "textAbout": "About",
+ "textVersion": "Version",
+ "textEmail": "Email",
+ "textAddress": "Address",
+ "textTel": "Tel",
+ "textPoweredBy": "Powered By",
+ "textBack": "Back"
}
}
diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx
new file mode 100644
index 000000000..39dad5fe2
--- /dev/null
+++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx
@@ -0,0 +1,385 @@
+import React, { useContext } from 'react';
+import { f7 } from 'framework7-react';
+import { inject, observer } from "mobx-react";
+import { withTranslation} from 'react-i18next';
+import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage';
+
+import ContextMenuController from '../../../../common/mobile/lib/controller/ContextMenu';
+import { idContextMenuElement } from '../../../../common/mobile/lib/view/ContextMenu';
+import { Device } from '../../../../common/mobile/utils/device';
+
+@inject ( stores => ({
+ isEdit: stores.storeAppOptions.isEdit,
+ canViewComments: stores.storeAppOptions.canViewComments,
+ users: stores.users,
+ isDisconnected: stores.users.isDisconnected,
+ storeSheets: stores.sheets
+}))
+class ContextMenu extends ContextMenuController {
+ constructor(props) {
+ super(props);
+
+ // console.log('context menu controller created');
+ this.onApiShowComment = this.onApiShowComment.bind(this);
+ this.onApiHideComment = this.onApiHideComment.bind(this);
+ this.getUserName = this.getUserName.bind(this);
+ }
+
+ static closeContextMenu() {
+ f7.popover.close(idContextMenuElement, false);
+ }
+
+ getUserName(id) {
+ const user = this.props.users.searchUserByCurrentId(id);
+ return Common.Utils.UserInfoParser.getParsedName(user.asc_getUserName());
+ }
+
+ componentWillUnmount() {
+ super.componentWillUnmount();
+
+ const api = Common.EditorApi.get();
+ api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
+ api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
+ }
+
+
+ onApiShowComment(comments) {
+ this.isComments = comments && comments.length > 0;
+ }
+
+ onApiHideComment() {
+ this.isComments = false;
+ }
+
+ // onMenuClosed() {
+ // super.onMenuClosed();
+ // }
+
+ onMenuItemClick(action) {
+ const { t } = this.props;
+ const _t = t("ContextMenu", { returnObjects: true });
+
+ super.onMenuItemClick(action);
+
+ const api = Common.EditorApi.get();
+ const info = api.asc_getCellInfo();
+ switch (action) {
+ case 'cut':
+ if (!api.asc_Cut() && !LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
+ this.showCopyCutPasteModal();
+ }
+ break;
+ case 'copy':
+ if (!api.asc_Copy() && !LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
+ this.showCopyCutPasteModal();
+ }
+ break;
+ case 'paste':
+ if (!api.asc_Paste() && !LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
+ this.showCopyCutPasteModal();
+ }
+ break;
+ case 'addcomment':
+ Common.Notifications.trigger('addcomment');
+ break;
+ case 'viewcomment':
+ Common.Notifications.trigger('viewcomment');
+ break;
+ case 'del':
+ api.asc_emptyCells(Asc.c_oAscCleanOptions.All);
+ break;
+ case 'wrap':
+ api.asc_setCellTextWrap(true);
+ break;
+ case 'unwrap':
+ api.asc_setCellTextWrap(false);
+ break;
+ case 'edit':
+ setTimeout(() => {
+ this.props.openOptions('edit');
+ }, 0);
+ break;
+ case 'merge':
+ if (api.asc_mergeCellsDataLost(Asc.c_oAscMergeOptions.Merge)) {
+ setTimeout(() => {
+ f7.dialog.confirm(_t.warnMergeLostData, _t.notcriticalErrorTitle, () => {
+ api.asc_mergeCells(Asc.c_oAscMergeOptions.Merge);
+ });
+ }, 0);
+ } else {
+ api.asc_mergeCells(Asc.c_oAscMergeOptions.Merge);
+ }
+ break;
+ case 'unmerge':
+ api.asc_mergeCells(Asc.c_oAscMergeOptions.None);
+ break;
+ case 'hide':
+ api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns']();
+ break;
+ case 'show':
+ api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_showRows' : 'asc_showColumns']();
+ break;
+ case 'addlink':
+ setTimeout(() => {
+ this.props.openOptions('add', 'link');
+ }, 400)
+ break;
+ case 'openlink':
+ const linkinfo = info.asc_getHyperlink();
+ if ( linkinfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink ) {
+ const nameSheet = linkinfo.asc_getSheet();
+ const curActiveSheet = api.asc_getActiveWorksheetIndex();
+ api.asc_setWorksheetRange(linkinfo);
+ const {storeSheets} = this.props;
+ const tab = storeSheets.sheets.find((sheet) => sheet.name === nameSheet);
+ if (tab) {
+ const sdkIndex = tab.index;
+ if (sdkIndex !== curActiveSheet) {
+ const index = storeSheets.sheets.indexOf(tab);
+ storeSheets.setActiveWorksheet(index);
+ Common.Notifications.trigger('sheet:active', sdkIndex);
+ }
+ }
+ } else {
+ const url = linkinfo.asc_getHyperlinkUrl().replace(/\s/g, "%20");
+ api.asc_getUrlType(url) > 0 && this.openLink(url);
+ }
+ break;
+ case 'freezePanes':
+ api.asc_freezePane();
+ break;
+ }
+
+ console.log("click context menu item: " + action);
+ }
+
+ showCopyCutPasteModal() {
+ const { t } = this.props;
+ const _t = t("ContextMenu", { returnObjects: true });
+ f7.dialog.create({
+ title: _t.textCopyCutPasteActions,
+ text: _t.errorCopyCutPaste,
+ content: `
+
+ ${_t.textDoNotShowAgain}
+
`,
+ buttons: [{
+ text: 'OK',
+ onClick: () => {
+ const dontShow = $$('input[name="checkbox-show"]').prop('checked');
+ if (dontShow) LocalStorage.setItem("de-hide-copy-cut-paste-warning", 1);
+ }
+ }]
+ }).open();
+ }
+
+ openLink(url) {
+ const newDocumentPage = window.open(url, '_blank');
+
+ if (newDocumentPage) {
+ newDocumentPage.focus();
+ }
+ }
+
+ onDocumentReady() {
+ super.onDocumentReady();
+
+ const api = Common.EditorApi.get();
+ api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
+ api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
+ }
+
+ initMenuItems() {
+ if ( !Common.EditorApi ) return [];
+
+ const { t } = this.props;
+ const _t = t("ContextMenu", { returnObjects: true });
+
+ const { isEdit, canViewComments, isDisconnected } = this.props;
+
+ const api = Common.EditorApi.get();
+ const cellinfo = api.asc_getCellInfo();
+
+ const itemsIcon = [];
+ const itemsText = [];
+
+ let iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu;
+ let iscelllocked = cellinfo.asc_getLocked();
+ const seltype = cellinfo.asc_getSelectionType();
+ const xfs = cellinfo.asc_getXfs();
+ const isComments = cellinfo.asc_getComments().length > 0; //prohibit adding multiple comments in one cell;
+
+ switch (seltype) {
+ case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeRow: isrowmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeCol: iscolmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeMax: isallmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeImage: isimagemenu = true; break;
+ case Asc.c_oAscSelectionType.RangeShape: isshapemenu = true; break;
+ case Asc.c_oAscSelectionType.RangeChart: ischartmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeChartText: istextchartmenu = true; break;
+ case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
+ }
+
+ if (!isEdit) {
+ if (iscellmenu || istextchartmenu || istextshapemenu) {
+ itemsIcon.push({
+ event: 'copy',
+ icon: 'icon-copy'
+ });
+ }
+ if (iscellmenu && cellinfo.asc_getHyperlink()) {
+ itemsText.push({
+ caption: _t.menuOpenLink,
+ event: 'openlink'
+ });
+ }
+ if (canViewComments && isComments) {
+ itemsText.push({
+ caption: _t.menuViewComment,
+ event: 'viewcomment'
+ });
+ }
+ } else {
+
+ if (!iscelllocked && (isimagemenu || isshapemenu || ischartmenu || istextshapemenu || istextchartmenu)) {
+ api.asc_getGraphicObjectProps().every((object) => {
+ if (object.asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
+ iscelllocked = object.asc_getObjectValue().asc_getLocked();
+ }
+ return !iscelllocked;
+ });
+ }
+
+ if (iscelllocked || api.isCellEdited) {
+ itemsIcon.push({
+ event: 'copy',
+ icon: 'icon-copy'
+ });
+
+ } else {
+ itemsIcon.push({
+ event: 'cut',
+ icon: 'icon-cut'
+ });
+ itemsIcon.push({
+ event: 'copy',
+ icon: 'icon-copy'
+ });
+ itemsIcon.push({
+ event: 'paste',
+ icon: 'icon-paste'
+ });
+ itemsText.push({
+ caption: _t.menuDelete,
+ event: 'del'
+ });
+
+ if (isimagemenu || isshapemenu || ischartmenu ||
+ istextshapemenu || istextchartmenu) {
+ itemsText.push({
+ caption: _t.menuEdit,
+ event: 'edit'
+ });
+ } else {
+ if (iscolmenu || isrowmenu) {
+ itemsText.push({
+ caption: _t.menuHide,
+ event: 'hide'
+ });
+ itemsText.push({
+ caption: _t.menuShow,
+ event: 'show'
+ });
+ } else if (iscellmenu) {
+ if (!iscelllocked) {
+ itemsText.push({
+ caption: _t.menuCell,
+ event: 'edit'
+ });
+ }
+
+ if (cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.None) {
+ itemsText.push({
+ caption: _t.menuMerge,
+ event: 'merge'
+ });
+ }
+
+ if (cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.Merge) {
+ itemsText.push({
+ caption: _t.menuUnmerge,
+ event: 'unmerge'
+ });
+ }
+
+ itemsText.push(
+ xfs.asc_getWrapText() ?
+ {
+ caption: _t.menuUnwrap,
+ event: 'unwrap'
+ } :
+ {
+ caption: _t.menuWrap,
+ event: 'wrap'
+ });
+
+ if (cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect()) {
+ itemsText.push({
+ caption: _t.menuOpenLink,
+ event: 'openlink'
+ });
+ } else if (!cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect() &&
+ !cellinfo.asc_getLockText() && !!cellinfo.asc_getText()) {
+ itemsText.push({
+ caption: _t.menuAddLink,
+ event: 'addlink'
+ });
+ }
+ }
+
+ itemsText.push({
+ caption: api.asc_getSheetViewSettings().asc_getIsFreezePane() ? _t.menuUnfreezePanes : _t.menuFreezePanes,
+ event: 'freezePanes'
+ });
+
+ }
+
+ if (canViewComments) {
+ if (isComments) {
+ itemsText.push({
+ caption: _t.menuViewComment,
+ event: 'viewcomment'
+ });
+ } else if (iscellmenu) {
+ itemsText.push({
+ caption: _t.menuAddComment,
+ event: 'addcomment'
+ });
+ }
+ }
+ }
+ }
+
+
+ if ( Device.phone && itemsText.length > 2 ) {
+ this.extraItems = itemsText.splice(2,itemsText.length, {
+ caption: _t.menuMore,
+ event: 'showActionSheet'
+ });
+ }
+
+ return itemsIcon.concat(itemsText);
+ }
+
+ initExtraItems () {
+ return (this.extraItems && this.extraItems.length > 0 ? this.extraItems : []);
+ }
+}
+
+const _ContextMenu = withTranslation()(ContextMenu);
+_ContextMenu.closeContextMenu = ContextMenu.closeContextMenu;
+export { _ContextMenu as default };
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
index 4f140b7b8..5a1a6e8cb 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
@@ -1,15 +1,22 @@
-import React, { Component } from 'react'
+import React, { Component, Fragment } from 'react'
import { inject } from "mobx-react";
import { f7 } from 'framework7-react';
import { withTranslation } from 'react-i18next';
import CollaborationController from '../../../../common/mobile/lib/controller/collaboration/Collaboration.jsx'
import { onAdvancedOptions } from './settings/Download.jsx';
+import {
+ AddCommentController,
+ CommentsController,
+ EditCommentController,
+ ViewCommentsController
+} from "../../../../common/mobile/lib/controller/collaboration/Comments";
@inject("storeAppOptions", "storeFocusObjects", "storeCellSettings", "storeTextSettings", "storeChartSettings", "storeSpreadsheetSettings", "storeSpreadsheetInfo")
class MainController extends Component {
constructor(props) {
- super(props)
+ super(props);
+ window.editorType = 'sse';
}
initSdk() {
@@ -318,7 +325,15 @@ class MainController extends Component {
}
render() {
- return
+ return (
+
+
+
+
+
+
+
+ )
}
componentDidMount() {
diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx
index 897d5b36c..6fdaae007 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx
@@ -16,13 +16,20 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
let isDisconnected = users.isDisconnected;
useEffect(() => {
- const on_api_created = api => {
+ const onDocumentReady = () => {
+ const api = Common.EditorApi.get();
api.asc_registerCallback('asc_onUpdateTabColor', onApiUpdateTabColor);
api.asc_registerCallback('asc_onWorkbookLocked', onWorkbookLocked);
api.asc_registerCallback('asc_onWorksheetLocked', onWorksheetLocked);
api.asc_registerCallback('asc_onSheetsChanged', onApiSheetsChanged);
api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu);
};
+ if ( !Common.EditorApi ) {
+ Common.Notifications.on('document:ready', onDocumentReady);
+ Common.Notifications.on('document:ready', onApiSheetsChanged);
+ } else {
+ onDocumentReady();
+ }
const on_main_view_click = e => {
if(!e.target.closest('.tab.active')) {
@@ -30,15 +37,13 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
}
};
- Common.Notifications.on('document:ready', onApiSheetsChanged);
- Common.Notifications.on('engineCreated', on_api_created);
-
$$('.view-main').on('click', on_main_view_click);
return () => {
+ Common.Notifications.off('document:ready', onDocumentReady);
Common.Notifications.off('document:ready', onApiSheetsChanged);
- Common.Notifications.off('engineCreated', on_api_created);
+ const api = Common.EditorApi.get();
api.asc_unregisterCallback('asc_onUpdateTabColor', onApiUpdateTabColor);
api.asc_unregisterCallback('asc_onWorkbookLocked', onWorkbookLocked);
api.asc_unregisterCallback('asc_onWorksheetLocked', onWorksheetLocked);
@@ -141,6 +146,8 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
api.asc_showWorksheet(model.index);
sheets.setActiveWorksheet(i);
+
+ Common.Notifications.trigger('sheet:active', model.index);
};
const createSheetName = () => {
diff --git a/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx b/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx
index 4e09ae1a0..85ffc2e93 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx
@@ -18,9 +18,18 @@ class AddOtherController extends Component {
}
}
+ hideAddComment () {
+ const cellinfo = Common.EditorApi.get().asc_getCellInfo();
+ const iscelllocked = cellinfo.asc_getLocked();
+ const seltype = cellinfo.asc_getSelectionType();
+ const isComments = cellinfo.asc_getComments().length > 0;
+ return (!(seltype === Asc.c_oAscSelectionType.RangeCells && !iscelllocked) || isComments);
+ }
+
render () {
return (
-
)
}
diff --git a/apps/spreadsheeteditor/mobile/src/less/app.less b/apps/spreadsheeteditor/mobile/src/less/app.less
index e0aacc6e6..b2dbf1c91 100644
--- a/apps/spreadsheeteditor/mobile/src/less/app.less
+++ b/apps/spreadsheeteditor/mobile/src/less/app.less
@@ -13,6 +13,7 @@
@import '../../../../common/mobile/resources/less/dataview.less';
@import '../../../../common/mobile/resources/less/search.less';
@import '../../../../common/mobile/resources/less/contextmenu.less';
+@import '../../../../common/mobile/resources/less/comments.less';
@import './app-material.less';
@import './app-ios.less';
@import './icons-ios.less';
diff --git a/apps/spreadsheeteditor/mobile/src/page/app.jsx b/apps/spreadsheeteditor/mobile/src/page/app.jsx
index 28fac09c7..b38f5c34a 100644
--- a/apps/spreadsheeteditor/mobile/src/page/app.jsx
+++ b/apps/spreadsheeteditor/mobile/src/page/app.jsx
@@ -34,9 +34,8 @@ export default class extends React.Component {
return (
{/* Your main view, should have "view-main" class */}
-
-
-
+
+
)
}
diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx
index d4c2f1515..2f7b3713d 100644
--- a/apps/spreadsheeteditor/mobile/src/page/main.jsx
+++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx
@@ -13,6 +13,7 @@ import { Search, SearchSettings } from '../controller/Search';
import { f7 } from 'framework7-react';
import {FunctionGroups} from "../controller/add/AddFunction";
+import ContextMenu from '../controller/ContextMenu';
export default class MainPage extends Component {
constructor(props) {
@@ -73,7 +74,7 @@ export default class MainPage extends Component {
this.handleClickToOpenOptions('edit')}>
this.handleClickToOpenOptions('add')}>
{ Device.phone ? null : }
- this.handleClickToOpenOptions('coauth')}>
+ this.handleClickToOpenOptions('coauth')}>
this.handleClickToOpenOptions('settings')}>
@@ -101,6 +102,7 @@ export default class MainPage extends Component {
{/* hidden component*/}
+
)
}
diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js
index ff2ddd65a..bb3f69a2d 100644
--- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js
+++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js
@@ -4,6 +4,7 @@ export class storeAppOptions {
constructor() {
makeObservable(this, {
isEdit: observable,
+ canViewComments: observable,
setConfigOptions: action,
setPermissionOptions: action
});
@@ -12,6 +13,9 @@ export class storeAppOptions {
isEdit = false;
config = {};
+ isEdit = false;
+ canViewComments = false;
+
setConfigOptions (config) {
this.config = config;
this.user = Common.Utils.fillUserInfo(config.user, config.lang, "Local.User"/*me.textAnonymous*/);
diff --git a/apps/spreadsheeteditor/mobile/src/store/mainStore.js b/apps/spreadsheeteditor/mobile/src/store/mainStore.js
index c5b523722..0190760f3 100644
--- a/apps/spreadsheeteditor/mobile/src/store/mainStore.js
+++ b/apps/spreadsheeteditor/mobile/src/store/mainStore.js
@@ -15,6 +15,7 @@ import {storeAppOptions} from "./appOptions";
// import {storeTableSettings} from "./tableSettings";
import {storeChartSettings} from "./chartSettings";
import {storeSpreadsheetSettings} from "./spreadsheetSettings";
+import {storeComments} from "../../../../common/mobile/lib/store/comments";
export const stores = {
storeFocusObjects: new storeFocusObjects(),
@@ -30,8 +31,9 @@ export const stores = {
storeShapeSettings: new storeShapeSettings(),
storeChartSettings: new storeChartSettings(),
storePalette: new storePalette(),
- storeCellSettings: new storeCellSettings()
+ storeCellSettings: new storeCellSettings(),
// storeImageSettings: new storeImageSettings(),
// storeTableSettings: new storeTableSettings()
+ storeComments: new storeComments()
};
diff --git a/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx b/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx
index 06727ee2a..0bd00a652 100644
--- a/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx
+++ b/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx
@@ -5,11 +5,18 @@ import { useTranslation } from 'react-i18next';
const AddOther = props => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
+ const hideAddComment = props.hideAddComment();
return (
+ {!hideAddComment && {
+ props.closeModal();
+ Common.Notifications.trigger('addcomment');
+ }}>
+
+ }
diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
index 938900eff..2d7a1fd5d 100644
--- a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
+++ b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx
@@ -9,7 +9,8 @@ import SpreadsheetInfoController from '../../controller/settings/SpreadsheetInfo
import {DownloadWithTranslation} from '../../controller/settings/Download.jsx';
import {SpreadsheetColorSchemes, SpreadsheetFormats, SpreadsheetMargins} from './SpreadsheetSettings.jsx';
import {MacrosSettings, RegionalSettings, FormulaLanguage} from './ApplicationSettings.jsx';
-import SpreadsheetAbout from './SpreadsheetAbout.jsx';
+// import SpreadsheetAbout from './SpreadsheetAbout.jsx';
+import About from '../../../../../common/mobile/lib/view/About';
const routes = [
{
@@ -57,8 +58,8 @@ const routes = [
component: SpreadsheetInfoController
},
{
- path: '/spreadsheet-about/',
- component: SpreadsheetAbout
+ path: '/about/',
+ component: About
}
];
@@ -137,7 +138,7 @@ const SettingsList = withTranslation()(props => {
-
+
diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js
index ae3ee3a13..ea3bc262f 100644
--- a/vendor/framework7-react/build/webpack.config.js
+++ b/vendor/framework7-react/build/webpack.config.js
@@ -7,6 +7,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
+const fs = require('fs')
const path = require('path');
@@ -18,6 +19,7 @@ const env = process.env.NODE_ENV || 'development';
const target = process.env.TARGET || 'web';
const editor = process.env.TARGET_EDITOR == 'cell' ? 'spreadsheeteditor' :
process.env.TARGET_EDITOR == 'slide' ? 'presentationeditor' : 'documenteditor';
+const targetPatch = process.env.TARGET_EDITOR || 'word';
module.exports = {
mode: env,
@@ -206,5 +208,10 @@ module.exports = {
},
],
}),
+ new webpack.NormalModuleReplacementPlugin(
+ /\.{2}\/lib\/patch/,
+ resource => fs.existsSync(`../../../web-apps-mobile/${targetPatch}/patch.jsx`) ?
+ resource.request = `../../../../../../web-apps-mobile/${targetPatch}/patch.jsx` : resource
+ ),
],
};
\ No newline at end of file
diff --git a/vendor/framework7-react/package.json b/vendor/framework7-react/package.json
index dff7d78ca..4f10dcfef 100644
--- a/vendor/framework7-react/package.json
+++ b/vendor/framework7-react/package.json
@@ -25,14 +25,14 @@
],
"dependencies": {
"dom7": "^3.0.0",
- "framework7": "^6.0.14",
+ "framework7": "^6.0.4",
"framework7-icons": "^3.0.1",
- "framework7-react": "^6.0.14",
+ "framework7-react": "^6.0.4",
"i18next": "^19.8.4",
"i18next-fetch-backend": "^3.0.0",
"prop-types": "^15.7.2",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
+ "react": "^17.0.1",
+ "react-dom": "^17.0.1",
"react-i18next": "^11.8.5",
"swiper": "^6.4.8",
"template7": "^1.4.2"
@@ -43,7 +43,7 @@
"@babel/plugin-proposal-decorators": "^7.12.12",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.12.10",
- "@babel/preset-env": "^7.13.12",
+ "@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/runtime": "^7.12.5",
"babel-loader": "^8.2.2",