aboutsummaryrefslogtreecommitdiff
path: root/src/Main.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-01 01:05:31 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-01 01:05:31 -0500
commitd12625a3a3e241d80ce3fe8e577ba8a41320b189 (patch)
treee42e3a86134d11f1bfa09eaa66200ffc88b86a8f /src/Main.tsx
parentee6e9bb0165e20e717140d2601b3de53d0c5380b (diff)
Changed formatting setting, added very basic generic FieldView, and added Schema view
Diffstat (limited to 'src/Main.tsx')
-rw-r--r--src/Main.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Main.tsx b/src/Main.tsx
index 02b866753..ab87fc316 100644
--- a/src/Main.tsx
+++ b/src/Main.tsx
@@ -16,6 +16,7 @@ import { CollectionFreeFormView } from './views/collections/CollectionFreeFormVi
import { ListField } from './fields/ListField';
import { DocumentView } from './views/nodes/DocumentView';
import { ContextMenu } from './views/ContextMenu';
+import { TextField } from './fields/TextField';
configure({
enforceActions: "observed"
@@ -48,7 +49,14 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
let doc3 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", {
x: 450, y: 500
});
- let docset = new Array<Document>(doc1, doc2, doc3);
+ const schemaDocs = Array.from(Array(5).keys()).map(v => Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", {
+ x: 50 + 100 * v, y: 50, width: 100, height: 100, title: "cat" + v
+ }));
+ schemaDocs[0].SetFieldValue(KS.Author, "Tyler", TextField);
+ schemaDocs[4].SetFieldValue(KS.Author, "Bob", TextField);
+ schemaDocs.push(doc2);
+ const doc7 = Documents.SchemaDocument(schemaDocs)
+ const docset = [doc1, doc2, doc3, doc7];
let doc4 = Documents.CollectionDocument(docset, {
x: 0, y: 400, title: "mini collection"
});