aboutsummaryrefslogtreecommitdiff
path: root/src/fields/HtmlField.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-02-23 10:12:41 -0500
committerBob Zeleznik <zzzman@gmail.com>2019-02-23 10:12:41 -0500
commitda295c9cfa71d773c609df0e7ce3ff58aa661337 (patch)
tree002e70a2be45aa846b37561891ef8ea72fde90c0 /src/fields/HtmlField.ts
parent96327e5b393ba967a05b6c985a2641e3705c9e2c (diff)
parent6c451fa68db11c80f452ca7c85242ad98d867ab0 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/fields/HtmlField.ts')
-rw-r--r--src/fields/HtmlField.ts25
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