aboutsummaryrefslogtreecommitdiff
path: root/mavigator-server/src/main/twirl/mavigator/views/app.scala.html
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2016-02-24 20:33:51 -0800
committerJakob Odersky <jakob@odersky.com>2016-02-24 20:33:51 -0800
commit8186b3622ce1c9d2b50df3d264ab526dc1e61d77 (patch)
treeb4446408291c9f179e1c270a561523023ac6a105 /mavigator-server/src/main/twirl/mavigator/views/app.scala.html
parent6c4e8849d753734b3e50523dcdb372fbdbccc2c1 (diff)
parenta41de68066007852d7d3dbf019d75b4caf7463ad (diff)
downloadmavigator-8186b3622ce1c9d2b50df3d264ab526dc1e61d77.tar.gz
mavigator-8186b3622ce1c9d2b50df3d264ab526dc1e61d77.tar.bz2
mavigator-8186b3622ce1c9d2b50df3d264ab526dc1e61d77.zip
Merge branch 'akka-streams'
Diffstat (limited to 'mavigator-server/src/main/twirl/mavigator/views/app.scala.html')
-rw-r--r--mavigator-server/src/main/twirl/mavigator/views/app.scala.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/mavigator-server/src/main/twirl/mavigator/views/app.scala.html b/mavigator-server/src/main/twirl/mavigator/views/app.scala.html
new file mode 100644
index 0000000..34d1fde
--- /dev/null
+++ b/mavigator-server/src/main/twirl/mavigator/views/app.scala.html
@@ -0,0 +1,53 @@
+@(title: String, appId: String, args: Map[String, String])
+
+@*
+* Provides the environment and loads a scalajs application.
+*@
+
+@main(title){
+
+<div id="scalajs-error" class="alert alert-danger" style="display: none;">
+ <p><strong><i class="fa fa-bug"></i> Error! </strong> An uncaught exception occurred in the browser application,
+ any information displayed on this website may be corrupt. This is NOT an error that should occur under normal
+ operation, it is an indication of a bug in the software.</p>
+ <p>The error was: "<span id="scalajs-error-message"></span>"</p>
+</div>
+
+<div id="@appId">
+ <div class="loader">
+ <i class="fa fa-spinner fa-spin"></i>
+ </div>
+</div>
+
+<script type="text/javascript">
+ document.addEventListener("DOMContentLoaded", function(event) {
+ try {
+ //root element that will contain the ScalaJS application
+ var root0 = document.getElementById("@appId");
+
+ //clear any existing content
+ while (root0.firstChild) {
+ root0.removeChild(root0.firstChild);
+ }
+
+ //run ScalaJS application
+ @{appId}().start({
+ root: root0,
+ assetsBase: "/assets",
+ args: {@args.map{ case (key, value) =>
+ @key: "@value",
+ }}
+ });
+
+ } catch(ex) {
+ //display warning message in case of exception
+ document.getElementById("scalajs-error").style.display = "block";
+ document.getElementById("scalajs-error-message").innerHTML = ex;
+ throw ex;
+ }
+ });
+</script>
+
+<script type="text/javascript" src="/assets/js/mavigator-dashboard-opt.js"></script>
+
+}