From e6265a20f4c5d2619aa06cef6ee9442c0fd6bb41 Mon Sep 17 00:00:00 2001 From: Hannah Chow Date: Thu, 28 Feb 2019 01:09:26 -0500 Subject: first pass at linking drag and drop --- src/fields/KeyStore.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fields/KeyStore.ts') diff --git a/src/fields/KeyStore.ts b/src/fields/KeyStore.ts index a3b39735d..9c3dab6de 100644 --- a/src/fields/KeyStore.ts +++ b/src/fields/KeyStore.ts @@ -26,4 +26,6 @@ export namespace KeyStore { export const Caption = new Key("Caption"); export const ActiveFrame = new Key("ActiveFrame"); export const DocumentText = new Key("DocumentText"); + export const LinkedToDocs = new Key("LinkedToDocs"); + export const LinkedFromDocs = new Key("LinkedFromDocs"); } -- cgit v1.2.3-70-g09d2 From 406ffebb6f38a67f829df094465ecf3bd5c37f03 Mon Sep 17 00:00:00 2001 From: Hannah Chow Date: Tue, 5 Mar 2019 18:10:45 -0500 Subject: underlying link structure set up --- src/client/views/nodes/DocumentView.tsx | 8 +++++--- src/fields/KeyStore.ts | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/fields/KeyStore.ts') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index d31441399..e69485b9a 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -20,6 +20,7 @@ import { KeyValueBox } from "./KeyValueBox" import { WebBox } from "../nodes/WebBox"; import "./DocumentView.scss"; import React = require("react"); +import { TextField } from "../../../fields/TextField"; const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this? @@ -109,7 +110,6 @@ export class DocumentView extends React.Component { } } } -<<<<<<< HEAD private dropDisposer?: DragManager.DragDropDisposer; protected createDropTarget = (ele: HTMLDivElement) => { @@ -137,8 +137,6 @@ export class DocumentView extends React.Component { } } -======= ->>>>>>> bb1d3120f11a47e9d493202c1003dae52bf6667f onPointerMove = (e: PointerEvent): void => { if (e.cancelBubble) { return; @@ -208,6 +206,10 @@ export class DocumentView extends React.Component { let destDoc: Document = this.props.Document; let linkDoc: Document = new Document(); + linkDoc.Set(KeyStore.Title, new TextField("New Link")); + linkDoc.Set(KeyStore.LinkDescription, new TextField("")); + linkDoc.Set(KeyStore.LinkTags, new TextField("Default")); + sourceDoc.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField).Data.push(linkDoc) }); linkDoc.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField).Data.push(destDoc) }); destDoc.GetOrCreateAsync(KeyStore.LinkedFromDocs, ListField, field => { (field as ListField).Data.push(linkDoc) }); diff --git a/src/fields/KeyStore.ts b/src/fields/KeyStore.ts index 9c3dab6de..27f0c28f5 100644 --- a/src/fields/KeyStore.ts +++ b/src/fields/KeyStore.ts @@ -28,4 +28,6 @@ export namespace KeyStore { export const DocumentText = new Key("DocumentText"); export const LinkedToDocs = new Key("LinkedToDocs"); export const LinkedFromDocs = new Key("LinkedFromDocs"); + export const LinkDescription = new Key("LinkDescription"); + export const LinkTags = new Key("LinkTag"); } -- cgit v1.2.3-70-g09d2