X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/82c3054bcdeb000aa9782da80d644070797b5cbe..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/pdcounter/static/pdcounter/pdcounter.js diff --git a/apps/pdcounter/static/pdcounter/pdcounter.js b/apps/pdcounter/static/pdcounter/pdcounter.js deleted file mode 100755 index a1ff53736..000000000 --- a/apps/pdcounter/static/pdcounter/pdcounter.js +++ /dev/null @@ -1,41 +0,0 @@ -(function($) { - $(function() { - - $('.countdown').each(function() { - var $this = $(this); - - var serverTime = function() { - var time = null; - $.ajax({url: '/zegar/', - async: false, dataType: 'text', - success: function(text) { - time = new Date(text); - }, error: function(http, message, exc) { - time = new Date(); - }}); - return time; - } - - if (LANGUAGE_CODE != 'en') { - $.countdown.setDefaults($.countdown.regional[LANGUAGE_CODE]); - } - else { - $.countdown.setDefaults($.countdown.regional['']); - } - - 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 = '{d<}{dn} {dl} {d>}{hnn}{sep}{mnn}{sep}{snn}'; - } - - $this.countdown(options); - }); - - - }); -})(jQuery);