From d7cdc4d2bcea9b3ee8e37fc88fb4dbc4580095ce Mon Sep 17 00:00:00 2001 From: Yuriy Prokopets Date: Wed, 23 Oct 2013 12:34:48 +0300 Subject: [PATCH] removed old files --- js/jcountdown.js | 74 ------------------------------------------------ 1 file changed, 74 deletions(-) delete mode 100644 js/jcountdown.js diff --git a/js/jcountdown.js b/js/jcountdown.js deleted file mode 100644 index 4052174..0000000 --- a/js/jcountdown.js +++ /dev/null @@ -1,74 +0,0 @@ -/*! - * jQuery Simple Countdown Plugin v1.0 - * https://github.com/madman/jquery-simple-countdown - * - * Copyright 2013 Yuriy Prokopets - * Released under the MIT license - */ -(function($) { - $.fn.countdown = function(options, callback){ - - if ($.isFunction(options)) { - callback = options; - options = {}; - } - - var defaults = { - data: 'time', - flag: 'countdown', - callback: 'callback', - }; - var settings = $.extend({}, defaults, options); - - - var intToTime = function(val) { - var - hours = (Math.floor(val / 3600)), - minutes = (Math.floor(val / 60) - (Math.floor(val / 3600) * 60)), - seconds = val % 60; - - if (hours < 10) { - hours = '0' + hours; - } - - if (minutes < 10) { - minutes = '0' + minutes; - } - - if (seconds < 10) { - seconds = '0' + seconds; - } - - return hours + ":" + minutes + ":" + seconds; - } - - var step = function(timer) { - var - callback, - left = parseInt(timer.data(settings.data)); - - timer.text(intToTime(left)); - - if (left > 0) { - timer.data(settings.data, left - 1); - setTimeout(function() {step(timer)},1000); - } else if (callback = timer.data(settings.callback)) { - if ($.isFunction(callback)) { - callback.call(null, timer); - } - } - } - - return this.each(function() { - var self = $(this); - - if (!self.data(settings.flag)) { - self.data(settings.flag, true); - self.data(settings.callback, callback); - - step(self); - } - - }); - }; -}(jQuery));