aboutsummaryrefslogtreecommitdiff
path: root/src/fields/HtmlField.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-02-25 01:31:27 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-02-25 01:31:27 -0500
commit1a32bdca177faf5a3d99bcb45aaf596ba8c706a8 (patch)
tree1f7531be1ae4032cbb5de0e54a9ae48fda9657cc /src/fields/HtmlField.ts
parentb418a6ed64e50700e2935963f01e392cbd81099d (diff)
parentdb7aa80be56e2d91acf224013b24ab73385f836c (diff)
Merge branch 'authentication' of https://github.com/browngraphicslab/Dash-Web into authentication
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