diff options
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/DocumentTypes.ts | 3 | ||||
| -rw-r--r-- | src/client/documents/Documents.ts | 30 | 
2 files changed, 24 insertions, 9 deletions
| diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts index de366763b..36d3e1c52 100644 --- a/src/client/documents/DocumentTypes.ts +++ b/src/client/documents/DocumentTypes.ts @@ -13,7 +13,7 @@ export enum DocumentType {      INK = "ink",        // ink stroke      SCREENSHOT = "screenshot",  // view of a desktop application      FONTICON = "fonticonbox",   // font icon -    QUERY = "query",            // search query +    SEARCH = "search",            // search query      LABEL = "label",            // simple text label      BUTTON = "button",          // onClick button      WEBCAM = "webcam",          // webcam @@ -31,6 +31,7 @@ export enum DocumentType {      COLOR = "color",            // color picker (view of a color picker for a color string)      YOUTUBE = "youtube",        // youtube directory (view of you tube search results)      DOCHOLDER = "docholder",    // nested document (view of a document) +    SEARCHITEM= "searchitem",      LINKDB = "linkdb",          // database of links  ??? why do we have this      RECOMMENDATION = "recommendation", // view of a recommendation diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 811bb5fb2..79a1d1303 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -32,9 +32,14 @@ import { ComputedField, ScriptField } from "../../new_fields/ScriptField";  import { ProxyField } from "../../new_fields/Proxy";  import { DocumentType } from "./DocumentTypes";  import { RecommendationsBox } from "../views/RecommendationsBox"; +import { filterData} from "../views/search/SearchBox"; + +//import { PresBox } from "../views/nodes/PresBox"; +//import { PresField } from "../../new_fields/PresField";  import { PresElementBox } from "../views/presentationview/PresElementBox"; +import { SearchItem } from "../views/search/SearchItem";  import { DashWebRTCVideo } from "../views/webcam/DashWebRTCVideo"; -import { QueryBox } from "../views/nodes/QueryBox"; +import { SearchBox } from "../views/search/SearchBox";  import { ColorBox } from "../views/nodes/ColorBox";  import { LinkAnchorBox } from "../views/nodes/LinkAnchorBox";  import { DocHolderBox } from "../views/nodes/DocumentBox"; @@ -157,10 +162,12 @@ export interface DocumentOptions {      flexDirection?: "unset" | "row" | "column" | "row-reverse" | "column-reverse";      selectedIndex?: number;      syntaxColor?: string; // can be applied to text for syntax highlighting all matches in the text -    searchText?: string; //for searchbox -    searchQuery?: string; // for queryBox -    filterQuery?: string; +    searchText?: string, //for searchbox +    searchQuery?: string, // for quersyBox +    filterQuery?: filterData,      linearViewIsExpanded?: boolean; // is linear view expanded +    border?: string; //for searchbox +    hovercolor?:string;  }  class EmptyBox { @@ -190,8 +197,8 @@ export namespace Docs {                  layout: { view: FormattedTextBox, dataField: "text" },                  options: { _height: 150, _xMargin: 10, _yMargin: 10 }              }], -            [DocumentType.QUERY, { -                layout: { view: QueryBox, dataField: defaultDataKey }, +            [DocumentType.SEARCH, { +                layout: { view: SearchBox, dataField: defaultDataKey },                  options: { _width: 400 }              }],              [DocumentType.COLOR, { @@ -276,6 +283,9 @@ export namespace Docs {              [DocumentType.PRESELEMENT, {                  layout: { view: PresElementBox, dataField: defaultDataKey }              }], +            [DocumentType.SEARCHITEM, { +                layout: { view: SearchItem, dataField: defaultDataKey  } +            }],              [DocumentType.INK, {                  layout: { view: InkingStroke, dataField: defaultDataKey },                  options: { backgroundColor: "transparent" } @@ -533,8 +543,8 @@ export namespace Docs {              return instance;          } -        export function QueryDocument(options: DocumentOptions = {}) { -            return InstanceFromProto(Prototypes.get(DocumentType.QUERY), "", options); +        export function SearchDocument(options: DocumentOptions = {}) { +            return InstanceFromProto(Prototypes.get(DocumentType.SEARCH), new List<Doc>([]), options);          }          export function ColorDocument(options: DocumentOptions = {}) { @@ -675,6 +685,10 @@ export namespace Docs {              return InstanceFromProto(Prototypes.get(DocumentType.PRESELEMENT), undefined, { ...(options || {}) });          } +        export function SearchItemBoxDocument(options?: DocumentOptions) { +            return InstanceFromProto(Prototypes.get(DocumentType.SEARCHITEM), undefined, { ...(options || {}) }); +        } +          export function DockDocument(documents: Array<Doc>, config: string, options: DocumentOptions, id?: string) {              const inst = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _viewType: CollectionViewType.Docking, dockingConfig: config }, id);              Doc.GetProto(inst).data = new List<Doc>(documents); | 
