aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/documents/DocumentTypes.ts3
-rw-r--r--src/client/documents/Documents.ts10
-rw-r--r--src/client/views/nodes/DocumentContentsView.tsx4
3 files changed, 15 insertions, 2 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts
index df056f3e0..e02382661 100644
--- a/src/client/documents/DocumentTypes.ts
+++ b/src/client/documents/DocumentTypes.ts
@@ -27,5 +27,6 @@ export enum DocumentType {
DOCULINK = "doculink",
PDFANNO = "pdfanno",
INK = "ink",
- DOCUMENT = "document"
+ DOCUMENT = "document",
+ SEARCH = "search",
} \ No newline at end of file
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 4b5152224..622486435 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -44,6 +44,8 @@ import { ComputedField, ScriptField } from "../../new_fields/ScriptField";
import { ProxyField } from "../../new_fields/Proxy";
import { DocumentType } from "./DocumentTypes";
import { RecommendationsBox } from "../views/RecommendationsBox";
+import { SearchDocBox } from "../views/SearchDocBox";
+
//import { PresBox } from "../views/nodes/PresBox";
//import { PresField } from "../../new_fields/PresField";
import { LinkFollowBox } from "../views/linking/LinkFollowBox";
@@ -255,6 +257,10 @@ export namespace Docs {
[DocumentType.INK, {
layout: { view: InkingStroke, dataField: data },
options: { backgroundColor: "transparent" }
+ }],
+ [DocumentType.SEARCH, {
+ layout: { view: SearchDocBox },
+ options: { width: 200, height: 200 },
}]
]);
@@ -588,6 +594,10 @@ export namespace Docs {
return InstanceFromProto(Prototypes.get(DocumentType.RECOMMENDATION), new List<Doc>(data), options);
}
+ export function SearchDocument(data: Doc[], options: DocumentOptions = {}) {
+ return InstanceFromProto(Prototypes.get(DocumentType.SEARCH), new List<Doc>(data), options);
+ }
+
export type DocConfig = {
doc: Doc,
initialWidth?: number,
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx
index 3b1a86d32..15dd1b29f 100644
--- a/src/client/views/nodes/DocumentContentsView.tsx
+++ b/src/client/views/nodes/DocumentContentsView.tsx
@@ -34,6 +34,8 @@ import { WebBox } from "./WebBox";
import { InkingStroke } from "../InkingStroke";
import React = require("react");
import { RecommendationsBox } from "../RecommendationsBox";
+import { SearchDocBox } from "../SearchDocBox";
+
import { TraceMobx } from "../../../new_fields/util";
const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this?
@@ -103,7 +105,7 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & {
FormattedTextBox, ImageBox, IconBox, DirectoryImportBox, FontIconBox: FontIconBox, ButtonBox, FieldView,
CollectionFreeFormView, CollectionDockingView, CollectionSchemaView, CollectionView, WebBox, KeyValueBox,
PDFBox, VideoBox, AudioBox, HistogramBox, PresBox, YoutubeBox, LinkFollowBox, PresElementBox, QueryBox,
- ColorBox, DocuLinkBox, InkingStroke, DocumentBox, RecommendationsBox
+ ColorBox, DocuLinkBox, InkingStroke, DocumentBox, RecommendationsBox, SearchDocBox,
}}
bindings={this.CreateBindings()}
jsx={this.layout}