diff --git a/apps/common/mobile/lib/controller/Collaboration.jsx b/apps/common/mobile/lib/controller/Collaboration.jsx
index 14ac7c170..a5fd1f57e 100644
--- a/apps/common/mobile/lib/controller/Collaboration.jsx
+++ b/apps/common/mobile/lib/controller/Collaboration.jsx
@@ -1,30 +1,35 @@
-import React, { useState } from 'react'
-import { resetUsers } from '../store/actions/actions.js'
+import React, { Component } from 'react'
import Notifications from '../../utils/notifications.js'
+import {observer, inject} from "mobx-react"
-const Collaboration = () => {
- const onChangeEditUsers = (users) => {
- const store = Common.Store.get();
- store.dispatch(resetUsers(Object.values(users)));
+
+@inject('users')
+class CollaborationController extends Component {
+ constructor(props){
+ super(props)
+
+ Common.Notifications.on('engineCreated', api => {
+ // this.api = api;
+ api.asc_registerCallback('asc_onAuthParticipantsChanged', this.onChangeEditUsers.bind(this));
+ api.asc_registerCallback('asc_onParticipantsChanged', this.onChangeEditUsers.bind(this));
+ // this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
+ // this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
+ // this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
+ // this.api.asc_registerCallback('asc_onRemoveComment', _.bind(this.onApiRemoveComment, this));
+ // this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onApiRemoveComments, this));
+ // this.api.asc_registerCallback('asc_onShowComment', _.bind(this.apiShowComments, this));
+ // this.api.asc_registerCallback('asc_onHideComment', _.bind(this.apiHideComments, this));
+ });
+ }
+
+ onChangeEditUsers(users) {
+ const storeUsers = this.props.users;
+ storeUsers.reset(users);
};
- Common.Notifications.on('engineCreated', api => {
- // this.api = api;
- api.asc_registerCallback('asc_onAuthParticipantsChanged', onChangeEditUsers);
- api.asc_registerCallback('asc_onParticipantsChanged', onChangeEditUsers);
- // this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
- // this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
- // this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
- // this.api.asc_registerCallback('asc_onRemoveComment', _.bind(this.onApiRemoveComment, this));
- // this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onApiRemoveComments, this));
- // this.api.asc_registerCallback('asc_onShowComment', _.bind(this.apiShowComments, this));
- // this.api.asc_registerCallback('asc_onHideComment', _.bind(this.apiHideComments, this));
- });
-
- return {
- setApi(api) {
- }
+ render() {
+ return null
}
};
-export {Collaboration as CollaborationController}
\ No newline at end of file
+export default CollaborationController;
\ No newline at end of file
diff --git a/apps/common/mobile/lib/store/actions/actions.js b/apps/common/mobile/lib/store/actions/actions.js
deleted file mode 100644
index 258592963..000000000
--- a/apps/common/mobile/lib/store/actions/actions.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export const RESET_USERS = 'RESET_USERS';
-
-export const resetUsers = list => {
- return {
- type: RESET_USERS,
- payload: list
- }
-};
diff --git a/apps/common/mobile/lib/store/users.js b/apps/common/mobile/lib/store/users.js
index 3f38e433b..a98f1e502 100644
--- a/apps/common/mobile/lib/store/users.js
+++ b/apps/common/mobile/lib/store/users.js
@@ -1,11 +1,10 @@
-import * as actionTypes from './actions/actions'
-const usersReducer = (state = [], action) => {
- if (action.type == actionTypes.RESET_USERS) {
- return [...action.payload];
+import {observable, action} from 'mobx';
+
+export class storeUsers {
+ @observable users = []
+
+ @action reset(users) {
+ this.users = Object.values(users)
}
-
- return state;
-};
-
-export default usersReducer
\ No newline at end of file
+}
diff --git a/apps/common/mobile/lib/view/Collaboration.jsx b/apps/common/mobile/lib/view/Collaboration.jsx
index 01dda0a47..f51a73f8a 100644
--- a/apps/common/mobile/lib/view/Collaboration.jsx
+++ b/apps/common/mobile/lib/view/Collaboration.jsx
@@ -1,24 +1,34 @@
-import React, { Component } from 'react';
-import { useSelector } from 'react-redux';
+import React, { Component, useEffect } from 'react';
+import { observer, inject } from "mobx-react";
import { Popover, List, ListItem, Navbar, NavTitle, NavRight } from 'framework7-react';
import { Sheet, Toolbar, BlockTitle, Link, Page, View, Icon } from 'framework7-react';
+import { f7 } from 'framework7-react';
import { withTranslation, useTranslation } from 'react-i18next';
-const PageUsers = () => {
- const { t } = useTranslation();
- const userlist = useSelector(state => state.users);
- return (
-
-
- {t("Collaboration.textEditUser")}
-
- {userlist.map((model, i) => (
-
-
-
- ))}
-
- )
+@inject('users')
+@observer
+class PageUsers extends Component {
+ constructor(props){
+ super(props)
+ }
+
+ render() {
+ const { t } = this.props;
+ const userlist = this.props.users;
+ return (
+
+
+ {t("Collaboration.textEditUser")}
+
+ {userlist.users.map((model, i) => (
+
+
+
+ ))}
+
+ )
+ }
};
const PageCollaboration = () => {
@@ -68,7 +78,7 @@ class CollaborationSheet extends Component {
}
render() {
return (
-
+ this.props.onclosed()}>
@@ -77,5 +87,25 @@ class CollaborationSheet extends Component {
}
}
+const CollaborationView = props => {
+ useEffect(() => {
+ f7.sheet.open('.coauth__sheet');
+
+ return () => {
+ // component will unmount
+ }
+ });
+
+ const onviewclosed = () => {
+ if ( props.onclosed ) props.onclosed();
+ };
+
+ return (
+
+ )
+};
+
+const pageusers = withTranslation()(PageUsers);
// export withTranslation()(CollaborationPopover);
-export {CollaborationPopover, CollaborationSheet, PageCollaboration, PageUsers, }
\ No newline at end of file
+export {CollaborationPopover, CollaborationSheet, PageCollaboration, pageusers as PageUsers}
+export default CollaborationView;
diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less
new file mode 100644
index 000000000..96836464b
--- /dev/null
+++ b/apps/common/mobile/resources/less/common-ios.less
@@ -0,0 +1,52 @@
+
+.device-ios {
+ .popover__titled {
+ .popover-inner {
+ //border-radius: var(--f7-popover-border-radius);
+
+ > .view {
+ border-radius: var(--f7-popover-border-radius);
+ }
+ }
+
+ .navbar-bg {
+ //-webkit-backdrop-filter: none;
+ backdrop-filter: none;
+ }
+
+ .list:first-child {
+ li:first-child {
+ a {
+ border-radius: 0;
+ }
+ }
+ }
+
+ .list:last-child {
+ li:last-child {
+ a {
+ border-radius: 0;
+ }
+
+ &:after {
+ content: '';
+ position: absolute;
+ background-color: var(--f7-navbar-border-color, var(--f7-bars-border-color));
+ display: block;
+ //z-index: 15;
+ top: auto;
+ right: auto;
+ bottom: 0;
+ left: 0;
+ height: 1px;
+ width: 100%;
+ transform-origin: 50% 100%;
+ transform: scaleY(calc(1 / var(--f7-device-pixel-ratio)));
+
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ }
+ }
+ }
+ }
+}
diff --git a/apps/common/mobile/resources/less/common-material.less b/apps/common/mobile/resources/less/common-material.less
new file mode 100644
index 000000000..7462e4a1e
--- /dev/null
+++ b/apps/common/mobile/resources/less/common-material.less
@@ -0,0 +1,12 @@
+
+.device-android {
+ .popover__titled {
+ .list:last-child {
+ li:last-child {
+ a {
+ border-radius: 0;
+ }
+ }
+ }
+ }
+}
diff --git a/apps/common/mobile/utils/device.jsx b/apps/common/mobile/utils/device.jsx
new file mode 100644
index 000000000..f156961a2
--- /dev/null
+++ b/apps/common/mobile/utils/device.jsx
@@ -0,0 +1,41 @@
+
+import React from 'react';
+import { f7 } from 'framework7-react';
+
+class Device {
+ constructor(){
+ const ua = navigator.userAgent,
+ isMobile = /Mobile(\/|\s|;)/.test(ua);
+
+ this.isPhone = /(iPhone|iPod)/.test(ua) ||
+ (!/(Silk)/.test(ua) && (/(Android)/.test(ua) && (/(Android 2)/.test(ua) || isMobile))) ||
+ (/(BlackBerry|BB)/.test(ua) && isMobile) ||
+ /(Windows Phone)/.test(ua);
+
+ this.isTablet = !this.isPhone && (/iPad/.test(ua) || /Android/.test(ua) || /(RIM Tablet OS)/.test(ua) ||
+ (/MSIE 10/.test(ua) && /; Touch/.test(ua)));
+ }
+
+ get phone() {
+ return this.isPhone
+ }
+
+ get tablet() {
+ return this.isTablet
+ }
+
+ get sailfish() {
+ return /Sailfish/.test(navigator.userAgent) || /Jolla/.test(navigator.userAgent);
+ }
+
+ get android() {
+ return f7.device.android;
+ }
+
+ get ios() {
+ return f7.device.ios;
+ }
+}
+
+const device = new Device();
+export {device as Device};
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index 8db7459d5..230df7b56 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -19,5 +19,40 @@
},
"Collaboration": {
"textEditUser": "Users who are editing the file:"
+ },
+ "Edit": {
+ "textClose": "Close",
+ "textBack": "Back",
+ "textText": "Text",
+ "textParagraph": "Paragraph",
+ "textTable": "Table",
+ "textFooter": "Footer",
+ "textHeader": "Header",
+ "textShape": "Shape",
+ "textImage": "Image",
+ "textChart": "Chart",
+ "textHyperlink": "Hyperlink",
+ "textSelectObjectToEdit": "Select object to edit",
+ "textSettings": "Settings",
+ "textFontColor": "Font Color",
+ "textHighlightColor": "Highlight Color",
+ "textAdditionalFormatting": "Additional Formatting",
+ "textAdditional": "Additional",
+ "textBullets": "Bullets",
+ "textNumbers": "Numbers",
+ "textLineSpacing": "Line Spacing",
+ "textFonts": "Fonts",
+ "textAuto": "Auto",
+ "textPt": "pt",
+ "textSize": "Size",
+ "textAuto": "Auto",
+ "textStrikethrough": "Strikethrough",
+ "textDoubleStrikethrough": "Double Strikethrough",
+ "textSuperscript": "Superscript",
+ "textSubscript": "Subscript",
+ "textSmallCaps": "Small Caps",
+ "textAllCaps": "All Caps",
+ "textLetterSpacing": "Letter Spacing",
+ "textNone": "None"
}
}
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/src/components/app.jsx b/apps/documenteditor/mobile/src/components/app.jsx
index cc5b8540e..c91b4b6e9 100644
--- a/apps/documenteditor/mobile/src/components/app.jsx
+++ b/apps/documenteditor/mobile/src/components/app.jsx
@@ -1,19 +1,15 @@
import React from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { App, Panel, View, Popup, Page, Navbar, NavRight, Link, Block, BlockTitle, List, ListItem } from 'framework7-react';
-import i18n from '../js/i18n';
+import {App,Panel,Views,View,Popup,Page,Navbar,Toolbar,NavRight,Link,Block,BlockTitle,List,ListItem,ListInput,ListButton,BlockFooter} from 'framework7-react';
+
import routes from '../js/routes';
-import { initApi } from '../store/actions/actions';
-
import '../../../../common/Gateway.js';
import '../../../../common/main/lib/util/utils.js';
-import { CollaborationController } from '../../../../common/mobile/lib/controller/Collaboration.jsx';
import Notifications from '../../../../common/mobile/utils/notifications.js'
+import MainController from '../controller/Main';
-class ComponentApp extends React.Component {
+export default class extends React.Component {
constructor() {
super();
@@ -23,20 +19,12 @@ class ComponentApp extends React.Component {
name: 'Desktop Editor', // App name
theme: 'auto', // Automatic theme detection
-
-
// App routes
routes: routes,
},
- // Login screen demo data
- username: '',
- password: '',
}
Common.Notifications = new Notifications();
-
- Common.Controllers = {};
- Common.Controllers.Collaboration = new CollaborationController();
}
render() {
return (
@@ -70,6 +58,7 @@ class ComponentApp extends React.Component {
{/* Your main view, should have "view-main" class */}
+
{/* Popup */}