File: /home/posscale/subdomains/xibo/modules/clock-get-resource-flip.twig
<!doctype html>
<html lang="en">
<head>
<title>Xibo Open Source Digital Signage</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width={{ viewPortWidth }}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Copyright 2006-2014 Daniel Garner. Part of the Xibo Open Source Digital Signage Solution. Released under the AGPLv3 or later. -->
<style type="text/css">
body {
margin: 0;
overflow: hidden;
font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
}
h1, h2, h3, h4, p {
margin-top: 0;
}
</style>
{{ head|raw }}
<style type="text/css">
.flip-clock-wrapper {
text-align: center;
position: relative;
{% if clockFace == "DailyCounter" %}
width: 620px;
{% else %}
width: 460px;
{% endif %}
margin: 0;
}
</style>
</head>
<!--[if lt IE 7 ]><body class="ie6"><![endif]-->
<!--[if IE 7 ]><body class="ie7"><![endif]-->
<!--[if IE 8 ]><body class="ie8"><![endif]-->
<!--[if IE 9 ]><body class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><body><!--<![endif]-->
<div id="clock"></div>
{{ body|raw }}
</body>
{{ javaScript|raw }}
<script type="text/javascript">
var width = {{ previewWidth }};
var height = {{ previewHeight }};
if (width == 0 || height == 0) {
width = $(window).width();
height = $(window).height();
}
// Flip clock is always the same size
{% if clockFace == "DailyCounter" %}
var clock_width = 620;
{% else %}
var clock_width = 460;
{% endif %}
// Calculate the width ratio between the actual width and the clock_width
var ratio = width / clock_width;
// What IE are we?
if ($("body").hasClass('ie7') || $("body").hasClass('ie8')) {
$("#clock").css({
"filter": "progid:DXImageTransform.Microsoft.Matrix(M11=" + ratio + ", M12=0, M21=0, M22=" + ratio + ", SizingMethod='auto expand'"
});
}
else {
$("#clock").css({
"transform": "scale(" + ratio + ")",
"transform-origin": "0 0"
});
}
function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor( (t/1000) % 60 );
var minutes = Math.floor( (t/1000/60) % 60 );
var hours = Math.floor( (t/(1000*60*60)) % 24 );
var days = Math.floor( t/(1000*60*60*24) );
return {
'total': t,
'days': days,
'hours': hours,
'minutes': minutes,
'seconds': seconds
};
}
var clock;
var offset = "{{ offset }}";
$(document).ready(function() {
// Show Seconds: {{ showSeconds }}
// Offset: {{ offset }}
{% if clockFace == "TwelveHourClock" or clockFace == "TwentyFourHourClock" %}
clock = $('#clock').FlipClock({
clockFace: '{{ clockFace }}',
showSeconds: {% if showSeconds == 1 %}true{% else %}false{% endif %}
});
clock.setTime(clock.getTime() + (offset * 60 * 1000));
{% else %}
if (isNaN(offset)) {
var duration = getTimeRemaining(offset).total / 1000;
} else {
var duration = {{ duration }};
}
clock = $('#clock').FlipClock(duration, {
clockFace: '{{ clockFace }}',
showSeconds: {% if showSeconds == 1 %}true{% else %}false{% endif %},
countdown: true
});
{% endif %}
});
</script>
</html>
{{ controlMeta|raw }}