summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rw-r--r--cgi/public/image.js9
-rw-r--r--cgi/templates/main.html.ep13
2 files changed, 10 insertions, 12 deletions
diff --git a/cgi/public/image.js b/cgi/public/image.js
new file mode 100644
index 0000000..40bc37d
--- /dev/null
+++ b/cgi/public/image.js
@@ -0,0 +1,9 @@
+$(document).ready(function() {
+ function reloadImage() {
+ d = new Date();
+ origurl = $('#display').attr('src').split('&r=')[0];
+ $('#display').attr('src', origurl+'&r='+d.getTime());
+ setTimeout(reloadImage, 60000);
+ }
+ setTimeout(reloadImage, 60000);
+});
diff --git a/cgi/templates/main.html.ep b/cgi/templates/main.html.ep
index cc93bed..8f42291 100644
--- a/cgi/templates/main.html.ep
+++ b/cgi/templates/main.html.ep
@@ -5,6 +5,7 @@
<meta charset="utf-8">
%= stylesheet '/main.css'
%= javascript '/jquery-2.1.1.min.js'
+ %= javascript '/image.js'
</head>
<body>
@@ -164,17 +165,5 @@ shorten destination names</li>
v<%= $version %>
</div>
-%= javascript begin
-function reloadDisplay() {
- d = new Date();
- $("#display").attr("src", "../<%= $city %>/<%= $stop %>.<%= $frontend %>?<%= $params %>&r="+d.getTime())
- setTimeout('reloadDisplay()', 60000);
-}
-
-setTimeout('reloadDisplay()', 60000);
-% end
-
</body>
-
-
</html>