aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-20 21:37:32 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-20 21:37:32 -0400
commitc0439996ec8b4858c48a7871120e19bb7c06c67d (patch)
tree5efd268f5cf119909f5c955b2710191698bcf47f
parent820ad7343816ee9d5881eefdbcbe8783fe903257 (diff)
drag and drop google docs tweaks
-rw-r--r--package.json4
-rw-r--r--src/client/DocServer.ts1
-rw-r--r--src/client/views/collections/CollectionSubView.tsx8
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx1
4 files changed, 6 insertions, 8 deletions
diff --git a/package.json b/package.json
index e6a0a54b9..de1f3f6e6 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,6 @@
"@types/cookie-parser": "^1.4.1",
"@types/cookie-session": "^2.0.36",
"@types/d3-format": "^1.3.1",
- "@types/diff": "^4.0.2",
"@types/dotenv": "^6.1.1",
"@types/express": "^4.16.1",
"@types/express-flash": "0.0.0",
@@ -128,7 +127,6 @@
"cookie-session": "^2.0.0-beta.3",
"crypto-browserify": "^3.11.0",
"d3-format": "^1.3.2",
- "diff": "^4.0.1",
"dotenv": "^8.0.0",
"express": "^4.16.4",
"express-flash": "0.0.2",
@@ -221,4 +219,4 @@
"xoauth2": "^1.2.0",
"youtube": "^0.1.0"
}
-}
+} \ No newline at end of file
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 56d9147ae..2cec1046b 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -5,7 +5,6 @@ import { Utils, emptyFunction } from '../Utils';
import { SerializationHelper } from './util/SerializationHelper';
import { RefField } from '../new_fields/RefField';
import { Id, HandleUpdate } from '../new_fields/FieldSymbols';
-import { docs_v1 } from 'googleapis';
/**
* This class encapsulates the transfer and cross-client synchronization of
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 3deec22b5..5b50c545c 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -17,7 +17,7 @@ import { DragManager } from "../../util/DragManager";
import { undoBatch, UndoManager } from "../../util/UndoManager";
import { DocComponent } from "../DocComponent";
import { FieldViewProps } from "../nodes/FieldView";
-import { FormattedTextBox, Blank } from "../nodes/FormattedTextBox";
+import { FormattedTextBox, GoogleRef } from "../nodes/FormattedTextBox";
import { CollectionPDFView } from "./CollectionPDFView";
import { CollectionVideoView } from "./CollectionVideoView";
import { CollectionView } from "./CollectionView";
@@ -209,11 +209,11 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
}
let matches: RegExpExecArray | null;
if ((matches = /(https:\/\/)?docs\.google\.com\/document\/d\/([^\\]+)\/edit/g.exec(text)) !== null) {
- let newBox = Docs.Create.TextDocument({ ...options, width: 600, height: 400, title: "Fetching title from Google Docs..." });
+ let newBox = Docs.Create.TextDocument({ ...options, width: 400, height: 200, title: "Awaiting title from Google Docs..." });
let proto = newBox.proto!;
proto.autoHeight = true;
- proto.googleDocId = matches[2];
- proto.data = "Fetching contents from Google Docs...";
+ proto[GoogleRef] = matches[2];
+ proto.data = "Please select and then click on this document's pull button to load its contents from from Google Docs...";
proto.backgroundColor = "#eeeeff";
this.props.addDocument(newBox);
return;
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index d4cbb5116..2b01fb70a 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -434,6 +434,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
delete dataDoc[GoogleRef];
}
DocumentDecorations.Instance.startPullOutcome(pullSuccess);
+ this.tryUpdateHeight();
}
checkState = (exportState: GoogleApiClientUtils.Docs.ReadResult, dataDoc: Doc) => {