diff --git a/apps/common/mobile/lib/view/About.jsx b/apps/common/mobile/lib/view/About.jsx
index cb6035fa7..a2fc8d61f 100644
--- a/apps/common/mobile/lib/view/About.jsx
+++ b/apps/common/mobile/lib/view/About.jsx
@@ -120,6 +120,7 @@ const PageAbout = props => {
const About = inject("storeAppOptions")(observer(PageAbout));
About.appVersion = () => (__PRODUCT_VERSION__);
+About.compareVersions = () => /d$/.test(__PRODUCT_VERSION__);
export default About;
\ 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 061f1eae9..849e4760d 100644
--- a/apps/documenteditor/mobile/src/controller/Main.jsx
+++ b/apps/documenteditor/mobile/src/controller/Main.jsx
@@ -467,7 +467,7 @@ class MainController extends Component {
if (this.changeServerVersion) return true;
const _t = this._t;
- if (About.appVersion() !== buildVersion && !window.compareVersions) {
+ if (About.appVersion() !== buildVersion && !About.compareVersions()) {
this.changeServerVersion = true;
f7.dialog.alert(
_t.errorServerVersion,
diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json
index 2651a9ccf..bcf17b851 100644
--- a/apps/presentationeditor/mobile/locale/en.json
+++ b/apps/presentationeditor/mobile/locale/en.json
@@ -274,7 +274,8 @@
"textCaseSensitive": "Case Sensitive",
"textHighlight": "Highlight Results",
"textNoTextFound": "Text not Found",
- "textSelectObjectToEdit": "Select object to edit"
+ "textSelectObjectToEdit": "Select object to edit",
+ "textFinalMessage": "The end of slide preview. Click to exit."
}
},
"Common": {
diff --git a/apps/presentationeditor/mobile/src/controller/Preview.jsx b/apps/presentationeditor/mobile/src/controller/Preview.jsx
index babf81120..df6cd83aa 100644
--- a/apps/presentationeditor/mobile/src/controller/Preview.jsx
+++ b/apps/presentationeditor/mobile/src/controller/Preview.jsx
@@ -4,8 +4,97 @@ import { f7 } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import Preview from "../view/Preview";
-const PreviewController = () => {
- console.log('preview');
+const PreviewController = props => {
+ const { t } = useTranslation();
+ const _t = t('View.Edit', {returnObjects: true})
+
+ let _view, _touches, _touchStart, _touchEnd;
+
+ _view = $$('#pe-preview');
+
+ useEffect(() => {
+ const onDocumentReady = () => {
+ const api = Common.EditorApi.get();
+
+ api.asc_registerCallback('asc_onEndDemonstration', onEndDemonstration);
+ api.DemonstrationEndShowMessage(_t.textFinalMessage);
+ };
+
+ show();
+ onDocumentReady();
+
+ _view.on('touchstart', onTouchStart);
+ _view.on('touchmove', onTouchMove);
+ _view.on('touchend', onTouchEnd);
+ _view.on('click', onClick);
+
+ return () => {
+ const api = Common.EditorApi.get();
+
+ api.asc_unregisterCallback('asc_onEndDemonstration', onEndDemonstration);
+
+ _view.off('touchstart', onTouchStart);
+ _view.off('touchmove', onTouchMove);
+ _view.off('touchend', onTouchEnd);
+ _view.off('click', onClick);
+ };
+ }, []);
+
+ const show = () => {
+ const api = Common.EditorApi.get();
+ api.StartDemonstration('presentation-preview', api.getCurrentPage());
+ };
+
+ const onTouchStart = e => {
+ e.preventDefault();
+
+ _touches = [];
+
+ for (let i = 0; i < e.touches.length; i++) {
+ _touches.push([e.touches[i].pageX, e.touches[i].pageY]);
+ }
+ _touchEnd = _touchStart = [e.touches[0].pageX, e.touches[0].pageY];
+ };
+
+ const onTouchMove = e => {
+ e.preventDefault();
+
+ const api = Common.EditorApi.get();
+
+ _touchEnd = [e.touches[0].pageX, e.touches[0].pageY];
+
+ if (e.touches.length < 2 ) return;
+
+ for (let i = 0; i < e.touches.length; i++) {
+ if (Math.abs(e.touches[i].pageX - _touches[i][0]) > 20 || Math.abs(e.touches[i].pageY - _touches[i][1]) > 20 ) {
+ api.EndDemonstration();
+ break;
+ }
+ }
+ };
+
+ const onTouchEnd = e => {
+ e.preventDefault();
+
+ const api = Common.EditorApi.get();
+
+ if (_touchEnd[0] - _touchStart[0] > 20)
+ api.DemonstrationPrevSlide();
+ else if (_touchStart[0] - _touchEnd[0] > 20)
+ api.DemonstrationNextSlide();
+ };
+
+ const onClick = e => {
+ const api = Common.EditorApi.get();
+ api.DemonstrationNextSlide();
+ };
+
+ // API Handlers
+
+ const onEndDemonstration = () => {
+ props.onclosed();
+ };
+
return (