diff options
author | bob <bcz@cs.brown.edu> | 2019-02-06 16:11:42 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-02-06 16:11:42 -0500 |
commit | 59d5992f2a101eff7743328c3fdefe6a0006ada9 (patch) | |
tree | b28dbb2e06f1fffeafcd2b43845072f9f3f6f1fc /src/Main.tsx | |
parent | 7598b88bbad9690c59f8b164144aa0d02a0a211f (diff) | |
parent | 84eea14a86265ce0585342d9f3a3c4107c02df17 (diff) |
woring db stub.
Diffstat (limited to 'src/Main.tsx')
-rw-r--r-- | src/Main.tsx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/Main.tsx b/src/Main.tsx index de4a1de5d..6730cf799 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -12,6 +12,8 @@ import { TextField } from './fields/TextField'; import "./Main.scss"; import { ContextMenu } from './views/ContextMenu'; import { DocumentView } from './views/nodes/DocumentView'; +import { CompileScript } from './util/Scripting'; + configure({ enforceActions: "observed" @@ -39,25 +41,25 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { { let doc1 = Documents.TextDocument({ title: "hello" }); let doc2 = doc1.MakeDelegate(); - doc2.SetField(KS.X, new NumberField(150)); - doc2.SetField(KS.Y, new NumberField(20)); + doc2.Set(KS.X, new NumberField(150)); + doc2.Set(KS.Y, new NumberField(20)); let doc3 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", { x: 450, y: 500, title: "cat 1" }); - 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 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].SetData(KS.Author, "Tyler", TextField); + // schemaDocs[4].SetData(KS.Author, "Bob", TextField); + // schemaDocs.push(doc2); + // const doc7 = Documents.SchemaDocument(schemaDocs) const docset = [doc3]; // [doc1, doc2, doc3, doc7]; let doc4 = Documents.CollectionDocument(docset, { x: 0, y: 400, title: "mini collection" }); - let doc5 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", { - x: 650, y: 500, width: 600, height: 600, title: "cat 2" - }); + // let doc5 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", { + // x: 650, y: 500, width: 600, height: 600, title: "cat 2" + // }); let docset2 = new Array<Document>(doc4);//, doc1, doc3); let doc6 = Documents.CollectionDocument(docset2, { x: 350, y: 100, width: 600, height: 600, title: "docking collection" @@ -69,13 +71,14 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { // mainNodes.Data.push(doc6); // mainNodes.Data.push(doc2); mainNodes.Data.push(doc4); - // mainNodes.Data.push(doc3); + mainNodes.Data.push(doc3); // mainNodes.Data.push(doc5); // mainNodes.Data.push(doc1); //mainNodes.Data.push(doc2); //mainNodes.Data.push(doc6); - mainContainer.SetField(KeyStore.Data, mainNodes); + mainContainer.Set(KeyStore.Data, mainNodes); } +//} //); ReactDOM.render(( |