aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.tsx32
-rw-r--r--src/documents/Documents.ts10
-rw-r--r--src/fields/ImageField.ts4
-rw-r--r--src/views/nodes/ImageBox.tsx3
-rw-r--r--src/views/nodes/PDFNode.tsx3
5 files changed, 24 insertions, 28 deletions
diff --git a/src/Main.tsx b/src/Main.tsx
index 03d44e0e5..f29dd192e 100644
--- a/src/Main.tsx
+++ b/src/Main.tsx
@@ -40,18 +40,18 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
//runInAction(() =>
{
- let PDFDoc = Documents.PDFDocument("");
+ let PDFDoc = Documents.PDFDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", {
+ x:0, y:0, width: 500, height: 500, title: "PDF"
+ });
+
let doc1 = Documents.TextDocument({ title: "hello" });
let doc2 = doc1.MakeDelegate();
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:0, y: 0, width: 500, height: 500,title: "cat 1"
- });
+ let doc3 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", {
+ x:0, y: 0, width: 500, height: 500,title: "cat 1"
+ });
- //let PDFDoc = Documents.PDFDocument("https://arxiv.org/pdf/1708.08021.pdf", {
- //x: 450, y: 500, title: "PDF!"
- //})
// 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
// }));
@@ -62,18 +62,18 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
- const docset = [doc3]; //pdfDoc
- let doc4 = Documents.CollectionDocument(docset, {
+ const docset = [PDFDoc]; //pdfDoc
+ 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 docset2 = new Array<Document>(doc4);//, doc1, doc3);
- let doc6 = Documents.CollectionDocument(docset2, {
- x: 350, y: 100, width: 600, height: 600, title: "docking collection"
- });
+ // let docset2 = new Array<Document>(doc4);//, doc1, doc3);
+ // let doc6 = Documents.CollectionDocument(docset2, {
+ // x: 350, y: 100, width: 600, height: 600, title: "docking collection"
+ //});
let mainNodes = null;// mainContainer.GetFieldT(KeyStore.Data, ListField);
if (!mainNodes) {
mainNodes = new ListField<Document>();
@@ -81,8 +81,8 @@ 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(PDFDoc);
+ //mainNodes.Data.push(doc3);
+ mainNodes.Data.push(PDFDoc);
// mainNodes.Data.push(doc5);
// mainNodes.Data.push(doc1);
//mainNodes.Data.push(doc2);
diff --git a/src/documents/Documents.ts b/src/documents/Documents.ts
index 6dce4e8f0..56ebbf565 100644
--- a/src/documents/Documents.ts
+++ b/src/documents/Documents.ts
@@ -12,7 +12,7 @@ import { ImageBox } from "../views/nodes/ImageBox";
import { CollectionFreeFormView } from "../views/collections/CollectionFreeFormView";
import { FIELD_ID } from "../fields/Field";
import {PDFField} from "../fields/PDFField";
-import {PDFNode} from "../views/nodes/PDFNode"
+import {PDFNode}from "../views/nodes/PDFNode";
interface DocumentOptions {
x?: number;
@@ -135,14 +135,14 @@ export namespace Documents {
let PDFProto = new Document();
PDFProtoId = PDFProto.Id;
PDFProto.Set(KeyStore.Title, new TextField("PDF PROTO"));
- PDFProto.Set(KeyStore.X, new NumberField(0));
+ PDFProto.Set(KeyStore.X, new NumberField(0));
PDFProto.Set(KeyStore.Y, new NumberField(0));
PDFProto.Set(KeyStore.Width, new NumberField(300));
- PDFProto.Set(KeyStore.Height, new NumberField(300));
- PDFProto.Set(KeyStore.Layout, new TextField(PDFNode.LayoutString()));
+ PDFProto.Set(KeyStore.Height, new NumberField(300));
+ PDFProto.Set(KeyStore.Layout, new TextField(PDFNode.LayoutString()));
PDFProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
Server.AddDocument(PDFProto);
- return PDFProto;
+ return PDFProto;
}
return Server.GetDocument(PDFProtoId, true)!;
}
diff --git a/src/fields/ImageField.ts b/src/fields/ImageField.ts
index b7470b657..e6b29fd3f 100644
--- a/src/fields/ImageField.ts
+++ b/src/fields/ImageField.ts
@@ -14,8 +14,4 @@ export class ImageField extends BasicField<URL> {
Copy(): Field {
return new ImageField(this.Data);
}
-
- @observable
- Page:Number = 1;
-
} \ No newline at end of file
diff --git a/src/views/nodes/ImageBox.tsx b/src/views/nodes/ImageBox.tsx
index f53d94a6d..c145280a1 100644
--- a/src/views/nodes/ImageBox.tsx
+++ b/src/views/nodes/ImageBox.tsx
@@ -54,9 +54,8 @@ import { Annotation } from './Annotation';
*/
@observer
export class ImageBox extends React.Component<FieldViewProps> {
-
public static LayoutString() { return FieldView.LayoutString("ImageBox"); }
-
+
private _mainDiv = React.createRef<HTMLDivElement>()
private _pdf = React.createRef<HTMLCanvasElement>();
diff --git a/src/views/nodes/PDFNode.tsx b/src/views/nodes/PDFNode.tsx
index e626dc748..814a59500 100644
--- a/src/views/nodes/PDFNode.tsx
+++ b/src/views/nodes/PDFNode.tsx
@@ -54,7 +54,8 @@ import { Annotation } from './Annotation';
*/
@observer
export class PDFNode extends React.Component<FieldViewProps> {
-
+ public static LayoutString() { return FieldView.LayoutString("ImageBox"); }
+
private _mainDiv = React.createRef<HTMLDivElement>()
private _pdf = React.createRef<HTMLCanvasElement>();