aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Templates.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-04-01 17:22:49 -0400
committerFawn <fangrui_tong@brown.edu>2019-04-01 17:22:49 -0400
commit5246c3c38acda6cbd8636577ff8f658657609d88 (patch)
tree6c8e055add9837a8d050de7498f7d4d8432c6215 /src/client/views/Templates.tsx
parent0ae1eac2e2b26c0eee747c81ea1478118b4ec874 (diff)
set up for templating
Diffstat (limited to 'src/client/views/Templates.tsx')
-rw-r--r--src/client/views/Templates.tsx40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/client/views/Templates.tsx b/src/client/views/Templates.tsx
new file mode 100644
index 000000000..8260f9414
--- /dev/null
+++ b/src/client/views/Templates.tsx
@@ -0,0 +1,40 @@
+import { observer } from "mobx-react";
+import { observable } from "mobx";
+import { action, computed } from "mobx";
+import React = require("react");
+
+export class Template {
+ constructor(layout: string) {
+ this._layout = layout;
+ }
+
+ private _layout: string = "";
+
+ get Layout(): string {
+ return this._layout;
+ }
+}
+
+export namespace Templates {
+ export const OuterCaption = new Template(`
+ <div>
+ <div style="margin:auto; height:calc(100%); width:100%;">
+ {layout}
+ </div>
+ <div style="height:(100% + 25px); width:100%; position:absolute">
+ <FormattedTextBox doc={Document} DocumentViewForField={DocumentView} bindings={bindings} fieldKey={"CaptionKey"} isSelected={isSelected} select={select} selectOnLoad={SelectOnLoad} isTopMost={isTopMost}/>
+ </div>
+ </div>
+ `);
+ export const InnerCaption = new Template(`
+ <div>
+ <div style="margin:auto; height:calc(100% - 25px); width:100%;">
+ {layout}
+ </div>
+ <div style="height:25px; width:100%; position:absolute">
+ <FormattedTextBox doc={Document} DocumentViewForField={DocumentView} bindings={bindings} fieldKey={"CaptionKey"} isSelected={isSelected} select={select} selectOnLoad={SelectOnLoad} isTopMost={isTopMost}/>
+ </div>
+ </div>
+ `);
+}
+