Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbroadcast.html
More file actions
Latest commit
50 lines (46 loc) · 1.65 KB
/
Copy pathbroadcast.html
File metadata and controls
50 lines (46 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
layout: default
title: Broadcast
description: Broadcasting Hackatron's meetings
---
<divid="broadcast">
<h2>Meeting broadcast</h2>
<p>
Next broadcast is scheduled for <spanid="next_broadcast"></span> and will start in <br/><spanid="timer"></span>.
</p>
</div>
<scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<scriptsrc="/javascripts/moment.min.js"></script>
<script>
functionplural(singular,n){
returnsingular+(n>1||n<=0 ? 's' : '');
}
$(document).ready(function(){
$.ajax({
type: 'GET',
dataType: 'jsonp',
cache: false,
url: 'http://hackatron-hubot.herokuapp.com/hubot/topic/hackatron',
success: function(topic){
timeString=topic.replace(/[^\:]+\:/,'').replace(/@.+/,'');
$('#next_broadcast').html(timeString);
time=moment(timeString+'+0200','dddd, MMMM DD.., hh:mm A ZZ');
time.year(newDate().getFullYear());
timerId=setInterval(function(target){
delta=Math.floor(target.unix()-(newDate().getTime()/1000));
seconds=delta%60;
delta=Math.floor(delta/60);
minutes=delta%60;
delta=Math.floor(delta/60);
hours=delta%24;
days=Math.floor(delta/24);
timerString=days+' '+plural('day',days)+', '+
hours+' '+plural('hour',hours)+', '+
minutes+' '+plural('minute',minutes)+', '+
seconds+' '+plural('second',seconds);
$('#timer').html(timerString);
},300,time);
}
});
});
</script>