From 1d667d19f5402dc9f9069e0a57008dac96f6de2a Mon Sep 17 00:00:00 2001
From: madelinegr <mgriswold99@gmail.com>
Date: Tue, 12 Feb 2019 18:55:11 -0500
Subject: set up web box classes

---
 src/client/views/Main.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index ba92cc17e..3e5118379 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -78,6 +78,12 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
     // mainNodes.Data.push(doc1);
     // mainNodes.Data.push(doc2);
     mainNodes.Data.push(doc6);
+
+    let doc9 = Documents.WebDocument("https://cs.brown.edu/", {
+        x: 450, y: 100, title: "cat 1", width: 606, height: 386, nativeWidth: 606, nativeHeight: 386
+    });
+    mainNodes.Data.push(doc9);
+
     mainContainer.Set(KeyStore.Data, mainNodes);
 }
 //}
-- 
cgit v1.2.3-70-g09d2


From 281f6268238c4f9f1640899ce258535ad4fe2401 Mon Sep 17 00:00:00 2001
From: madelinegr <mgriswold99@gmail.com>
Date: Mon, 18 Feb 2019 18:01:47 -0500
Subject: tried to get around cors with crossorigin.me

---
 src/client/views/Main.tsx         | 2 +-
 src/client/views/nodes/WebBox.tsx | 2 +-
 src/fields/WebField.ts            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 3e5118379..f310be950 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -79,7 +79,7 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
     // mainNodes.Data.push(doc2);
     mainNodes.Data.push(doc6);
 
-    let doc9 = Documents.WebDocument("https://cs.brown.edu/", {
+    let doc9 = Documents.WebDocument("https://crossorigin.me/https://google.com", {
         x: 450, y: 100, title: "cat 1", width: 606, height: 386, nativeWidth: 606, nativeHeight: 386
     });
     mainNodes.Data.push(doc9);
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index f50f8c60e..b9d0853b9 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -62,7 +62,7 @@ export class WebBox extends React.Component<FieldViewProps> {
     render() {
         let field = this.props.doc.Get(this.props.fieldKey);
         let path = field == FieldWaiting ? "https://image.flaticon.com/icons/svg/66/66163.svg" :
-            field instanceof WebField ? field.Data.href : "https://cs.brown.edu/";
+            field instanceof WebField ? field.Data.href : "https://crossorigin.me/" + "https://cs.brown.edu";
         let nativeWidth = this.props.doc.GetNumber(KeyStore.NativeWidth, 1);
 
         return (
diff --git a/src/fields/WebField.ts b/src/fields/WebField.ts
index 88e6130e0..cd3519128 100644
--- a/src/fields/WebField.ts
+++ b/src/fields/WebField.ts
@@ -3,7 +3,7 @@ import { Field } from "./Field";
 
 export class WebField extends BasicField<URL> {
     constructor(data: URL | undefined = undefined) {
-        super(data == undefined ? new URL("https://cs.brown.edu/") : data);
+        super(data == undefined ? new URL("https://crossorigin.me/" + "https://cs.brown.edu/") : data);
     }
 
     toString(): string {
-- 
cgit v1.2.3-70-g09d2


From 14d6495e4d4b9d38a37187a50ebeb84057abbc20 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Tue, 26 Feb 2019 23:59:38 -0500
Subject: from last

---
 src/client/views/Main.tsx            | 2 +-
 src/client/views/nodes/FieldView.tsx | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index af4db521c..578aecd1e 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -85,7 +85,7 @@ Documents.initProtos(() => {
             width: 200, height: 200, title: "an image of a cat"
         }));
         let addWebNode = action(() => Documents.WebDocument("https://cs.brown.edu/courses/cs166/", {
-            width: 200, height: 200, title: "an image of a cat"
+            width: 200, height: 200, title: "a sample web page"
         }));
 
         let addClick = (creator: any) => action(() => {
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index f34574234..a883fa672 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -12,6 +12,7 @@ import { Key } from "../../../fields/Key";
 import { FormattedTextBox } from "./FormattedTextBox";
 import { ImageBox } from "./ImageBox";
 import { WebBox } from "./WebBox";
+import { HtmlField } from "../../../fields/HtmlField";
 
 //
 // these properties get assigned through the render() method of the DocumentView when it creates this node.
@@ -53,6 +54,10 @@ export class FieldView extends React.Component<FieldViewProps> {
         else if (field instanceof WebField) {
             return <WebBox {...this.props} />
         }
+        // bcz: this belongs here, but it doesn't render well so taking it out for now
+        // else if (field instanceof HtmlField) {
+        //     return <WebBox {...this.props} />
+        // }
         else if (field instanceof NumberField) {
             return <p>{field.Data}</p>
         }
-- 
cgit v1.2.3-70-g09d2

