diff options
author | laurawilsonri <laura_wilson@brown.edu> | 2019-02-24 14:37:07 -0500 |
---|---|---|
committer | laurawilsonri <laura_wilson@brown.edu> | 2019-02-24 14:37:07 -0500 |
commit | f7b46167a7fd5d7ecf560dbd72e7d3295ba6c0c9 (patch) | |
tree | cc96c12c49e6c03c98b0f0e6f642e0902948283b /src/fields/ImageField.ts | |
parent | 3ad38f0445178bdfe025e4f6da60f68f03876f56 (diff) | |
parent | d9d55e422826da1fe87aa7973c92e54bc0c99f02 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into improveText
Diffstat (limited to 'src/fields/ImageField.ts')
-rw-r--r-- | src/fields/ImageField.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fields/ImageField.ts b/src/fields/ImageField.ts index d82260f54..b2226d55a 100644 --- a/src/fields/ImageField.ts +++ b/src/fields/ImageField.ts @@ -1,9 +1,11 @@ import { BasicField } from "./BasicField"; -import { Field } from "./Field"; +import { Field, FieldId } from "./Field"; +import { Types } from "../server/Message"; +import { ObjectID } from "bson"; export class ImageField extends BasicField<URL> { - constructor(data: URL | undefined = undefined) { - super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data); + constructor(data: URL | undefined = undefined, id?: FieldId, save: boolean = true) { + super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data, save, id); } toString(): string { @@ -18,4 +20,11 @@ export class ImageField extends BasicField<URL> { return new ImageField(this.Data); } + ToJson(): { type: Types, data: URL, _id: string } { + return { + type: Types.Image, + data: this.Data, + _id: this.Id + } + } }
\ No newline at end of file |