aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/util/Import & Export/DirectoryImportBox.tsx4
-rw-r--r--src/client/util/RichTextSchema.tsx1
-rw-r--r--src/client/views/collections/CollectionSubView.tsx8
-rw-r--r--src/client/views/nodes/DocumentView.tsx4
-rw-r--r--src/client/views/nodes/ImageBox.tsx4
5 files changed, 11 insertions, 10 deletions
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx
index 071015193..d04f56e57 100644
--- a/src/client/util/Import & Export/DirectoryImportBox.tsx
+++ b/src/client/util/Import & Export/DirectoryImportBox.tsx
@@ -120,8 +120,8 @@ export default class DirectoryImportBox extends React.Component<FieldViewProps>
runInAction(() => this.completed += batch.length);
});
- await Promise.all(uploads.map(async ({ name, type, clientAccessPath, exifData }) => {
- const path = Utils.prepend(clientAccessPath);
+ await Promise.all(uploads.map(async ({ name, type, accessPaths, exifData }) => {
+ const path = Utils.prepend(accessPaths.agnostic.client);
const document = await Docs.Get.DocumentFromType(type, path, { _width: 300, title: name });
const { data, error } = exifData;
if (document) {
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index f12b3632c..3cf0561dc 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -133,6 +133,7 @@ export const nodes: { [index: string]: NodeSpec } = {
inline: true,
attrs: {
src: {},
+ agnostic: { default: null },
width: { default: 100 },
alt: { default: null },
title: { default: null },
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 293a8491a..20941493f 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -232,8 +232,8 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
const split = img.split("src=\"")[1].split("\"")[0];
let source = split;
if (split.startsWith("data:image") && split.includes("base64")) {
- const [{ clientAccessPath }] = await Networking.PostToServer("/uploadRemoteImage", { sources: [split] });
- source = Utils.prepend(clientAccessPath);
+ const [{ accessPaths }] = await Networking.PostToServer("/uploadRemoteImage", { sources: [split] });
+ source = Utils.prepend(accessPaths.agnostic.client);
}
const doc = Docs.Create.ImageDocument(source, { ...options, _width: 300 });
ImageUtils.ExtractExif(doc);
@@ -312,9 +312,9 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
const dropFileName = file ? file.name : "-empty-";
promises.push(Networking.PostFormDataToServer("/uploadFormData", formData).then(results => {
results.map(action((result: any) => {
- const { clientAccessPath, nativeWidth, nativeHeight, contentSize } = result;
+ const { accessPaths, nativeWidth, nativeHeight, contentSize } = result;
const full = { ...options, _width: 300, title: dropFileName };
- const pathname = Utils.prepend(clientAccessPath);
+ const pathname = Utils.prepend(accessPaths.agnostic.client);
Docs.Get.DocumentFromType(type, pathname, full).then(doc => {
if (doc) {
const proto = Doc.GetProto(doc);
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index e4ab3e746..5c5a87cb9 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -277,7 +277,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
}
preventDefault && e.preventDefault();
}
- })
+ });
buttonClick = async (altKey: boolean, ctrlKey: boolean) => {
const linkDocs = DocListCast(this.props.Document.links);
@@ -636,7 +636,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
if (StrCast(tempDoc.title) === layout) {
foundLayout = tempDoc;
}
- })
+ });
DocumentView.
makeCustomViewClicked(this.props.Document, this.props.DataDoc, Docs.Create.StackingDocument, layout, foundLayout);
} else {
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index db9800de4..c0e102195 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -321,12 +321,12 @@ export class ImageBox extends DocAnnotatableComponent<FieldViewProps, ImageDocum
const { dataDoc } = this;
const { success, failure, idle, loading } = uploadIcons;
runInAction(() => this.uploadIcon = loading);
- const [{ clientAccessPath }] = await Networking.PostToServer("/uploadRemoteImage", { sources: [primary] });
+ const [{ accessPaths }] = await Networking.PostToServer("/uploadRemoteImage", { sources: [primary] });
dataDoc.originalUrl = primary;
let succeeded = true;
let data: ImageField | undefined;
try {
- data = new ImageField(Utils.prepend(clientAccessPath));
+ data = new ImageField(Utils.prepend(accessPaths.agnostic.client));
} catch {
succeeded = false;
}