aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/plain.tpl
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-11 11:59:49 +0000
committerMario <mario@mariovavti.com>2021-05-11 11:59:49 +0000
commit26e851ff7fc074592f93088dbd96713b22defe8b (patch)
treee727d9a83590b152ddd63a8c8e7756835c45de4a /view/tpl/plain.tpl
parent406ca206347152cf4acbdcb81fc8152d83f99182 (diff)
parent89ec043ce1183dbae5ff10a994f0f819a8544ba9 (diff)
downloadvolse-hubzilla-26e851ff7fc074592f93088dbd96713b22defe8b.tar.gz
volse-hubzilla-26e851ff7fc074592f93088dbd96713b22defe8b.tar.bz2
volse-hubzilla-26e851ff7fc074592f93088dbd96713b22defe8b.zip
Merge branch '5.6RC'
Diffstat (limited to 'view/tpl/plain.tpl')
-rw-r--r--view/tpl/plain.tpl37
1 files changed, 37 insertions, 0 deletions
diff --git a/view/tpl/plain.tpl b/view/tpl/plain.tpl
new file mode 100644
index 000000000..e7aa9c63c
--- /dev/null
+++ b/view/tpl/plain.tpl
@@ -0,0 +1,37 @@
+<h2>{{$title}}</h2>
+{{if $now}}<div>{{$now}}</div>{{/if}}
+<div style="font-weight: normal; font-family: monospace;">{{$infos}}</div>
+<div id="countdown" class="h3"></div>
+<script>
+ $('.register_date').each( function () {
+ var date = new Date($(this).data('utc'));
+ $(this).html(date.toLocaleString());
+ });
+
+
+ var date = '{{$countdown}}';
+
+ date = date !== '' ? date : $('#register_start').data('utc');
+
+ if(date) {
+ doCountDown(date, 'countdown');
+ var x = setInterval(doCountDown, 1000, date, 'countdown');
+ }
+ function doCountDown(date, id) {
+ var countDownDate = new Date(date).getTime();
+ var now = new Date().getTime();
+ var distance = countDownDate - now;
+ var days = Math.floor(distance / (1000 * 60 * 60 * 24));
+ var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
+ var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
+ var seconds = Math.floor((distance % (1000 * 60)) / 1000);
+
+ document.getElementById(id).innerHTML = days + "d " + hours + "h "+ minutes + "m " + seconds + "s ";
+
+ if (distance < 0) {
+ clearInterval(x);
+ document.getElementById(id).innerHTML = 'Reloading...';
+ window.location.reload();
+ }
+ }
+</script>