(function($) {
$(function() {
-
- $('#countdown').each(function() {
+ $('.countdown').each(function() {
var $this = $(this);
var serverTime = function() {
$.countdown.setDefaults($.countdown.regional['']);
}
- var d = new Date($this.attr('data-year'), 0, 1);
- function re() {location.reload()};
- $this.countdown({until: d, format: 'ydHMS', serverSync: serverTime,
- onExpiry: re, alwaysExpire: true});
-
+ var options = {
+ until: new Date($this.attr('data-until')),
+ format: 'ydHMS',
+ serverSync: serverTime,
+ onExpiry: function(){location.reload()}, // TODO: no reload
+ };
+ if ($this.hasClass('inline')) {
+ options.layout = '{dn} {dl} {hnn}{sep}{mnn}{sep}{snn}';
+ }
+
+ $this.countdown(options);
});
});
-})(jQuery);
\ No newline at end of file
+})(jQuery);