diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-08-20 17:37:38 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-08-20 17:37:38 +0200 |
commit | 9d09737ac16b1f3715c38f57830b41a3269d85d9 (patch) | |
tree | 69c8cd1fe4c3ac07481e5a8bc611b1d5466a7949 /cgi | |
parent | 67293b98b51c7287e7bd93715d3324b2bc64b529 (diff) |
do not use inline js as well
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/public/image.js | 9 | ||||
-rw-r--r-- | cgi/templates/main.html.ep | 13 |
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> |