Merge branch 'master' of hackerspace.pl:q3k/web-static

master
Tomek Dubrownik 2013-01-26 20:01:37 +01:00
commit 5fc69c51a1
3 changed files with 48 additions and 6 deletions

View File

@ -340,24 +340,25 @@ div .twtr-widget p {
display: block;
position: absolute;
border-radius: 3px;
bottom: 5px;
top: 15px;
left: 0;
}
#status img {
width: 59px;
height: 40px;
height: 60px;
position: absolute;
left: 5px;
bottom: 0;
top: 0;
}
#status-tooltip {
margin-right: 5px;
margin-top: 2px;
margin-top: 11 px;
max-width: 250px;
height: 38px;
border-radius: 3px;
margin-left: 60px;
margin-left: 102px;
margin-top: 8px;
padding: 4px;
}
.status-tooltip-open {
@ -375,6 +376,8 @@ div .twtr-widget p {
line-height: 130%;
font-weight: 600;
font-size: 14px;
padding: 0;
text-align: center;
}
#status-tooltip a {

35
js/checkinator-header.js Normal file
View File

@ -0,0 +1,35 @@
jQuery(document).ready(function() {
function checkinify() {
jQuery.get("http://at.hackerspace.pl/api", function(data) {
var jdata = JSON.parse(data);
var users = jdata.users.length;
var tooltip = jQuery('#status-tooltip');
var text = 'According to <a href="http://at.hackerspace.pl">our instruments</a> there ';
if (users == 1)
text += 'is at least one person';
else if(users == 0)
text += 'is probably no one';
else
text += 'are at least ' + users + ' people';
text += ' at the hackerspace right now.';
jQuery("#status-tooltip p").html(text);
if(users > 0) {
jQuery("#status img").attr("src", "https://static.hackerspace.pl/img/status-open.png");
tooltip.removeClass('status-tooltip-closed');
tooltip.addClass('status-tooltip-open');
}
else {
jQuery("#status img").attr("src", "https://static.hackerspace.pl/img/status-closed.png");
tooltip.removeClass('status-tooltip-open');
tooltip.addClass('status-tooltip-closed');
}
jQuery("#status").css('display', 'inline-block');
jQuery("#status-tooltip").css('display', 'inline-block');
});
}
setInterval(checkinify, 1e3 * 300);
checkinify();
});

4
js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long