From cf45bce93ed1df567ecbbaa2a03fc3c3411526fd Mon Sep 17 00:00:00 2001
From: Sam Wilkins <abdullah_ahmed@brown.edu>
Date: Sat, 16 Mar 2019 19:07:25 -0400
Subject: initial steps toward implementing remote cursor display

---
 src/client/views/Main.tsx | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 5ff16b8dc..63cc785e0 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -23,6 +23,7 @@ import { observer } from 'mobx-react';
 import { Field, Opt } from '../../fields/Field';
 import { InkingControl } from './InkingControl';
 import { RouteStore } from '../../server/RouteStore';
+import { json } from 'body-parser';
 
 @observer
 export class Main extends React.Component {
@@ -43,6 +44,7 @@ export class Main extends React.Component {
     }
 
     initEventListeners = () => {
+        // window.addEventListener("pointermove", (e) => this.reportLocation(e))
         window.addEventListener("drop", (e) => e.preventDefault(), false) // drop event handler
         window.addEventListener("dragover", (e) => e.preventDefault(), false) // drag event handler
         // click interactions for the context menu
@@ -71,6 +73,24 @@ export class Main extends React.Component {
         });
     }
 
+    // reportLocation = (e: PointerEvent) => {
+    //     request.post(this.prepend(RouteStore.updateCursor), {
+    //         body: {
+    //             cursorX: e.screenX,
+    //             cursorY: e.screenY,
+    //             docId: this.mainContainer ? this.mainContainer.Id : undefined
+    //         },
+    //         json: true
+    //     });
+    // }
+
+    // componentWillUnmount = () => {
+
+    // }
+
+    // pushCursor = () => {
+    // }
+
     @action
     createNewWorkspace = (init: boolean): void => {
         let mainDoc = Documents.DockDocument(JSON.stringify({ content: [{ type: 'row', content: [] }] }), { title: `Main Container ${this.userWorkspaces.length + 1}` });
@@ -108,6 +128,7 @@ export class Main extends React.Component {
         });
         this.mainContainer = doc;
         this.mainContainer.GetAsync(KeyStore.ActiveFrame, field => this.mainfreeform = field as Document);
+        // this.pushCursor();
     }
 
     toggleWorkspaces = () => {
-- 
cgit v1.2.3-70-g09d2

