aboutsummaryrefslogtreecommitdiff
path: root/common/shared/src/main/scala/TextTemplates.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@inpher.io>2019-10-09 17:10:43 -0400
committerJakob Odersky <jakob@inpher.io>2019-10-09 20:33:16 -0400
commit0ceee5ed4bae240b8c8e94d2fd7424d9d0b67ec7 (patch)
tree2df0258f81050e6fed51d38e217c4f6256518e12 /common/shared/src/main/scala/TextTemplates.scala
parentfaed28c54900fc0b359700873367095f51425794 (diff)
downloadscala-triad-0ceee5ed4bae240b8c8e94d2fd7424d9d0b67ec7.tar.gz
scala-triad-0ceee5ed4bae240b8c8e94d2fd7424d9d0b67ec7.tar.bz2
scala-triad-0ceee5ed4bae240b8c8e94d2fd7424d9d0b67ec7.zip
Migrate build to mill
Diffstat (limited to 'common/shared/src/main/scala/TextTemplates.scala')
-rw-r--r--common/shared/src/main/scala/TextTemplates.scala64
1 files changed, 0 insertions, 64 deletions
diff --git a/common/shared/src/main/scala/TextTemplates.scala b/common/shared/src/main/scala/TextTemplates.scala
deleted file mode 100644
index e7e364a..0000000
--- a/common/shared/src/main/scala/TextTemplates.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-package triad
-
-object TextTemplates extends Templates(scalatags.Text) {
- import bundle.all._
-
- def scripts(js: Boolean = true) =
- if (js)
- Seq(
- div(id := "scalajs-error", style := "display: none;")(
- "ScalaJS raised an exception. See the log for more information."
- ),
- script(`type` := "text/javascript",
- src := "/assets/ui/js/ui-fastopt.js"),
- script(`type` := "text/javascript")(
- raw(
- """|document.addEventListener("DOMContentLoaded", function(event) {
- | try {
- | // root element that will contain the ScalaJS application
- | var root = document.getElementById("conversation");
- |
- | // clear any existing content
- | while (root.firstChild) {
- | root.removeChild(root.firstChild);
- | }
- |
- | // run ScalaJS application
- | console.info("Starting ScalaJS application...")
- | triad.Main().main(root)
- | } catch(ex) {
- | // display warning message in case of exception
- | document.getElementById("scalajs-error").style.display = "block";
- | throw ex;
- | }
- |});
- |""".stripMargin
- )
- )
- )
- else Seq.empty
-
- def page(messages: Seq[Message], js: Boolean = true) = html(
- head(
- link(rel := "stylesheet",
- `type` := "text/css",
- href := "/assets/lib/bootstrap-4.1.0/css/bootstrap-reboot.min.css"),
- link(rel := "stylesheet",
- `type` := "text/css",
- href := "/assets/lib/bootstrap-4.1.0/css/bootstrap-grid.min.css"),
- link(rel := "stylesheet",
- `type` := "text/css",
- href := "/assets/lib/bootstrap-4.1.0/css/bootstrap.min.css"),
- link(rel := "stylesheet",
- `type` := "text/css",
- href := "/assets/main.css"),
- meta(name := "viewport",
- content := "width=device-width, initial-scale=1, shrink-to-fit=no")
- ),
- body(
- conversation(messages),
- scripts(js)
- )
- )
-
-}