diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-03-09 15:59:36 -0500 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-03-09 15:59:36 -0500 |
commit | 30b082a9d94465ae24d9c392843518e8df2c9d66 (patch) | |
tree | 01c464b96defe06b2c99e8e298b9287901d4d9b0 /src/fields/HtmlField.ts | |
parent | 12d20ab1b9b843d816bde445d9b67b3aa6abc6ae (diff) | |
parent | 96eede5f7d1706a3f7ac6ee02a85bb3da217f467 (diff) |
merging
Diffstat (limited to 'src/fields/HtmlField.ts')
-rw-r--r-- | src/fields/HtmlField.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fields/HtmlField.ts b/src/fields/HtmlField.ts new file mode 100644 index 000000000..a07326095 --- /dev/null +++ b/src/fields/HtmlField.ts @@ -0,0 +1,25 @@ +import { BasicField } from "./BasicField"; +import { Types } from "../server/Message"; +import { FieldId } from "./Field"; + +export class HtmlField extends BasicField<string> { + constructor(data: string = "<html></html>", id?: FieldId, save: boolean = true) { + super(data, save, id); + } + + ToScriptString(): string { + return `new HtmlField("${this.Data}")`; + } + + Copy() { + return new HtmlField(this.Data); + } + + ToJson(): { _id: string; type: Types; data: any; } { + return { + type: Types.Html, + data: this.Data, + _id: this.Id, + } + } +}
\ No newline at end of file |