aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
authorandrewdkim <46148447+andrewdkim@users.noreply.github.com>2019-03-09 18:37:10 -0500
committerGitHub <noreply@github.com>2019-03-09 18:37:10 -0500
commit36830f4677997ce190e0c18bad7bd5ffbeab86b0 (patch)
tree1ff38ba44c3567ed1ef09fc2107da8b4ffb7d1b0 /src/client/views/Main.tsx
parentb9cfa458a6535e7ee0ff8b81398afa1e123cf458 (diff)
parent96eede5f7d1706a3f7ac6ee02a85bb3da217f467 (diff)
Merge branch 'master' into audiovideo
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index a52047631..6f08566bc 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -17,6 +17,7 @@ import { ContextMenu } from './ContextMenu';
import { DocumentDecorations } from './DocumentDecorations';
import { DocumentView } from './nodes/DocumentView';
import "./Main.scss";
+import { InkingControl } from './InkingControl';
configure({ enforceActions: "observed" }); // causes errors to be generated when modifying an observable outside of an action
@@ -51,6 +52,7 @@ Documents.initProtos(mainDocId, (res?: Document) => {
}
let imgurl = "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg";
+ let pdfurl = "http://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"
let weburl = "https://cs.brown.edu/courses/cs166/";
let audiourl = "http://techslides.com/demos/samples/sample.mp3";
let videourl = "http://techslides.com/demos/sample-videos/small.mp4";
@@ -59,6 +61,7 @@ Documents.initProtos(mainDocId, (res?: Document) => {
let addColNode = action(() => Documents.FreeformDocument([], { width: 200, height: 200, title: "a freeform collection" }));
let addSchemaNode = action(() => Documents.SchemaDocument([Documents.TextDocument()], { width: 200, height: 200, title: "a schema collection" }));
let addVideoNode = action(() => Documents.VideoDocument(videourl, {width: 200, height:200, title: "video node"}));
+ let addPDFNode = action(() => Documents.PdfDocument(pdfurl, { width: 200, height: 200, title: "a schema collection" }));
let addImageNode = action(() => Documents.ImageDocument(imgurl, { width: 200, height: 200, title: "an image of a cat" }));
let addWebNode = action(() => Documents.WebDocument(weburl, { width: 200, height: 200, title: "a sample web page" }));
let addAudioNode = action(() => Documents.AudioDocument(audiourl,{ width: 200, height: 200, title: "audio node" } ))
@@ -67,6 +70,7 @@ Documents.initProtos(mainDocId, (res?: Document) => {
);
let imgRef = React.createRef<HTMLDivElement>();
+ let pdfRef = React.createRef<HTMLDivElement>();
let webRef = React.createRef<HTMLDivElement>();
let textRef = React.createRef<HTMLDivElement>();
let schemaRef = React.createRef<HTMLDivElement>();
@@ -99,12 +103,15 @@ Documents.initProtos(mainDocId, (res?: Document) => {
<button onPointerDown={setupDrag(schemaRef, addSchemaNode)} onClick={addClick(addSchemaNode)}>Add Schema</button></div>
<div className="main-buttonDiv" style={{ bottom: '125px' }} >
<button onClick={clearDatabase}>Clear Database</button></div>
- <div className="main-buttonDiv" style={{ bottom: '150px' }} ref={videoRef}>
+ <div className="main-buttonDiv" style={{ bottom: '175px' }} ref={videoRef}>
<button onPointerDown={setupDrag(videoRef, addVideoNode)} onClick={addClick(addVideoNode)}>Add Video</button></div>
- <div className="main-buttonDiv" style={{ bottom: '175px' }} ref={audioRef}>
+ <div className="main-buttonDiv" style={{ bottom: '200px' }} ref={audioRef}>
<button onPointerDown={setupDrag(audioRef, addAudioNode)} onClick={addClick(addAudioNode)}>Add Audio</button></div>
+ <div className="main-buttonDiv" style={{ bottom: '150px' }} ref={pdfRef}>
+ <button onPointerDown={setupDrag(pdfRef, addPDFNode)} onClick={addClick(addPDFNode)}>Add PDF</button></div>
<button className="main-undoButtons" style={{ bottom: '25px' }} onClick={() => UndoManager.Undo()}>Undo</button>
<button className="main-undoButtons" style={{ bottom: '0px' }} onClick={() => UndoManager.Redo()}>Redo</button>
+ <InkingControl />
</div>),
document.getElementById('root'));
})