From 29fa69cb5e8b1fd87f7d3106f09143c781cb24f7 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:48:15 -0500 Subject: [PATCH 001/129] - (Examples) Updated example to match all the new code changes --- ...ntdown-from-new-years-without-seconds.html | 4 ++- examples/countdown-start-callback.html | 15 ++++----- examples/countdown-stop-callback.html | 12 +++---- ...ountdown-to-new-years-without-seconds.html | 6 ++-- examples/countdown-to-new-years.html | 4 ++- examples/daily-counter-countdown.html | 16 ++++----- examples/daily-counter.html | 5 ++- examples/interval-callback.html | 12 ++----- examples/load-new-clock-face.html | 10 +----- examples/localization.html | 4 ++- examples/simple-countdown-autostart.html | 6 ++-- examples/simple-counter-autostart.html | 4 ++- examples/simple-counter-minimum-digits.html | 6 ++-- examples/test.html | 33 ++++--------------- .../twelve-hour-clock-without-seconds.html | 4 ++- ...wenty-four-hour-clock-without-seconds.html | 4 ++- 16 files changed, 65 insertions(+), 80 deletions(-) diff --git a/examples/countdown-from-new-years-without-seconds.html b/examples/countdown-from-new-years-without-seconds.html index 16ab3c95..a3c48a56 100644 --- a/examples/countdown-from-new-years-without-seconds.html +++ b/examples/countdown-from-new-years-without-seconds.html @@ -26,7 +26,9 @@ // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', - showSeconds: false + clockFaceOptions: { + showSeconds: false + } }); }); diff --git a/examples/countdown-start-callback.html b/examples/countdown-start-callback.html index d27242b7..c483493c 100644 --- a/examples/countdown-start-callback.html +++ b/examples/countdown-start-callback.html @@ -19,17 +19,16 @@ clock = $('.clock').FlipClock(10, { clockFace: 'MinuteCounter', - countdown: true, - autoStart: false, - callbacks: { - start: function() { - $('.message').html('The clock has started!'); - } - } + clockFaceOptions: { + countdown: true, + autoStart: false + }, + onStart: function() { + $('.message').html('The clock has started!'); + } }); $('.start').click(function(e) { - clock.start(); }); diff --git a/examples/countdown-stop-callback.html b/examples/countdown-stop-callback.html index 66869d9c..395e7c28 100644 --- a/examples/countdown-stop-callback.html +++ b/examples/countdown-stop-callback.html @@ -15,13 +15,13 @@ $(document).ready(function() { - clock = $('.clock').FlipClock(10, { + clock = $('.clock').FlipClock(5, { clockFace: 'MinuteCounter', - countdown: true, - callbacks: { - stop: function() { - $('.message').html('The clock has stopped!'); - } + clockFaceOptions: { + countdown: true, + }, + onStop: function() { + $('.message').html('The clock has stopped!'); } }); diff --git a/examples/countdown-to-new-years-without-seconds.html b/examples/countdown-to-new-years-without-seconds.html index 6ec0405b..cc8d735e 100644 --- a/examples/countdown-to-new-years-without-seconds.html +++ b/examples/countdown-to-new-years-without-seconds.html @@ -26,8 +26,10 @@ // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', - countdown: true, - showSeconds: false + clockFaceOption: { + countdown: true, + showSeconds: false + } }); }); diff --git a/examples/countdown-to-new-years.html b/examples/countdown-to-new-years.html index 0fe052b9..30947cd3 100644 --- a/examples/countdown-to-new-years.html +++ b/examples/countdown-to-new-years.html @@ -26,7 +26,9 @@ // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', - countdown: true + clockFaceOption: { + countdown: true + } }); }); diff --git a/examples/daily-counter-countdown.html b/examples/daily-counter-countdown.html index 5ed3250d..3048a873 100644 --- a/examples/daily-counter-countdown.html +++ b/examples/daily-counter-countdown.html @@ -18,16 +18,16 @@ clock = $('.clock').FlipClock({ clockFace: 'DailyCounter', - autoStart: false, - callbacks: { - stop: function() { - $('.message').html('The clock has stopped!') - } - } + clockFaceOptions: { + autoStart: false, + }, + onStop: function() { + $('.message').html('The clock has stopped!'); + } }); - clock.setTime(220880); - clock.setCountdown(true); + clock.setTime(10); + clock.face.setCountdown(true); clock.start(); }); diff --git a/examples/daily-counter.html b/examples/daily-counter.html index b7a7a072..3afa8adb 100644 --- a/examples/daily-counter.html +++ b/examples/daily-counter.html @@ -16,7 +16,10 @@ $(document).ready(function() { clock = $('.clock').FlipClock({ - clockFace: 'DailyCounter' + clockFace: 'DailyCounter', + clockFaceOptions: { + showSeconds: false + } }); }); diff --git a/examples/interval-callback.html b/examples/interval-callback.html index 97655b8d..e283e9c8 100644 --- a/examples/interval-callback.html +++ b/examples/interval-callback.html @@ -17,15 +17,9 @@ clock = $('.clock').FlipClock({ clockFace: 'MinuteCounter', - callbacks: { - interval: function() { - var time = this.factory.getTime().time; - - if(time) { - console.log('interval', time); - } - } - } + onInterval: function() { + console.log('interval', this.face.getTime().time); + } }); }); diff --git a/examples/load-new-clock-face.html b/examples/load-new-clock-face.html index 305159d0..d4a6e2db 100644 --- a/examples/load-new-clock-face.html +++ b/examples/load-new-clock-face.html @@ -20,19 +20,11 @@ autoStart: true }); - setTimeout(function() { - clock.loadClockFace('MinuteCounter'); - }, 3000); - - setTimeout(function() { - clock.loadClockFace('HourlyCounter'); - }, 7000); - setTimeout(function() { clock.loadClockFace('Counter', { autoStart: true }); - }, 10000); + }, 3000); }); diff --git a/examples/localization.html b/examples/localization.html index dedcae1c..e480d4f4 100644 --- a/examples/localization.html +++ b/examples/localization.html @@ -15,7 +15,9 @@ $(document).ready(function() { clock = $('.clock').FlipClock({ clockFace: 'DailyCounter', - language: 'es' + clockFaceOptions: { + language: 'es' + } }); }); diff --git a/examples/simple-countdown-autostart.html b/examples/simple-countdown-autostart.html index 6b24f19d..9408e9fd 100644 --- a/examples/simple-countdown-autostart.html +++ b/examples/simple-countdown-autostart.html @@ -17,8 +17,10 @@ // Instantiate a counter clock = new FlipClock($('.clock'), 10, { clockFace: 'Counter', - autoStart: true, - countdown: true + clockFaceOptions: { + autoStart: true, + countdown: true + } }); }); diff --git a/examples/simple-counter-autostart.html b/examples/simple-counter-autostart.html index 8bd7c8fa..1c2ba649 100644 --- a/examples/simple-counter-autostart.html +++ b/examples/simple-counter-autostart.html @@ -17,7 +17,9 @@ // Instantiate a counter clock = new FlipClock($('.clock'), { clockFace: 'Counter', - autoStart: true + clockFaceOptions: { + autoStart: true + } }); }); diff --git a/examples/simple-counter-minimum-digits.html b/examples/simple-counter-minimum-digits.html index 053544a5..ecc708eb 100644 --- a/examples/simple-counter-minimum-digits.html +++ b/examples/simple-counter-minimum-digits.html @@ -17,8 +17,10 @@ // Instantiate a counter clock = new FlipClock($('.clock'), { clockFace: 'Counter', - autoStart: true, - minimumDigits: 6 + clockFaceOptions: { + autoStart: true, + minimumDigits: 6 + } }); }); diff --git a/examples/test.html b/examples/test.html index 7067e265..5a29a8ec 100644 --- a/examples/test.html +++ b/examples/test.html @@ -10,37 +10,16 @@
diff --git a/examples/twelve-hour-clock-without-seconds.html b/examples/twelve-hour-clock-without-seconds.html index 569f213c..bdc198f6 100644 --- a/examples/twelve-hour-clock-without-seconds.html +++ b/examples/twelve-hour-clock-without-seconds.html @@ -15,7 +15,9 @@ $(document).ready(function() { clock = $('.clock').FlipClock({ clockFace: 'TwelveHourClock', - showSeconds: false + clockFaceOptions: { + showSeconds: false + } }); }); diff --git a/examples/twenty-four-hour-clock-without-seconds.html b/examples/twenty-four-hour-clock-without-seconds.html index f0ac6a0b..51e9607f 100644 --- a/examples/twenty-four-hour-clock-without-seconds.html +++ b/examples/twenty-four-hour-clock-without-seconds.html @@ -15,7 +15,9 @@ $(document).ready(function() { clock = $('.clock').FlipClock({ clockFace: 'TwentyFourHourClock', - showSeconds: false + clockFaceOptions: { + showSeconds: false + } }); }); From fbdba08cbc3f684cfa26a4abbc365c3c3d52620a Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:49:04 -0500 Subject: [PATCH 002/129] - (API) Added new Flipclock.Uuid generator classes which is used for "cid", a unique id assigned to all objects created by FlipClock --- src/flipclock/js/libs/Uuid.js | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/flipclock/js/libs/Uuid.js diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js new file mode 100644 index 00000000..6f310288 --- /dev/null +++ b/src/flipclock/js/libs/Uuid.js @@ -0,0 +1,41 @@ +(function($) { + + FlipClock.Uuid = FlipClock.Base.extend({ + + value: false, + + constructor: function() { + this.value = this.generate(); + }, + + generate: function() { + var d = new Date().getTime(); + var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = (d + Math.random()*16)%16 | 0; + d = Math.floor(d/16); + return (c=='x' ? r : (r&0x3|0x8)).toString(16); + }); + return uuid; + }, + + equals: function(other) { + return this.isUuid(other) && value == other; + }, + + isUuid: function(value) { + var validator = new RegExp("^[a-z0-9]{32}$", "i"); + + return value && (value instanceof Uuid || validator.test(value.toString())); + }, + + toString: function() { + return this.value; + }, + + toJSON: function() { + return this.value; + } + + }); + +}(jQuery)); \ No newline at end of file From 4304ac8f3cce575a555cd44ce7f58f6eb8f1db8f Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:49:36 -0500 Subject: [PATCH 003/129] - (API) Added FlipClock.Translator classes to provide an abstraction for translating strings in FlipClock --- src/flipclock/js/libs/Translator.js | 86 +++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src/flipclock/js/libs/Translator.js diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js new file mode 100644 index 00000000..a2b117dc --- /dev/null +++ b/src/flipclock/js/libs/Translator.js @@ -0,0 +1,86 @@ +(function() { + + FlipClock.Translator = FlipClock.Base.extend({ + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english', + + /** + * The language object after it has been loaded + */ + + lang: false, + + /* + * Constructor + * + * @param string + * @return + */ + + constructor: function(options) { + this.base(options); + this.loadLanguage(this.language); + }, + + /** + * Load the FlipClock.Lang object + * + * @param object The name of the language to load + */ + + loadLanguage: function(name) { + var lang; + + if(FlipClock.Lang[name.ucfirst()]) { + lang = FlipClock.Lang[name.ucfirst()]; + } + else if(FlipClock.Lang[name]) { + lang = FlipClock.Lang[name]; + } + else { + lang = FlipClock.Lang[this.defaultLanguage]; + } + + return this.lang = lang; + }, + + /** + * Localize strings into various languages + * + * @param string The index of the localized string + * @param object Optionally pass a lang object + */ + + localize: function(index, obj) { + var lang = this.lang; + + if(!index) { + return null; + } + + var lindex = index.toLowerCase(); + + if(typeof obj == "object") { + lang = obj; + } + + if(lang && lang[lindex]) { + return lang[lindex]; + } + + return index; + } + + }); + +}()); \ No newline at end of file From 143efea8b536cf249038d1befd4bd8cb126b528c Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:53:52 -0500 Subject: [PATCH 004/129] - (Bug Fix) Fixed leaky abstractions in FlipClock.Timer --- src/flipclock/js/libs/{timer.js => Timer.js} | 65 ++++++++------------ 1 file changed, 27 insertions(+), 38 deletions(-) rename src/flipclock/js/libs/{timer.js => Timer.js} (76%) diff --git a/src/flipclock/js/libs/timer.js b/src/flipclock/js/libs/Timer.js similarity index 76% rename from src/flipclock/js/libs/timer.js rename to src/flipclock/js/libs/Timer.js index f729257e..6e5ae779 100644 --- a/src/flipclock/js/libs/timer.js +++ b/src/flipclock/js/libs/Timer.js @@ -15,38 +15,23 @@ /** * The FlipClock.Timer object managers the JS timers * - * @param object The parent FlipClock.Factory object * @param object Override the default options */ FlipClock.Timer = FlipClock.Base.extend({ /** - * Callbacks + * The rate of the animation in milliseconds (not currently in use) */ - callbacks: { - destroy: false, - create: false, - init: false, - interval: false, - start: false, - stop: false, - reset: false - }, - + animationRate: 1000, + /** * FlipClock timer count (how many intervals have passed) */ count: 0, - /** - * The parent FlipClock.Factory object - */ - - factory: false, - /** * Timer interval (1 second by default) */ @@ -54,10 +39,10 @@ interval: 1000, /** - * The rate of the animation in milliseconds (not currently in use) + * Is the timer running? */ - animationRate: 1000, + running: false, /** * Constructor @@ -65,11 +50,9 @@ * @return void */ - constructor: function(factory, options) { + constructor: function(options) { this.base(options); - this.factory = factory; - this.callback(this.callbacks.init); - this.callback(this.callbacks.create); + this.trigger('init'); }, /** @@ -102,8 +85,8 @@ reset: function(callback) { clearInterval(this.timer); this.count = 0; - this._setInterval(callback); - this.callback(this.callbacks.reset); + this._setInterval(callback); + this.trigger('reset'); }, /** @@ -113,10 +96,10 @@ * @return void */ - start: function(callback) { - this.factory.running = true; + start: function(callback) { + this.running = true; this._createTimer(callback); - this.callback(this.callbacks.start); + this.trigger('start'); }, /** @@ -127,10 +110,15 @@ */ stop: function(callback) { - this.factory.running = false; - this._clearInterval(callback); - this.callback(this.callbacks.stop); - this.callback(callback); + var t = this; + + this.running = false; + this._clearInterval(); + + setTimeout(function() { + t.callback(callback); + t.trigger('stop'); + }, this.interval); }, /** @@ -161,11 +149,12 @@ * @return void */ - _destroyTimer: function(callback) { - this._clearInterval(); + destroyTimer: function(callback) { + this._clearInterval(); + this.running = false; this.timer = false; this.callback(callback); - this.callback(this.callbacks.destroy); + this.trigger('destroy') }, /** @@ -176,8 +165,8 @@ */ _interval: function(callback) { - this.callback(this.callbacks.interval); this.callback(callback); + this.trigger('interval'); this.count++; }, @@ -200,4 +189,4 @@ }); -}(jQuery)); +}(jQuery)); \ No newline at end of file From 801d7e58b0190f1694a702070ad70521b122d1d6 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:54:31 -0500 Subject: [PATCH 005/129] - (Bug Fix) Removed leaky abstractions in FlipClock.Time --- src/flipclock/js/libs/time.js | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/flipclock/js/libs/time.js b/src/flipclock/js/libs/time.js index a87cb88c..57bbdd4c 100644 --- a/src/flipclock/js/libs/time.js +++ b/src/flipclock/js/libs/time.js @@ -16,7 +16,6 @@ * The FlipClock Time class is used to manage all the time * calculations. * - * @param object A FlipClock.Factory object * @param mixed This is the digit used to set the clock. If an * object is passed, 0 will be used. * @param object An object of properties to override the default @@ -30,12 +29,6 @@ time: 0, - /** - * The parent FlipClock.Factory object - */ - - factory: false, - /** * The minimum number of digits the clock face must have */ @@ -45,26 +38,24 @@ /** * Constructor * - * @param object A FlipClock.Factory object * @param int An integer use to select the correct digit * @param object An object to override the default properties */ - constructor: function(factory, time, options) { + constructor: function(time, options) { if(typeof options != "object") { options = {}; } - if(!options.minimumDigits) { - options.minimumDigits = factory.minimumDigits; + if(time instanceof Date) { + this.time = time; + } + else if(time) { + this.time = Math.round(time); } this.base(options); - this.factory = factory; - if(time) { - this.time = time; - } }, /** @@ -299,13 +290,13 @@ * @return int Returns a floored integer */ - getTimeSeconds: function(date) { + getTimeSeconds: function(countdown, date) { if(!date) { date = new Date(); } if (this.time instanceof Date) { - if (this.factory.countdown) { + if (countdown) { return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); } else { return date.getTime()/1000 - this.time.getTime()/1000 ; @@ -330,9 +321,6 @@ date = this.getDateObject(); } - console.log(date); - - var hours = date.getHours(); var merid = hours > 12 ? 'PM' : 'AM'; var data = [ From cedaae84e00ee66de378e3921a4081e307151b35 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:54:56 -0500 Subject: [PATCH 006/129] - (API) Added FlipClock.NumericList for numeric based clocks --- src/flipclock/js/libs/NumericList.js | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/flipclock/js/libs/NumericList.js diff --git a/src/flipclock/js/libs/NumericList.js b/src/flipclock/js/libs/NumericList.js new file mode 100644 index 00000000..5df19213 --- /dev/null +++ b/src/flipclock/js/libs/NumericList.js @@ -0,0 +1,46 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock.List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. + * + * @param mixed This is the value used to set the clock. If an + * object is passed, 0 will be used. + * @param object An object of properties to override the default + */ + + FlipClock.NumericList = FlipClock.List.extend({ + + getPrevValue: function() { + if(this.value > 0) { + return this.value - 1; + } + + return 9; + }, + + getNextValue: function() { + if(this.value < 9) { + return this.value + 1; + } + + return 0; + } + + }); + + +}(jQuery)); \ No newline at end of file From a7508243be64828c9257b034340f2fb30f3ad156 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:57:19 -0500 Subject: [PATCH 007/129] - (API) Added new FlipClock.ListItem class handle all the list items instead of using jQuery and strings --- src/flipclock/js/libs/ListItem.js | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/flipclock/js/libs/ListItem.js diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js new file mode 100644 index 00000000..d0ed111d --- /dev/null +++ b/src/flipclock/js/libs/ListItem.js @@ -0,0 +1,43 @@ +(function($) { + + FlipClock.ListItem = FlipClock.Base.extend({ + + css: null, + + value: null, + + classes: { + up: 'up', + down: 'down' + }, + + $el: false, + + constructor: function(css, value, options) { + this.base(options); + this.css = css; + this.value = value; + + this.$el = $([ + '
  • ', + '', + '
    ', + '
    ', + '
    '+value+'
    ', + '
    ', + '
    ', + '
    ', + '
    '+value+'
    ', + '
    ', + '
    ', + '
  • ' + ].join('')); + }, + + toString: function() { + return this.$el.html(); + } + + }); + +}(jQuery)); \ No newline at end of file From 4d6256a06724055b24035c392ce18be20ff74447 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 02:58:29 -0500 Subject: [PATCH 008/129] - (Bug Fix) Removed leaky abstractions in FlipClock.List --- src/flipclock/js/libs/list.js | 184 ++++++++++++++-------------------- 1 file changed, 76 insertions(+), 108 deletions(-) diff --git a/src/flipclock/js/libs/list.js b/src/flipclock/js/libs/list.js index fd40a9a8..bd6e7c3e 100644 --- a/src/flipclock/js/libs/list.js +++ b/src/flipclock/js/libs/list.js @@ -13,24 +13,17 @@ "use strict"; /** - * The FlipClock List class is used to build the list used to create + * The FlipClock.List class is used to build the list used to create * the card flip effect. This object fascilates selecting the correct - * node by passing a specific digit. + * node by passing a specific value. * - * @param object A FlipClock.Factory object - * @param mixed This is the digit used to set the clock. If an + * @param mixed This is the value used to set the clock. If an * object is passed, 0 will be used. * @param object An object of properties to override the default */ FlipClock.List = FlipClock.Base.extend({ - /** - * The digit (0-9) - */ - - digit: 0, - /** * The CSS classes */ @@ -38,26 +31,15 @@ classes: { active: 'flip-clock-active', before: 'flip-clock-before', - flip: 'flip' + flip: 'flip', + play: 'play' }, - /** - * The parent FlipClock.Factory object - */ - - factory: false, - /** * The jQuery object */ $el: false, - - /** - * The jQuery object (deprecated) - */ - - $obj: false, /** * The items in the list @@ -66,81 +48,91 @@ items: [], /** - * The last digit + * The last value selected in the list */ - lastDigit: 0, + lastValue: 0, + /** + * The selected value in the list + */ + + value: 0, + /** * Constructor * * @param object A FlipClock.Factory object - * @param int An integer use to select the correct digit + * @param int An string or integer use to select the correct value * @param object An object to override the default properties */ - constructor: function(factory, digit, options) { - this.factory = factory; - this.digit = digit; - this.lastDigit = digit; - this.$el = this.createList(); - - // Depcrated support of the $obj property. - this.$obj = this.$el; + constructor: function(value, options) { + this.base(options); - if(digit > 0) { - this.select(digit); - } + this.value = value; - this.factory.$el.append(this.$el); + var t = this; + + this.createList(); + + this.trigger('init'); }, /** - * Select the digit in the list + * Select the value in the list * - * @param int A digit 0-9 + * @param int A value 0-9 */ - select: function(digit) { - if(typeof digit === "undefined") { - digit = this.digit; + select: function(value) { + var _afterListItem = this._afterListItem; + + this.lastValue = this.value; + + if(typeof value === "undefined") { + value = this.value; } else { - this.digit = digit; + this.value = value; } - if(this.digit != this.lastDigit) { - var $delete = this.$el.find('.'+this.classes.before).removeClass(this.classes.before); + if(this.value != this.lastValue) { + this._beforeListItem.$el.removeClass(this.classes.before); - this.$el.find('.'+this.classes.active).removeClass(this.classes.active) - .addClass(this.classes.before); + this.$el.find('.'+this.classes.active) + .removeClass(this.classes.active) + .addClass(this.classes.before); - this.appendListItem(this.classes.active, this.digit); + this.items.splice(0, 1); - $delete.remove(); + this._afterListItem = this.createListItem(this.classes.active, this.value); - this.lastDigit = this.digit; + this._beforeListItem.$el.remove(); + this._beforeListItem = _afterListItem; + + this.trigger('select', this.value); } }, - - /** - * Adds the play class to the DOM object - */ - - play: function() { - this.$el.addClass(this.factory.classes.play); + + /* + * Add the play class to the list + * + * @return + */ + + addPlayClass: function() { + this.$el.addClass(this.classes.play); }, - /** - * Removes the play class to the DOM object - */ - - stop: function() { - var t = this; + /* + * Remove the play class to the list + * + * @return + */ - setTimeout(function() { - t.$el.removeClass(t.factory.classes.play); - }, this.factory.timer.interval); + removePlayClass: function() { + this.$el.removeClass(this.classes.play); }, /** @@ -148,59 +140,35 @@ */ createListItem: function(css, value) { - return [ - '
  • ', - '', - '
    ', - '
    ', - '
    '+(value ? value : '')+'
    ', - '
    ', - '
    ', - '
    ', - '
    '+(value ? value : '')+'
    ', - '
    ', - '
    ', - '
  • ' - ].join(''); - }, + var item = new FlipClock.ListItem(css, value); - /** - * Append the list item to the parent DOM node - */ + this.items.push(item); - appendListItem: function(css, value) { - var html = this.createListItem(css, value); + this.$el.append(item.$el); - this.$el.append(html); + this.trigger('create:item', item); + + return item; }, /** - * Create the list of digits and appends it to the DOM object + * Create the lsit of values and appends it to the DOM object */ createList: function() { + var $el = this.$el = $('
      '); - var lastDigit = this.getPrevDigit() ? this.getPrevDigit() : this.digit; - - var html = $([ - '
        ', - this.createListItem(this.classes.before, lastDigit), - this.createListItem(this.classes.active, this.digit), - '
      ' - ].join('')); - - return html; - }, + this._beforeListItem = this.createListItem(this.classes.before, this.getPrevValue()); + this._afterListItem = this.createListItem(this.classes.active, this.value); - getNextDigit: function() { - return this.digit == 9 ? 0 : this.digit + 1; - }, + $el.append(this._beforeListItem.el); + $el.append(this._afterListItem.el); + + this.trigger('create:list', $el); - getPrevDigit: function() { - return this.digit == 0 ? 9 : this.digit - 1; + return $el; } }); - - -}(jQuery)); + +}(jQuery)); \ No newline at end of file From 2f140b8a91e6f348adcbfa9aab790512e4dd5cbc Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:00:28 -0500 Subject: [PATCH 009/129] - (API) Drastically simplified the FlipClock.Factory object. No longer passing the object to child classes as a property --- src/flipclock/js/libs/Factory.js | 233 +++++++++++++++++++ src/flipclock/js/libs/factory.js | 380 ------------------------------- 2 files changed, 233 insertions(+), 380 deletions(-) create mode 100644 src/flipclock/js/libs/Factory.js delete mode 100644 src/flipclock/js/libs/factory.js diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js new file mode 100644 index 00000000..3462f8bf --- /dev/null +++ b/src/flipclock/js/libs/Factory.js @@ -0,0 +1,233 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock Factory class is used to build the clock and manage + * all the public methods. + * + * @param object A jQuery object or CSS selector used to fetch + the wrapping DOM nodes + * @param mixed This is the digit used to set the clock. If an + object is passed, 0 will be used. + * @param object An object of properties to override the default + */ + + FlipClock.Factory = FlipClock.Base.extend({ + + /** + * The CSS classes + */ + + classes: { + wrapper: 'flip-clock-wrapper' + }, + + /** + * The name of the clock face class in use + */ + + clockFace: 'HourlyCounter', + + /** + * The FlipClock.Face options object + */ + + clockFaceOptions: {}, + + /** + * The name of the default clock face class to use if the defined + * clockFace variable is not a valid FlipClock.Face object + */ + + defaultClockFace: 'HourlyCounter', + + /** + * The jQuery object + */ + + $el: false, + + /** + * The FlipClock.Face object + */ + + face: false, + + /** + * Constructor + * + * @param object The wrapping jQuery object + * @param object Number of seconds used to start the clock + * @param object An object override options + * @return + */ + + constructor: function($el, value, options) { + if(value instanceof Date === false && typeof value === "object") { + options = value; + value = 0; + } + + this.base(options); + + this.lists = []; + + this.$el = $el.addClass(this.classes.wrapper); + + this.loadClockFace(this.clockFace, value, this.clockFaceOptions); + }, + + /** + * Load the FlipClock.Face object + * + * @param object The name of the FlickClock.Face class + * @param object An object override options + * @return object + */ + + loadClockFace: function(name, value, options) { + var t = this, face, suffix = 'Face', hasStopped = false; + + name = name.ucfirst()+suffix; + + if(this.face.stop) { + this.stop(); + hasStopped = true; + } + + this.$el.html(''); + + if(FlipClock[name]) { + this.face = new FlipClock[name](value, options); + } + else { + this.face = new FlipClock[this.defaultClockFace+suffix](value, options); + } + + this.face.on('create:list', function(list) { + t.face.attachList(t.$el, list); + }); + + this.face.on('destroy', function() { + t.callback(t.onDestroy); + }); + + this.face.on('start', function() { + t.callback(t.onStart); + }); + + this.face.on('stop', function() { + t.callback(t.onStop); + }); + + this.face.on('reset', function() { + t.callback(t.onReset); + }); + + this.face.on('init', function() { + t.callback(t.onInit); + }); + + this.face.on('interval', function() { + t.callback(t.onInterval); + }); + + this.face.init(this); + + this.face.build(); + + if(hasStopped) { + this.start(); + } + + return this.face; + }, + + /** + * Starts the clock + * + * @return object + */ + + start: function() { + this.face.start(); + + return this; + }, + + /** + * Stops the clock + * + * @return object + */ + + stop: function() { + this.face.stop(); + + return this; + }, + + /** + * Reset the clock + * + * @return object + */ + + reset: function() { + this.face.reset(); + + return this; + }, + + /** + * Sets the clock time + * + * @return object + */ + + setTime: function(time) { + this.face.setTime(time); + + return this; + }, + + /** + * Gets the clock time + * + * @return object + */ + + getTime: function() { + this.face.getTime(); + + return this; + }, + + onDestroy: function() {}, + + onCreate: function() {}, + + onInit: function() {}, + + onInterval: function() {}, + + onStart: function() {}, + + onStop: function() {}, + + onReset: function() {} + + }); + +}(jQuery)); diff --git a/src/flipclock/js/libs/factory.js b/src/flipclock/js/libs/factory.js deleted file mode 100644 index 7cbb2f00..00000000 --- a/src/flipclock/js/libs/factory.js +++ /dev/null @@ -1,380 +0,0 @@ -/*jshint smarttabs:true */ - -/** - * FlipClock.js - * - * @author Justin Kimbrell - * @copyright 2013 - Objective HTML, LLC - * @licesnse http://www.opensource.org/licenses/mit-license.php - */ - -(function($) { - - "use strict"; - - /** - * The FlipClock Factory class is used to build the clock and manage - * all the public methods. - * - * @param object A jQuery object or CSS selector used to fetch - the wrapping DOM nodes - * @param mixed This is the digit used to set the clock. If an - object is passed, 0 will be used. - * @param object An object of properties to override the default - */ - - FlipClock.Factory = FlipClock.Base.extend({ - - /** - * The clock's animation rate. - * - * Note, currently this property doesn't do anything. - * This property is here to be used in the future to - * programmaticaly set the clock's animation speed - */ - - animationRate: 1000, - - /** - * Auto start the clock on page load (True|False) - */ - - autoStart: true, - - /** - * The callback methods - */ - - callbacks: { - destroy: false, - create: false, - init: false, - interval: false, - start: false, - stop: false, - reset: false - }, - - /** - * The CSS classes - */ - - classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - divider: 'flip-clock-divider', - dot: 'flip-clock-dot', - label: 'flip-clock-label', - flip: 'flip', - play: 'play', - wrapper: 'flip-clock-wrapper' - }, - - /** - * The name of the clock face class in use - */ - - clockFace: 'HourlyCounter', - - /** - * The name of the clock face class in use - */ - - countdown: false, - - /** - * The name of the default clock face class to use if the defined - * clockFace variable is not a valid FlipClock.Face object - */ - - defaultClockFace: 'HourlyCounter', - - /** - * The default language - */ - - defaultLanguage: 'english', - - /** - * The jQuery object - */ - - $el: false, - - /** - * The FlipClock.Face object - */ - - face: true, - - /** - * The language object after it has been loaded - */ - - lang: false, - - /** - * The language being used to display labels (string) - */ - - language: 'english', - - /** - * The minimum digits the clock must have - */ - - minimumDigits: 0, - - /** - * The original starting value of the clock. Used for the reset method. - */ - - original: false, - - /** - * Is the clock running? (True|False) - */ - - running: false, - - /** - * The FlipClock.Time object - */ - - time: false, - - /** - * The FlipClock.Timer object - */ - - timer: false, - - /** - * The jQuery object (depcrecated) - */ - - $wrapper: false, - - /** - * Constructor - * - * @param object The wrapping jQuery object - * @param object Number of seconds used to start the clock - * @param object An object override options - */ - - constructor: function(obj, digit, options) { - - if(!options) { - options = {}; - } - - this.lists = []; - this.running = false; - this.base(options); - - this.$el = $(obj).addClass(this.classes.wrapper); - - // Depcrated support of the $wrapper property. - this.$wrapper = this.$el; - - this.original = (digit instanceof Date) ? digit : (digit ? Math.round(digit) : 0); - - this.time = new FlipClock.Time(this, this.original, { - minimumDigits: this.minimumDigits, - animationRate: this.animationRate - }); - - this.timer = new FlipClock.Timer(this, options); - - this.loadLanguage(this.language); - - this.loadClockFace(this.clockFace, options); - - if(this.autoStart) { - this.start(); - } - - }, - - /** - * Load the FlipClock.Face object - * - * @param object The name of the FlickClock.Face class - * @param object An object override options - */ - - loadClockFace: function(name, options) { - var face, suffix = 'Face', hasStopped = false; - - name = name.ucfirst()+suffix; - - if(this.face.stop) { - this.stop(); - hasStopped = true; - } - - this.$el.html(''); - - this.time.minimumDigits = this.minimumDigits; - - if(FlipClock[name]) { - face = new FlipClock[name](this, options); - } - else { - face = new FlipClock[this.defaultClockFace+suffix](this, options); - } - - face.build(); - - this.face = face - - if(hasStopped) { - this.start(); - } - - return this.face; - }, - - /** - * Load the FlipClock.Lang object - * - * @param object The name of the language to load - */ - - loadLanguage: function(name) { - var lang; - - if(FlipClock.Lang[name.ucfirst()]) { - lang = FlipClock.Lang[name.ucfirst()]; - } - else if(FlipClock.Lang[name]) { - lang = FlipClock.Lang[name]; - } - else { - lang = FlipClock.Lang[this.defaultLanguage]; - } - - return this.lang = lang; - }, - - /** - * Localize strings into various languages - * - * @param string The index of the localized string - * @param object Optionally pass a lang object - */ - - localize: function(index, obj) { - var lang = this.lang; - - if(!index) { - return null; - } - - var lindex = index.toLowerCase(); - - if(typeof obj == "object") { - lang = obj; - } - - if(lang && lang[lindex]) { - return lang[lindex]; - } - - return index; - }, - - - /** - * Starts the clock - */ - - start: function(callback) { - var t = this; - - if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) { - t.face.start(t.time); - t.timer.start(function() { - t.flip(); - - if(typeof callback === "function") { - callback(); - } - }); - } - else { - t.log('Trying to start timer when countdown already at 0'); - } - }, - - /** - * Stops the clock - */ - - stop: function(callback) { - this.face.stop(); - this.timer.stop(callback); - - for(var x in this.lists) { - if (this.lists.hasOwnProperty(x)) { - this.lists[x].stop(); - } - } - }, - - /** - * Reset the clock - */ - - reset: function(callback) { - this.timer.reset(callback); - this.face.reset(); - }, - - /** - * Sets the clock time - */ - - setTime: function(time) { - this.time.time = time; - this.flip(true); - }, - - /** - * Get the clock time - * - * @return object Returns a FlipClock.Time object - */ - - getTime: function(time) { - return this.time; - }, - - /** - * Changes the increment of time to up or down (add/sub) - */ - - setCountdown: function(value) { - var running = this.running; - - this.countdown = value ? true : false; - - if(running) { - this.stop(); - this.start(); - } - }, - - /** - * Flip the digits on the clock - * - * @param array An array of digits - */ - flip: function(doNotAddPlayClass) { - this.face.flip(false, doNotAddPlayClass); - } - - }); - -}(jQuery)); From 4a3034ebcab8cf79575e9e265d58f338a095ad85 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:01:10 -0500 Subject: [PATCH 010/129] - (Bug Fix) Removed leaky abstractions in FlipClock.Face --- src/flipclock/js/libs/Face.js | 388 ++++++++++++++++++++++++++++++++++ src/flipclock/js/libs/face.js | 243 --------------------- 2 files changed, 388 insertions(+), 243 deletions(-) create mode 100644 src/flipclock/js/libs/Face.js delete mode 100644 src/flipclock/js/libs/face.js diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js new file mode 100644 index 00000000..679a6987 --- /dev/null +++ b/src/flipclock/js/libs/Face.js @@ -0,0 +1,388 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock Face class is the base class in which to extend + * all other FlockClock.Face classes. + * + * @param object An object of properties to override the default + */ + + FlipClock.Face = FlipClock.Base.extend({ + + /** + * The clock's animation rate. + * + * Note, currently this property doesn't do anything. + * This property is here to be used in the future to + * programmaticaly set the clock's animation speed + */ + + animationRate: 1000, + + /** + * Sets whether or not the clock should start upon instantiation + */ + + autoStart: true, + + /** + * Sets whether or not the clock should countdown + */ + + countdown: false, + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * An array of jQuery objects used for the dividers (the colons) + */ + + dividers: [], + + /** + * The language object after it has been loaded + */ + + lang: false, + + /** + * The language being used to display labels (string) + */ + + language: 'english', + + /** + * An array of FlipClock.List objects + */ + + lists: [], + + /** + * The minimum digits the clock must have + */ + + minimumDigits: 0, + + /** + * The original starting value of the clock face. + */ + + originalValue: 0, + + /** + * The FlipClock.Time object + */ + + time: false, + + /** + * The FlipClock.Timer object + */ + + timer: false, + + /** + * The FlipClock.Translator object + */ + + translator: false, + + /** + * The current value of the clock face. + */ + + value: false, + + /** + * Constructor + * + * @param mixed + * @param object + */ + + constructor: function(value, options) { + var t = this; + + if(value instanceof Date === false && typeof value === "object") { + options = value; + value = 0; + } + + this.dividers = []; + this.lists = []; + this.originalValue = value; + + this.translator = new FlipClock.Translator({ + defaultLanguage: this.defaultLanguage, + language: this.language + }); + + this.time = new FlipClock.Time(value, { + minimumDigits: 0 + }); + + this.timer = new FlipClock.Timer(); + + this.timer.on('interval', function() { + t.flip(); + t.trigger('interval'); + }); + + this.base(options); + + this.on('add:digit', function(list) { + if(this.dividers.length) { + for(var i in this.dividers) { + var divider = this.dividers[i]; + + if(!divider.$el.is(':first-child')) { + divider.$el.insertAfter(divider.$el.next()); + } + } + } + }); + + this.trigger('create'); + }, + + /** + * Add a digit to the clock face + */ + + addDigit: function(digit) { + var list = this.createList(digit); + + console.log(this._events); + + this.trigger('add:digit', list); + + return list; + }, + + attachList: function($el, list) { + $el.append(list.$el); + }, + + /** + * Build the clock face + */ + + build: function() { + if(this.autoStart) { + this.start(); + } + }, + + /** + * Perform arbirtrary logic when the clock face instantiated. + * The factor object is passed in the first argument + * + * @param object + */ + + init: function(factory) { + this.trigger('init'); + }, + + /** + * Creates a jQuery object used for the digit divider + * + * @param mixed The divider label text + * @param mixed Set true to exclude the dots in the divider. + * If not set, is false. + */ + + createDivider: function(label, css, excludeDots) { + if(typeof css == "boolean" || !css) { + excludeDots = css; + css = false; + } + + var divider = new FlipClock.Divider(label, { + css: css, + excludeDots: excludeDots, + translator: this.translator + }); + + this.dividers.push(divider); + + return divider; + }, + + /** + * Creates a FlipClock.List object and appends it to the DOM + * + * @param mixed The value to select in the list + * @param object An object to override the default properties + */ + + createList: function(value, options) { + var List = this.getListClass(); + + var list = new List(value, { + translator: this.translator + }); + + if(this.timer.running) { + list.addPlayClass(); + } + + this.lists.push(list); + + this.trigger('create:list', list); + + return list; + }, + + /* + * Get the list class object + * + * @return + */ + + getListClass: function() { + return FlipClock.NumericList; + }, + + /** + * Triggers when the clock is reset + */ + + reset: function() { + this.time.time = Math.round(this.originalValue); + this.flip(); + this.trigger('reset'); + }, + + /** + * Starts the clock + */ + + start: function() { + if(!this.timer.running) { + this.trigger('before:start'); + this.timer.start(); + this.trigger('start'); + } + }, + + /** + * Stops the clock + */ + + stop: function() { + var t = this; + this.trigger('before:stop'); + this.timer.stop(function() { + t.trigger('stop'); + }); + }, + + /** + * Auto increments/decrements the value of the clock face + */ + + autoIncrement: function() { + if(!this.countdown) { + this.increment(); + } + else { + this.decrement(); + } + }, + + /** + * Increments the value of the clock face + */ + + increment: function() { + this.time.addSecond(); + }, + + /** + * Decrements the value of the clock face + */ + + decrement: function() { + if(this.time.getTimeSeconds() == 0) { + this.stop() + } + else { + this.time.subSecond(); + } + }, + + /** + * Triggers when the numbers on the clock flip + */ + + flip: function(time) { + var t = this; + + $.each(time, function(i, digit) { + if(t.lists[i]) { + t.lists[i].select(digit); + + if(t.timer.running) { + t.lists[i].addPlayClass(); + } + } + else { + t.addDigit(digit); + } + }); + + this.trigger('flip'); + }, + + /** + * Sets the clock time + */ + + setTime: function(time) { + this.time.time = time; + this.flip(); + }, + + /** + * Get the clock time + * + * @return object Returns a FlipClock.Time object + */ + + getTime: function(time) { + return this.time; + }, + + /** + * Changes the increment of time to up or down (add/sub) + */ + + setCountdown: function(value) { + this.countdown = value ? true : false; + + if(this.timer.running) { + this.stop(); + this.start(); + } + } + + }); + +}(jQuery)); diff --git a/src/flipclock/js/libs/face.js b/src/flipclock/js/libs/face.js deleted file mode 100644 index ab05dac1..00000000 --- a/src/flipclock/js/libs/face.js +++ /dev/null @@ -1,243 +0,0 @@ -/*jshint smarttabs:true */ - -/** - * FlipClock.js - * - * @author Justin Kimbrell - * @copyright 2013 - Objective HTML, LLC - * @licesnse http://www.opensource.org/licenses/mit-license.php - */ - -(function($) { - - "use strict"; - - /** - * The FlipClock Face class is the base class in which to extend - * all other FlockClock.Face classes. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - FlipClock.Face = FlipClock.Base.extend({ - - /** - * Sets whether or not the clock should start upon instantiation - */ - - autoStart: true, - - /** - * An array of jQuery objects used for the dividers (the colons) - */ - - dividers: [], - - /** - * An array of FlipClock.List objects - */ - - factory: false, - - /** - * An array of FlipClock.List objects - */ - - lists: [], - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.dividers = []; - this.lists = []; - this.base(options); - this.factory = factory; - }, - - /** - * Build the clock face - */ - - build: function() { - if(this.autoStart) { - this.start(); - } - }, - - /** - * Creates a jQuery object used for the digit divider - * - * @param mixed The divider label text - * @param mixed Set true to exclude the dots in the divider. - * If not set, is false. - */ - - createDivider: function(label, css, excludeDots) { - if(typeof css == "boolean" || !css) { - excludeDots = css; - css = label; - } - - var dots = [ - '', - '' - ].join(''); - - if(excludeDots) { - dots = ''; - } - - label = this.factory.localize(label); - - var html = [ - '', - ''+(label ? label : '')+'', - dots, - '' - ]; - - var $html = $(html.join('')); - - this.dividers.push($html); - - return $html; - }, - - /** - * Creates a FlipClock.List object and appends it to the DOM - * - * @param mixed The digit to select in the list - * @param object An object to override the default properties - */ - - createList: function(digit, options) { - if(typeof digit === "object") { - options = digit; - digit = 0; - } - - var obj = new FlipClock.List(this.factory, digit, options); - - this.lists.push(obj); - - return obj; - }, - - /** - * Triggers when the clock is reset - */ - - reset: function() { - this.factory.time = new FlipClock.Time( - this.factory, - this.factory.original ? Math.round(this.factory.original) : 0, - { - minimumDigits: this.factory.minimumDigits - } - ); - - this.flip(this.factory.original, false); - }, - - /** - * Append a newly created list to the clock - */ - - appendDigitToClock: function(obj) { - obj.$el.append(false); - }, - - /** - * Add a digit to the clock face - */ - - addDigit: function(digit) { - var obj = this.createList(digit, { - classes: { - active: this.factory.classes.active, - before: this.factory.classes.before, - flip: this.factory.classes.flip - } - }); - - this.appendDigitToClock(obj); - }, - - /** - * Triggers when the clock is started - */ - - start: function() {}, - - /** - * Triggers when the time on the clock stops - */ - - stop: function() {}, - - /** - * Auto increments/decrements the value of the clock face - */ - - autoIncrement: function() { - if(!this.factory.countdown) { - this.increment(); - } - else { - this.decrement(); - } - }, - - /** - * Increments the value of the clock face - */ - - increment: function() { - this.factory.time.addSecond(); - }, - - /** - * Decrements the value of the clock face - */ - - decrement: function() { - if(this.factory.time.getTimeSeconds() == 0) { - this.factory.stop() - } - else { - this.factory.time.subSecond(); - } - }, - - /** - * Triggers when the numbers on the clock flip - */ - - flip: function(time, doNotAddPlayClass) { - var t = this; - - $.each(time, function(i, digit) { - var list = t.lists[i]; - - if(list) { - if(!doNotAddPlayClass && digit != list.digit) { - list.play(); - } - - list.select(digit); - } - else { - t.addDigit(digit); - } - }); - } - - }); - -}(jQuery)); From 06f534b1308dc1bad89e37ce0321f286d77d07d2 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:01:33 -0500 Subject: [PATCH 011/129] - (API) Added new FlipClock.Event classes to facilitate event handling --- src/flipclock/js/libs/Event.js | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/flipclock/js/libs/Event.js diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js new file mode 100644 index 00000000..dbef046d --- /dev/null +++ b/src/flipclock/js/libs/Event.js @@ -0,0 +1,63 @@ +(function($) { + + FlipClock.Event = FlipClock.Base.extend({ + + name: false, + + _hasFired: false, + + _lastResponse: null, + + _preventFire: false, + + _fireOnce: false, + + _callback: function() {}, + + constructor: function(name, callback) { + if(!name) { + throw "Events must have a name"; + } + + if(typeof callback === "function") { + this._callback = callback; + } + }, + + fire: function(obj, arguments) { + if(this._preventFire === false) { + this.setLastResponse(this._callback.apply(obj, arguments)); + this._hasFired = true; + if(this._fireOnce) { + this._preventFire = true; + } + } + }, + + off: function() { + this._preventFire = true; + }, + + hasFired: function() { + return this._hasFired; + }, + + getLastResponse: function() { + return this._lastResponse; + }, + + setLastResponse: function(response) { + this._lastResponse = response; + }, + + getFireOnce: function(value) { + return this._fireOnce; + }, + + setFireOnce: function(value) { + this._fireOnce = value; + } + + }); + +}(jQuery)); \ No newline at end of file From b3574bff56d1ceefca76ac6b8ed5a53d1df07313 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:02:09 -0500 Subject: [PATCH 012/129] - (API) Added new EnglishAlphaFace to handle alphabetical clocks --- src/flipclock/js/libs/EnglishAlphaList.js | 64 +++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/flipclock/js/libs/EnglishAlphaList.js diff --git a/src/flipclock/js/libs/EnglishAlphaList.js b/src/flipclock/js/libs/EnglishAlphaList.js new file mode 100644 index 00000000..0351f2e8 --- /dev/null +++ b/src/flipclock/js/libs/EnglishAlphaList.js @@ -0,0 +1,64 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. + * + * @param mixed This is the value used to set the clock. If an + * object is passed, 0 will be used. + * @param object An object of properties to override the default + */ + + FlipClock.EnglishAlphaList = FlipClock.List.extend({ + + capitalLetters: true, + + getPrevValue: function() { + var charCode = this.value.charCodeAt(0) - 1; + var minCode = 65, maxCode = 90; + + if(!this.capitalLetters) { + minCode = 97; + maxCode = 122; + } + + if(charCode < minCode) { + charCode = maxCode; + } + + return String.fromCharCode(charCode); + }, + + getNextValue: function() { + var charCode = this.value.charCodeAt(0) + 1; + var minCode = 65, maxCode = 90; + + if(!this.capitalLetters) { + minCode = 97; + maxCode = 122; + } + + if(charCode > maxCode) { + charCode = minCode; + } + + return String.fromCharCode(charCode); + } + + }); + + +}(jQuery)); \ No newline at end of file From 4dc096107bebe594c982dd1c88c09226f289c411 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:03:04 -0500 Subject: [PATCH 013/129] - (API) Added FlipClock.Divider class to handle the dividers instead of using strings and jQuery --- src/flipclock/js/libs/Divider.js | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/flipclock/js/libs/Divider.js diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js new file mode 100644 index 00000000..69bd65fa --- /dev/null +++ b/src/flipclock/js/libs/Divider.js @@ -0,0 +1,46 @@ +(function($) { + + FlipClock.Divider = FlipClock.Base.extend({ + + label: false, + + css: false, + + excludeDots: false, + + translator: false, + + classes: { + divider: 'flip-clock-divider', + dot: 'flip-clock-dot', + label: 'flip-clock-label' + }, + + $el: false, + + constructor: function(label, options) { + this.base(options); + + this.label = this.t(label); + + var dots = !this.excludeDots ? [ + '', + '' + ].join('') : ''; + + this.$el = $([ + '', + ''+(this.label ? this.label : '')+'', + dots, + '' + ].join('')); + + }, + + toString: function() { + return this.$el.html(); + } + + }); + +}(jQuery)); \ No newline at end of file From 6585c182d85a09d0cdec7c9440e9dbb6b1708c91 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:04:03 -0500 Subject: [PATCH 014/129] - (API) Added new event handling to all application objects instead of using callbacks in properties --- src/flipclock/js/libs/{core.js => Core.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/flipclock/js/libs/{core.js => Core.js} (100%) diff --git a/src/flipclock/js/libs/core.js b/src/flipclock/js/libs/Core.js similarity index 100% rename from src/flipclock/js/libs/core.js rename to src/flipclock/js/libs/Core.js From c8bb5e77a7f612b30caafe66d2406e876b414e02 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:04:17 -0500 Subject: [PATCH 015/129] - (API) Added new event handling to all application objects instead of using callbacks in properties --- src/flipclock/js/libs/Core.js | 115 ++++++++++++++++++++++++++++++++-- 1 file changed, 111 insertions(+), 4 deletions(-) diff --git a/src/flipclock/js/libs/Core.js b/src/flipclock/js/libs/Core.js index b8450b2e..b6e9d55c 100644 --- a/src/flipclock/js/libs/Core.js +++ b/src/flipclock/js/libs/Core.js @@ -40,9 +40,6 @@ var FlipClock; /** * The Base FlipClock class is used to extend all other FlipFlock * classes. It handles the callbacks and the basic setters/getters - * - * @param object An object of the default properties - * @param object An object of properties to override the default */ FlipClock.Base = Base.extend({ @@ -59,6 +56,18 @@ var FlipClock; version: '0.7.7', + /** + * The bound events to this object + */ + + _events: {}, + + /** + * The bound events to this object + */ + + _uid: false, + /** * Sets the default options * @@ -73,6 +82,8 @@ var FlipClock; if(typeof options !== "object") { options = {}; } + this._events = {}; + this._uid = (new FlipClock.Uuid()).toString(); this.setOptions($.extend(true, {}, _default, options)); }, @@ -158,8 +169,104 @@ var FlipClock; this.setOption(key, options[key]); } } + }, + + /* + * Bind an event + * + * @param string + * @param callback + */ + + on: function(name, callback) { + if(!this._events[name]) { + this._events[name] = []; + } + + var event = new FlipClock.Event(name, callback); + + this._events[name].push(event); + + return event; + }, + + /* + * Bind an event to be called once + * + * @param string + * @param callback + */ + + once: function(name, callback) { + var event = this.on(name, callback); + + event.setFireOnce(true); + }, + + /* + * Remove all bound events for a specific trigger + * + * @param string + * @return + */ + + off: function(name) { + if(this._events[name]) { + delete this._events[name]; + } + }, + + /* + * Remove all bound events for a specific trigger + * + * @param string + * @return + */ + + trigger: function(name) { + if(this._events[name]) { + var params = []; + + for(var x in arguments) { + if(x > 0) { + params.push(arguments[x]); + } + } + + for(var i in this._events[name]) { + this._events[name][i].fire(this, params); + } + + return this._events[name]; + } + }, + + /* + * Translate a string to the localized locale + * + * @param + * @return + */ + + localize: function(name) { + if(this.translator) { + this.translator.localize(name); + } + + return name; + }, + + /* + * Helper method for localize. t() is just short. + * + * @param + * @return + */ + + t: function(name) { + return this.localize(name); } }); -}(jQuery)); +}(jQuery)); \ No newline at end of file From 41520347004ffadaaf6ea0c570c1615fb2daa7ed Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:04:43 -0500 Subject: [PATCH 016/129] - (API) Renamed Twenty Four Hour Clock source file --- .../js/faces/TwentyFourHourClockFace.js | 46 ++++++++++++ src/flipclock/js/faces/twentyfourhourclock.js | 72 ------------------- 2 files changed, 46 insertions(+), 72 deletions(-) create mode 100644 src/flipclock/js/faces/TwentyFourHourClockFace.js delete mode 100644 src/flipclock/js/faces/twentyfourhourclock.js diff --git a/src/flipclock/js/faces/TwentyFourHourClockFace.js b/src/flipclock/js/faces/TwentyFourHourClockFace.js new file mode 100644 index 00000000..b69f0e2c --- /dev/null +++ b/src/flipclock/js/faces/TwentyFourHourClockFace.js @@ -0,0 +1,46 @@ +(function($) { + + /** + * Twenty-Four Hour Clock Face + * + * This class will generate a twenty-four our clock for FlipClock.js + * + * @param object An object of properties to override the default + */ + + FlipClock.TwentyFourHourClockFace = FlipClock.Face.extend({ + + /** + * Build the clock face + * + * @param object Pass the time that should be used to display on the clock. + */ + + build: function(time) { + var time = time ? time : this.time.getMilitaryTime(false, this.showSeconds); + + for(var i in time) { + this.createList(time[i]); + } + + this.createDivider().$el.insertBefore(this.lists[this.lists.length - 2].$el); + this.createDivider().$el.insertBefore(this.lists[this.lists.length - 4].$el); + + this.base(); + }, + + /** + * Flip the clock face + */ + + flip: function(time, doNotAddPlayClass) { + this.autoIncrement(); + + time = time ? time : this.time.getMilitaryTime(false, this.showSeconds); + + this.base(time); + } + + }); + +}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/twentyfourhourclock.js b/src/flipclock/js/faces/twentyfourhourclock.js deleted file mode 100644 index 29090cad..00000000 --- a/src/flipclock/js/faces/twentyfourhourclock.js +++ /dev/null @@ -1,72 +0,0 @@ -(function($) { - - /** - * Twenty-Four Hour Clock Face - * - * This class will generate a twenty-four our clock for FlipClock.js - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - FlipClock.TwentyFourHourClockFace = FlipClock.Face.extend({ - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - - /** - * Build the clock face - * - * @param object Pass the time that should be used to display on the clock. - */ - - build: function(time) { - var t = this; - var children = this.factory.$el.find('ul'); - - if(!this.factory.time.time) { - this.factory.original = new Date(); - - this.factory.time = new FlipClock.Time(this.factory, this.factory.original); - } - - var time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); - } - - this.createDivider(); - this.createDivider(); - - $(this.dividers[0]).insertBefore(this.lists[this.lists.length - 2].$el); - $(this.dividers[1]).insertBefore(this.lists[this.lists.length - 4].$el); - - this.base(); - }, - - /** - * Flip the clock face - */ - - flip: function(time, doNotAddPlayClass) { - this.autoIncrement(); - - time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds); - - this.base(time, doNotAddPlayClass); - } - - }); - -}(jQuery)); \ No newline at end of file From d6b9d23d0d813df9844df0b932d3425c3a06c530 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:05:06 -0500 Subject: [PATCH 017/129] - (API) Renamed Twelve Hour Clock file --- .../{twelvehourclock.js => TwelveHourClockFace.js} | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) rename src/flipclock/js/faces/{twelvehourclock.js => TwelveHourClockFace.js} (80%) diff --git a/src/flipclock/js/faces/twelvehourclock.js b/src/flipclock/js/faces/TwelveHourClockFace.js similarity index 80% rename from src/flipclock/js/faces/twelvehourclock.js rename to src/flipclock/js/faces/TwelveHourClockFace.js index 9a5c260d..eb9a8b54 100644 --- a/src/flipclock/js/faces/twelvehourclock.js +++ b/src/flipclock/js/faces/TwelveHourClockFace.js @@ -4,9 +4,6 @@ * Twelve Hour Clock Face * * This class will generate a twelve hour clock for FlipClock.js - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default */ FlipClock.TwelveHourClockFace = FlipClock.TwentyFourHourClockFace.extend({ @@ -32,7 +29,7 @@ build: function() { var t = this; - var time = this.factory.time.getTime(false, this.showSeconds); + var time = this.time.getTime(false, this.showSeconds); this.base(time); this.meridiumText = this.getMeridium(); @@ -51,12 +48,12 @@ * Flip the clock face */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(this.meridiumText != this.getMeridium()) { this.meridiumText = this.getMeridium(); this.meridium.find('a').html(this.meridiumText); } - this.base(this.factory.time.getTime(false, this.showSeconds), doNotAddPlayClass); + this.base(this.time.getTime(false, this.showSeconds)); }, /** @@ -66,7 +63,7 @@ */ getMeridium: function() { - return new Date().getHours() >= 12 ? 'PM' : 'AM'; + return new Date().getHours() >= 12 ? this.t('PM') : this.t('AM'); }, /** From d09ad948238397f383003cc9026ede2f34baf167 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:05:24 -0500 Subject: [PATCH 018/129] - (API) Renamed Minute Counter Face file --- src/flipclock/js/faces/MinuteCounterFace.js | 40 ++++++++++++++++ src/flipclock/js/faces/minutecounter.js | 51 --------------------- 2 files changed, 40 insertions(+), 51 deletions(-) create mode 100644 src/flipclock/js/faces/MinuteCounterFace.js delete mode 100644 src/flipclock/js/faces/minutecounter.js diff --git a/src/flipclock/js/faces/MinuteCounterFace.js b/src/flipclock/js/faces/MinuteCounterFace.js new file mode 100644 index 00000000..e8a83dd0 --- /dev/null +++ b/src/flipclock/js/faces/MinuteCounterFace.js @@ -0,0 +1,40 @@ +(function($) { + + /** + * Minute Counter Clock Face + * + * This class will generate a minute counter for FlipClock.js. A + * minute counter will track minutes and seconds. If an hour is + * reached, the counter will reset back to 0. (4 digits max) + * + */ + + FlipClock.MinuteCounterFace = FlipClock.HourlyCounterFace.extend({ + + /** + * Build the clock face + * + * @return + */ + + build: function() { + this.base(true, this.time.getMinuteCounter()); + }, + + /** + * Flip the clock face + * + * @return + */ + + flip: function(time) { + if(!time) { + time = this.time.getMinuteCounter(); + } + + this.base(time); + } + + }); + +}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/minutecounter.js b/src/flipclock/js/faces/minutecounter.js deleted file mode 100644 index ba14684f..00000000 --- a/src/flipclock/js/faces/minutecounter.js +++ /dev/null @@ -1,51 +0,0 @@ -(function($) { - - /** - * Minute Counter Clock Face - * - * This class will generate a minute counter for FlipClock.js. A - * minute counter will track minutes and seconds. If an hour is - * reached, the counter will reset back to 0. (4 digits max) - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - FlipClock.MinuteCounterFace = FlipClock.HourlyCounterFace.extend({ - - clearExcessDigits: false, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - - /** - * Build the clock face - */ - - build: function() { - this.base(true, this.factory.time.getMinuteCounter()); - }, - - /** - * Flip the clock face - */ - - flip: function(time, doNotAddPlayClass) { - if(!time) { - time = this.factory.time.getMinuteCounter(); - } - - this.base(time, doNotAddPlayClass); - } - - }); - -}(jQuery)); \ No newline at end of file From 73bb97d9c38e63d057681ab4d70a17d28a72c862 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:06:19 -0500 Subject: [PATCH 019/129] - (API) Renamed Hourly Clock Face file --- ...{hourlycounter.js => HourlyCounterFace.js} | 41 +++++-------------- 1 file changed, 11 insertions(+), 30 deletions(-) rename src/flipclock/js/faces/{hourlycounter.js => HourlyCounterFace.js} (50%) diff --git a/src/flipclock/js/faces/hourlycounter.js b/src/flipclock/js/faces/HourlyCounterFace.js similarity index 50% rename from src/flipclock/js/faces/hourlycounter.js rename to src/flipclock/js/faces/HourlyCounterFace.js index b348b8f1..d70d40d3 100644 --- a/src/flipclock/js/faces/hourlycounter.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -14,42 +14,24 @@ FlipClock.HourlyCounterFace = FlipClock.Face.extend({ - // clearExcessDigits: true, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - /** * Build the clock face */ build: function(excludeHours, time) { - var t = this; - var children = this.factory.$el.find('ul'); + var time = time ? time : this.time.getHourCounter(); - time = time ? time : this.factory.time.getHourCounter(); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); + for(var i in time) { + this.createList(time[i]); } - - $(this.createDivider('Seconds')).insertBefore(this.lists[this.lists.length - 2].$el); - $(this.createDivider('Minutes')).insertBefore(this.lists[this.lists.length - 4].$el); + + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4].$el); if(!excludeHours) { - $(this.createDivider('Hours', true)).insertBefore(this.lists[0].$el); + this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); } - + this.base(); }, @@ -57,14 +39,13 @@ * Flip the clock face */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(!time) { - time = this.factory.time.getHourCounter(); + time = this.time.getHourCounter(); } this.autoIncrement(); - - this.base(time, doNotAddPlayClass); + this.base(time); }, /** From 2f61002ac656e914733d07492457223afb4a2ed4 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:06:35 -0500 Subject: [PATCH 020/129] - (API) Renamed Daily Counter File --- src/flipclock/js/faces/CounterFace.js | 108 ++++++++++++++++++++++ src/flipclock/js/faces/DailyCounter.js | 59 ++++++++++++ src/flipclock/js/faces/counter.js | 119 ------------------------- src/flipclock/js/faces/dailycounter.js | 78 ---------------- 4 files changed, 167 insertions(+), 197 deletions(-) create mode 100644 src/flipclock/js/faces/CounterFace.js create mode 100644 src/flipclock/js/faces/DailyCounter.js delete mode 100644 src/flipclock/js/faces/counter.js delete mode 100644 src/flipclock/js/faces/dailycounter.js diff --git a/src/flipclock/js/faces/CounterFace.js b/src/flipclock/js/faces/CounterFace.js new file mode 100644 index 00000000..74551856 --- /dev/null +++ b/src/flipclock/js/faces/CounterFace.js @@ -0,0 +1,108 @@ +(function($) { + + /** + * Counter Clock Face + * + * This class will generate a generice flip counter. The timer has been + * disabled. clock.increment() and clock.decrement() have been added. + */ + + FlipClock.CounterFace = FlipClock.Face.extend({ + + /** + * Tells the counter clock face if it should auto-increment + */ + + shouldAutoIncrement: false, + + /** + * Constructor + * + * @param object The parent FlipClock.Factory object + * @param object An object of properties to override the default + * @return + */ + + constructor: function(value, options) { + this.base(value, options); + + this.timer.off('stop'); + + this.on('before:start', function() { + this.shouldAutoIncrement = true; + }); + + this.on('before:stop', function() { + this.shouldAutoIncrement = false; + }); + + this.on('create:list', function(list) { + list.addPlayClass(); + }); + }, + + /** + * Build the clock face + * + * @return + */ + + build: function() { + var t = this, time = this.getTime().digitize([this.getTime().time]); + + $.each(time, function(i, value) { + t.createList(value); + }); + + if(this.autoStart) { + this.shouldAutoIncrement = true; + } + + this.base(); + }, + + /** + * Flip the clock face + * + * @return + */ + + flip: function(time) { + if(this.shouldAutoIncrement) { + this.autoIncrement(); + } + + if(!time) { + time = this.getTime().digitize([this.getTime().time]); + } + + this.base(time); + }, + + /** + * Perform arbirtrary logic when the clock face instantiated. + * The factor object is passed in the first argument + * + * @param object + * @return + */ + + init: function(factory) { + var t = this; + + factory.increment = function() { + t.increment(); + t.flip(); + }; + + factory.decrement = function() { + t.decrement(); + t.flip(); + }; + + this.base(factory); + } + + }); + +}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/DailyCounter.js b/src/flipclock/js/faces/DailyCounter.js new file mode 100644 index 00000000..640cfeff --- /dev/null +++ b/src/flipclock/js/faces/DailyCounter.js @@ -0,0 +1,59 @@ +(function($) { + + /** + * Daily Counter Clock Face + * + * This class will generate a daily counter for FlipClock.js. A + * daily counter will track days, hours, minutes, and seconds. If + * the number of available digits is exceeded in the count, a new + * digit will be created. + * + * @param object An object of properties to override the default + */ + + FlipClock.DailyCounterFace = FlipClock.Face.extend({ + + showSeconds: true, + + /** + * Build the clock face + */ + + build: function(time) { + var offset = 0, time = time ? time : this.time.getDayCounter(this.showSeconds); + + for(var i in time) { + this.createList(time[i]); + } + + if(this.showSeconds) { + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); + } + else + { + offset = 2; + } + + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4 + offset].$el); + this.createDivider('Hours').$el.insertBefore(this.lists[this.lists.length - 6 + offset].$el); + this.createDivider('Days', true).$el.insertBefore(this.lists[0].$el); + + this.base(); + }, + + /** + * Flip the clock face + */ + + flip: function(time) { + if(!time) { + time = this.time.getDayCounter(this.showSeconds); + } + + this.autoIncrement(); + this.base(time); + } + + }); + +}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/counter.js b/src/flipclock/js/faces/counter.js deleted file mode 100644 index aea72886..00000000 --- a/src/flipclock/js/faces/counter.js +++ /dev/null @@ -1,119 +0,0 @@ -(function($) { - - /** - * Counter Clock Face - * - * This class will generate a generice flip counter. The timer has been - * disabled. clock.increment() and clock.decrement() have been added. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - FlipClock.CounterFace = FlipClock.Face.extend({ - - /** - * Tells the counter clock face if it should auto-increment - */ - - shouldAutoIncrement: false, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - - if(typeof options != "object") { - options = {}; - } - - factory.autoStart = options.autoStart ? true : false; - - if(options.autoStart) { - this.shouldAutoIncrement = true; - } - - factory.increment = function() { - factory.countdown = false; - factory.setTime(factory.getTime().getTimeSeconds() + 1); - }; - - factory.decrement = function() { - factory.countdown = true; - var time = factory.getTime().getTimeSeconds(); - if(time > 0) { - factory.setTime(time - 1); - } - }; - - factory.setValue = function(digits) { - factory.setTime(digits); - }; - - factory.setCounter = function(digits) { - factory.setTime(digits); - }; - - this.base(factory, options); - }, - - /** - * Build the clock face - */ - - build: function() { - var t = this; - var children = this.factory.$el.find('ul'); - var time = this.factory.getTime().digitize([this.factory.getTime().time]); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - var list = t.createList(digit); - - list.select(digit); - }); - - } - - $.each(this.lists, function(i, list) { - list.play(); - }); - - this.base(); - }, - - /** - * Flip the clock face - */ - - flip: function(time, doNotAddPlayClass) { - if(this.shouldAutoIncrement) { - this.autoIncrement(); - } - - if(!time) { - time = this.factory.getTime().digitize([this.factory.getTime().time]); - } - - this.base(time, doNotAddPlayClass); - }, - - /** - * Reset the clock face - */ - - reset: function() { - this.factory.time = new FlipClock.Time( - this.factory, - this.factory.original ? Math.round(this.factory.original) : 0 - ); - - this.flip(); - } - }); - -}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/dailycounter.js b/src/flipclock/js/faces/dailycounter.js deleted file mode 100644 index 11395670..00000000 --- a/src/flipclock/js/faces/dailycounter.js +++ /dev/null @@ -1,78 +0,0 @@ -(function($) { - - /** - * Daily Counter Clock Face - * - * This class will generate a daily counter for FlipClock.js. A - * daily counter will track days, hours, minutes, and seconds. If - * the number of available digits is exceeded in the count, a new - * digit will be created. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - FlipClock.DailyCounterFace = FlipClock.Face.extend({ - - showSeconds: true, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - - /** - * Build the clock face - */ - - build: function(time) { - var t = this; - var children = this.factory.$el.find('ul'); - var offset = 0; - - time = time ? time : this.factory.time.getDayCounter(this.showSeconds); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); - } - - if(this.showSeconds) { - $(this.createDivider('Seconds')).insertBefore(this.lists[this.lists.length - 2].$el); - } - else - { - offset = 2; - } - - $(this.createDivider('Minutes')).insertBefore(this.lists[this.lists.length - 4 + offset].$el); - $(this.createDivider('Hours')).insertBefore(this.lists[this.lists.length - 6 + offset].$el); - $(this.createDivider('Days', true)).insertBefore(this.lists[0].$el); - - this.base(); - }, - - /** - * Flip the clock face - */ - - flip: function(time, doNotAddPlayClass) { - if(!time) { - time = this.factory.time.getDayCounter(this.showSeconds); - } - - this.autoIncrement(); - - this.base(time, doNotAddPlayClass); - } - - }); - -}(jQuery)); \ No newline at end of file From 6e05db15725dd504b8abfc11d64674088b3a63a2 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:08:07 -0500 Subject: [PATCH 021/129] Updated Gruntfile and recompiled the source --- Gruntfile.js | 8 +- compiled/flipclock.js | 1873 ++++++++++++++++++++++--------------- compiled/flipclock.min.js | 4 +- 3 files changed, 1118 insertions(+), 767 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1c34978e..8163a530 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,9 +13,13 @@ module.exports = function(grunt) { js: { src: [ 'src/flipclock/js/vendor/*.js', - 'src/flipclock/js/libs/core.js', + 'src/flipclock/js/libs/Core.js', + 'src/flipclock/js/libs/Plugins.js', + 'src/flipclock/js/libs/List.js', + 'src/flipclock/js/libs/ListItem.js', + 'src/flipclock/js/libs/EnglishAlphaList.js', 'src/flipclock/js/libs/*.js', - 'src/flipclock/js/faces/twentyfourhourclock.js', + 'src/flipclock/js/faces/TwentyFourHourClockFace.js', 'src/flipclock/js/faces/*.js', 'src/flipclock/js/lang/*.js', ], diff --git a/compiled/flipclock.js b/compiled/flipclock.js index b4677e1c..e6ea18c1 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -186,9 +186,6 @@ var FlipClock; /** * The Base FlipClock class is used to extend all other FlipFlock * classes. It handles the callbacks and the basic setters/getters - * - * @param object An object of the default properties - * @param object An object of properties to override the default */ FlipClock.Base = Base.extend({ @@ -205,6 +202,18 @@ var FlipClock; version: '0.7.7', + /** + * The bound events to this object + */ + + _events: {}, + + /** + * The bound events to this object + */ + + _uid: false, + /** * Sets the default options * @@ -219,6 +228,8 @@ var FlipClock; if(typeof options !== "object") { options = {}; } + this._events = {}; + this._uid = (new FlipClock.Uuid()).toString(); this.setOptions($.extend(true, {}, _default, options)); }, @@ -304,10 +315,153 @@ var FlipClock; this.setOption(key, options[key]); } } + }, + + /* + * Bind an event + * + * @param string + * @param callback + */ + + on: function(name, callback) { + if(!this._events[name]) { + this._events[name] = []; + } + + var event = new FlipClock.Event(name, callback); + + this._events[name].push(event); + + return event; + }, + + /* + * Bind an event to be called once + * + * @param string + * @param callback + */ + + once: function(name, callback) { + var event = this.on(name, callback); + + event.setFireOnce(true); + }, + + /* + * Remove all bound events for a specific trigger + * + * @param string + * @return + */ + + off: function(name) { + if(this._events[name]) { + delete this._events[name]; + } + }, + + /* + * Remove all bound events for a specific trigger + * + * @param string + * @return + */ + + trigger: function(name) { + if(this._events[name]) { + var params = []; + + for(var x in arguments) { + if(x > 0) { + params.push(arguments[x]); + } + } + + for(var i in this._events[name]) { + this._events[name][i].fire(this, params); + } + + return this._events[name]; + } + }, + + /* + * Translate a string to the localized locale + * + * @param + * @return + */ + + localize: function(name) { + if(this.translator) { + this.translator.localize(name); + } + + return name; + }, + + /* + * Helper method for localize. t() is just short. + * + * @param + * @return + */ + + t: function(name) { + return this.localize(name); } }); +}(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * Capitalize the first letter in a string + * + * @return string + */ + + String.prototype.ucfirst = function() { + return this.substr(0, 1).toUpperCase() + this.substr(1); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.FlipClock = function(digit, options) { + return new FlipClock($(this), digit, options); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.flipClock = function(digit, options) { + return $.fn.FlipClock(digit, options); + }; + }(jQuery)); /*jshint smarttabs:true */ @@ -325,235 +479,208 @@ var FlipClock; "use strict"; /** - * The FlipClock Face class is the base class in which to extend - * all other FlockClock.Face classes. + * The FlipClock.List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. * - * @param object The parent FlipClock.Factory object + * @param mixed This is the value used to set the clock. If an + * object is passed, 0 will be used. * @param object An object of properties to override the default */ - - FlipClock.Face = FlipClock.Base.extend({ + + FlipClock.List = FlipClock.Base.extend({ /** - * Sets whether or not the clock should start upon instantiation - */ - - autoStart: true, - - /** - * An array of jQuery objects used for the dividers (the colons) - */ + * The CSS classes + */ - dividers: [], - + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + flip: 'flip', + play: 'play' + }, + /** - * An array of FlipClock.List objects + * The jQuery object */ - factory: false, + $el: false, /** - * An array of FlipClock.List objects + * The items in the list */ - lists: [], - + items: [], + /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ + * The last value selected in the list + */ - constructor: function(factory, options) { - this.dividers = []; - this.lists = []; - this.base(options); - this.factory = factory; - }, - + lastValue: 0, + /** - * Build the clock face - */ + * The selected value in the list + */ - build: function() { - if(this.autoStart) { - this.start(); - } - }, + value: 0, /** - * Creates a jQuery object used for the digit divider + * Constructor * - * @param mixed The divider label text - * @param mixed Set true to exclude the dots in the divider. - * If not set, is false. + * @param object A FlipClock.Factory object + * @param int An string or integer use to select the correct value + * @param object An object to override the default properties */ - createDivider: function(label, css, excludeDots) { - if(typeof css == "boolean" || !css) { - excludeDots = css; - css = label; - } - - var dots = [ - '', - '' - ].join(''); - - if(excludeDots) { - dots = ''; - } + constructor: function(value, options) { + this.base(options); - label = this.factory.localize(label); + this.value = value; - var html = [ - '', - ''+(label ? label : '')+'', - dots, - '' - ]; - - var $html = $(html.join('')); + var t = this; - this.dividers.push($html); + this.createList(); - return $html; + this.trigger('init'); }, /** - * Creates a FlipClock.List object and appends it to the DOM + * Select the value in the list * - * @param mixed The digit to select in the list - * @param object An object to override the default properties + * @param int A value 0-9 */ - createList: function(digit, options) { - if(typeof digit === "object") { - options = digit; - digit = 0; + select: function(value) { + var _afterListItem = this._afterListItem; + + this.lastValue = this.value; + + if(typeof value === "undefined") { + value = this.value; + } + else { + this.value = value; } - var obj = new FlipClock.List(this.factory, digit, options); - - this.lists.push(obj); + if(this.value != this.lastValue) { + this._beforeListItem.$el.removeClass(this.classes.before); - return obj; - }, - - /** - * Triggers when the clock is reset - */ + this.$el.find('.'+this.classes.active) + .removeClass(this.classes.active) + .addClass(this.classes.before); - reset: function() { - this.factory.time = new FlipClock.Time( - this.factory, - this.factory.original ? Math.round(this.factory.original) : 0, - { - minimumDigits: this.factory.minimumDigits - } - ); + this.items.splice(0, 1); - this.flip(this.factory.original, false); - }, + this._afterListItem = this.createListItem(this.classes.active, this.value); - /** - * Append a newly created list to the clock - */ + this._beforeListItem.$el.remove(); + this._beforeListItem = _afterListItem; - appendDigitToClock: function(obj) { - obj.$el.append(false); + this.trigger('select', this.value); + } }, - /** - * Add a digit to the clock face - */ - - addDigit: function(digit) { - var obj = this.createList(digit, { - classes: { - active: this.factory.classes.active, - before: this.factory.classes.before, - flip: this.factory.classes.flip - } - }); + /* + * Add the play class to the list + * + * @return + */ - this.appendDigitToClock(obj); + addPlayClass: function() { + this.$el.addClass(this.classes.play); }, - /** - * Triggers when the clock is started - */ - - start: function() {}, - - /** - * Triggers when the time on the clock stops - */ - - stop: function() {}, + /* + * Remove the play class to the list + * + * @return + */ + + removePlayClass: function() { + this.$el.removeClass(this.classes.play); + }, /** - * Auto increments/decrements the value of the clock face + * Creates the list item HTML and returns as a string */ - autoIncrement: function() { - if(!this.factory.countdown) { - this.increment(); - } - else { - this.decrement(); - } - }, + createListItem: function(css, value) { + var item = new FlipClock.ListItem(css, value); - /** - * Increments the value of the clock face - */ - - increment: function() { - this.factory.time.addSecond(); - }, + this.items.push(item); - /** - * Decrements the value of the clock face - */ + this.$el.append(item.$el); - decrement: function() { - if(this.factory.time.getTimeSeconds() == 0) { - this.factory.stop() - } - else { - this.factory.time.subSecond(); - } + this.trigger('create:item', item); + + return item; }, - + /** - * Triggers when the numbers on the clock flip + * Create the lsit of values and appends it to the DOM object */ - flip: function(time, doNotAddPlayClass) { - var t = this; + createList: function() { + var $el = this.$el = $('
        '); - $.each(time, function(i, digit) { - var list = t.lists[i]; + this._beforeListItem = this.createListItem(this.classes.before, this.getPrevValue()); + this._afterListItem = this.createListItem(this.classes.active, this.value); - if(list) { - if(!doNotAddPlayClass && digit != list.digit) { - list.play(); - } + $el.append(this._beforeListItem.el); + $el.append(this._afterListItem.el); + + this.trigger('create:list', $el); - list.select(digit); - } - else { - t.addDigit(digit); - } - }); + return $el; } - + }); - + }(jQuery)); +(function($) { + + FlipClock.ListItem = FlipClock.Base.extend({ + + css: null, + + value: null, + + classes: { + up: 'up', + down: 'down' + }, + + $el: false, + + constructor: function(css, value, options) { + this.base(options); + this.css = css; + this.value = value; + + this.$el = $([ + '
      • ', + '', + '
        ', + '
        ', + '
        '+value+'
        ', + '
        ', + '
        ', + '
        ', + '
        '+value+'
        ', + '
        ', + '
        ', + '
      • ' + ].join('')); + }, + + toString: function() { + return this.$el.html(); + } + }); + +}(jQuery)); /*jshint smarttabs:true */ /** @@ -569,17 +696,186 @@ var FlipClock; "use strict"; /** - * The FlipClock Factory class is used to build the clock and manage - * all the public methods. + * The FlipClock List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. * - * @param object A jQuery object or CSS selector used to fetch - the wrapping DOM nodes - * @param mixed This is the digit used to set the clock. If an - object is passed, 0 will be used. + * @param mixed This is the value used to set the clock. If an + * object is passed, 0 will be used. * @param object An object of properties to override the default */ - - FlipClock.Factory = FlipClock.Base.extend({ + + FlipClock.EnglishAlphaList = FlipClock.List.extend({ + + capitalLetters: true, + + getPrevValue: function() { + var charCode = this.value.charCodeAt(0) - 1; + var minCode = 65, maxCode = 90; + + if(!this.capitalLetters) { + minCode = 97; + maxCode = 122; + } + + if(charCode < minCode) { + charCode = maxCode; + } + + return String.fromCharCode(charCode); + }, + + getNextValue: function() { + var charCode = this.value.charCodeAt(0) + 1; + var minCode = 65, maxCode = 90; + + if(!this.capitalLetters) { + minCode = 97; + maxCode = 122; + } + + if(charCode > maxCode) { + charCode = minCode; + } + + return String.fromCharCode(charCode); + } + + }); + + +}(jQuery)); +(function($) { + + FlipClock.Divider = FlipClock.Base.extend({ + + label: false, + + css: false, + + excludeDots: false, + + translator: false, + + classes: { + divider: 'flip-clock-divider', + dot: 'flip-clock-dot', + label: 'flip-clock-label' + }, + + $el: false, + + constructor: function(label, options) { + this.base(options); + + this.label = this.t(label); + + var dots = !this.excludeDots ? [ + '', + '' + ].join('') : ''; + + this.$el = $([ + '', + ''+(this.label ? this.label : '')+'', + dots, + '' + ].join('')); + + }, + + toString: function() { + return this.$el.html(); + } + + }); + +}(jQuery)); +(function($) { + + FlipClock.Event = FlipClock.Base.extend({ + + name: false, + + _hasFired: false, + + _lastResponse: null, + + _preventFire: false, + + _fireOnce: false, + + _callback: function() {}, + + constructor: function(name, callback) { + if(!name) { + throw "Events must have a name"; + } + + if(typeof callback === "function") { + this._callback = callback; + } + }, + + fire: function(obj, arguments) { + if(this._preventFire === false) { + this.setLastResponse(this._callback.apply(obj, arguments)); + this._hasFired = true; + if(this._fireOnce) { + this._preventFire = true; + } + } + }, + + off: function() { + this._preventFire = true; + }, + + hasFired: function() { + return this._hasFired; + }, + + getLastResponse: function() { + return this._lastResponse; + }, + + setLastResponse: function(response) { + this._lastResponse = response; + }, + + getFireOnce: function(value) { + return this._fireOnce; + }, + + setFireOnce: function(value) { + this._fireOnce = value; + } + + }); + +}(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock Face class is the base class in which to extend + * all other FlockClock.Face classes. + * + * @param object An object of properties to override the default + */ + + FlipClock.Face = FlipClock.Base.extend({ /** * The clock's animation rate. @@ -592,59 +888,17 @@ var FlipClock; animationRate: 1000, /** - * Auto start the clock on page load (True|False) - */ + * Sets whether or not the clock should start upon instantiation + */ autoStart: true, - - /** - * The callback methods - */ - - callbacks: { - destroy: false, - create: false, - init: false, - interval: false, - start: false, - stop: false, - reset: false - }, - - /** - * The CSS classes - */ - - classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - divider: 'flip-clock-divider', - dot: 'flip-clock-dot', - label: 'flip-clock-label', - flip: 'flip', - play: 'play', - wrapper: 'flip-clock-wrapper' - }, - - /** - * The name of the clock face class in use - */ - - clockFace: 'HourlyCounter', - + /** - * The name of the clock face class in use - */ + * Sets whether or not the clock should countdown + */ countdown: false, - - /** - * The name of the default clock face class to use if the defined - * clockFace variable is not a valid FlipClock.Face object - */ - - defaultClockFace: 'HourlyCounter', - + /** * The default language */ @@ -652,29 +906,29 @@ var FlipClock; defaultLanguage: 'english', /** - * The jQuery object - */ + * An array of jQuery objects used for the dividers (the colons) + */ - $el: false, + dividers: [], - /** - * The FlipClock.Face object - */ - - face: true, - /** * The language object after it has been loaded */ lang: false, - + /** * The language being used to display labels (string) */ language: 'english', + + /** + * An array of FlipClock.List objects + */ + lists: [], + /** * The minimum digits the clock must have */ @@ -682,17 +936,11 @@ var FlipClock; minimumDigits: 0, /** - * The original starting value of the clock. Used for the reset method. + * The original starting value of the clock face. */ - original: false, - - /** - * Is the clock running? (True|False) - */ - - running: false, - + originalValue: 0, + /** * The FlipClock.Time object */ @@ -706,161 +954,187 @@ var FlipClock; timer: false, /** - * The jQuery object (depcrecated) + * The FlipClock.Translator object */ - $wrapper: false, + translator: false, + + /** + * The current value of the clock face. + */ + + value: false, /** * Constructor * - * @param object The wrapping jQuery object - * @param object Number of seconds used to start the clock - * @param object An object override options + * @param mixed + * @param object */ - constructor: function(obj, digit, options) { + constructor: function(value, options) { + var t = this; - if(!options) { - options = {}; + if(value instanceof Date === false && typeof value === "object") { + options = value; + value = 0; } + this.dividers = []; this.lists = []; - this.running = false; - this.base(options); + this.originalValue = value; - this.$el = $(obj).addClass(this.classes.wrapper); + this.translator = new FlipClock.Translator({ + defaultLanguage: this.defaultLanguage, + language: this.language + }); - // Depcrated support of the $wrapper property. - this.$wrapper = this.$el; + this.time = new FlipClock.Time(value, { + minimumDigits: 0 + }); - this.original = (digit instanceof Date) ? digit : (digit ? Math.round(digit) : 0); + this.timer = new FlipClock.Timer(); - this.time = new FlipClock.Time(this, this.original, { - minimumDigits: this.minimumDigits, - animationRate: this.animationRate + this.timer.on('interval', function() { + t.flip(); + t.trigger('interval'); }); - this.timer = new FlipClock.Timer(this, options); + this.base(options); - this.loadLanguage(this.language); - - this.loadClockFace(this.clockFace, options); + this.on('add:digit', function(list) { + if(this.dividers.length) { + for(var i in this.dividers) { + var divider = this.dividers[i]; - if(this.autoStart) { - this.start(); - } + if(!divider.$el.is(':first-child')) { + divider.$el.insertAfter(divider.$el.next()); + } + } + } + }); + this.trigger('create'); }, /** - * Load the FlipClock.Face object - * - * @param object The name of the FlickClock.Face class - * @param object An object override options + * Add a digit to the clock face */ - loadClockFace: function(name, options) { - var face, suffix = 'Face', hasStopped = false; - - name = name.ucfirst()+suffix; - - if(this.face.stop) { - this.stop(); - hasStopped = true; - } + addDigit: function(digit) { + var list = this.createList(digit); - this.$el.html(''); + console.log(this._events); - this.time.minimumDigits = this.minimumDigits; - - if(FlipClock[name]) { - face = new FlipClock[name](this, options); - } - else { - face = new FlipClock[this.defaultClockFace+suffix](this, options); - } - - face.build(); + this.trigger('add:digit', list); - this.face = face + return list; + }, - if(hasStopped) { + attachList: function($el, list) { + $el.append(list.$el); + }, + + /** + * Build the clock face + */ + + build: function() { + if(this.autoStart) { this.start(); } - - return this.face; }, - + /** - * Load the FlipClock.Lang object + * Perform arbirtrary logic when the clock face instantiated. + * The factor object is passed in the first argument * - * @param object The name of the language to load + * @param object + */ + + init: function(factory) { + this.trigger('init'); + }, + + /** + * Creates a jQuery object used for the digit divider + * + * @param mixed The divider label text + * @param mixed Set true to exclude the dots in the divider. + * If not set, is false. */ - loadLanguage: function(name) { - var lang; - - if(FlipClock.Lang[name.ucfirst()]) { - lang = FlipClock.Lang[name.ucfirst()]; - } - else if(FlipClock.Lang[name]) { - lang = FlipClock.Lang[name]; - } - else { - lang = FlipClock.Lang[this.defaultLanguage]; + createDivider: function(label, css, excludeDots) { + if(typeof css == "boolean" || !css) { + excludeDots = css; + css = false; } - - return this.lang = lang; + + var divider = new FlipClock.Divider(label, { + css: css, + excludeDots: excludeDots, + translator: this.translator + }); + + this.dividers.push(divider); + + return divider; }, - + /** - * Localize strings into various languages + * Creates a FlipClock.List object and appends it to the DOM * - * @param string The index of the localized string - * @param object Optionally pass a lang object + * @param mixed The value to select in the list + * @param object An object to override the default properties */ + + createList: function(value, options) { + var List = this.getListClass(); - localize: function(index, obj) { - var lang = this.lang; - - if(!index) { - return null; + var list = new List(value, { + translator: this.translator + }); + + if(this.timer.running) { + list.addPlayClass(); } - var lindex = index.toLowerCase(); + this.lists.push(list); - if(typeof obj == "object") { - lang = obj; - } + this.trigger('create:list', list); - if(lang && lang[lindex]) { - return lang[lindex]; - } + return list; + }, + + /* + * Get the list class object + * + * @return + */ + + getListClass: function() { + return FlipClock.NumericList; + }, + + /** + * Triggers when the clock is reset + */ - return index; + reset: function() { + this.time.time = Math.round(this.originalValue); + this.flip(); + this.trigger('reset'); }, - /** * Starts the clock */ - start: function(callback) { - var t = this; - - if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) { - t.face.start(t.time); - t.timer.start(function() { - t.flip(); - - if(typeof callback === "function") { - callback(); - } - }); - } - else { - t.log('Trying to start timer when countdown already at 0'); + start: function() { + if(!this.timer.running) { + this.trigger('before:start'); + this.timer.start(); + this.trigger('start'); } }, @@ -868,33 +1142,78 @@ var FlipClock; * Stops the clock */ - stop: function(callback) { - this.face.stop(); - this.timer.stop(callback); - - for(var x in this.lists) { - if (this.lists.hasOwnProperty(x)) { - this.lists[x].stop(); - } - } + stop: function() { + var t = this; + this.trigger('before:stop'); + this.timer.stop(function() { + t.trigger('stop'); + }); }, /** - * Reset the clock + * Auto increments/decrements the value of the clock face */ - reset: function(callback) { - this.timer.reset(callback); - this.face.reset(); + autoIncrement: function() { + if(!this.countdown) { + this.increment(); + } + else { + this.decrement(); + } + }, + + /** + * Increments the value of the clock face + */ + + increment: function() { + this.time.addSecond(); + }, + + /** + * Decrements the value of the clock face + */ + + decrement: function() { + if(this.time.getTimeSeconds() == 0) { + this.stop() + } + else { + this.time.subSecond(); + } }, + /** + * Triggers when the numbers on the clock flip + */ + + flip: function(time) { + var t = this; + + $.each(time, function(i, digit) { + if(t.lists[i]) { + t.lists[i].select(digit); + + if(t.timer.running) { + t.lists[i].addPlayClass(); + } + } + else { + t.addDigit(digit); + } + }); + + this.trigger('flip'); + }, + /** * Sets the clock time */ setTime: function(time) { this.time.time = time; - this.flip(true); + this.flip(); }, /** @@ -906,33 +1225,22 @@ var FlipClock; getTime: function(time) { return this.time; }, - + /** * Changes the increment of time to up or down (add/sub) */ - - setCountdown: function(value) { - var running = this.running; - + + setCountdown: function(value) { this.countdown = value ? true : false; - if(running) { + if(this.timer.running) { this.stop(); this.start(); } - }, - - /** - * Flip the digits on the clock - * - * @param array An array of digits - */ - flip: function(doNotAddPlayClass) { - this.face.flip(false, doNotAddPlayClass); - } - + } + }); - + }(jQuery)); /*jshint smarttabs:true */ @@ -950,196 +1258,223 @@ var FlipClock; "use strict"; /** - * The FlipClock List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific digit. + * The FlipClock Factory class is used to build the clock and manage + * all the public methods. * - * @param object A FlipClock.Factory object + * @param object A jQuery object or CSS selector used to fetch + the wrapping DOM nodes * @param mixed This is the digit used to set the clock. If an - * object is passed, 0 will be used. + object is passed, 0 will be used. * @param object An object of properties to override the default */ - FlipClock.List = FlipClock.Base.extend({ - - /** - * The digit (0-9) - */ - - digit: 0, + FlipClock.Factory = FlipClock.Base.extend({ /** * The CSS classes */ classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - flip: 'flip' + wrapper: 'flip-clock-wrapper' }, - + /** - * The parent FlipClock.Factory object - */ + * The name of the clock face class in use + */ + + clockFace: 'HourlyCounter', - factory: false, - /** - * The jQuery object - */ + * The FlipClock.Face options object + */ + + clockFaceOptions: {}, - $el: false, - /** - * The jQuery object (deprecated) - */ + * The name of the default clock face class to use if the defined + * clockFace variable is not a valid FlipClock.Face object + */ + + defaultClockFace: 'HourlyCounter', - $obj: false, - /** - * The items in the list + * The jQuery object */ - items: [], - + $el: false, + /** - * The last digit - */ + * The FlipClock.Face object + */ + + face: false, - lastDigit: 0, - /** * Constructor * - * @param object A FlipClock.Factory object - * @param int An integer use to select the correct digit - * @param object An object to override the default properties + * @param object The wrapping jQuery object + * @param object Number of seconds used to start the clock + * @param object An object override options + * @return */ - constructor: function(factory, digit, options) { - this.factory = factory; - this.digit = digit; - this.lastDigit = digit; - this.$el = this.createList(); - - // Depcrated support of the $obj property. - this.$obj = this.$el; - - if(digit > 0) { - this.select(digit); + constructor: function($el, value, options) { + if(value instanceof Date === false && typeof value === "object") { + options = value; + value = 0; } - this.factory.$el.append(this.$el); + this.base(options); + + this.lists = []; + + this.$el = $el.addClass(this.classes.wrapper); + + this.loadClockFace(this.clockFace, value, this.clockFaceOptions); }, /** - * Select the digit in the list + * Load the FlipClock.Face object * - * @param int A digit 0-9 + * @param object The name of the FlickClock.Face class + * @param object An object override options + * @return object */ - select: function(digit) { - if(typeof digit === "undefined") { - digit = this.digit; + loadClockFace: function(name, value, options) { + var t = this, face, suffix = 'Face', hasStopped = false; + + name = name.ucfirst()+suffix; + + if(this.face.stop) { + this.stop(); + hasStopped = true; + } + + this.$el.html(''); + + if(FlipClock[name]) { + this.face = new FlipClock[name](value, options); } else { - this.digit = digit; + this.face = new FlipClock[this.defaultClockFace+suffix](value, options); } - if(this.digit != this.lastDigit) { - var $delete = this.$el.find('.'+this.classes.before).removeClass(this.classes.before); + this.face.on('create:list', function(list) { + t.face.attachList(t.$el, list); + }); - this.$el.find('.'+this.classes.active).removeClass(this.classes.active) - .addClass(this.classes.before); + this.face.on('destroy', function() { + t.callback(t.onDestroy); + }); - this.appendListItem(this.classes.active, this.digit); + this.face.on('start', function() { + t.callback(t.onStart); + }); + + this.face.on('stop', function() { + t.callback(t.onStop); + }); + + this.face.on('reset', function() { + t.callback(t.onReset); + }); + + this.face.on('init', function() { + t.callback(t.onInit); + }); + + this.face.on('interval', function() { + t.callback(t.onInterval); + }); + + this.face.init(this); - $delete.remove(); + this.face.build(); - this.lastDigit = this.digit; - } + if(hasStopped) { + this.start(); + } + + return this.face; }, - + /** - * Adds the play class to the DOM object + * Starts the clock + * + * @return object */ - - play: function() { - this.$el.addClass(this.factory.classes.play); + + start: function() { + this.face.start(); + + return this; }, /** - * Removes the play class to the DOM object + * Stops the clock + * + * @return object */ stop: function() { - var t = this; - - setTimeout(function() { - t.$el.removeClass(t.factory.classes.play); - }, this.factory.timer.interval); + this.face.stop(); + + return this; }, - + /** - * Creates the list item HTML and returns as a string + * Reset the clock + * + * @return object */ - createListItem: function(css, value) { - return [ - '
      • ', - '', - '
        ', - '
        ', - '
        '+(value ? value : '')+'
        ', - '
        ', - '
        ', - '
        ', - '
        '+(value ? value : '')+'
        ', - '
        ', - '
        ', - '
      • ' - ].join(''); + reset: function() { + this.face.reset(); + + return this; }, /** - * Append the list item to the parent DOM node + * Sets the clock time + * + * @return object */ - - appendListItem: function(css, value) { - var html = this.createListItem(css, value); - - this.$el.append(html); + + setTime: function(time) { + this.face.setTime(time); + + return this; }, /** - * Create the list of digits and appends it to the DOM object + * Gets the clock time + * + * @return object */ - createList: function() { - - var lastDigit = this.getPrevDigit() ? this.getPrevDigit() : this.digit; - - var html = $([ - '
          ', - this.createListItem(this.classes.before, lastDigit), - this.createListItem(this.classes.active, this.digit), - '
        ' - ].join('')); - - return html; - }, - - getNextDigit: function() { - return this.digit == 9 ? 0 : this.digit + 1; + getTime: function() { + this.face.getTime(); + + return this; }, - getPrevDigit: function() { - return this.digit == 0 ? 9 : this.digit - 1; - } - + onDestroy: function() {}, + + onCreate: function() {}, + + onInit: function() {}, + + onInterval: function() {}, + + onStart: function() {}, + + onStop: function() {}, + + onReset: function() {} + }); - - + }(jQuery)); /*jshint smarttabs:true */ @@ -1157,39 +1492,37 @@ var FlipClock; "use strict"; /** - * Capitalize the first letter in a string - * - * @return string - */ - - String.prototype.ucfirst = function() { - return this.substr(0, 1).toUpperCase() + this.substr(1); - }; - - /** - * jQuery helper method - * - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default - */ - - $.fn.FlipClock = function(digit, options) { - return new FlipClock($(this), digit, options); - }; - - /** - * jQuery helper method + * The FlipClock.List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. * - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default + * @param mixed This is the value used to set the clock. If an + * object is passed, 0 will be used. + * @param object An object of properties to override the default */ - - $.fn.flipClock = function(digit, options) { - return $.fn.FlipClock(digit, options); - }; + + FlipClock.NumericList = FlipClock.List.extend({ + + getPrevValue: function() { + if(this.value > 0) { + return this.value - 1; + } + + return 9; + }, + + getNextValue: function() { + if(this.value < 9) { + return this.value + 1; + } + + return 0; + } + + }); + }(jQuery)); - /*jshint smarttabs:true */ /** @@ -1208,7 +1541,6 @@ var FlipClock; * The FlipClock Time class is used to manage all the time * calculations. * - * @param object A FlipClock.Factory object * @param mixed This is the digit used to set the clock. If an * object is passed, 0 will be used. * @param object An object of properties to override the default @@ -1222,12 +1554,6 @@ var FlipClock; time: 0, - /** - * The parent FlipClock.Factory object - */ - - factory: false, - /** * The minimum number of digits the clock face must have */ @@ -1237,26 +1563,24 @@ var FlipClock; /** * Constructor * - * @param object A FlipClock.Factory object * @param int An integer use to select the correct digit * @param object An object to override the default properties */ - constructor: function(factory, time, options) { + constructor: function(time, options) { if(typeof options != "object") { options = {}; } - if(!options.minimumDigits) { - options.minimumDigits = factory.minimumDigits; + if(time instanceof Date) { + this.time = time; + } + else if(time) { + this.time = Math.round(time); } this.base(options); - this.factory = factory; - if(time) { - this.time = time; - } }, /** @@ -1491,13 +1815,13 @@ var FlipClock; * @return int Returns a floored integer */ - getTimeSeconds: function(date) { + getTimeSeconds: function(countdown, date) { if(!date) { date = new Date(); } if (this.time instanceof Date) { - if (this.factory.countdown) { + if (countdown) { return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); } else { return date.getTime()/1000 - this.time.getTime()/1000 ; @@ -1522,9 +1846,6 @@ var FlipClock; date = this.getDateObject(); } - console.log(date); - - var hours = date.getHours(); var merid = hours > 12 ? 'PM' : 'AM'; var data = [ @@ -1686,38 +2007,23 @@ var FlipClock; /** * The FlipClock.Timer object managers the JS timers * - * @param object The parent FlipClock.Factory object * @param object Override the default options */ FlipClock.Timer = FlipClock.Base.extend({ /** - * Callbacks + * The rate of the animation in milliseconds (not currently in use) */ - callbacks: { - destroy: false, - create: false, - init: false, - interval: false, - start: false, - stop: false, - reset: false - }, - + animationRate: 1000, + /** * FlipClock timer count (how many intervals have passed) */ count: 0, - /** - * The parent FlipClock.Factory object - */ - - factory: false, - /** * Timer interval (1 second by default) */ @@ -1725,10 +2031,10 @@ var FlipClock; interval: 1000, /** - * The rate of the animation in milliseconds (not currently in use) + * Is the timer running? */ - animationRate: 1000, + running: false, /** * Constructor @@ -1736,11 +2042,9 @@ var FlipClock; * @return void */ - constructor: function(factory, options) { + constructor: function(options) { this.base(options); - this.factory = factory; - this.callback(this.callbacks.init); - this.callback(this.callbacks.create); + this.trigger('init'); }, /** @@ -1773,8 +2077,8 @@ var FlipClock; reset: function(callback) { clearInterval(this.timer); this.count = 0; - this._setInterval(callback); - this.callback(this.callbacks.reset); + this._setInterval(callback); + this.trigger('reset'); }, /** @@ -1784,10 +2088,10 @@ var FlipClock; * @return void */ - start: function(callback) { - this.factory.running = true; + start: function(callback) { + this.running = true; this._createTimer(callback); - this.callback(this.callbacks.start); + this.trigger('start'); }, /** @@ -1798,10 +2102,15 @@ var FlipClock; */ stop: function(callback) { - this.factory.running = false; - this._clearInterval(callback); - this.callback(this.callbacks.stop); - this.callback(callback); + var t = this; + + this.running = false; + this._clearInterval(); + + setTimeout(function() { + t.callback(callback); + t.trigger('stop'); + }, this.interval); }, /** @@ -1832,11 +2141,12 @@ var FlipClock; * @return void */ - _destroyTimer: function(callback) { - this._clearInterval(); + destroyTimer: function(callback) { + this._clearInterval(); + this.running = false; this.timer = false; this.callback(callback); - this.callback(this.callbacks.destroy); + this.trigger('destroy') }, /** @@ -1847,8 +2157,8 @@ var FlipClock; */ _interval: function(callback) { - this.callback(this.callbacks.interval); this.callback(callback); + this.trigger('interval'); this.count++; }, @@ -1872,7 +2182,133 @@ var FlipClock; }); }(jQuery)); +(function() { + + FlipClock.Translator = FlipClock.Base.extend({ + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english', + + /** + * The language object after it has been loaded + */ + + lang: false, + + /* + * Constructor + * + * @param string + * @return + */ + + constructor: function(options) { + this.base(options); + this.loadLanguage(this.language); + }, + + /** + * Load the FlipClock.Lang object + * + * @param object The name of the language to load + */ + + loadLanguage: function(name) { + var lang; + + if(FlipClock.Lang[name.ucfirst()]) { + lang = FlipClock.Lang[name.ucfirst()]; + } + else if(FlipClock.Lang[name]) { + lang = FlipClock.Lang[name]; + } + else { + lang = FlipClock.Lang[this.defaultLanguage]; + } + + return this.lang = lang; + }, + + /** + * Localize strings into various languages + * + * @param string The index of the localized string + * @param object Optionally pass a lang object + */ + + localize: function(index, obj) { + var lang = this.lang; + + if(!index) { + return null; + } + + var lindex = index.toLowerCase(); + + if(typeof obj == "object") { + lang = obj; + } + + if(lang && lang[lindex]) { + return lang[lindex]; + } + + return index; + } + }); + +}()); +(function($) { + + FlipClock.Uuid = FlipClock.Base.extend({ + + value: false, + + constructor: function() { + this.value = this.generate(); + }, + + generate: function() { + var d = new Date().getTime(); + var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = (d + Math.random()*16)%16 | 0; + d = Math.floor(d/16); + return (c=='x' ? r : (r&0x3|0x8)).toString(16); + }); + return uuid; + }, + + equals: function(other) { + return this.isUuid(other) && value == other; + }, + + isUuid: function(value) { + var validator = new RegExp("^[a-z0-9]{32}$", "i"); + + return value && (value instanceof Uuid || validator.test(value.toString())); + }, + + toString: function() { + return this.value; + }, + + toJSON: function() { + return this.value; + } + + }); + +}(jQuery)); (function($) { /** @@ -1880,23 +2316,11 @@ var FlipClock; * * This class will generate a twenty-four our clock for FlipClock.js * - * @param object The parent FlipClock.Factory object * @param object An object of properties to override the default */ FlipClock.TwentyFourHourClockFace = FlipClock.Face.extend({ - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - /** * Build the clock face * @@ -1904,28 +2328,14 @@ var FlipClock; */ build: function(time) { - var t = this; - var children = this.factory.$el.find('ul'); + var time = time ? time : this.time.getMilitaryTime(false, this.showSeconds); - if(!this.factory.time.time) { - this.factory.original = new Date(); - - this.factory.time = new FlipClock.Time(this.factory, this.factory.original); - } - - var time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); + for(var i in time) { + this.createList(time[i]); } - this.createDivider(); - this.createDivider(); - - $(this.dividers[0]).insertBefore(this.lists[this.lists.length - 2].$el); - $(this.dividers[1]).insertBefore(this.lists[this.lists.length - 4].$el); + this.createDivider().$el.insertBefore(this.lists[this.lists.length - 2].$el); + this.createDivider().$el.insertBefore(this.lists[this.lists.length - 4].$el); this.base(); }, @@ -1937,9 +2347,9 @@ var FlipClock; flip: function(time, doNotAddPlayClass) { this.autoIncrement(); - time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds); + time = time ? time : this.time.getMilitaryTime(false, this.showSeconds); - this.base(time, doNotAddPlayClass); + this.base(time); } }); @@ -1952,9 +2362,6 @@ var FlipClock; * * This class will generate a generice flip counter. The timer has been * disabled. clock.increment() and clock.decrement() have been added. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default */ FlipClock.CounterFace = FlipClock.Face.extend({ @@ -1969,98 +2376,90 @@ var FlipClock; * Constructor * * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default + * @param object An object of properties to override the default + * @return */ - constructor: function(factory, options) { - - if(typeof options != "object") { - options = {}; - } + constructor: function(value, options) { + this.base(value, options); - factory.autoStart = options.autoStart ? true : false; + this.timer.off('stop'); - if(options.autoStart) { + this.on('before:start', function() { this.shouldAutoIncrement = true; - } - - factory.increment = function() { - factory.countdown = false; - factory.setTime(factory.getTime().getTimeSeconds() + 1); - }; - - factory.decrement = function() { - factory.countdown = true; - var time = factory.getTime().getTimeSeconds(); - if(time > 0) { - factory.setTime(time - 1); - } - }; - - factory.setValue = function(digits) { - factory.setTime(digits); - }; + }); - factory.setCounter = function(digits) { - factory.setTime(digits); - }; + this.on('before:stop', function() { + this.shouldAutoIncrement = false; + }); - this.base(factory, options); + this.on('create:list', function(list) { + list.addPlayClass(); + }); }, /** * Build the clock face + * + * @return */ build: function() { - var t = this; - var children = this.factory.$el.find('ul'); - var time = this.factory.getTime().digitize([this.factory.getTime().time]); + var t = this, time = this.getTime().digitize([this.getTime().time]); - if(time.length > children.length) { - $.each(time, function(i, digit) { - var list = t.createList(digit); + $.each(time, function(i, value) { + t.createList(value); + }); - list.select(digit); - }); - + if(this.autoStart) { + this.shouldAutoIncrement = true; } - $.each(this.lists, function(i, list) { - list.play(); - }); - this.base(); }, /** * Flip the clock face + * + * @return */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(this.shouldAutoIncrement) { this.autoIncrement(); } - if(!time) { - time = this.factory.getTime().digitize([this.factory.getTime().time]); + if(!time) { + time = this.getTime().digitize([this.getTime().time]); } - this.base(time, doNotAddPlayClass); + this.base(time); }, /** - * Reset the clock face + * Perform arbirtrary logic when the clock face instantiated. + * The factor object is passed in the first argument + * + * @param object + * @return */ - reset: function() { - this.factory.time = new FlipClock.Time( - this.factory, - this.factory.original ? Math.round(this.factory.original) : 0 - ); + init: function(factory) { + var t = this; - this.flip(); + factory.increment = function() { + t.increment(); + t.flip(); + }; + + factory.decrement = function() { + t.decrement(); + t.flip(); + }; + + this.base(factory); } + }); }(jQuery)); @@ -2074,7 +2473,6 @@ var FlipClock; * the number of available digits is exceeded in the count, a new * digit will be created. * - * @param object The parent FlipClock.Factory object * @param object An object of properties to override the default */ @@ -2082,45 +2480,28 @@ var FlipClock; showSeconds: true, - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - /** * Build the clock face */ - build: function(time) { - var t = this; - var children = this.factory.$el.find('ul'); - var offset = 0; - - time = time ? time : this.factory.time.getDayCounter(this.showSeconds); + build: function(time) { + var offset = 0, time = time ? time : this.time.getDayCounter(this.showSeconds); - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); + for(var i in time) { + this.createList(time[i]); } if(this.showSeconds) { - $(this.createDivider('Seconds')).insertBefore(this.lists[this.lists.length - 2].$el); + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); } else { offset = 2; } - $(this.createDivider('Minutes')).insertBefore(this.lists[this.lists.length - 4 + offset].$el); - $(this.createDivider('Hours')).insertBefore(this.lists[this.lists.length - 6 + offset].$el); - $(this.createDivider('Days', true)).insertBefore(this.lists[0].$el); + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4 + offset].$el); + this.createDivider('Hours').$el.insertBefore(this.lists[this.lists.length - 6 + offset].$el); + this.createDivider('Days', true).$el.insertBefore(this.lists[0].$el); this.base(); }, @@ -2129,14 +2510,13 @@ var FlipClock; * Flip the clock face */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(!time) { - time = this.factory.time.getDayCounter(this.showSeconds); + time = this.time.getDayCounter(this.showSeconds); } this.autoIncrement(); - - this.base(time, doNotAddPlayClass); + this.base(time); } }); @@ -2158,42 +2538,24 @@ var FlipClock; FlipClock.HourlyCounterFace = FlipClock.Face.extend({ - // clearExcessDigits: true, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - /** * Build the clock face */ build: function(excludeHours, time) { - var t = this; - var children = this.factory.$el.find('ul'); + var time = time ? time : this.time.getHourCounter(); - time = time ? time : this.factory.time.getHourCounter(); - - if(time.length > children.length) { - $.each(time, function(i, digit) { - t.createList(digit); - }); + for(var i in time) { + this.createList(time[i]); } - - $(this.createDivider('Seconds')).insertBefore(this.lists[this.lists.length - 2].$el); - $(this.createDivider('Minutes')).insertBefore(this.lists[this.lists.length - 4].$el); + + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4].$el); if(!excludeHours) { - $(this.createDivider('Hours', true)).insertBefore(this.lists[0].$el); + this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); } - + this.base(); }, @@ -2201,14 +2563,13 @@ var FlipClock; * Flip the clock face */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(!time) { - time = this.factory.time.getHourCounter(); + time = this.time.getHourCounter(); } this.autoIncrement(); - - this.base(time, doNotAddPlayClass); + this.base(time); }, /** @@ -2232,44 +2593,33 @@ var FlipClock; * This class will generate a minute counter for FlipClock.js. A * minute counter will track minutes and seconds. If an hour is * reached, the counter will reset back to 0. (4 digits max) - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default + * */ FlipClock.MinuteCounterFace = FlipClock.HourlyCounterFace.extend({ - clearExcessDigits: false, - - /** - * Constructor - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default - */ - - constructor: function(factory, options) { - this.base(factory, options); - }, - /** - * Build the clock face + * Build the clock face + * + * @return */ build: function() { - this.base(true, this.factory.time.getMinuteCounter()); + this.base(true, this.time.getMinuteCounter()); }, /** * Flip the clock face + * + * @return */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(!time) { - time = this.factory.time.getMinuteCounter(); + time = this.time.getMinuteCounter(); } - this.base(time, doNotAddPlayClass); + this.base(time); } }); @@ -2281,9 +2631,6 @@ var FlipClock; * Twelve Hour Clock Face * * This class will generate a twelve hour clock for FlipClock.js - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default */ FlipClock.TwelveHourClockFace = FlipClock.TwentyFourHourClockFace.extend({ @@ -2309,7 +2656,7 @@ var FlipClock; build: function() { var t = this; - var time = this.factory.time.getTime(false, this.showSeconds); + var time = this.time.getTime(false, this.showSeconds); this.base(time); this.meridiumText = this.getMeridium(); @@ -2328,12 +2675,12 @@ var FlipClock; * Flip the clock face */ - flip: function(time, doNotAddPlayClass) { + flip: function(time) { if(this.meridiumText != this.getMeridium()) { this.meridiumText = this.getMeridium(); this.meridium.find('a').html(this.meridiumText); } - this.base(this.factory.time.getTime(false, this.showSeconds), doNotAddPlayClass); + this.base(this.time.getTime(false, this.showSeconds)); }, /** @@ -2343,7 +2690,7 @@ var FlipClock; */ getMeridium: function() { - return new Date().getHours() >= 12 ? 'PM' : 'AM'; + return new Date().getHours() >= 12 ? this.t('PM') : this.t('AM'); }, /** diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index fb6931d4..56d31309 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2014-12-12 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a',''].join("");d&&(e=""),b=this.factory.localize(b);var f=['',''+(b?b:"")+"",e,""],g=a(f.join(""));return this.dividers.push(g),g},createList:function(a,b){"object"==typeof a&&(b=a,a=0);var c=new FlipClock.List(this.factory,a,b);return this.lists.push(c),c},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(a){a.$el.append(!1)},addDigit:function(a){var b=this.createList(a,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(b)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0==this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(b,c){var d=this;a.each(b,function(a,b){var e=d.lists[a];e?(c||b==e.digit||e.play(),e.select(b)):d.addDigit(b)})}})}(jQuery),function(a){"use strict";FlipClock.Factory=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(b,c,d){d||(d={}),this.lists=[],this.running=!1,this.base(d),this.$el=a(b).addClass(this.classes.wrapper),this.$wrapper=this.$el,this.original=c instanceof Date?c:c?Math.round(c):0,this.time=new FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new FlipClock.Timer(this,d),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,d),this.autoStart&&this.start()},loadClockFace:function(a,b){var c,d="Face",e=!1;return a=a.ucfirst()+d,this.face.stop&&(this.stop(),e=!0),this.$el.html(""),this.time.minimumDigits=this.minimumDigits,c=FlipClock[a]?new FlipClock[a](this,b):new FlipClock[this.defaultClockFace+d](this,b),c.build(),this.face=c,e&&this.start(),this.face},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a},start:function(a){var b=this;b.running||b.countdown&&!(b.countdown&&b.time.time>0)?b.log("Trying to start timer when countdown already at 0"):(b.face.start(b.time),b.timer.start(function(){b.flip(),"function"==typeof a&&a()}))},stop:function(a){this.face.stop(),this.timer.stop(a);for(var b in this.lists)this.lists.hasOwnProperty(b)&&this.lists[b].stop()},reset:function(a){this.timer.reset(a),this.face.reset()},setTime:function(a){this.time.time=a,this.flip(!0)},getTime:function(){return this.time},setCountdown:function(a){var b=this.running;this.countdown=a?!0:!1,b&&(this.stop(),this.start())},flip:function(a){this.face.flip(!1,a)}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(a,b){this.factory=a,this.digit=b,this.lastDigit=b,this.$el=this.createList(),this.$obj=this.$el,b>0&&this.select(b),this.factory.$el.append(this.$el)},select:function(a){if("undefined"==typeof a?a=this.digit:this.digit=a,this.digit!=this.lastDigit){var b=this.$el.find("."+this.classes.before).removeClass(this.classes.before);this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.appendListItem(this.classes.active,this.digit),b.remove(),this.lastDigit=this.digit}},play:function(){this.$el.addClass(this.factory.classes.play)},stop:function(){var a=this;setTimeout(function(){a.$el.removeClass(a.factory.classes.play)},this.factory.timer.interval)},createListItem:function(a,b){return['
      • ','','
        ','
        ','
        '+(b?b:"")+"
        ","
        ",'
        ','
        ','
        '+(b?b:"")+"
        ","
        ","
        ","
      • "].join("")},appendListItem:function(a,b){var c=this.createListItem(a,b);this.$el.append(c)},createList:function(){var b=this.getPrevDigit()?this.getPrevDigit():this.digit,c=a(['
          ',this.createListItem(this.classes.before,b),this.createListItem(this.classes.active,this.digit),"
        "].join(""));return c},getNextDigit:function(){return 9==this.digit?0:this.digit+1},getPrevDigit:function(){return 0==this.digit?9:this.digit-1}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(a,b,c){"object"!=typeof c&&(c={}),c.minimumDigits||(c.minimumDigits=a.minimumDigits),this.base(c),this.factory=a,b&&(this.time=b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},count:0,factory:!1,interval:1e3,animationRate:1e3,constructor:function(a,b){this.base(b),this.factory=a,this.callback(this.callbacks.init),this.callback(this.callbacks.create)},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.callback(this.callbacks.reset)},start:function(a){this.factory.running=!0,this._createTimer(a),this.callback(this.callbacks.start)},stop:function(a){this.factory.running=!1,this._clearInterval(a),this.callback(this.callbacks.stop),this.callback(a)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.timer=!1,this.callback(a),this.callback(this.callbacks.destroy)},_interval:function(a){this.callback(this.callbacks.interval),this.callback(a),this.count++},_setInterval:function(a){var b=this;b._interval(a),b.timer=setInterval(function(){b._interval(a)},this.interval)}})}(jQuery),function(a){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul");this.factory.time.time||(this.factory.original=new Date,this.factory.time=new FlipClock.Time(this.factory,this.factory.original));var b=b?b:this.factory.time.getMilitaryTime(!1,this.showSeconds);b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.createDivider(),this.createDivider(),a(this.dividers[0]).insertBefore(this.lists[this.lists.length-2].$el),a(this.dividers[1]).insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a,b){this.autoIncrement(),a=a?a:this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(a,b)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){"object"!=typeof b&&(b={}),a.autoStart=b.autoStart?!0:!1,b.autoStart&&(this.shouldAutoIncrement=!0),a.increment=function(){a.countdown=!1,a.setTime(a.getTime().getTimeSeconds()+1)},a.decrement=function(){a.countdown=!0;var b=a.getTime().getTimeSeconds();b>0&&a.setTime(b-1)},a.setValue=function(b){a.setTime(b)},a.setCounter=function(b){a.setTime(b)},this.base(a,b)},build:function(){var b=this,c=this.factory.$el.find("ul"),d=this.factory.getTime().digitize([this.factory.getTime().time]);d.length>c.length&&a.each(d,function(a,c){var d=b.createList(c);d.select(c)}),a.each(this.lists,function(a,b){b.play()}),this.base()},flip:function(a,b){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(a,b)},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}})}(jQuery),function(a){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul"),e=0;b=b?b:this.factory.time.getDayCounter(this.showSeconds),b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.showSeconds?a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el):e=2,a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4+e].$el),a(this.createDivider("Hours")).insertBefore(this.lists[this.lists.length-6+e].$el),a(this.createDivider("Days",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(a,b)}})}(jQuery),function(a){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b,c){var d=this,e=this.factory.$el.find("ul");c=c?c:this.factory.time.getHourCounter(),c.length>e.length&&a.each(c,function(a,b){d.createList(b)}),a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el),a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4].$el),b||a(this.createDivider("Hours",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(a,b)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(a,b){this.base(a,b)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(a,b){a||(a=this.factory.time.getMinuteCounter()),this.base(a,b)}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.factory.time.getTime(!1,this.showSeconds);this.base(b),this.meridiumText=this.getMeridium(),this.meridium=a(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(a,b){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),b)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-09 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
          ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
        • ','','
          ','
          ','
          '+c+"
          ","
          ",'
          ','
          ','
          '+c+"
          ","
          ","
          ","
        • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=65,c=90;return this.capitalLetters||(b=97,c=122),b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=65,c=90;return this.capitalLetters||(b=97,c=122),a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:!1,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.time=new FlipClock.Time(a,{minimumDigits:0}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return console.log(this._events),this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListClass(),c=new b(a,{translator:this.translator});return this.timer.running&&c.addPlayClass(),this.lists.push(c),this.trigger("create:list",c),c},getListClass:function(){return FlipClock.NumericList},reset:function(){this.time.time=Math.round(this.originalValue),this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")})},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.time.addSecond()},decrement:function(){0==this.time.getTimeSeconds()?this.stop():this.time.subSecond()},flip:function(b){var c=this;a.each(b,function(a,b){c.lists[a]?(c.lists[a].select(b),c.timer.running&&c.lists[a].addPlayClass()):c.addDigit(b)}),this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face",f=!1;return a=a.ucfirst()+e,this.face.stop&&(this.stop(),f=!0),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),f&&this.start(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setTime:function(a){return this.face.setTime(a),this},getTime:function(){return this.face.getTime(),this},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a),this.trigger("start")},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.interval)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;b._interval(a),b.timer=setInterval(function(){b._interval(a)},this.interval)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var b=this,c=this.getTime().digitize([this.getTime().time]);a.each(c,function(a,c){b.createList(c)}),this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(a){var b=0,a=a?a:this.time.getDayCounter(this.showSeconds);for(var c in a)this.createList(a[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):b=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+b].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+b].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(a)}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.autoIncrement(),this.base(a)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(a){a||(a=this.time.getMinuteCounter()),this.base(a)}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.base(b),this.meridiumText=this.getMeridium(),this.meridium=a(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file From 965ece7d1db794e4867bedac7831b146cb1a5703 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:18:30 -0500 Subject: [PATCH 022/129] Updated changelog --- CHANGE LOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGE LOG.md b/CHANGE LOG.md index 0e06c714..b7bca232 100644 --- a/CHANGE LOG.md +++ b/CHANGE LOG.md @@ -1,5 +1,30 @@ # FlipClock.js +#### 0.8.0 +##### 01/09/2014 + +- (API) Added new Flipclock.Uuid generator classes which is used for "cid", a unique id assigned to all objects created by FlipClock +- (API) Added FlipClock.Translator classes to provide an abstraction for translating strings in FlipClock +- (API) Added FlipClock.NumericList for numeric based clocks +- (API) Added new FlipClock.ListItem class handle all the list items instead of using jQuery and strings +- (API) Drastically simplified the FlipClock.Factory object. No longer passing the object to child classes as a property +- (API) Added new FlipClock.Event classes to facilitate event handling +- (API) Added new EnglishAlphaFace to handle alphabetical clocks +- (API) Added FlipClock.Divider class to handle the dividers instead of using strings and jQuery +- (API) Added new event handling to all application objects instead of using callbacks in properties +- (API) Added new event handling to all application objects instead of using callbacks in properties +- (API) Renamed Twenty Four Hour Clock source file +- (API) Renamed Twelve Hour Clock file +- (API) Renamed Minute Counter Face file +- (API) Renamed Hourly Clock Face file +- (API) Renamed Daily Counter File +- (Bug Fix) Removed leaky abstractions in FlipClock.Timer +- (Bug Fix) Removed leaky abstractions in FlipClock.Time +- (Bug Fix) Removed leaky abstractions in FlipClock.List +- (Bug Fix) Removed leaky abstractions in FlipClock.Face +- (Examples) Updated example to match all the new code changes + + #### 0.7.8 ##### 12/12/2014 From c4ae78cdbd79e44ceb9508c1902d58fb215c5e6c Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Fri, 9 Jan 2015 03:22:08 -0500 Subject: [PATCH 023/129] Updated change log and code comments --- CHANGE LOG.md | 2 ++ compiled/flipclock.js | 10 +--------- src/flipclock/js/faces/DailyCounter.js | 2 -- src/flipclock/js/faces/HourlyCounterFace.js | 3 --- src/flipclock/js/faces/MinuteCounterFace.js | 1 - src/flipclock/js/faces/TwentyFourHourClockFace.js | 4 +--- 6 files changed, 4 insertions(+), 18 deletions(-) diff --git a/CHANGE LOG.md b/CHANGE LOG.md index b7bca232..0f1f7bf5 100644 --- a/CHANGE LOG.md +++ b/CHANGE LOG.md @@ -3,6 +3,8 @@ #### 0.8.0 ##### 01/09/2014 +*This update is a major refactor and contains a few breaking API changes.* + - (API) Added new Flipclock.Uuid generator classes which is used for "cid", a unique id assigned to all objects created by FlipClock - (API) Added FlipClock.Translator classes to provide an abstraction for translating strings in FlipClock - (API) Added FlipClock.NumericList for numeric based clocks diff --git a/compiled/flipclock.js b/compiled/flipclock.js index e6ea18c1..7f4352d3 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -2314,9 +2314,7 @@ var FlipClock; /** * Twenty-Four Hour Clock Face * - * This class will generate a twenty-four our clock for FlipClock.js - * - * @param object An object of properties to override the default + * This class will generate a twenty-four our clock for FlipClock.js */ FlipClock.TwentyFourHourClockFace = FlipClock.Face.extend({ @@ -2472,8 +2470,6 @@ var FlipClock; * daily counter will track days, hours, minutes, and seconds. If * the number of available digits is exceeded in the count, a new * digit will be created. - * - * @param object An object of properties to override the default */ FlipClock.DailyCounterFace = FlipClock.Face.extend({ @@ -2531,9 +2527,6 @@ var FlipClock; * hour counter will track hours, minutes, and seconds. If number of * available digits is exceeded in the count, a new digit will be * created. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default */ FlipClock.HourlyCounterFace = FlipClock.Face.extend({ @@ -2593,7 +2586,6 @@ var FlipClock; * This class will generate a minute counter for FlipClock.js. A * minute counter will track minutes and seconds. If an hour is * reached, the counter will reset back to 0. (4 digits max) - * */ FlipClock.MinuteCounterFace = FlipClock.HourlyCounterFace.extend({ diff --git a/src/flipclock/js/faces/DailyCounter.js b/src/flipclock/js/faces/DailyCounter.js index 640cfeff..607f35df 100644 --- a/src/flipclock/js/faces/DailyCounter.js +++ b/src/flipclock/js/faces/DailyCounter.js @@ -7,8 +7,6 @@ * daily counter will track days, hours, minutes, and seconds. If * the number of available digits is exceeded in the count, a new * digit will be created. - * - * @param object An object of properties to override the default */ FlipClock.DailyCounterFace = FlipClock.Face.extend({ diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index d70d40d3..d2e485c8 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -7,9 +7,6 @@ * hour counter will track hours, minutes, and seconds. If number of * available digits is exceeded in the count, a new digit will be * created. - * - * @param object The parent FlipClock.Factory object - * @param object An object of properties to override the default */ FlipClock.HourlyCounterFace = FlipClock.Face.extend({ diff --git a/src/flipclock/js/faces/MinuteCounterFace.js b/src/flipclock/js/faces/MinuteCounterFace.js index e8a83dd0..4f0a1688 100644 --- a/src/flipclock/js/faces/MinuteCounterFace.js +++ b/src/flipclock/js/faces/MinuteCounterFace.js @@ -6,7 +6,6 @@ * This class will generate a minute counter for FlipClock.js. A * minute counter will track minutes and seconds. If an hour is * reached, the counter will reset back to 0. (4 digits max) - * */ FlipClock.MinuteCounterFace = FlipClock.HourlyCounterFace.extend({ diff --git a/src/flipclock/js/faces/TwentyFourHourClockFace.js b/src/flipclock/js/faces/TwentyFourHourClockFace.js index b69f0e2c..8a33db27 100644 --- a/src/flipclock/js/faces/TwentyFourHourClockFace.js +++ b/src/flipclock/js/faces/TwentyFourHourClockFace.js @@ -3,9 +3,7 @@ /** * Twenty-Four Hour Clock Face * - * This class will generate a twenty-four our clock for FlipClock.js - * - * @param object An object of properties to override the default + * This class will generate a twenty-four our clock for FlipClock.js */ FlipClock.TwentyFourHourClockFace = FlipClock.Face.extend({ From 62b336e0bc061d9a2a9fb1dbde0dcfcc3e0cb7ff Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 13:55:14 -0500 Subject: [PATCH 024/129] - (Bug Fix) Fixed issue with clock face not counting down correctly. The flip() method was getting triggered twice. --- src/flipclock/js/libs/Face.js | 16 ++++++++-------- src/flipclock/js/libs/Factory.js | 7 +------ src/flipclock/js/libs/Timer.js | 15 ++++++++------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 679a6987..b4188530 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -168,8 +168,6 @@ addDigit: function(digit) { var list = this.createList(digit); - console.log(this._events); - this.trigger('add:digit', list); return list; @@ -288,10 +286,12 @@ stop: function() { var t = this; - this.trigger('before:stop'); - this.timer.stop(function() { - t.trigger('stop'); - }); + if(this.timer.running) { + this.trigger('before:stop'); + this.timer.stop(function() { + t.trigger('stop'); + }); + } }, /** @@ -320,8 +320,8 @@ */ decrement: function() { - if(this.time.getTimeSeconds() == 0) { - this.stop() + if(this.time.getTimeSeconds() === 0) { + this.stop(); } else { this.time.subSecond(); diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index 3462f8bf..0013f73e 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -97,13 +97,12 @@ */ loadClockFace: function(name, value, options) { - var t = this, face, suffix = 'Face', hasStopped = false; + var t = this, face, suffix = 'Face'; name = name.ucfirst()+suffix; if(this.face.stop) { this.stop(); - hasStopped = true; } this.$el.html(''); @@ -146,10 +145,6 @@ this.face.init(this); this.face.build(); - - if(hasStopped) { - this.start(); - } return this.face; }, diff --git a/src/flipclock/js/libs/Timer.js b/src/flipclock/js/libs/Timer.js index 6e5ae779..c47ea3a0 100644 --- a/src/flipclock/js/libs/Timer.js +++ b/src/flipclock/js/libs/Timer.js @@ -99,7 +99,6 @@ start: function(callback) { this.running = true; this._createTimer(callback); - this.trigger('start'); }, /** @@ -117,8 +116,9 @@ setTimeout(function() { t.callback(callback); - t.trigger('stop'); }, this.interval); + + t.trigger('stop'); }, /** @@ -179,12 +179,13 @@ _setInterval: function(callback) { var t = this; - - t._interval(callback); - - t.timer = setInterval(function() { - t._interval(callback); + this.timer = setInterval(function() { + if(t.running) { + t._interval(callback); + } }, this.interval); + this.trigger('start'); + this._interval(callback); } }); From 0c7b941d76d19a27564185405076cc7586f70ce7 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 15:57:32 -0500 Subject: [PATCH 025/129] - (Bug Fix) Fixed and issue with the "60" displaying when calculating the number of seconds. Should never display 60. --- src/flipclock/js/libs/{time.js => Time.js} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/flipclock/js/libs/{time.js => Time.js} (97%) diff --git a/src/flipclock/js/libs/time.js b/src/flipclock/js/libs/Time.js similarity index 97% rename from src/flipclock/js/libs/time.js rename to src/flipclock/js/libs/Time.js index 57bbdd4c..a9a875f1 100644 --- a/src/flipclock/js/libs/time.js +++ b/src/flipclock/js/libs/Time.js @@ -297,12 +297,12 @@ if (this.time instanceof Date) { if (countdown) { - return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); + return Math.round(Math.max(this.time.getTime()/1000 - date.getTime()/1000,0)); } else { - return date.getTime()/1000 - this.time.getTime()/1000 ; + return Math.round(date.getTime()/1000 - this.time.getTime()/1000); } } else { - return this.time; + return Math.round(this.time); } }, From e2e67ac36b944e2f328078cccb7227554d14d21c Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 15:58:27 -0500 Subject: [PATCH 026/129] - (API) Replaced setTime() and getTime() with setFaceValue() and getFaceValue() on the FlipClock.Factory class --- src/flipclock/js/libs/Factory.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index 0013f73e..f1f58283 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -145,7 +145,7 @@ this.face.init(this); this.face.build(); - + return this.face; }, @@ -186,27 +186,25 @@ }, /** - * Sets the clock time + * Sets the clock face's value * * @return object */ - setTime: function(time) { - this.face.setTime(time); + setFaceValue: function(value) { + this.face.setValue(value); return this; }, /** - * Gets the clock time + * Gets the clock face's value * * @return object */ - getTime: function() { - this.face.getTime(); - - return this; + getFaceValue: function() { + return this.face.getValue(); }, onDestroy: function() {}, From 130df15ced904a88d3c4d4cd176d1bdbba7e989f Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 15:58:54 -0500 Subject: [PATCH 027/129] - (API) Replaced setTime() and getTime() with setFaceValue() and getFaceValue() on the Face class --- src/flipclock/js/libs/Face.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index b4188530..620566ab 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -370,6 +370,32 @@ return this.time; }, + /** + * Sets the clock face's time + */ + + setValue: function(value) { + this.value = value; + + if(this.time) { + this.time = new FlipClock.Time(this.value, { + minimumDigits: this.minimumDigits + }); + } + + this.flip(); + }, + + /** + * Get the clock face's value + * + * @return object + */ + + getValue: function() { + return this.value; + }, + /** * Changes the increment of time to up or down (add/sub) */ From 67f78d25f21085425da91ea99934300e75602990 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 15:59:23 -0500 Subject: [PATCH 028/129] - (API) Added new autoPlay property to control whether the play classes should be automatically added to the clock --- src/flipclock/js/libs/Face.js | 60 +++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 620566ab..f4d9c5b4 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -32,7 +32,13 @@ animationRate: 1000, /** - * Sets whether or not the clock should start upon instantiation + * Sets whether or not the clock should automatically add the play class + */ + + autoPlay: true, + + /** + * Sets whether or not the clock should start ticking upon instantiation */ autoStart: true, @@ -107,7 +113,7 @@ * The current value of the clock face. */ - value: false, + value: 0, /** * Constructor @@ -119,6 +125,7 @@ constructor: function(value, options) { var t = this; + if(value instanceof Date === false && typeof value === "object") { options = value; value = 0; @@ -127,16 +134,13 @@ this.dividers = []; this.lists = []; this.originalValue = value; + this.value = value; this.translator = new FlipClock.Translator({ defaultLanguage: this.defaultLanguage, language: this.language }); - this.time = new FlipClock.Time(value, { - minimumDigits: 0 - }); - this.timer = new FlipClock.Timer(); this.timer.on('interval', function() { @@ -195,6 +199,10 @@ */ init: function(factory) { + this.time = new FlipClock.Time(this.value, { + minimumDigits: this.minimumDigits + }); + this.trigger('init'); }, @@ -231,13 +239,9 @@ */ createList: function(value, options) { - var List = this.getListClass(); - - var list = new List(value, { - translator: this.translator - }); + var list = this.getListObject(value); - if(this.timer.running) { + if(this.autoPlay || this.timer.running) { list.addPlayClass(); } @@ -251,19 +255,33 @@ /* * Get the list class object * - * @return + * @return object */ getListClass: function() { return FlipClock.NumericList; }, + + /* + * Get a new list class instance + * + * @return object + */ + + getListObject: function(value) { + var List = this.getListClass(); + + return new List(value, { + translator: this.translator + }); + }, /** * Triggers when the clock is reset */ reset: function() { - this.time.time = Math.round(this.originalValue); + this.value = this.originalValue; this.flip(); this.trigger('reset'); }, @@ -312,7 +330,11 @@ */ increment: function() { - this.time.addSecond(); + this.value++; + + if(this.time) { + this.time.addSecond(); + } }, /** @@ -324,7 +346,11 @@ this.stop(); } else { - this.time.subSecond(); + this.value--; + + if(this.time) { + this.time.subSecond(); + } } }, @@ -339,7 +365,7 @@ if(t.lists[i]) { t.lists[i].select(digit); - if(t.timer.running) { + if(t.autoPlay || t.timer.running) { t.lists[i].addPlayClass(); } } From 6855cdbe4e538825cf98f10a2a36a0f9ed1103ff Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 15:59:40 -0500 Subject: [PATCH 029/129] - (Feature) Added the new English Alphabetical Clock Face --- src/flipclock/js/libs/EnglishAlphaList.js | 43 ++++++++++++++--------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/flipclock/js/libs/EnglishAlphaList.js b/src/flipclock/js/libs/EnglishAlphaList.js index 0351f2e8..a69a6cd7 100644 --- a/src/flipclock/js/libs/EnglishAlphaList.js +++ b/src/flipclock/js/libs/EnglishAlphaList.js @@ -16,24 +16,39 @@ * The FlipClock List class is used to build the list used to create * the card flip effect. This object fascilates selecting the correct * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.EnglishAlphaList = FlipClock.List.extend({ capitalLetters: true, + + constructor: function(value, options) { + if(!value) { + value = String.fromCharCode(this.getMinCharCode()); + } + + this.base(value, options); + + if(!this.value) { + this.value = String.fromCharCode(this.getMinCharCode()); + } + }, + + getMaxCharCode: function() { + return this.capitalLetters ? 90 : 122; + }, + + getMinCharCode: function() { + return this.capitalLetters ? 65 : 96; + }, + + getCharCode: function() { + return this.value.charCodeAt(0); + }, getPrevValue: function() { var charCode = this.value.charCodeAt(0) - 1; - var minCode = 65, maxCode = 90; - - if(!this.capitalLetters) { - minCode = 97; - maxCode = 122; - } + var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); if(charCode < minCode) { charCode = maxCode; @@ -44,12 +59,7 @@ getNextValue: function() { var charCode = this.value.charCodeAt(0) + 1; - var minCode = 65, maxCode = 90; - - if(!this.capitalLetters) { - minCode = 97; - maxCode = 122; - } + var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); if(charCode > maxCode) { charCode = minCode; @@ -60,5 +70,4 @@ }); - }(jQuery)); \ No newline at end of file From 6a7c9f6c2536ebb64e94c40521c2b0912fdbb05a Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 16:00:08 -0500 Subject: [PATCH 030/129] - (Bug Fix) Renamed Counter Face file --- .../faces/{DailyCounter.js => DailyCounterFace.js} | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) rename src/flipclock/js/faces/{DailyCounter.js => DailyCounterFace.js} (81%) diff --git a/src/flipclock/js/faces/DailyCounter.js b/src/flipclock/js/faces/DailyCounterFace.js similarity index 81% rename from src/flipclock/js/faces/DailyCounter.js rename to src/flipclock/js/faces/DailyCounterFace.js index 607f35df..1c405ed1 100644 --- a/src/flipclock/js/faces/DailyCounter.js +++ b/src/flipclock/js/faces/DailyCounterFace.js @@ -17,8 +17,10 @@ * Build the clock face */ - build: function(time) { - var offset = 0, time = time ? time : this.time.getDayCounter(this.showSeconds); + build: function() { + var offset = 0; + + var time = this.time.getDayCounter(this.showSeconds) for(var i in time) { this.createList(time[i]); @@ -43,13 +45,9 @@ * Flip the clock face */ - flip: function(time) { - if(!time) { - time = this.time.getDayCounter(this.showSeconds); - } - + flip: function() { + this.base(this.time.getDayCounter(this.showSeconds)); this.autoIncrement(); - this.base(time); } }); From 1b3fb44178bd801dd0a8617ef3344a9c00d0f5f7 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 16:00:26 -0500 Subject: [PATCH 031/129] Updated examples --- examples/english-alphabetical-clock.html | 30 ++++++++++++++++++++++++ examples/simple-counter.html | 5 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 examples/english-alphabetical-clock.html diff --git a/examples/english-alphabetical-clock.html b/examples/english-alphabetical-clock.html new file mode 100644 index 00000000..6c6f716f --- /dev/null +++ b/examples/english-alphabetical-clock.html @@ -0,0 +1,30 @@ + + + + + + + + + +
          + + + + + \ No newline at end of file diff --git a/examples/simple-counter.html b/examples/simple-counter.html index 3ff1474a..01b95a71 100644 --- a/examples/simple-counter.html +++ b/examples/simple-counter.html @@ -22,7 +22,10 @@ // Instantiate a counter clock = new FlipClock($('.clock'), 101, { - clockFace: 'Counter' + clockFace: 'Counter', + clockFaceOptions: { + autoStart: false + } }); // Attach a click event to a button a increment the clock From 50def78bd58df3c8409a252456cc62d8b8a672c5 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 16:00:44 -0500 Subject: [PATCH 032/129] Updates --- src/flipclock/js/faces/EnglishAlphabetFace.js | 143 ++++++++++++++++++ src/flipclock/js/faces/HourlyCounterFace.js | 3 +- src/flipclock/js/faces/MinuteCounterFace.js | 8 +- src/flipclock/js/faces/TwelveHourClockFace.js | 17 ++- 4 files changed, 155 insertions(+), 16 deletions(-) create mode 100644 src/flipclock/js/faces/EnglishAlphabetFace.js diff --git a/src/flipclock/js/faces/EnglishAlphabetFace.js b/src/flipclock/js/faces/EnglishAlphabetFace.js new file mode 100644 index 00000000..6652b8c6 --- /dev/null +++ b/src/flipclock/js/faces/EnglishAlphabetFace.js @@ -0,0 +1,143 @@ +(function($) { + + /** + * English Alphabet Clock Face + * + */ + + FlipClock.EnglishAlphabetFace = FlipClock.Face.extend({ + + _autoIncrementValues: [], + + /** + * Tells the clock face if it should auto-increment + */ + + shouldAutoIncrement: false, + + /** + * Tells the clock face if it should use capital letters + */ + + capitalLetters: true, + + init: function(factory) { + this.base(factory); + + this.on('before:start', function() { + console.log('before'); + + this.shouldAutoIncrement = true; + }); + + this.on('before:stop', function() { + this.shouldAutoIncrement = false; + }); + + if(!this.value) { + this.value = this.getListObject(this.value).value; + } + }, + + build: function() { + var values = this.value.split(''); + + for(var i in values) { + this.createList(values[i]); + } + + for(var x in this.lists) { + this._autoIncrementValues.unshift(this.lists[x].getCharCode()); + } + + this.base(); + }, + + increment: function() { + var flip = true, i = 0, values = this.value.split(''); + + while (flip) + { + flip = false; + + var value = this._autoIncrementValues[i]; + var list = this.lists[this.lists.length - i - 1]; + + if(list) { + values[this.value.length - i - 1] = list.getNextValue(); + + if(list.getCharCode() >= list.getMaxCharCode()) { + flip = true; + i++; + } + } + else { + values.unshift(String.fromCharCode(this.getListObject(false).getMinCharCode())); + } + } + + this.value = values.join(''); + }, + + decrement: function() { + var flip = true, i = 0, values = this.value.split(''); + + while (flip) + { + flip = false; + + var value = this._autoIncrementValues[i]; + var list = this.lists[this.lists.length - i - 1]; + + if(list) { + values[this.value.length - i - 1] = list.getPrevValue(); + + if(list.getCharCode() <= list.getMinCharCode()) { + flip = true; + i++; + } + } + else { + values.unshift(String.fromCharCode(this.getListObject(false).getMinCharCode())); + } + } + + this.value = values.join(''); + }, + + flip: function() { + if(this.shouldAutoIncrement) { + this.autoIncrement(); + } + + this.base(this.value.split('')); + }, + + /* + * Get the list class object + * + * @return object + */ + + getListClass: function() { + return FlipClock.EnglishAlphaList; + }, + + /* + * Get a new list class instance + * + * @return object + */ + + getListObject: function(value) { + var List = this.getListClass(); + + return new List(value, { + capitalLetters: this.capitalLetters, + translator: this.translator + }); + } + + }); + +}(jQuery)); \ No newline at end of file diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index d2e485c8..df40b546 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -41,8 +41,8 @@ time = this.time.getHourCounter(); } - this.autoIncrement(); this.base(time); + this.autoIncrement(); }, /** @@ -51,7 +51,6 @@ appendDigitToClock: function(obj) { this.base(obj); - this.dividers[0].insertAfter(this.dividers[0].next()); } diff --git a/src/flipclock/js/faces/MinuteCounterFace.js b/src/flipclock/js/faces/MinuteCounterFace.js index 4f0a1688..0fe50969 100644 --- a/src/flipclock/js/faces/MinuteCounterFace.js +++ b/src/flipclock/js/faces/MinuteCounterFace.js @@ -26,12 +26,8 @@ * @return */ - flip: function(time) { - if(!time) { - time = this.time.getMinuteCounter(); - } - - this.base(time); + flip: function() { + this.base(this.time.getMinuteCounter()); } }); diff --git a/src/flipclock/js/faces/TwelveHourClockFace.js b/src/flipclock/js/faces/TwelveHourClockFace.js index eb9a8b54..18d3625a 100644 --- a/src/flipclock/js/faces/TwelveHourClockFace.js +++ b/src/flipclock/js/faces/TwelveHourClockFace.js @@ -27,21 +27,21 @@ */ build: function() { - var t = this; - - var time = this.time.getTime(false, this.showSeconds); + var t = this, time = this.time.getTime(false, this.showSeconds); + + this.meridiumText = this.getMeridium(); - this.base(time); - this.meridiumText = this.getMeridium(); - this.meridium = $([ + this.$meridium = $([ '' ].join('')); + + this.base(time); - this.meridium.insertAfter(this.lists[this.lists.length-1].$el); + this.$meridium.insertAfter(this.lists[this.lists.length-1].$el); }, /** @@ -51,8 +51,9 @@ flip: function(time) { if(this.meridiumText != this.getMeridium()) { this.meridiumText = this.getMeridium(); - this.meridium.find('a').html(this.meridiumText); + this.$meridium.find('a').html(this.meridiumText); } + this.base(this.time.getTime(false, this.showSeconds)); }, From f3a013f4df174d7853410ae22cb1671da528b1a0 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 16:00:54 -0500 Subject: [PATCH 033/129] Recompiled source --- compiled/flipclock.js | 372 +++++++++++++++++++++++++++++--------- compiled/flipclock.min.js | 4 +- 2 files changed, 284 insertions(+), 92 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 7f4352d3..9b8d72a8 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -699,24 +699,39 @@ var FlipClock; * The FlipClock List class is used to build the list used to create * the card flip effect. This object fascilates selecting the correct * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.EnglishAlphaList = FlipClock.List.extend({ capitalLetters: true, + + constructor: function(value, options) { + if(!value) { + value = String.fromCharCode(this.getMinCharCode()); + } + + this.base(value, options); + + if(!this.value) { + this.value = String.fromCharCode(this.getMinCharCode()); + } + }, + + getMaxCharCode: function() { + return this.capitalLetters ? 90 : 122; + }, + + getMinCharCode: function() { + return this.capitalLetters ? 65 : 96; + }, + + getCharCode: function() { + return this.value.charCodeAt(0); + }, getPrevValue: function() { var charCode = this.value.charCodeAt(0) - 1; - var minCode = 65, maxCode = 90; - - if(!this.capitalLetters) { - minCode = 97; - maxCode = 122; - } + var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); if(charCode < minCode) { charCode = maxCode; @@ -727,12 +742,7 @@ var FlipClock; getNextValue: function() { var charCode = this.value.charCodeAt(0) + 1; - var minCode = 65, maxCode = 90; - - if(!this.capitalLetters) { - minCode = 97; - maxCode = 122; - } + var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); if(charCode > maxCode) { charCode = minCode; @@ -743,7 +753,6 @@ var FlipClock; }); - }(jQuery)); (function($) { @@ -888,7 +897,13 @@ var FlipClock; animationRate: 1000, /** - * Sets whether or not the clock should start upon instantiation + * Sets whether or not the clock should automatically add the play class + */ + + autoPlay: true, + + /** + * Sets whether or not the clock should start ticking upon instantiation */ autoStart: true, @@ -963,7 +978,7 @@ var FlipClock; * The current value of the clock face. */ - value: false, + value: 0, /** * Constructor @@ -975,6 +990,7 @@ var FlipClock; constructor: function(value, options) { var t = this; + if(value instanceof Date === false && typeof value === "object") { options = value; value = 0; @@ -983,16 +999,13 @@ var FlipClock; this.dividers = []; this.lists = []; this.originalValue = value; + this.value = value; this.translator = new FlipClock.Translator({ defaultLanguage: this.defaultLanguage, language: this.language }); - this.time = new FlipClock.Time(value, { - minimumDigits: 0 - }); - this.timer = new FlipClock.Timer(); this.timer.on('interval', function() { @@ -1024,8 +1037,6 @@ var FlipClock; addDigit: function(digit) { var list = this.createList(digit); - console.log(this._events); - this.trigger('add:digit', list); return list; @@ -1053,6 +1064,10 @@ var FlipClock; */ init: function(factory) { + this.time = new FlipClock.Time(this.value, { + minimumDigits: this.minimumDigits + }); + this.trigger('init'); }, @@ -1089,13 +1104,9 @@ var FlipClock; */ createList: function(value, options) { - var List = this.getListClass(); - - var list = new List(value, { - translator: this.translator - }); + var list = this.getListObject(value); - if(this.timer.running) { + if(this.autoPlay || this.timer.running) { list.addPlayClass(); } @@ -1109,19 +1120,33 @@ var FlipClock; /* * Get the list class object * - * @return + * @return object */ getListClass: function() { return FlipClock.NumericList; }, + + /* + * Get a new list class instance + * + * @return object + */ + + getListObject: function(value) { + var List = this.getListClass(); + + return new List(value, { + translator: this.translator + }); + }, /** * Triggers when the clock is reset */ reset: function() { - this.time.time = Math.round(this.originalValue); + this.value = this.originalValue; this.flip(); this.trigger('reset'); }, @@ -1144,10 +1169,12 @@ var FlipClock; stop: function() { var t = this; - this.trigger('before:stop'); - this.timer.stop(function() { - t.trigger('stop'); - }); + if(this.timer.running) { + this.trigger('before:stop'); + this.timer.stop(function() { + t.trigger('stop'); + }); + } }, /** @@ -1168,7 +1195,11 @@ var FlipClock; */ increment: function() { - this.time.addSecond(); + this.value++; + + if(this.time) { + this.time.addSecond(); + } }, /** @@ -1176,11 +1207,15 @@ var FlipClock; */ decrement: function() { - if(this.time.getTimeSeconds() == 0) { - this.stop() + if(this.time.getTimeSeconds() === 0) { + this.stop(); } else { - this.time.subSecond(); + this.value--; + + if(this.time) { + this.time.subSecond(); + } } }, @@ -1195,7 +1230,7 @@ var FlipClock; if(t.lists[i]) { t.lists[i].select(digit); - if(t.timer.running) { + if(t.autoPlay || t.timer.running) { t.lists[i].addPlayClass(); } } @@ -1226,6 +1261,32 @@ var FlipClock; return this.time; }, + /** + * Sets the clock face's time + */ + + setValue: function(value) { + this.value = value; + + if(this.time) { + this.time = new FlipClock.Time(this.value, { + minimumDigits: this.minimumDigits + }); + } + + this.flip(); + }, + + /** + * Get the clock face's value + * + * @return object + */ + + getValue: function() { + return this.value; + }, + /** * Changes the increment of time to up or down (add/sub) */ @@ -1342,13 +1403,12 @@ var FlipClock; */ loadClockFace: function(name, value, options) { - var t = this, face, suffix = 'Face', hasStopped = false; + var t = this, face, suffix = 'Face'; name = name.ucfirst()+suffix; if(this.face.stop) { this.stop(); - hasStopped = true; } this.$el.html(''); @@ -1392,10 +1452,6 @@ var FlipClock; this.face.build(); - if(hasStopped) { - this.start(); - } - return this.face; }, @@ -1436,27 +1492,25 @@ var FlipClock; }, /** - * Sets the clock time + * Sets the clock face's value * * @return object */ - setTime: function(time) { - this.face.setTime(time); + setFaceValue: function(value) { + this.face.setValue(value); return this; }, /** - * Gets the clock time + * Gets the clock face's value * * @return object */ - getTime: function() { - this.face.getTime(); - - return this; + getFaceValue: function() { + return this.face.getValue(); }, onDestroy: function() {}, @@ -1822,12 +1876,12 @@ var FlipClock; if (this.time instanceof Date) { if (countdown) { - return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); + return Math.round(Math.max(this.time.getTime()/1000 - date.getTime()/1000,0)); } else { - return date.getTime()/1000 - this.time.getTime()/1000 ; + return Math.round(date.getTime()/1000 - this.time.getTime()/1000); } } else { - return this.time; + return Math.round(this.time); } }, @@ -2091,7 +2145,6 @@ var FlipClock; start: function(callback) { this.running = true; this._createTimer(callback); - this.trigger('start'); }, /** @@ -2109,8 +2162,9 @@ var FlipClock; setTimeout(function() { t.callback(callback); - t.trigger('stop'); }, this.interval); + + t.trigger('stop'); }, /** @@ -2171,12 +2225,13 @@ var FlipClock; _setInterval: function(callback) { var t = this; - - t._interval(callback); - - t.timer = setInterval(function() { - t._interval(callback); + this.timer = setInterval(function() { + if(t.running) { + t._interval(callback); + } }, this.interval); + this.trigger('start'); + this._interval(callback); } }); @@ -2480,8 +2535,10 @@ var FlipClock; * Build the clock face */ - build: function(time) { - var offset = 0, time = time ? time : this.time.getDayCounter(this.showSeconds); + build: function() { + var offset = 0; + + var time = this.time.getDayCounter(this.showSeconds) for(var i in time) { this.createList(time[i]); @@ -2506,17 +2563,156 @@ var FlipClock; * Flip the clock face */ - flip: function(time) { - if(!time) { - time = this.time.getDayCounter(this.showSeconds); - } - + flip: function() { + this.base(this.time.getDayCounter(this.showSeconds)); this.autoIncrement(); - this.base(time); } }); +}(jQuery)); +(function($) { + + /** + * English Alphabet Clock Face + * + */ + + FlipClock.EnglishAlphabetFace = FlipClock.Face.extend({ + + _autoIncrementValues: [], + + /** + * Tells the clock face if it should auto-increment + */ + + shouldAutoIncrement: false, + + /** + * Tells the clock face if it should use capital letters + */ + + capitalLetters: true, + + init: function(factory) { + this.base(factory); + + this.on('before:start', function() { + console.log('before'); + + this.shouldAutoIncrement = true; + }); + + this.on('before:stop', function() { + this.shouldAutoIncrement = false; + }); + + if(!this.value) { + this.value = this.getListObject(this.value).value; + } + }, + + build: function() { + var values = this.value.split(''); + + for(var i in values) { + this.createList(values[i]); + } + + for(var x in this.lists) { + this._autoIncrementValues.unshift(this.lists[x].getCharCode()); + } + + this.base(); + }, + + increment: function() { + var flip = true, i = 0, values = this.value.split(''); + + while (flip) + { + flip = false; + + var value = this._autoIncrementValues[i]; + var list = this.lists[this.lists.length - i - 1]; + + if(list) { + values[this.value.length - i - 1] = list.getNextValue(); + + if(list.getCharCode() >= list.getMaxCharCode()) { + flip = true; + i++; + } + } + else { + values.unshift(String.fromCharCode(this.getListObject(false).getMinCharCode())); + } + } + + this.value = values.join(''); + }, + + decrement: function() { + var flip = true, i = 0, values = this.value.split(''); + + while (flip) + { + flip = false; + + var value = this._autoIncrementValues[i]; + var list = this.lists[this.lists.length - i - 1]; + + if(list) { + values[this.value.length - i - 1] = list.getPrevValue(); + + if(list.getCharCode() <= list.getMinCharCode()) { + flip = true; + i++; + } + } + else { + values.unshift(String.fromCharCode(this.getListObject(false).getMinCharCode())); + } + } + + this.value = values.join(''); + }, + + flip: function() { + if(this.shouldAutoIncrement) { + this.autoIncrement(); + } + + this.base(this.value.split('')); + }, + + /* + * Get the list class object + * + * @return object + */ + + getListClass: function() { + return FlipClock.EnglishAlphaList; + }, + + /* + * Get a new list class instance + * + * @return object + */ + + getListObject: function(value) { + var List = this.getListClass(); + + return new List(value, { + capitalLetters: this.capitalLetters, + translator: this.translator + }); + } + + }); + }(jQuery)); (function($) { @@ -2561,8 +2757,8 @@ var FlipClock; time = this.time.getHourCounter(); } - this.autoIncrement(); this.base(time); + this.autoIncrement(); }, /** @@ -2571,7 +2767,6 @@ var FlipClock; appendDigitToClock: function(obj) { this.base(obj); - this.dividers[0].insertAfter(this.dividers[0].next()); } @@ -2606,12 +2801,8 @@ var FlipClock; * @return */ - flip: function(time) { - if(!time) { - time = this.time.getMinuteCounter(); - } - - this.base(time); + flip: function() { + this.base(this.time.getMinuteCounter()); } }); @@ -2646,21 +2837,21 @@ var FlipClock; */ build: function() { - var t = this; - - var time = this.time.getTime(false, this.showSeconds); + var t = this, time = this.time.getTime(false, this.showSeconds); + + this.meridiumText = this.getMeridium(); - this.base(time); - this.meridiumText = this.getMeridium(); - this.meridium = $([ + this.$meridium = $([ '' ].join('')); + + this.base(time); - this.meridium.insertAfter(this.lists[this.lists.length-1].$el); + this.$meridium.insertAfter(this.lists[this.lists.length-1].$el); }, /** @@ -2670,8 +2861,9 @@ var FlipClock; flip: function(time) { if(this.meridiumText != this.getMeridium()) { this.meridiumText = this.getMeridium(); - this.meridium.find('a').html(this.meridiumText); + this.$meridium.find('a').html(this.meridiumText); } + this.base(this.time.getTime(false, this.showSeconds)); }, diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 56d31309..f2ae129a 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-09 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
            ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
          • ','','
            ','
            ','
            '+c+"
            ","
            ",'
            ','
            ','
            '+c+"
            ","
            ","
            ","
          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=65,c=90;return this.capitalLetters||(b=97,c=122),b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=65,c=90;return this.capitalLetters||(b=97,c=122),a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:!1,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.time=new FlipClock.Time(a,{minimumDigits:0}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return console.log(this._events),this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListClass(),c=new b(a,{translator:this.translator});return this.timer.running&&c.addPlayClass(),this.lists.push(c),this.trigger("create:list",c),c},getListClass:function(){return FlipClock.NumericList},reset:function(){this.time.time=Math.round(this.originalValue),this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")})},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.time.addSecond()},decrement:function(){0==this.time.getTimeSeconds()?this.stop():this.time.subSecond()},flip:function(b){var c=this;a.each(b,function(a,b){c.lists[a]?(c.lists[a].select(b),c.timer.running&&c.lists[a].addPlayClass()):c.addDigit(b)}),this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face",f=!1;return a=a.ucfirst()+e,this.face.stop&&(this.stop(),f=!0),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),f&&this.start(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setTime:function(a){return this.face.setTime(a),this},getTime:function(){return this.face.getTime(),this},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a),this.trigger("start")},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.interval)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;b._interval(a),b.timer=setInterval(function(){b._interval(a)},this.interval)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var b=this,c=this.getTime().digitize([this.getTime().time]);a.each(c,function(a,c){b.createList(c)}),this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(a){var b=0,a=a?a:this.time.getDayCounter(this.showSeconds);for(var c in a)this.createList(a[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):b=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+b].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+b].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(a)}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.autoIncrement(),this.base(a)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(a){a||(a=this.time.getMinuteCounter()),this.base(a)}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.base(b),this.meridiumText=this.getMeridium(),this.meridium=a(['"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-10 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
              ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
            • ','','
              ','
              ','
              '+c+"
              ","
              ",'
              ','
              ','
              '+c+"
              ","
              ","
              ","
            • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.capitalLetters?90:122},getMinCharCode:function(){return this.capitalLetters?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits}),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListObject(a);return(this.autoPlay||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(){this.value=this.originalValue,this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")}))},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.value++,this.time&&this.time.addSecond()},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond())},flip:function(b){var c=this;a.each(b,function(a,b){c.lists[a]?(c.lists[a].select(b),(c.autoPlay||c.timer.running)&&c.lists[a].addPlayClass()):c.addDigit(b)}),this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setValue:function(a){this.value=a,this.time&&(this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits})),this.flip()},getValue:function(){return this.value},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.interval),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.interval),this.trigger("start"),this._interval(a)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var b=this,c=this.getTime().digitize([this.getTime().time]);a.each(c,function(a,c){b.createList(c)}),this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file From 7c83f29ea65692eaa931919a20d53dba8de63292 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 18:35:45 -0500 Subject: [PATCH 034/129] - (Bug Fix) Replaced $.each instances with native for loops to eliminate the dependency on jQuery for simple loops --- src/flipclock/js/faces/CounterFace.js | 8 ++++---- src/flipclock/js/libs/Face.js | 16 +++++++--------- src/flipclock/js/libs/Time.js | 14 +++++++------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/flipclock/js/faces/CounterFace.js b/src/flipclock/js/faces/CounterFace.js index 74551856..b8f4dff5 100644 --- a/src/flipclock/js/faces/CounterFace.js +++ b/src/flipclock/js/faces/CounterFace.js @@ -50,10 +50,10 @@ build: function() { var t = this, time = this.getTime().digitize([this.getTime().time]); - $.each(time, function(i, value) { - t.createList(value); - }); - + for(var i in time) { + t.createList(time[i]); + } + if(this.autoStart) { this.shouldAutoIncrement = true; } diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index f4d9c5b4..18d4c6c5 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -359,20 +359,18 @@ */ flip: function(time) { - var t = this; - - $.each(time, function(i, digit) { - if(t.lists[i]) { - t.lists[i].select(digit); + for(var i in time) { + if(this.lists[i]) { + this.lists[i].select(time[i]); - if(t.autoPlay || t.timer.running) { - t.lists[i].addPlayClass(); + if(this.autoPlay || this.timer.running) { + this.lists[i].addPlayClass(); } } else { - t.addDigit(digit); + this.addDigit(time[i]); } - }); + } this.trigger('flip'); }, diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index a9a875f1..7d31f33e 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -108,8 +108,8 @@ digitize: function(obj) { var data = []; - $.each(obj, function(i, value) { - value = value.toString(); + for(var i in obj) { + value = obj[i].toString(); if(value.length == 1) { value = '0'+value; @@ -117,8 +117,8 @@ for(var x = 0; x < value.length; x++) { data.push(value.charAt(x)); - } - }); + } + } if(data.length > this.minimumDigits) { this.minimumDigits = data.length; @@ -387,15 +387,15 @@ var total = 0; var newArray = []; - $.each(digits, function(i, digit) { + for(var i in digits) { if(i < totalDigits) { total += parseInt(digits[i], 10); } else { newArray.push(digits[i]); } - }); - + } + if(total === 0) { return newArray; } From 39b066bed8b8612a5a6742ee255f2c5ac71097d8 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 10 Jan 2015 18:35:59 -0500 Subject: [PATCH 035/129] Recompiled soure --- compiled/flipclock.js | 38 ++++++++++++++++++-------------------- compiled/flipclock.min.js | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 9b8d72a8..af7cb67e 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -1224,20 +1224,18 @@ var FlipClock; */ flip: function(time) { - var t = this; - - $.each(time, function(i, digit) { - if(t.lists[i]) { - t.lists[i].select(digit); + for(var i in time) { + if(this.lists[i]) { + this.lists[i].select(time[i]); - if(t.autoPlay || t.timer.running) { - t.lists[i].addPlayClass(); + if(this.autoPlay || this.timer.running) { + this.lists[i].addPlayClass(); } } else { - t.addDigit(digit); + this.addDigit(time[i]); } - }); + } this.trigger('flip'); }, @@ -1687,8 +1685,8 @@ var FlipClock; digitize: function(obj) { var data = []; - $.each(obj, function(i, value) { - value = value.toString(); + for(var i in obj) { + value = obj[i].toString(); if(value.length == 1) { value = '0'+value; @@ -1696,8 +1694,8 @@ var FlipClock; for(var x = 0; x < value.length; x++) { data.push(value.charAt(x)); - } - }); + } + } if(data.length > this.minimumDigits) { this.minimumDigits = data.length; @@ -1966,15 +1964,15 @@ var FlipClock; var total = 0; var newArray = []; - $.each(digits, function(i, digit) { + for(var i in digits) { if(i < totalDigits) { total += parseInt(digits[i], 10); } else { newArray.push(digits[i]); } - }); - + } + if(total === 0) { return newArray; } @@ -2460,10 +2458,10 @@ var FlipClock; build: function() { var t = this, time = this.getTime().digitize([this.getTime().time]); - $.each(time, function(i, value) { - t.createList(value); - }); - + for(var i in time) { + t.createList(time[i]); + } + if(this.autoStart) { this.shouldAutoIncrement = true; } diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index f2ae129a..c775edcd 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-10 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
              • ','','
                ','
                ','
                '+c+"
                ","
                ",'
                ','
                ','
                '+c+"
                ","
                ","
                ","
              • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.capitalLetters?90:122},getMinCharCode:function(){return this.capitalLetters?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits}),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListObject(a);return(this.autoPlay||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(){this.value=this.originalValue,this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")}))},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.value++,this.time&&this.time.addSecond()},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond())},flip:function(b){var c=this;a.each(b,function(a,b){c.lists[a]?(c.lists[a].select(b),(c.autoPlay||c.timer.running)&&c.lists[a].addPlayClass()):c.addDigit(b)}),this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setValue:function(a){this.value=a,this.time&&(this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits})),this.flip()},getValue:function(){return this.value},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.interval),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.interval),this.trigger("start"),this._interval(a)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var b=this,c=this.getTime().digitize([this.getTime().time]);a.each(c,function(a,c){b.createList(c)}),this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                  ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
                • ','','
                  ','
                  ','
                  '+c+"
                  ","
                  ",'
                  ','
                  ','
                  '+c+"
                  ","
                  ","
                  ","
                • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.capitalLetters?90:122},getMinCharCode:function(){return this.capitalLetters?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits}),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListObject(a);return(this.autoPlay||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(){this.value=this.originalValue,this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")}))},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.value++,this.time&&this.time.addSecond()},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond())},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.autoPlay||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setValue:function(a){this.value=a,this.time&&(this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits})),this.flip()},getValue:function(){return this.value},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=b.length),this.minimumDigits>b.length)for(var d=b.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.interval),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.interval),this.trigger("start"),this._interval(a)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file From cc9cdd745ef63707764db9f65dafb84562ec99a4 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 00:48:22 -0500 Subject: [PATCH 036/129] - (Bug Fix) Renamed Core.js to Base.js --- Gruntfile.js | 2 +- src/flipclock/js/libs/{Core.js => Base.js} | 64 +++++++++++++++------- 2 files changed, 46 insertions(+), 20 deletions(-) rename src/flipclock/js/libs/{Core.js => Base.js} (83%) diff --git a/Gruntfile.js b/Gruntfile.js index 8163a530..d16ed54a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,7 @@ module.exports = function(grunt) { js: { src: [ 'src/flipclock/js/vendor/*.js', - 'src/flipclock/js/libs/Core.js', + 'src/flipclock/js/libs/Base.js', 'src/flipclock/js/libs/Plugins.js', 'src/flipclock/js/libs/List.js', 'src/flipclock/js/libs/ListItem.js', diff --git a/src/flipclock/js/libs/Core.js b/src/flipclock/js/libs/Base.js similarity index 83% rename from src/flipclock/js/libs/Core.js rename to src/flipclock/js/libs/Base.js index b6e9d55c..fc26f7df 100644 --- a/src/flipclock/js/libs/Core.js +++ b/src/flipclock/js/libs/Base.js @@ -56,6 +56,12 @@ var FlipClock; version: '0.7.7', + /** + * The available options for this class + */ + + options: {}, + /** * The bound events to this object */ @@ -71,8 +77,8 @@ var FlipClock; /** * Sets the default options * - * @param object The default options - * @param object The override options + * @param object The default options + * @param object The override options */ constructor: function(_default, options) { @@ -90,8 +96,9 @@ var FlipClock; /** * Delegates the callback to the defined method * - * @param object The default options - * @param object The override options + * @param object The default options + * @param object The override options + * @return object */ callback: function(method) { @@ -106,33 +113,37 @@ var FlipClock; method.apply(this, args); } + + return this; }, /** * Log a string into the console if it exists * - * @param string The name of the option - * @return mixed + * @param string The name of the option + * @return mixed */ log: function(str) { if(window.console && console.log) { console.log(str); } + + return this; }, /** * Get an single option value. Returns false if option does not exist * - * @param string The name of the option - * @return mixed + * @param string The name of the option + * @return mixed */ getOption: function(index) { - if(this[index]) { - return this[index]; + if(this.options.hasOwnProperty(index)) { + return this.options[index]; } - return false; + return null; }, /** @@ -142,7 +153,7 @@ var FlipClock; */ getOptions: function() { - return this; + return this.options; }, /** @@ -153,7 +164,14 @@ var FlipClock; */ setOption: function(index, value) { - this[index] = value; + if(this.hasOwnProperty(index)) { + this[index] = value; + } + else { + this.options[index] = value; + } + + return this; }, /** @@ -169,6 +187,8 @@ var FlipClock; this.setOption(key, options[key]); } } + + return this; }, /* @@ -201,26 +221,30 @@ var FlipClock; var event = this.on(name, callback); event.setFireOnce(true); + + return event; }, /* * Remove all bound events for a specific trigger * * @param string - * @return + * @return object */ off: function(name) { if(this._events[name]) { delete this._events[name]; } + + return this; }, /* * Remove all bound events for a specific trigger * * @param string - * @return + * @return mixed */ trigger: function(name) { @@ -239,13 +263,15 @@ var FlipClock; return this._events[name]; } + + return this; }, /* * Translate a string to the localized locale * - * @param - * @return + * @param string + * @return string */ localize: function(name) { @@ -259,8 +285,8 @@ var FlipClock; /* * Helper method for localize. t() is just short. * - * @param - * @return + * @param string + * @return string */ t: function(name) { From b33424c98343aedb74830a011ed6bdd42554b322 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 00:49:47 -0500 Subject: [PATCH 037/129] - (API) Made all classes with options as root properties into the "options" property (similar to how Marionette.js handles handles object options). This makes it easy to scan a class file to see what options are available to override. --- src/flipclock/js/libs/Divider.js | 74 ++++++-- src/flipclock/js/libs/EnglishAlphaList.js | 60 ++++++- src/flipclock/js/libs/Event.js | 108 +++++++++++- src/flipclock/js/libs/Face.js | 200 +++++++++++++--------- src/flipclock/js/libs/Factory.js | 143 +++++++++++----- src/flipclock/js/libs/ListItem.js | 60 +++++-- src/flipclock/js/libs/NumericList.js | 21 ++- src/flipclock/js/libs/Time.js | 39 +++-- src/flipclock/js/libs/Timer.js | 39 +++-- src/flipclock/js/libs/Translator.js | 35 ++-- src/flipclock/js/libs/Uuid.js | 44 ++++- src/flipclock/js/libs/list.js | 75 ++++---- 12 files changed, 645 insertions(+), 253 deletions(-) diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 69bd65fa..25927125 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -2,35 +2,77 @@ FlipClock.Divider = FlipClock.Base.extend({ - label: false, + /** + * The jQuery object + */ + + $el: false, - css: false, + /** + * The available options for this class + */ + + options: { + + /** + * The available options for this class + */ + + className: false, - excludeDots: false, + /** + * An object of available CSS classes + */ + + classes: { + divider: 'flip-clock-divider', + dot: 'flip-clock-dot', + label: 'flip-clock-label' + }, - translator: false, + /** + * If true the dots will not be displayed in the divider + */ + + excludeDots: false, - classes: { - divider: 'flip-clock-divider', - dot: 'flip-clock-dot', - label: 'flip-clock-label' + /** + * The label for the divider + */ + + label: false }, - $el: false, + /** + * The FlipClock.Translator instance + */ + + translator: false, + + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ - constructor: function(label, options) { + constructor: function(options) { this.base(options); - this.label = this.t(label); + // Tranlate the label + if(this.getOption('label')) { + this.setOption('label', this.t(this.getOption('label'))); + } - var dots = !this.excludeDots ? [ - '', - '' + var dots = !this.getOption('excludeDots') ? [ + '', + '' ].join('') : ''; this.$el = $([ - '', - ''+(this.label ? this.label : '')+'', + '', + ''+(this.getOption('label') ? this.getOption('label') : '')+'', dots, '' ].join('')); diff --git a/src/flipclock/js/libs/EnglishAlphaList.js b/src/flipclock/js/libs/EnglishAlphaList.js index a69a6cd7..64766312 100644 --- a/src/flipclock/js/libs/EnglishAlphaList.js +++ b/src/flipclock/js/libs/EnglishAlphaList.js @@ -13,14 +13,32 @@ "use strict"; /** - * The FlipClock List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific value. + * The FlipClock.EnglishAlphaList class is a specific class to create + * lists that alphabetical values */ FlipClock.EnglishAlphaList = FlipClock.List.extend({ - capitalLetters: true, + /** + * The available options for this class + */ + + options: { + + /** + * Tells the list to use capital letters if true + */ + + capitalLetters: true + }, + + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ constructor: function(value, options) { if(!value) { @@ -34,18 +52,42 @@ } }, + /* + * Get the maximum character code in the list + * + * @return int + */ + getMaxCharCode: function() { - return this.capitalLetters ? 90 : 122; + return this.getOption('capitalLetters') ? 90 : 122; }, + /* + * Get the minimum character code in the list + * + * @return int + */ + getMinCharCode: function() { - return this.capitalLetters ? 65 : 96; + return this.getOption('capitalLetters') ? 65 : 96; }, + /* + * Get the char code of the current list value + * + * @return int + */ + getCharCode: function() { return this.value.charCodeAt(0); }, + /* + * Get the previous value in the list + * + * @return int + */ + getPrevValue: function() { var charCode = this.value.charCodeAt(0) - 1; var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); @@ -57,6 +99,12 @@ return String.fromCharCode(charCode); }, + /* + * Get the next value in the list + * + * @return int + */ + getNextValue: function() { var charCode = this.value.charCodeAt(0) + 1; var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js index dbef046d..4e3a4105 100644 --- a/src/flipclock/js/libs/Event.js +++ b/src/flipclock/js/libs/Event.js @@ -1,19 +1,57 @@ (function($) { + /* + * The FlipClock.Event class are instances for each event triggered + * by FlipClock's classes. + */ + FlipClock.Event = FlipClock.Base.extend({ + /** + * The name of the event + */ + name: false, + /** + * Has the event fired? + */ + _hasFired: false, + /** + * The returned object of the last event response. Null + * if no response has been triggered. + */ + _lastResponse: null, + /** + * If true, the event will not fire + */ + _preventFire: false, + /** + * If true, the event will only fire once + */ + _fireOnce: false, + /** + * The function to call when the event is fired + */ + _callback: function() {}, + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ + constructor: function(name, callback) { if(!name) { throw "Events must have a name"; @@ -24,6 +62,14 @@ } }, + /* + * Fire the event. This method is chainable. + * + * @param object + * @param mixed + * @return object + */ + fire: function(obj, arguments) { if(this._preventFire === false) { this.setLastResponse(this._callback.apply(obj, arguments)); @@ -32,30 +78,90 @@ this._preventFire = true; } } + + return this; }, + /* + * Prevent the event from firing. This method is chainable. + * + * @param + * @return + */ + off: function() { this._preventFire = true; + + return this; + }, + + /* + * Turn on the event (if the event was previously turned off). + * This method is chainable. + * + * @return object + */ + + on: function() { + this._preventFire = false; + + return this; }, + /* + * Returns true if the event has fired + * + * @return bool + */ + hasFired: function() { return this._hasFired; }, + /* + * Get the last response. Returns null if no response exists + * + * @return mixed + */ + getLastResponse: function() { return this._lastResponse; }, + /* + * Sets the last response. This method is chainable. + * + * @param object + * @return object + */ + setLastResponse: function(response) { this._lastResponse = response; + + return this; }, - getFireOnce: function(value) { + /* + * Returns true if the event is set to only fire once + * + * @return bool + */ + + getFireOnce: function() { return this._fireOnce; }, + /* + * Set event to fire once or indefinitely + * + * @param bool + * @return object + */ + setFireOnce: function(value) { this._fireOnce = value; + + return this; } }); diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 18d4c6c5..33f8ff14 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -13,48 +13,12 @@ "use strict"; /** - * The FlipClock Face class is the base class in which to extend - * all other FlockClock.Face classes. - * - * @param object An object of properties to override the default + * The FlipClock.Face class is an abstract class used to create + * new clock faces. */ - + FlipClock.Face = FlipClock.Base.extend({ - /** - * The clock's animation rate. - * - * Note, currently this property doesn't do anything. - * This property is here to be used in the future to - * programmaticaly set the clock's animation speed - */ - - animationRate: 1000, - - /** - * Sets whether or not the clock should automatically add the play class - */ - - autoPlay: true, - - /** - * Sets whether or not the clock should start ticking upon instantiation - */ - - autoStart: true, - - /** - * Sets whether or not the clock should countdown - */ - - countdown: false, - - /** - * The default language - */ - - defaultLanguage: 'english', - /** * An array of jQuery objects used for the dividers (the colons) */ @@ -67,12 +31,6 @@ lang: false, - /** - * The language being used to display labels (string) - */ - - language: 'english', - /** * An array of FlipClock.List objects */ @@ -80,10 +38,57 @@ lists: [], /** - * The minimum digits the clock must have + * The available options for this class */ - - minimumDigits: 0, + + options: { + + /** + * The clock's animation rate. + * + * Note, currently this property doesn't do anything. + * This property is here to be used in the future to + * programmaticaly set the clock's animation speed + */ + + animationRate: 1000, + + /** + * Sets whether or not the clock should automatically add the play class + */ + + autoPlay: true, + + /** + * Sets whether or not the clock should start ticking upon instantiation + */ + + autoStart: true, + + /** + * Sets whether or not the clock should countdown + */ + + countdown: false, + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english', + + /** + * The minimum digits the clock must have + */ + + minimumDigits: 0 + }, /** * The original starting value of the clock face. @@ -119,13 +124,12 @@ * Constructor * * @param mixed - * @param object + * @param mixed */ constructor: function(value, options) { var t = this; - if(value instanceof Date === false && typeof value === "object") { options = value; value = 0; @@ -137,8 +141,8 @@ this.value = value; this.translator = new FlipClock.Translator({ - defaultLanguage: this.defaultLanguage, - language: this.language + defaultLanguage: this.getOption('defaultLanguage'), + language: this.getOption('language') }); this.timer = new FlipClock.Timer(); @@ -161,8 +165,6 @@ } } }); - - this.trigger('create'); }, /** @@ -177,6 +179,14 @@ return list; }, + /* + * Attach the FlipClock.List to the DOM of the clock face + * + * @param object A jQuery object + * @param object A FlipClock.List object + * @return + */ + attachList: function($el, list) { $el.append(list.$el); }, @@ -186,9 +196,11 @@ */ build: function() { - if(this.autoStart) { + if(this.getOption('autoStart')) { this.start(); } + + this.trigger('build'); }, /** @@ -199,10 +211,7 @@ */ init: function(factory) { - this.time = new FlipClock.Time(this.value, { - minimumDigits: this.minimumDigits - }); - + this.setTimeObject(this.value); this.trigger('init'); }, @@ -214,23 +223,26 @@ * If not set, is false. */ - createDivider: function(label, css, excludeDots) { - if(typeof css == "boolean" || !css) { - excludeDots = css; - css = false; + createDivider: function(label, className, excludeDots) { + if(typeof className == "boolean" || !className) { + excludeDots = className; + className = false; } - var divider = new FlipClock.Divider(label, { - css: css, + var divider = new FlipClock.Divider({ + label: label, + className: className, excludeDots: excludeDots, translator: this.translator }); this.dividers.push(divider); + this.trigger('create:divider', divider); + return divider; }, - + /** * Creates a FlipClock.List object and appends it to the DOM * @@ -241,7 +253,7 @@ createList: function(value, options) { var list = this.getListObject(value); - if(this.autoPlay || this.timer.running) { + if(this.getOption('autoPlay') || this.timer.running) { list.addPlayClass(); } @@ -280,21 +292,23 @@ * Triggers when the clock is reset */ - reset: function() { + reset: function(callback) { this.value = this.originalValue; this.flip(); this.trigger('reset'); + this.callback(callback); }, /** * Starts the clock */ - start: function() { + start: function(callback) { if(!this.timer.running) { this.trigger('before:start'); this.timer.start(); this.trigger('start'); + this.callback(callback); } }, @@ -302,12 +316,13 @@ * Stops the clock */ - stop: function() { + stop: function(callback) { var t = this; if(this.timer.running) { this.trigger('before:stop'); this.timer.stop(function() { t.trigger('stop'); + t.callback(callback); }); } }, @@ -317,12 +332,14 @@ */ autoIncrement: function() { - if(!this.countdown) { + if(!this.getOption('countdown')) { this.increment(); } else { this.decrement(); } + + this.trigger('auto:increment', this.getOption('countdown')); }, /** @@ -335,6 +352,8 @@ if(this.time) { this.time.addSecond(); } + + this.trigger('increment'); }, /** @@ -352,6 +371,8 @@ this.time.subSecond(); } } + + this.trigger('decrement'); }, /** @@ -363,7 +384,7 @@ if(this.lists[i]) { this.lists[i].select(time[i]); - if(this.autoPlay || this.timer.running) { + if(this.getOption('autoPlay') || this.timer.running) { this.lists[i].addPlayClass(); } } @@ -381,7 +402,8 @@ setTime: function(time) { this.time.time = time; - this.flip(); + this.flip(); + this.trigger('set:time', time); }, /** @@ -394,6 +416,16 @@ return this.time; }, + /** + * Set the time attribute with a new FlipClock.Time object + */ + + setTimeObject: function(time) { + this.time = new FlipClock.Time(time, { + minimumDigits: this.getOption('minimumDigits') + }); + }, + /** * Sets the clock face's time */ @@ -402,14 +434,14 @@ this.value = value; if(this.time) { - this.time = new FlipClock.Time(this.value, { - minimumDigits: this.minimumDigits - }); + this.setTimeObject(this.time); } - this.flip(); + this.flip(); + + this.trigger('set:value', this.value); }, - + /** * Get the clock face's value * @@ -425,12 +457,22 @@ */ setCountdown: function(value) { - this.countdown = value ? true : false; + this.setOption('countdown', value ? true : false); if(this.timer.running) { this.stop(); this.start(); } + + this.trigger('set:countdown', this.getOption('countdown')); + }, + + /** + * Get the current countdown option value + */ + + getCountdown: function(value) { + return this.getOption('countdown'); } }); diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index f1f58283..b340aa34 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -15,43 +15,10 @@ /** * The FlipClock Factory class is used to build the clock and manage * all the public methods. - * - * @param object A jQuery object or CSS selector used to fetch - the wrapping DOM nodes - * @param mixed This is the digit used to set the clock. If an - object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.Factory = FlipClock.Base.extend({ - /** - * The CSS classes - */ - - classes: { - wrapper: 'flip-clock-wrapper' - }, - - /** - * The name of the clock face class in use - */ - - clockFace: 'HourlyCounter', - - /** - * The FlipClock.Face options object - */ - - clockFaceOptions: {}, - - /** - * The name of the default clock face class to use if the defined - * clockFace variable is not a valid FlipClock.Face object - */ - - defaultClockFace: 'HourlyCounter', - /** * The jQuery object */ @@ -64,6 +31,40 @@ face: false, + /** + * The available options for this class + */ + + options: { + + /** + * An object of available CSS classes + */ + + classes: { + wrapper: 'flip-clock-wrapper' + }, + + /** + * The name of the clock face class in use + */ + + clockFace: 'HourlyCounter', + + /** + * The FlipClock.Face options object + */ + + clockFaceOptions: {}, + + /** + * The name of the default clock face class to use if the defined + * clockFace variable is not a valid FlipClock.Face object + */ + + defaultClockFace: 'HourlyCounter' + }, + /** * Constructor * @@ -83,9 +84,11 @@ this.lists = []; - this.$el = $el.addClass(this.classes.wrapper); + this.$el = $el.addClass(this.getOption('classes').wrapper); - this.loadClockFace(this.clockFace, value, this.clockFaceOptions); + this.loadClockFace(this.getOption('clockFace'), value, this.getOption('clockFaceOptions')); + + this.trigger('init'); }, /** @@ -111,7 +114,7 @@ this.face = new FlipClock[name](value, options); } else { - this.face = new FlipClock[this.defaultClockFace+suffix](value, options); + this.face = new FlipClock[this.getOption('defaultClockFace')+suffix](value, options); } this.face.on('create:list', function(list) { @@ -134,10 +137,6 @@ t.callback(t.onReset); }); - this.face.on('init', function() { - t.callback(t.onInit); - }); - this.face.on('interval', function() { t.callback(t.onInterval); }); @@ -146,9 +145,35 @@ this.face.build(); + this.trigger('load:face', this.face); + + this.callback(t.onInit); + return this.face; }, + /** + * Starts the clock face countdown option + * + * @return object + */ + + setCountdown: function(value) { + this.face.setCountdown(value); + + return this; + }, + + /** + * Gets the countdown option from the clock face + * + * @return object + */ + + getCountdown: function() { + return this.face.getCountdown(); + }, + /** * Starts the clock * @@ -207,18 +232,52 @@ return this.face.getValue(); }, + /* + * The onDestroy callback + * + * @return + */ + onDestroy: function() {}, - onCreate: function() {}, - + /* + * The onInit callback + * + * @return + */ + onInit: function() {}, + /* + * The onInterval callback + * + * @return + */ + onInterval: function() {}, + /* + * The onStart callback + * + * @return + */ + onStart: function() {}, + /* + * The onStop callback + * + * @return + */ + onStop: function() {}, + /* + * The onReset callback + * + * @return + */ + onReset: function() {} }); diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index d0ed111d..75f9a13e 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -1,31 +1,61 @@ (function($) { FlipClock.ListItem = FlipClock.Base.extend({ + + /** + * The jQuery object + */ + + $el: false, + + /** + * The available options for this class + */ - css: null, + options: { - value: null, + /** + * An object of available CSS classes + */ + + classes: { + up: 'up', + down: 'down' + }, + + /** + * The css class appended to the parent DOM node + */ - classes: { - up: 'up', - down: 'down' + className: null }, - $el: false, + /** + * The list item value + */ - constructor: function(css, value, options) { + value: null, + + /* + * Constructor + * + * @param mixed + * @param mixed + * @return + */ + + constructor: function(value, options) { this.base(options); - this.css = css; this.value = value; - + this.$el = $([ - '
                • ', + '
                • ', '', - '
                  ', + '
                  ', '
                  ', '
                  '+value+'
                  ', '
                  ', - '
                  ', + '
                  ', '
                  ', '
                  '+value+'
                  ', '
                  ', @@ -34,6 +64,12 @@ ].join('')); }, + /* + * Output the object instance as a string + * + * @return string + */ + toString: function() { return this.$el.html(); } diff --git a/src/flipclock/js/libs/NumericList.js b/src/flipclock/js/libs/NumericList.js index 5df19213..1e341035 100644 --- a/src/flipclock/js/libs/NumericList.js +++ b/src/flipclock/js/libs/NumericList.js @@ -13,17 +13,18 @@ "use strict"; /** - * The FlipClock.List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default + * The FlipClock.NumberList class is a specific class to create + * lists that display numbers */ FlipClock.NumericList = FlipClock.List.extend({ + /* + * Get the previous value in the list + * + * @return int + */ + getPrevValue: function() { if(this.value > 0) { return this.value - 1; @@ -32,6 +33,12 @@ return 9; }, + /* + * Get the next value in the list + * + * @return int + */ + getNextValue: function() { if(this.value < 9) { return this.value + 1; diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index 7d31f33e..89cc7d9a 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -11,16 +11,12 @@ (function($) { "use strict"; - - /** - * The FlipClock Time class is used to manage all the time - * calculations. - * - * @param mixed This is the digit used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default - */ - + + /* + * The FlipClock.Time class is a helper classes to digitize clock + * values and help calculate time. + */ + FlipClock.Time = FlipClock.Base.extend({ /** @@ -30,10 +26,17 @@ time: 0, /** - * The minimum number of digits the clock face must have + * The available options for this class */ - - minimumDigits: 0, + + options: { + + /** + * The minimum number of digits the clock face must have + */ + + minimumDigits: 0 + }, /** * Constructor @@ -109,7 +112,7 @@ var data = []; for(var i in obj) { - value = obj[i].toString(); + var value = obj[i].toString(); if(value.length == 1) { value = '0'+value; @@ -120,12 +123,12 @@ } } - if(data.length > this.minimumDigits) { - this.minimumDigits = data.length; + if(data.length > this.getOption('minimumDigits')) { + this.setOption('minimumDigits', data.length); } - if(this.minimumDigits > data.length) { - for(var x = data.length; x < this.minimumDigits; x++) { + if(this.getOption('minimumDigits') > data.length) { + for(var x = data.length; x < this.getOption('minimumDigits'); x++) { data.unshift('0'); } } diff --git a/src/flipclock/js/libs/Timer.js b/src/flipclock/js/libs/Timer.js index c47ea3a0..bfaa77f8 100644 --- a/src/flipclock/js/libs/Timer.js +++ b/src/flipclock/js/libs/Timer.js @@ -13,31 +13,36 @@ "use strict"; /** - * The FlipClock.Timer object managers the JS timers - * - * @param object Override the default options + * The FlipClock.Timer object is a helper to manage the JS time intervals */ FlipClock.Timer = FlipClock.Base.extend({ - /** - * The rate of the animation in milliseconds (not currently in use) - */ - - animationRate: 1000, - /** * FlipClock timer count (how many intervals have passed) */ count: 0, - + /** - * Timer interval (1 second by default) + * The available options for this class */ - - interval: 1000, + + options: { + + /** + * The rate of the animation in milliseconds (not currently in use) + */ + + animationRate: 1000, + /** + * Timer interval (1 second by default) + */ + + interval: 1000 + }, + /** * Is the timer running? */ @@ -62,7 +67,7 @@ */ getElapsed: function() { - return this.count * this.interval; + return this.count * this.getOption('interval'); }, /** @@ -88,7 +93,7 @@ this._setInterval(callback); this.trigger('reset'); }, - + /** * This method is starts the timer * @@ -116,7 +121,7 @@ setTimeout(function() { t.callback(callback); - }, this.interval); + }, this.getOption('interval')); t.trigger('stop'); }, @@ -183,7 +188,7 @@ if(t.running) { t._interval(callback); } - }, this.interval); + }, this.getOption('interval')); this.trigger('start'); this._interval(callback); } diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js index a2b117dc..c86fec06 100644 --- a/src/flipclock/js/libs/Translator.js +++ b/src/flipclock/js/libs/Translator.js @@ -2,24 +2,31 @@ FlipClock.Translator = FlipClock.Base.extend({ - /** - * The default language - */ - - defaultLanguage: 'english', - - /** - * The language being used to display labels (string) - */ - - language: 'english', - /** * The language object after it has been loaded */ lang: false, + /** + * The available options for this class + */ + + options: { + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english' + }, + /* * Constructor * @@ -29,7 +36,7 @@ constructor: function(options) { this.base(options); - this.loadLanguage(this.language); + this.loadLanguage(this.getOption('language')); }, /** @@ -48,7 +55,7 @@ lang = FlipClock.Lang[name]; } else { - lang = FlipClock.Lang[this.defaultLanguage]; + lang = FlipClock.Lang[this.getOption('defaultLanguage')]; } return this.lang = lang; diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js index 6f310288..376fef0e 100644 --- a/src/flipclock/js/libs/Uuid.js +++ b/src/flipclock/js/libs/Uuid.js @@ -2,12 +2,28 @@ FlipClock.Uuid = FlipClock.Base.extend({ + /** + * The actual uuid value as a string + */ + value: false, - constructor: function() { - this.value = this.generate(); + /* + * Constructor + * + * @return + */ + + constructor: function(value) { + this.value = value ? value : this.generate(); }, + /* + * Generate a new Uuid + * + * @return string + */ + generate: function() { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { @@ -18,21 +34,37 @@ return uuid; }, + /* + * Does this uuid equal another uuid object + * + * @param object + * @return bool + */ + equals: function(other) { return this.isUuid(other) && value == other; }, + /* + * Tests another value to see if it's a uuid + * + * @param mixed + * @return bool + */ + isUuid: function(value) { var validator = new RegExp("^[a-z0-9]{32}$", "i"); return value && (value instanceof Uuid || validator.test(value.toString())); }, - toString: function() { - return this.value; - }, + /* + * Outputs the object instance as a string + * + * @return string + */ - toJSON: function() { + toString: function() { return this.value; } diff --git a/src/flipclock/js/libs/list.js b/src/flipclock/js/libs/list.js index bd6e7c3e..43edafc9 100644 --- a/src/flipclock/js/libs/list.js +++ b/src/flipclock/js/libs/list.js @@ -16,25 +16,10 @@ * The FlipClock.List class is used to build the list used to create * the card flip effect. This object fascilates selecting the correct * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.List = FlipClock.Base.extend({ - - /** - * The CSS classes - */ - - classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - flip: 'flip', - play: 'play' - }, - + /** * The jQuery object */ @@ -48,11 +33,29 @@ items: [], /** - * The last value selected in the list + * The available options for this class */ - - lastValue: 0, - + + options: { + + /** + * The CSS classes + */ + + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + flip: 'flip', + play: 'play' + }, + + /** + * The last value selected in the list + */ + + lastValue: 0 + }, + /** * The selected value in the list */ @@ -88,7 +91,7 @@ select: function(value) { var _afterListItem = this._afterListItem; - this.lastValue = this.value; + this.setOption('lastValue', this.value); if(typeof value === "undefined") { value = this.value; @@ -97,16 +100,16 @@ this.value = value; } - if(this.value != this.lastValue) { - this._beforeListItem.$el.removeClass(this.classes.before); + if(this.value != this.getOption('lastValue')) { + this._beforeListItem.$el.removeClass(this.getOption('classes').before); - this.$el.find('.'+this.classes.active) - .removeClass(this.classes.active) - .addClass(this.classes.before); + this.$el.find('.'+this.getOption('classes').active) + .removeClass(this.getOption('classes').active) + .addClass(this.getOption('classes').before); this.items.splice(0, 1); - this._afterListItem = this.createListItem(this.classes.active, this.value); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); this._beforeListItem.$el.remove(); this._beforeListItem = _afterListItem; @@ -122,7 +125,7 @@ */ addPlayClass: function() { - this.$el.addClass(this.classes.play); + this.$el.addClass(this.getOption('classes').play); }, /* @@ -132,15 +135,17 @@ */ removePlayClass: function() { - this.$el.removeClass(this.classes.play); + this.$el.removeClass(this.getOption('classes').play); }, /** * Creates the list item HTML and returns as a string */ - createListItem: function(css, value) { - var item = new FlipClock.ListItem(css, value); + createListItem: function(value, css) { + var item = new FlipClock.ListItem(value, { + className: css + }); this.items.push(item); @@ -152,14 +157,14 @@ }, /** - * Create the lsit of values and appends it to the DOM object + * Create the list of values and appends it to the DOM object */ createList: function() { - var $el = this.$el = $('
                    '); + var $el = this.$el = $('
                      '); - this._beforeListItem = this.createListItem(this.classes.before, this.getPrevValue()); - this._afterListItem = this.createListItem(this.classes.active, this.value); + this._beforeListItem = this.createListItem(this.getPrevValue(), this.getOption('classes').before); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); $el.append(this._beforeListItem.el); $el.append(this._afterListItem.el); From 1351d9ff97ff979f61c1df81bd1916536dcc8cb8 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 00:53:13 -0500 Subject: [PATCH 038/129] - (API) Updated code comments to make sure every property and method has proper code comments --- src/flipclock/js/libs/Base.js | 2 +- src/flipclock/js/libs/Divider.js | 15 +++++++++++++++ src/flipclock/js/libs/EnglishAlphaList.js | 2 +- src/flipclock/js/libs/Event.js | 10 ++++++++++ src/flipclock/js/libs/Face.js | 2 +- src/flipclock/js/libs/Factory.js | 2 +- src/flipclock/js/libs/ListItem.js | 10 ++++++++++ src/flipclock/js/libs/NumericList.js | 2 +- src/flipclock/js/libs/Time.js | 2 +- src/flipclock/js/libs/Timer.js | 2 +- src/flipclock/js/libs/Translator.js | 10 ++++++++++ src/flipclock/js/libs/Uuid.js | 10 ++++++++++ src/flipclock/js/libs/list.js | 2 +- src/flipclock/js/libs/plugins.js | 2 +- 14 files changed, 64 insertions(+), 9 deletions(-) diff --git a/src/flipclock/js/libs/Base.js b/src/flipclock/js/libs/Base.js index fc26f7df..97a8d106 100644 --- a/src/flipclock/js/libs/Base.js +++ b/src/flipclock/js/libs/Base.js @@ -9,7 +9,7 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 25927125..95ccabbe 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -1,5 +1,20 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { + /* + * The FlipClock.Divider class makes visual dividers on clocks + * easy to create and manipulate. + */ + FlipClock.Divider = FlipClock.Base.extend({ /** diff --git a/src/flipclock/js/libs/EnglishAlphaList.js b/src/flipclock/js/libs/EnglishAlphaList.js index 64766312..4d676dd1 100644 --- a/src/flipclock/js/libs/EnglishAlphaList.js +++ b/src/flipclock/js/libs/EnglishAlphaList.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js index 4e3a4105..e7e5dcd5 100644 --- a/src/flipclock/js/libs/Event.js +++ b/src/flipclock/js/libs/Event.js @@ -1,3 +1,13 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { /* diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 33f8ff14..22d1f024 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index b340aa34..4b16f2f0 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index 75f9a13e..36f9dbde 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -1,3 +1,13 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { FlipClock.ListItem = FlipClock.Base.extend({ diff --git a/src/flipclock/js/libs/NumericList.js b/src/flipclock/js/libs/NumericList.js index 1e341035..81afc877 100644 --- a/src/flipclock/js/libs/NumericList.js +++ b/src/flipclock/js/libs/NumericList.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index 89cc7d9a..a7f3d10f 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Timer.js b/src/flipclock/js/libs/Timer.js index bfaa77f8..053a3f73 100644 --- a/src/flipclock/js/libs/Timer.js +++ b/src/flipclock/js/libs/Timer.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js index c86fec06..e271b3ff 100644 --- a/src/flipclock/js/libs/Translator.js +++ b/src/flipclock/js/libs/Translator.js @@ -1,3 +1,13 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function() { FlipClock.Translator = FlipClock.Base.extend({ diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js index 376fef0e..8d613714 100644 --- a/src/flipclock/js/libs/Uuid.js +++ b/src/flipclock/js/libs/Uuid.js @@ -1,3 +1,13 @@ +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { FlipClock.Uuid = FlipClock.Base.extend({ diff --git a/src/flipclock/js/libs/list.js b/src/flipclock/js/libs/list.js index 43edafc9..42f145fe 100644 --- a/src/flipclock/js/libs/list.js +++ b/src/flipclock/js/libs/list.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; diff --git a/src/flipclock/js/libs/plugins.js b/src/flipclock/js/libs/plugins.js index 5b0d5e42..76a89e60 100644 --- a/src/flipclock/js/libs/plugins.js +++ b/src/flipclock/js/libs/plugins.js @@ -7,7 +7,7 @@ * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; From 12e9479b81223fd1be582523330db2b57a0a88df Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 00:56:29 -0500 Subject: [PATCH 039/129] - (Big Fix) Removed hard coded classes from markup in the FlipClock.ListItem class --- src/flipclock/js/libs/ListItem.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index 36f9dbde..3628dc9a 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -29,8 +29,10 @@ */ classes: { - up: 'up', - down: 'down' + down: 'down', + inn: 'inn', + shadow: 'shadow', + up: 'up' }, /** @@ -62,12 +64,12 @@ '
                    • ', '', '
                      ', - '
                      ', - '
                      '+value+'
                      ', + '
                      ', + '
                      '+value+'
                      ', '
                      ', '
                      ', - '
                      ', - '
                      '+value+'
                      ', + '
                      ', + '
                      '+value+'
                      ', '
                      ', '
                      ', '
                    • ' From f7c741d7a2558ea002690ae6ab0a851d8e8df475 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 00:58:10 -0500 Subject: [PATCH 040/129] - (Bug Fix) Added "use strict" to classes where it was missing --- src/flipclock/js/libs/Divider.js | 2 ++ src/flipclock/js/libs/Event.js | 2 ++ src/flipclock/js/libs/ListItem.js | 2 ++ src/flipclock/js/libs/Translator.js | 2 ++ src/flipclock/js/libs/Uuid.js | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 95ccabbe..09c9e126 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -10,6 +10,8 @@ (function($) { + "use strict"; + /* * The FlipClock.Divider class makes visual dividers on clocks * easy to create and manipulate. diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js index e7e5dcd5..057b24e7 100644 --- a/src/flipclock/js/libs/Event.js +++ b/src/flipclock/js/libs/Event.js @@ -10,6 +10,8 @@ (function($) { + "use strict"; + /* * The FlipClock.Event class are instances for each event triggered * by FlipClock's classes. diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index 3628dc9a..5a7e9a32 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -10,6 +10,8 @@ (function($) { + "use strict"; + FlipClock.ListItem = FlipClock.Base.extend({ /** diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js index e271b3ff..98bdfcca 100644 --- a/src/flipclock/js/libs/Translator.js +++ b/src/flipclock/js/libs/Translator.js @@ -10,6 +10,8 @@ (function() { + "use strict"; + FlipClock.Translator = FlipClock.Base.extend({ /** diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js index 8d613714..c2101042 100644 --- a/src/flipclock/js/libs/Uuid.js +++ b/src/flipclock/js/libs/Uuid.js @@ -10,6 +10,8 @@ (function($) { + "use strict"; + FlipClock.Uuid = FlipClock.Base.extend({ /** From 5e8fdc9b6b4ef7fb00307ae5a0b02e7b7b4e4dd9 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 01:03:23 -0500 Subject: [PATCH 041/129] Added more code comments --- src/flipclock/js/libs/Translator.js | 5 +++++ src/flipclock/js/libs/Uuid.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js index 98bdfcca..12bca047 100644 --- a/src/flipclock/js/libs/Translator.js +++ b/src/flipclock/js/libs/Translator.js @@ -12,6 +12,11 @@ "use strict"; + /** + * The FlipClock.Translate object will translate string to a specified + * locale. + */ + FlipClock.Translator = FlipClock.Base.extend({ /** diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js index c2101042..d6a92607 100644 --- a/src/flipclock/js/libs/Uuid.js +++ b/src/flipclock/js/libs/Uuid.js @@ -12,6 +12,11 @@ "use strict"; + /** + * The FlipClock.Uuid object generates a uuid instance and return + * the uuid as string. + */ + FlipClock.Uuid = FlipClock.Base.extend({ /** From 847ed0dd038519d66a13c927b36e00f78a95232a Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 01:04:14 -0500 Subject: [PATCH 042/129] Fixed bug caused by strict mode being disabled --- src/flipclock/js/libs/Event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js index 057b24e7..2fbed500 100644 --- a/src/flipclock/js/libs/Event.js +++ b/src/flipclock/js/libs/Event.js @@ -82,9 +82,9 @@ * @return object */ - fire: function(obj, arguments) { + fire: function(obj, args) { if(this._preventFire === false) { - this.setLastResponse(this._callback.apply(obj, arguments)); + this.setLastResponse(this._callback.apply(obj, args)); this._hasFired = true; if(this._fireOnce) { this._preventFire = true; From caa6883b5ade700b60c31f1b888d68d2a49ae958 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 01:05:19 -0500 Subject: [PATCH 043/129] More comments --- src/flipclock/js/libs/ListItem.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index 5a7e9a32..7e1d3082 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -12,6 +12,11 @@ "use strict"; + /** + * The FlipClock.ListItem object generates and maintains a list item + * in FlipClock.List objets. + */ + FlipClock.ListItem = FlipClock.Base.extend({ /** From 0069f1148c0c0dd39d7958e219113095d851ad78 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 01:53:45 -0500 Subject: [PATCH 044/129] Recompiled source --- compiled/flipclock.js | 1082 +++++++++++++++++++++++++++---------- compiled/flipclock.min.js | 4 +- 2 files changed, 793 insertions(+), 293 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index af7cb67e..73a11d62 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -155,7 +155,7 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; @@ -202,6 +202,12 @@ var FlipClock; version: '0.7.7', + /** + * The available options for this class + */ + + options: {}, + /** * The bound events to this object */ @@ -217,8 +223,8 @@ var FlipClock; /** * Sets the default options * - * @param object The default options - * @param object The override options + * @param object The default options + * @param object The override options */ constructor: function(_default, options) { @@ -236,8 +242,9 @@ var FlipClock; /** * Delegates the callback to the defined method * - * @param object The default options - * @param object The override options + * @param object The default options + * @param object The override options + * @return object */ callback: function(method) { @@ -252,33 +259,37 @@ var FlipClock; method.apply(this, args); } + + return this; }, /** * Log a string into the console if it exists * - * @param string The name of the option - * @return mixed + * @param string The name of the option + * @return mixed */ log: function(str) { if(window.console && console.log) { console.log(str); } + + return this; }, /** * Get an single option value. Returns false if option does not exist * - * @param string The name of the option - * @return mixed + * @param string The name of the option + * @return mixed */ getOption: function(index) { - if(this[index]) { - return this[index]; + if(this.options.hasOwnProperty(index)) { + return this.options[index]; } - return false; + return null; }, /** @@ -288,7 +299,7 @@ var FlipClock; */ getOptions: function() { - return this; + return this.options; }, /** @@ -299,7 +310,14 @@ var FlipClock; */ setOption: function(index, value) { - this[index] = value; + if(this.hasOwnProperty(index)) { + this[index] = value; + } + else { + this.options[index] = value; + } + + return this; }, /** @@ -315,6 +333,8 @@ var FlipClock; this.setOption(key, options[key]); } } + + return this; }, /* @@ -347,26 +367,30 @@ var FlipClock; var event = this.on(name, callback); event.setFireOnce(true); + + return event; }, /* * Remove all bound events for a specific trigger * * @param string - * @return + * @return object */ off: function(name) { if(this._events[name]) { delete this._events[name]; } + + return this; }, /* * Remove all bound events for a specific trigger * * @param string - * @return + * @return mixed */ trigger: function(name) { @@ -385,13 +409,15 @@ var FlipClock; return this._events[name]; } + + return this; }, /* * Translate a string to the localized locale * - * @param - * @return + * @param string + * @return string */ localize: function(name) { @@ -405,8 +431,8 @@ var FlipClock; /* * Helper method for localize. t() is just short. * - * @param - * @return + * @param string + * @return string */ t: function(name) { @@ -425,7 +451,7 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; @@ -473,7 +499,7 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; @@ -482,25 +508,10 @@ var FlipClock; * The FlipClock.List class is used to build the list used to create * the card flip effect. This object fascilates selecting the correct * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.List = FlipClock.Base.extend({ - - /** - * The CSS classes - */ - - classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - flip: 'flip', - play: 'play' - }, - + /** * The jQuery object */ @@ -514,11 +525,29 @@ var FlipClock; items: [], /** - * The last value selected in the list + * The available options for this class */ - - lastValue: 0, - + + options: { + + /** + * The CSS classes + */ + + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + flip: 'flip', + play: 'play' + }, + + /** + * The last value selected in the list + */ + + lastValue: 0 + }, + /** * The selected value in the list */ @@ -554,7 +583,7 @@ var FlipClock; select: function(value) { var _afterListItem = this._afterListItem; - this.lastValue = this.value; + this.setOption('lastValue', this.value); if(typeof value === "undefined") { value = this.value; @@ -563,16 +592,16 @@ var FlipClock; this.value = value; } - if(this.value != this.lastValue) { - this._beforeListItem.$el.removeClass(this.classes.before); + if(this.value != this.getOption('lastValue')) { + this._beforeListItem.$el.removeClass(this.getOption('classes').before); - this.$el.find('.'+this.classes.active) - .removeClass(this.classes.active) - .addClass(this.classes.before); + this.$el.find('.'+this.getOption('classes').active) + .removeClass(this.getOption('classes').active) + .addClass(this.getOption('classes').before); this.items.splice(0, 1); - this._afterListItem = this.createListItem(this.classes.active, this.value); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); this._beforeListItem.$el.remove(); this._beforeListItem = _afterListItem; @@ -588,7 +617,7 @@ var FlipClock; */ addPlayClass: function() { - this.$el.addClass(this.classes.play); + this.$el.addClass(this.getOption('classes').play); }, /* @@ -598,15 +627,17 @@ var FlipClock; */ removePlayClass: function() { - this.$el.removeClass(this.classes.play); + this.$el.removeClass(this.getOption('classes').play); }, /** * Creates the list item HTML and returns as a string */ - createListItem: function(css, value) { - var item = new FlipClock.ListItem(css, value); + createListItem: function(value, css) { + var item = new FlipClock.ListItem(value, { + className: css + }); this.items.push(item); @@ -618,14 +649,14 @@ var FlipClock; }, /** - * Create the lsit of values and appends it to the DOM object + * Create the list of values and appends it to the DOM object */ createList: function() { - var $el = this.$el = $('
                        '); + var $el = this.$el = $('
                          '); - this._beforeListItem = this.createListItem(this.classes.before, this.getPrevValue()); - this._afterListItem = this.createListItem(this.classes.active, this.value); + this._beforeListItem = this.createListItem(this.getPrevValue(), this.getOption('classes').before); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); $el.append(this._beforeListItem.el); $el.append(this._afterListItem.el); @@ -638,42 +669,97 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { + "use strict"; + + /** + * The FlipClock.ListItem object generates and maintains a list item + * in FlipClock.List objets. + */ + FlipClock.ListItem = FlipClock.Base.extend({ + + /** + * The jQuery object + */ + + $el: false, + + /** + * The available options for this class + */ - css: null, + options: { - value: null, + /** + * An object of available CSS classes + */ + + classes: { + down: 'down', + inn: 'inn', + shadow: 'shadow', + up: 'up' + }, + + /** + * The css class appended to the parent DOM node + */ - classes: { - up: 'up', - down: 'down' + className: null }, - $el: false, + /** + * The list item value + */ - constructor: function(css, value, options) { + value: null, + + /* + * Constructor + * + * @param mixed + * @param mixed + * @return + */ + + constructor: function(value, options) { this.base(options); - this.css = css; this.value = value; - + this.$el = $([ - '
                        • ', + '
                        • ', '', - '
                        • ' ].join('')); }, + /* + * Output the object instance as a string + * + * @return string + */ + toString: function() { return this.$el.html(); } @@ -690,20 +776,38 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; /** - * The FlipClock List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific value. + * The FlipClock.EnglishAlphaList class is a specific class to create + * lists that alphabetical values */ FlipClock.EnglishAlphaList = FlipClock.List.extend({ - capitalLetters: true, + /** + * The available options for this class + */ + + options: { + + /** + * Tells the list to use capital letters if true + */ + + capitalLetters: true + }, + + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ constructor: function(value, options) { if(!value) { @@ -717,18 +821,42 @@ var FlipClock; } }, + /* + * Get the maximum character code in the list + * + * @return int + */ + getMaxCharCode: function() { - return this.capitalLetters ? 90 : 122; + return this.getOption('capitalLetters') ? 90 : 122; }, + /* + * Get the minimum character code in the list + * + * @return int + */ + getMinCharCode: function() { - return this.capitalLetters ? 65 : 96; + return this.getOption('capitalLetters') ? 65 : 96; }, + /* + * Get the char code of the current list value + * + * @return int + */ + getCharCode: function() { return this.value.charCodeAt(0); }, + /* + * Get the previous value in the list + * + * @return int + */ + getPrevValue: function() { var charCode = this.value.charCodeAt(0) - 1; var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); @@ -740,6 +868,12 @@ var FlipClock; return String.fromCharCode(charCode); }, + /* + * Get the next value in the list + * + * @return int + */ + getNextValue: function() { var charCode = this.value.charCodeAt(0) + 1; var minCode = this.getMinCharCode(), maxCode = this.getMaxCharCode(); @@ -754,39 +888,98 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { + "use strict"; + + /* + * The FlipClock.Divider class makes visual dividers on clocks + * easy to create and manipulate. + */ + FlipClock.Divider = FlipClock.Base.extend({ - label: false, + /** + * The jQuery object + */ + + $el: false, - css: false, + /** + * The available options for this class + */ - excludeDots: false, + options: { + + /** + * The available options for this class + */ + + className: false, + + /** + * An object of available CSS classes + */ + + classes: { + divider: 'flip-clock-divider', + dot: 'flip-clock-dot', + label: 'flip-clock-label' + }, + + /** + * If true the dots will not be displayed in the divider + */ + + excludeDots: false, + + /** + * The label for the divider + */ + + label: false + }, + /** + * The FlipClock.Translator instance + */ + translator: false, - classes: { - divider: 'flip-clock-divider', - dot: 'flip-clock-dot', - label: 'flip-clock-label' - }, - - $el: false, + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ - constructor: function(label, options) { + constructor: function(options) { this.base(options); - this.label = this.t(label); + // Tranlate the label + if(this.getOption('label')) { + this.setOption('label', this.t(this.getOption('label'))); + } - var dots = !this.excludeDots ? [ - '', - '' + var dots = !this.getOption('excludeDots') ? [ + '', + '' ].join('') : ''; this.$el = $([ - '', - ''+(this.label ? this.label : '')+'', + '', + ''+(this.getOption('label') ? this.getOption('label') : '')+'', dots, '' ].join('')); @@ -800,22 +993,72 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { + "use strict"; + + /* + * The FlipClock.Event class are instances for each event triggered + * by FlipClock's classes. + */ + FlipClock.Event = FlipClock.Base.extend({ + /** + * The name of the event + */ + name: false, + /** + * Has the event fired? + */ + _hasFired: false, + /** + * The returned object of the last event response. Null + * if no response has been triggered. + */ + _lastResponse: null, + /** + * If true, the event will not fire + */ + _preventFire: false, + /** + * If true, the event will only fire once + */ + _fireOnce: false, + /** + * The function to call when the event is fired + */ + _callback: function() {}, + /* + * Constructor + * + * @param string + * @param mixed + * @return + */ + constructor: function(name, callback) { if(!name) { throw "Events must have a name"; @@ -826,38 +1069,106 @@ var FlipClock; } }, - fire: function(obj, arguments) { + /* + * Fire the event. This method is chainable. + * + * @param object + * @param mixed + * @return object + */ + + fire: function(obj, args) { if(this._preventFire === false) { - this.setLastResponse(this._callback.apply(obj, arguments)); + this.setLastResponse(this._callback.apply(obj, args)); this._hasFired = true; if(this._fireOnce) { this._preventFire = true; } } + + return this; }, + /* + * Prevent the event from firing. This method is chainable. + * + * @param + * @return + */ + off: function() { this._preventFire = true; + + return this; }, + /* + * Turn on the event (if the event was previously turned off). + * This method is chainable. + * + * @return object + */ + + on: function() { + this._preventFire = false; + + return this; + }, + + /* + * Returns true if the event has fired + * + * @return bool + */ + hasFired: function() { return this._hasFired; }, + /* + * Get the last response. Returns null if no response exists + * + * @return mixed + */ + getLastResponse: function() { return this._lastResponse; }, + /* + * Sets the last response. This method is chainable. + * + * @param object + * @return object + */ + setLastResponse: function(response) { this._lastResponse = response; + + return this; }, - getFireOnce: function(value) { + /* + * Returns true if the event is set to only fire once + * + * @return bool + */ + + getFireOnce: function() { return this._fireOnce; }, + /* + * Set event to fire once or indefinitely + * + * @param bool + * @return object + */ + setFireOnce: function(value) { this._fireOnce = value; + + return this; } }); @@ -872,54 +1183,18 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; - /** - * The FlipClock Face class is the base class in which to extend - * all other FlockClock.Face classes. - * - * @param object An object of properties to override the default - */ - - FlipClock.Face = FlipClock.Base.extend({ - - /** - * The clock's animation rate. - * - * Note, currently this property doesn't do anything. - * This property is here to be used in the future to - * programmaticaly set the clock's animation speed - */ - - animationRate: 1000, - - /** - * Sets whether or not the clock should automatically add the play class - */ - - autoPlay: true, - - /** - * Sets whether or not the clock should start ticking upon instantiation - */ - - autoStart: true, - - /** - * Sets whether or not the clock should countdown - */ - - countdown: false, - - /** - * The default language - */ - - defaultLanguage: 'english', - + /** + * The FlipClock.Face class is an abstract class used to create + * new clock faces. + */ + + FlipClock.Face = FlipClock.Base.extend({ + /** * An array of jQuery objects used for the dividers (the colons) */ @@ -932,12 +1207,6 @@ var FlipClock; lang: false, - /** - * The language being used to display labels (string) - */ - - language: 'english', - /** * An array of FlipClock.List objects */ @@ -945,10 +1214,57 @@ var FlipClock; lists: [], /** - * The minimum digits the clock must have + * The available options for this class */ + + options: { + + /** + * The clock's animation rate. + * + * Note, currently this property doesn't do anything. + * This property is here to be used in the future to + * programmaticaly set the clock's animation speed + */ + + animationRate: 1000, + + /** + * Sets whether or not the clock should automatically add the play class + */ + + autoPlay: true, + + /** + * Sets whether or not the clock should start ticking upon instantiation + */ + + autoStart: true, + + /** + * Sets whether or not the clock should countdown + */ + + countdown: false, + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english', - minimumDigits: 0, + /** + * The minimum digits the clock must have + */ + + minimumDigits: 0 + }, /** * The original starting value of the clock face. @@ -984,13 +1300,12 @@ var FlipClock; * Constructor * * @param mixed - * @param object + * @param mixed */ constructor: function(value, options) { var t = this; - if(value instanceof Date === false && typeof value === "object") { options = value; value = 0; @@ -1002,8 +1317,8 @@ var FlipClock; this.value = value; this.translator = new FlipClock.Translator({ - defaultLanguage: this.defaultLanguage, - language: this.language + defaultLanguage: this.getOption('defaultLanguage'), + language: this.getOption('language') }); this.timer = new FlipClock.Timer(); @@ -1026,8 +1341,6 @@ var FlipClock; } } }); - - this.trigger('create'); }, /** @@ -1042,6 +1355,14 @@ var FlipClock; return list; }, + /* + * Attach the FlipClock.List to the DOM of the clock face + * + * @param object A jQuery object + * @param object A FlipClock.List object + * @return + */ + attachList: function($el, list) { $el.append(list.$el); }, @@ -1051,9 +1372,11 @@ var FlipClock; */ build: function() { - if(this.autoStart) { + if(this.getOption('autoStart')) { this.start(); } + + this.trigger('build'); }, /** @@ -1064,10 +1387,7 @@ var FlipClock; */ init: function(factory) { - this.time = new FlipClock.Time(this.value, { - minimumDigits: this.minimumDigits - }); - + this.setTimeObject(this.value); this.trigger('init'); }, @@ -1079,23 +1399,26 @@ var FlipClock; * If not set, is false. */ - createDivider: function(label, css, excludeDots) { - if(typeof css == "boolean" || !css) { - excludeDots = css; - css = false; + createDivider: function(label, className, excludeDots) { + if(typeof className == "boolean" || !className) { + excludeDots = className; + className = false; } - var divider = new FlipClock.Divider(label, { - css: css, + var divider = new FlipClock.Divider({ + label: label, + className: className, excludeDots: excludeDots, translator: this.translator }); this.dividers.push(divider); + this.trigger('create:divider', divider); + return divider; }, - + /** * Creates a FlipClock.List object and appends it to the DOM * @@ -1106,7 +1429,7 @@ var FlipClock; createList: function(value, options) { var list = this.getListObject(value); - if(this.autoPlay || this.timer.running) { + if(this.getOption('autoPlay') || this.timer.running) { list.addPlayClass(); } @@ -1145,21 +1468,23 @@ var FlipClock; * Triggers when the clock is reset */ - reset: function() { + reset: function(callback) { this.value = this.originalValue; this.flip(); this.trigger('reset'); + this.callback(callback); }, /** * Starts the clock */ - start: function() { + start: function(callback) { if(!this.timer.running) { this.trigger('before:start'); this.timer.start(); this.trigger('start'); + this.callback(callback); } }, @@ -1167,12 +1492,13 @@ var FlipClock; * Stops the clock */ - stop: function() { + stop: function(callback) { var t = this; if(this.timer.running) { this.trigger('before:stop'); this.timer.stop(function() { t.trigger('stop'); + t.callback(callback); }); } }, @@ -1182,12 +1508,14 @@ var FlipClock; */ autoIncrement: function() { - if(!this.countdown) { + if(!this.getOption('countdown')) { this.increment(); } else { this.decrement(); } + + this.trigger('auto:increment', this.getOption('countdown')); }, /** @@ -1200,6 +1528,8 @@ var FlipClock; if(this.time) { this.time.addSecond(); } + + this.trigger('increment'); }, /** @@ -1217,6 +1547,8 @@ var FlipClock; this.time.subSecond(); } } + + this.trigger('decrement'); }, /** @@ -1228,7 +1560,7 @@ var FlipClock; if(this.lists[i]) { this.lists[i].select(time[i]); - if(this.autoPlay || this.timer.running) { + if(this.getOption('autoPlay') || this.timer.running) { this.lists[i].addPlayClass(); } } @@ -1246,7 +1578,8 @@ var FlipClock; setTime: function(time) { this.time.time = time; - this.flip(); + this.flip(); + this.trigger('set:time', time); }, /** @@ -1259,6 +1592,16 @@ var FlipClock; return this.time; }, + /** + * Set the time attribute with a new FlipClock.Time object + */ + + setTimeObject: function(time) { + this.time = new FlipClock.Time(time, { + minimumDigits: this.getOption('minimumDigits') + }); + }, + /** * Sets the clock face's time */ @@ -1267,14 +1610,14 @@ var FlipClock; this.value = value; if(this.time) { - this.time = new FlipClock.Time(this.value, { - minimumDigits: this.minimumDigits - }); + this.setTimeObject(this.time); } - this.flip(); + this.flip(); + + this.trigger('set:value', this.value); }, - + /** * Get the clock face's value * @@ -1290,12 +1633,22 @@ var FlipClock; */ setCountdown: function(value) { - this.countdown = value ? true : false; + this.setOption('countdown', value ? true : false); if(this.timer.running) { this.stop(); this.start(); } + + this.trigger('set:countdown', this.getOption('countdown')); + }, + + /** + * Get the current countdown option value + */ + + getCountdown: function(value) { + return this.getOption('countdown'); } }); @@ -1311,7 +1664,7 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; @@ -1319,43 +1672,10 @@ var FlipClock; /** * The FlipClock Factory class is used to build the clock and manage * all the public methods. - * - * @param object A jQuery object or CSS selector used to fetch - the wrapping DOM nodes - * @param mixed This is the digit used to set the clock. If an - object is passed, 0 will be used. - * @param object An object of properties to override the default */ FlipClock.Factory = FlipClock.Base.extend({ - /** - * The CSS classes - */ - - classes: { - wrapper: 'flip-clock-wrapper' - }, - - /** - * The name of the clock face class in use - */ - - clockFace: 'HourlyCounter', - - /** - * The FlipClock.Face options object - */ - - clockFaceOptions: {}, - - /** - * The name of the default clock face class to use if the defined - * clockFace variable is not a valid FlipClock.Face object - */ - - defaultClockFace: 'HourlyCounter', - /** * The jQuery object */ @@ -1368,6 +1688,40 @@ var FlipClock; face: false, + /** + * The available options for this class + */ + + options: { + + /** + * An object of available CSS classes + */ + + classes: { + wrapper: 'flip-clock-wrapper' + }, + + /** + * The name of the clock face class in use + */ + + clockFace: 'HourlyCounter', + + /** + * The FlipClock.Face options object + */ + + clockFaceOptions: {}, + + /** + * The name of the default clock face class to use if the defined + * clockFace variable is not a valid FlipClock.Face object + */ + + defaultClockFace: 'HourlyCounter' + }, + /** * Constructor * @@ -1387,9 +1741,11 @@ var FlipClock; this.lists = []; - this.$el = $el.addClass(this.classes.wrapper); + this.$el = $el.addClass(this.getOption('classes').wrapper); + + this.loadClockFace(this.getOption('clockFace'), value, this.getOption('clockFaceOptions')); - this.loadClockFace(this.clockFace, value, this.clockFaceOptions); + this.trigger('init'); }, /** @@ -1415,7 +1771,7 @@ var FlipClock; this.face = new FlipClock[name](value, options); } else { - this.face = new FlipClock[this.defaultClockFace+suffix](value, options); + this.face = new FlipClock[this.getOption('defaultClockFace')+suffix](value, options); } this.face.on('create:list', function(list) { @@ -1438,10 +1794,6 @@ var FlipClock; t.callback(t.onReset); }); - this.face.on('init', function() { - t.callback(t.onInit); - }); - this.face.on('interval', function() { t.callback(t.onInterval); }); @@ -1450,9 +1802,35 @@ var FlipClock; this.face.build(); + this.trigger('load:face', this.face); + + this.callback(t.onInit); + return this.face; }, + /** + * Starts the clock face countdown option + * + * @return object + */ + + setCountdown: function(value) { + this.face.setCountdown(value); + + return this; + }, + + /** + * Gets the countdown option from the clock face + * + * @return object + */ + + getCountdown: function() { + return this.face.getCountdown(); + }, + /** * Starts the clock * @@ -1511,18 +1889,52 @@ var FlipClock; return this.face.getValue(); }, + /* + * The onDestroy callback + * + * @return + */ + onDestroy: function() {}, - onCreate: function() {}, - + /* + * The onInit callback + * + * @return + */ + onInit: function() {}, + /* + * The onInterval callback + * + * @return + */ + onInterval: function() {}, + /* + * The onStart callback + * + * @return + */ + onStart: function() {}, + /* + * The onStop callback + * + * @return + */ + onStop: function() {}, + /* + * The onReset callback + * + * @return + */ + onReset: function() {} }); @@ -1538,23 +1950,24 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; /** - * The FlipClock.List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific value. - * - * @param mixed This is the value used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default + * The FlipClock.NumberList class is a specific class to create + * lists that display numbers */ FlipClock.NumericList = FlipClock.List.extend({ + /* + * Get the previous value in the list + * + * @return int + */ + getPrevValue: function() { if(this.value > 0) { return this.value - 1; @@ -1563,6 +1976,12 @@ var FlipClock; return 9; }, + /* + * Get the next value in the list + * + * @return int + */ + getNextValue: function() { if(this.value < 9) { return this.value + 1; @@ -1584,20 +2003,16 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; - - /** - * The FlipClock Time class is used to manage all the time - * calculations. - * - * @param mixed This is the digit used to set the clock. If an - * object is passed, 0 will be used. - * @param object An object of properties to override the default - */ - + + /* + * The FlipClock.Time class is a helper classes to digitize clock + * values and help calculate time. + */ + FlipClock.Time = FlipClock.Base.extend({ /** @@ -1607,10 +2022,17 @@ var FlipClock; time: 0, /** - * The minimum number of digits the clock face must have + * The available options for this class */ - - minimumDigits: 0, + + options: { + + /** + * The minimum number of digits the clock face must have + */ + + minimumDigits: 0 + }, /** * Constructor @@ -1686,7 +2108,7 @@ var FlipClock; var data = []; for(var i in obj) { - value = obj[i].toString(); + var value = obj[i].toString(); if(value.length == 1) { value = '0'+value; @@ -1697,12 +2119,12 @@ var FlipClock; } } - if(data.length > this.minimumDigits) { - this.minimumDigits = data.length; + if(data.length > this.getOption('minimumDigits')) { + this.setOption('minimumDigits', data.length); } - if(this.minimumDigits > data.length) { - for(var x = data.length; x < this.minimumDigits; x++) { + if(this.getOption('minimumDigits') > data.length) { + for(var x = data.length; x < this.getOption('minimumDigits'); x++) { data.unshift('0'); } } @@ -2051,37 +2473,42 @@ var FlipClock; * @copyright 2013 - Objective HTML, LLC * @licesnse http://www.opensource.org/licenses/mit-license.php */ - + (function($) { "use strict"; /** - * The FlipClock.Timer object managers the JS timers - * - * @param object Override the default options + * The FlipClock.Timer object is a helper to manage the JS time intervals */ FlipClock.Timer = FlipClock.Base.extend({ - /** - * The rate of the animation in milliseconds (not currently in use) - */ - - animationRate: 1000, - /** * FlipClock timer count (how many intervals have passed) */ count: 0, - + /** - * Timer interval (1 second by default) + * The available options for this class */ - - interval: 1000, + + options: { + /** + * The rate of the animation in milliseconds (not currently in use) + */ + + animationRate: 1000, + + /** + * Timer interval (1 second by default) + */ + + interval: 1000 + }, + /** * Is the timer running? */ @@ -2106,7 +2533,7 @@ var FlipClock; */ getElapsed: function() { - return this.count * this.interval; + return this.count * this.getOption('interval'); }, /** @@ -2132,7 +2559,7 @@ var FlipClock; this._setInterval(callback); this.trigger('reset'); }, - + /** * This method is starts the timer * @@ -2160,7 +2587,7 @@ var FlipClock; setTimeout(function() { t.callback(callback); - }, this.interval); + }, this.getOption('interval')); t.trigger('stop'); }, @@ -2227,7 +2654,7 @@ var FlipClock; if(t.running) { t._interval(callback); } - }, this.interval); + }, this.getOption('interval')); this.trigger('start'); this._interval(callback); } @@ -2235,28 +2662,52 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function() { + "use strict"; + + /** + * The FlipClock.Translate object will translate string to a specified + * locale. + */ + FlipClock.Translator = FlipClock.Base.extend({ - /** - * The default language - */ - - defaultLanguage: 'english', - - /** - * The language being used to display labels (string) - */ - - language: 'english', - /** * The language object after it has been loaded */ lang: false, + /** + * The available options for this class + */ + + options: { + + /** + * The default language + */ + + defaultLanguage: 'english', + + /** + * The language being used to display labels (string) + */ + + language: 'english' + }, + /* * Constructor * @@ -2266,7 +2717,7 @@ var FlipClock; constructor: function(options) { this.base(options); - this.loadLanguage(this.language); + this.loadLanguage(this.getOption('language')); }, /** @@ -2285,7 +2736,7 @@ var FlipClock; lang = FlipClock.Lang[name]; } else { - lang = FlipClock.Lang[this.defaultLanguage]; + lang = FlipClock.Lang[this.getOption('defaultLanguage')]; } return this.lang = lang; @@ -2321,16 +2772,49 @@ var FlipClock; }); }()); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + (function($) { + "use strict"; + + /** + * The FlipClock.Uuid object generates a uuid instance and return + * the uuid as string. + */ + FlipClock.Uuid = FlipClock.Base.extend({ + /** + * The actual uuid value as a string + */ + value: false, - constructor: function() { - this.value = this.generate(); + /* + * Constructor + * + * @return + */ + + constructor: function(value) { + this.value = value ? value : this.generate(); }, + /* + * Generate a new Uuid + * + * @return string + */ + generate: function() { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { @@ -2341,21 +2825,37 @@ var FlipClock; return uuid; }, + /* + * Does this uuid equal another uuid object + * + * @param object + * @return bool + */ + equals: function(other) { return this.isUuid(other) && value == other; }, + /* + * Tests another value to see if it's a uuid + * + * @param mixed + * @return bool + */ + isUuid: function(value) { var validator = new RegExp("^[a-z0-9]{32}$", "i"); return value && (value instanceof Uuid || validator.test(value.toString())); }, - toString: function() { - return this.value; - }, + /* + * Outputs the object instance as a string + * + * @return string + */ - toJSON: function() { + toString: function() { return this.value; } diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index c775edcd..c297e093 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-10 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},$el:!1,items:[],lastValue:0,value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.lastValue=this.value,"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.lastValue&&(this._beforeListItem.$el.removeClass(this.classes.before),this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.classes.active,this.value),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.classes.play)},removePlayClass:function(){this.$el.removeClass(this.classes.play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,b);return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                            ');return this._beforeListItem=this.createListItem(this.classes.before,this.getPrevValue()),this._afterListItem=this.createListItem(this.classes.active,this.value),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){FlipClock.ListItem=FlipClock.Base.extend({css:null,value:null,classes:{up:"up",down:"down"},$el:!1,constructor:function(b,c,d){this.base(d),this.css=b,this.value=c,this.$el=a(['
                          • ','','
                            ','
                            ','
                            '+c+"
                            ","
                            ",'
                            ','
                            ','
                            '+c+"
                            ","
                            ","
                            ","
                          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({capitalLetters:!0,constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.capitalLetters?90:122},getMinCharCode:function(){return this.capitalLetters?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){FlipClock.Divider=FlipClock.Base.extend({label:!1,css:!1,excludeDots:!1,translator:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},$el:!1,constructor:function(b,c){this.base(c),this.label=this.t(b);var d=this.excludeDots?"":['',''].join("");this.$el=a(['',''+(this.label?this.label:"")+"",d,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0))},off:function(){this._preventFire=!0},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){this._lastResponse=a},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){this._fireOnce=a}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",dividers:[],lang:!1,language:"english",lists:[],minimumDigits:0,originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.defaultLanguage,language:this.language}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}}),this.trigger("create")},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.autoStart&&this.start()},init:function(){this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits}),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider(a,{css:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),d},createList:function(a){var b=this.getListObject(a);return(this.autoPlay||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(){this.value=this.originalValue,this.flip(),this.trigger("reset")},start:function(){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"))},stop:function(){var a=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){a.trigger("stop")}))},autoIncrement:function(){this.countdown?this.decrement():this.increment()},increment:function(){this.value++,this.time&&this.time.addSecond()},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond())},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.autoPlay||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip()},getTime:function(){return this.time},setValue:function(a){this.value=a,this.time&&(this.time=new FlipClock.Time(this.value,{minimumDigits:this.minimumDigits})),this.flip()},getValue:function(){return this.value},setCountdown:function(a){this.countdown=a?!0:!1,this.timer.running&&(this.stop(),this.start())}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter",$el:!1,face:!1,constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.classes.wrapper),this.loadClockFace(this.clockFace,b,this.clockFaceOptions)},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new FlipClock[this.defaultClockFace+e](b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("init",function(){d.callback(d.onInit)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.face},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onCreate:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,minimumDigits:0,constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.minimumDigits&&(this.minimumDigits=b.length),this.minimumDigits>b.length)for(var d=b.length;d12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({animationRate:1e3,count:0,interval:1e3,running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.interval),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.interval),this.trigger("start"),this._interval(a)}})}(jQuery),function(){FlipClock.Translator=FlipClock.Base.extend({defaultLanguage:"english",language:"english",lang:!1,constructor:function(a){this.base(a),this.loadLanguage(this.language)},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(){this.value=this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value},toJSON:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-19 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                            • ','','
                              ','
                              ','
                              '+b+"
                              ","
                              ",'
                              ','
                              ','
                              '+b+"
                              ","
                              ","
                              ","
                            • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file From 17697c0891bd8e7908db15c613fee96f99b44036 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 19 Jan 2015 01:57:31 -0500 Subject: [PATCH 045/129] - (Feature) Added Chinese language file --- compiled/flipclock.js | 255 +++++++++++++++++++++++++++++++++ compiled/flipclock.min.js | 2 +- src/flipclock/js/lang/zh-cn.js | 27 ++++ 3 files changed, 283 insertions(+), 1 deletion(-) create mode 100644 src/flipclock/js/lang/zh-cn.js diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 73a11d62..b38fe736 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -2862,6 +2862,233 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock.List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. + */ + + FlipClock.List = FlipClock.Base.extend({ + + /** + * The jQuery object + */ + + $el: false, + + /** + * The items in the list + */ + + items: [], + + /** + * The available options for this class + */ + + options: { + + /** + * The CSS classes + */ + + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + flip: 'flip', + play: 'play' + }, + + /** + * The last value selected in the list + */ + + lastValue: 0 + }, + + /** + * The selected value in the list + */ + + value: 0, + + /** + * Constructor + * + * @param object A FlipClock.Factory object + * @param int An string or integer use to select the correct value + * @param object An object to override the default properties + */ + + constructor: function(value, options) { + this.base(options); + + this.value = value; + + var t = this; + + this.createList(); + + this.trigger('init'); + }, + + /** + * Select the value in the list + * + * @param int A value 0-9 + */ + + select: function(value) { + var _afterListItem = this._afterListItem; + + this.setOption('lastValue', this.value); + + if(typeof value === "undefined") { + value = this.value; + } + else { + this.value = value; + } + + if(this.value != this.getOption('lastValue')) { + this._beforeListItem.$el.removeClass(this.getOption('classes').before); + + this.$el.find('.'+this.getOption('classes').active) + .removeClass(this.getOption('classes').active) + .addClass(this.getOption('classes').before); + + this.items.splice(0, 1); + + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); + + this._beforeListItem.$el.remove(); + this._beforeListItem = _afterListItem; + + this.trigger('select', this.value); + } + }, + + /* + * Add the play class to the list + * + * @return + */ + + addPlayClass: function() { + this.$el.addClass(this.getOption('classes').play); + }, + + /* + * Remove the play class to the list + * + * @return + */ + + removePlayClass: function() { + this.$el.removeClass(this.getOption('classes').play); + }, + + /** + * Creates the list item HTML and returns as a string + */ + + createListItem: function(value, css) { + var item = new FlipClock.ListItem(value, { + className: css + }); + + this.items.push(item); + + this.$el.append(item.$el); + + this.trigger('create:item', item); + + return item; + }, + + /** + * Create the list of values and appends it to the DOM object + */ + + createList: function() { + var $el = this.$el = $('
                                '); + + this._beforeListItem = this.createListItem(this.getPrevValue(), this.getOption('classes').before); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); + + $el.append(this._beforeListItem.el); + $el.append(this._afterListItem.el); + + this.trigger('create:list', $el); + + return $el; + } + + }); + +}(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * Capitalize the first letter in a string + * + * @return string + */ + + String.prototype.ucfirst = function() { + return this.substr(0, 1).toUpperCase() + this.substr(1); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.FlipClock = function(digit, options) { + return new FlipClock($(this), digit, options); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.flipClock = function(digit, options) { + return $.fn.FlipClock(digit, options); + }; + +}(jQuery)); + (function($) { /** @@ -3781,3 +4008,31 @@ var FlipClock; FlipClock.Lang['swedish'] = FlipClock.Lang.Swedish; }(jQuery)); + +(function($) { + + /** + * FlipClock Chinese Language Pack + * + * This class will used to translate tokens into the Chinese language. + * + */ + + FlipClock.Lang.Chinese = { + + 'years' : '年', + 'months' : '月', + 'days' : '日', + 'hours' : '时', + 'minutes' : '分', + 'seconds' : '秒' + + }; + + /* Create various aliases for convenience */ + + FlipClock.Lang['zh'] = FlipClock.Lang.Chinese; + FlipClock.Lang['zh-cn'] = FlipClock.Lang.Chinese; + FlipClock.Lang['chinese'] = FlipClock.Lang.Chinese; + +}(jQuery)); \ No newline at end of file diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index c297e093..ab25bcf6 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-19 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                • ','','
                                  ','
                                  ','
                                  '+b+"
                                  ","
                                  ",'
                                  ','
                                  ','
                                  '+b+"
                                  ","
                                  ","
                                  ","
                                • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                    ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                  • ','','
                                    ','
                                    ','
                                    '+b+"
                                    ","
                                    ",'
                                    ','
                                    ','
                                    '+b+"
                                    ","
                                    ","
                                    ","
                                  • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                      ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/src/flipclock/js/lang/zh-cn.js b/src/flipclock/js/lang/zh-cn.js new file mode 100644 index 00000000..6b94fe47 --- /dev/null +++ b/src/flipclock/js/lang/zh-cn.js @@ -0,0 +1,27 @@ +(function($) { + + /** + * FlipClock Chinese Language Pack + * + * This class will used to translate tokens into the Chinese language. + * + */ + + FlipClock.Lang.Chinese = { + + 'years' : '年', + 'months' : '月', + 'days' : '日', + 'hours' : '时', + 'minutes' : '分', + 'seconds' : '秒' + + }; + + /* Create various aliases for convenience */ + + FlipClock.Lang['zh'] = FlipClock.Lang.Chinese; + FlipClock.Lang['zh-cn'] = FlipClock.Lang.Chinese; + FlipClock.Lang['chinese'] = FlipClock.Lang.Chinese; + +}(jQuery)); \ No newline at end of file From f1f7ecd7b7c7588621b6e1dc280589f464020c37 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 15:49:50 -0500 Subject: [PATCH 046/129] - (Bug Fix) Fixed an issue where includeSeconds wasn't working for hourly and minute counter faces --- compiled/flipclock.js | 96 ++++++++++++++------- compiled/flipclock.min.js | 4 +- examples/hourly-counter.html | 5 +- src/flipclock/js/faces/HourlyCounterFace.js | 33 +++++-- src/flipclock/js/faces/MinuteCounterFace.js | 21 +++-- src/flipclock/js/libs/Time.js | 42 +++++---- 6 files changed, 136 insertions(+), 65 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index b38fe736..68b2ef9c 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -2186,34 +2186,39 @@ var FlipClock; /** * Gets an hourly breakdown * + * @param mixed includeSeconds * @return object Returns a digitized object */ - getHourCounter: function() { - var obj = this.digitize([ + getHourCounter: function(includeSeconds) { + var data = [ this.getHours(), - this.getMinutes(true), - this.getSeconds(true) - ]); - - return obj; + this.getMinutes(true) + ]; + + if(includeSeconds !== false) { + data.push(this.getSeconds(true)); + } + + return this.digitize(data); }, /** * Gets an hourly breakdown * + * @param mixed includeSeconds * @return object Returns a digitized object */ - getHourly: function() { - return this.getHourCounter(); + getHourly: function(includeSeconds) { + return this.getHourCounter(includeSeconds); }, /** * Gets number of hours * - * @param bool Should perform a modulus? If not sent, then no. - * @return int Retuns a floored integer + * @param bool mod + * @return int */ getHours: function(mod) { @@ -2274,13 +2279,16 @@ var FlipClock; * Gets a minute breakdown */ - getMinuteCounter: function() { - var obj = this.digitize([ - this.getMinutes(), - this.getSeconds(true) - ]); + getMinuteCounter: function(includeSeconds) { + var data = [ + this.getMinutes() + ]; + + if(includeSeconds !== false) { + data.push(this.getSeconds(true)); + } - return obj; + return this.digitize(data); }, /** @@ -3452,23 +3460,39 @@ var FlipClock; FlipClock.HourlyCounterFace = FlipClock.Face.extend({ + /** + * Constructor + * + * @param mixed + * @param mixed + */ + + constructor: function(value, options) { + this.base(value, options); + + if(this.getOption('includeSeconds') === null) { + this.setOption('includeSeconds', true); + } + }, + /** * Build the clock face */ - build: function(excludeHours, time) { - var time = time ? time : this.time.getHourCounter(); + build: function(time) { + var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { this.createList(time[i]); } - this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); - this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4].$el); - - if(!excludeHours) { - this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); + if(this.getOption('includeSeconds') === true) { + offset = 2; + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - offset].$el); } + + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 2 - offset].$el); + this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); this.base(); }, @@ -3479,11 +3503,10 @@ var FlipClock; flip: function(time) { if(!time) { - time = this.time.getHourCounter(); + time = this.time.getHourCounter(this.getOption('includeSeconds')); } this.base(time); - this.autoIncrement(); }, /** @@ -3517,17 +3540,28 @@ var FlipClock; */ build: function() { - this.base(true, this.time.getMinuteCounter()); + var time = this.time.getMinuteCounter(this.getOption('includeSeconds')); + + for(var i in time) { + this.createList(time[i]); + } + + if(this.getOption('includeSeconds')) { + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); + } + + this.createDivider('Minutes').$el.insertBefore(this.lists[0].$el); + + return FlipClock.Face.prototype.build.call(this); }, - + /** * Flip the clock face - * - * @return */ flip: function() { - this.base(this.time.getMinuteCounter()); + this.base(this.time.getMinuteCounter(this.getOption('includeSeconds'))); + this.autoIncrement(); } }); diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index ab25bcf6..38a2fd3d 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-19 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                        ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                      • ','','
                                        ','
                                        ','
                                        '+b+"
                                        ","
                                        ",'
                                        ','
                                        ','
                                        '+b+"
                                        ","
                                        ","
                                        ","
                                      • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                          ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({build:function(a,b){var b=b?b:this.time.getHourCounter();for(var c in b)this.createList(b[c]);this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4].$el),a||this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter()),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){this.base(!0,this.time.getMinuteCounter())},flip:function(){this.base(this.time.getMinuteCounter())}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-20 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                            ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                          • ','','
                                            ','
                                            ','
                                            '+b+"
                                            ","
                                            ",'
                                            ','
                                            ','
                                            '+b+"
                                            ","
                                            ","
                                            ","
                                          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds"))),this.autoIncrement()}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index 853baea3..e840998f 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -16,7 +16,10 @@ $(document).ready(function() { clock = $('.clock').FlipClock({ - clockFace: 'HourlyCounter' + clockFace: 'HourlyCounter', + clockFaceOptions: { + includeSeconds: false + } }); }); diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index df40b546..d73d9771 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -11,23 +11,39 @@ FlipClock.HourlyCounterFace = FlipClock.Face.extend({ + /** + * Constructor + * + * @param mixed + * @param mixed + */ + + constructor: function(value, options) { + this.base(value, options); + + if(this.getOption('includeSeconds') === null) { + this.setOption('includeSeconds', true); + } + }, + /** * Build the clock face */ - build: function(excludeHours, time) { - var time = time ? time : this.time.getHourCounter(); + build: function(time) { + var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { this.createList(time[i]); } - this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); - this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 4].$el); - - if(!excludeHours) { - this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); + if(this.getOption('includeSeconds') === true) { + offset = 2; + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - offset].$el); } + + this.createDivider('Minutes').$el.insertBefore(this.lists[this.lists.length - 2 - offset].$el); + this.createDivider('Hours', true).$el.insertBefore(this.lists[0].$el); this.base(); }, @@ -38,11 +54,10 @@ flip: function(time) { if(!time) { - time = this.time.getHourCounter(); + time = this.time.getHourCounter(this.getOption('includeSeconds')); } this.base(time); - this.autoIncrement(); }, /** diff --git a/src/flipclock/js/faces/MinuteCounterFace.js b/src/flipclock/js/faces/MinuteCounterFace.js index 0fe50969..8a92406f 100644 --- a/src/flipclock/js/faces/MinuteCounterFace.js +++ b/src/flipclock/js/faces/MinuteCounterFace.js @@ -17,17 +17,28 @@ */ build: function() { - this.base(true, this.time.getMinuteCounter()); + var time = this.time.getMinuteCounter(this.getOption('includeSeconds')); + + for(var i in time) { + this.createList(time[i]); + } + + if(this.getOption('includeSeconds')) { + this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); + } + + this.createDivider('Minutes').$el.insertBefore(this.lists[0].$el); + + return FlipClock.Face.prototype.build.call(this); }, - + /** * Flip the clock face - * - * @return */ flip: function() { - this.base(this.time.getMinuteCounter()); + this.base(this.time.getMinuteCounter(this.getOption('includeSeconds'))); + this.autoIncrement(); } }); diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index a7f3d10f..ddb4630b 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -190,34 +190,39 @@ /** * Gets an hourly breakdown * + * @param mixed includeSeconds * @return object Returns a digitized object */ - getHourCounter: function() { - var obj = this.digitize([ + getHourCounter: function(includeSeconds) { + var data = [ this.getHours(), - this.getMinutes(true), - this.getSeconds(true) - ]); - - return obj; + this.getMinutes(true) + ]; + + if(includeSeconds !== false) { + data.push(this.getSeconds(true)); + } + + return this.digitize(data); }, /** * Gets an hourly breakdown * + * @param mixed includeSeconds * @return object Returns a digitized object */ - getHourly: function() { - return this.getHourCounter(); + getHourly: function(includeSeconds) { + return this.getHourCounter(includeSeconds); }, /** * Gets number of hours * - * @param bool Should perform a modulus? If not sent, then no. - * @return int Retuns a floored integer + * @param bool mod + * @return int */ getHours: function(mod) { @@ -278,13 +283,16 @@ * Gets a minute breakdown */ - getMinuteCounter: function() { - var obj = this.digitize([ - this.getMinutes(), - this.getSeconds(true) - ]); + getMinuteCounter: function(includeSeconds) { + var data = [ + this.getMinutes() + ]; - return obj; + if(includeSeconds !== false) { + data.push(this.getSeconds(true)); + } + + return this.digitize(data); }, /** From feefccc67211ab4606ccc014e36d15f646deec60 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 15:56:53 -0500 Subject: [PATCH 047/129] - (Bug Fix) Fixed an issue with the face.setValue method not setting the proper time object correctly --- compiled/flipclock.js | 9 ++++++--- examples/hourly-counter.html | 2 +- src/flipclock/js/faces/HourlyCounterFace.js | 5 ++++- src/flipclock/js/libs/Face.js | 2 +- src/flipclock/js/libs/Time.js | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 68b2ef9c..abc18515 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -1610,7 +1610,7 @@ var FlipClock; this.value = value; if(this.time) { - this.setTimeObject(this.time); + this.setTimeObject(new FlipClock.Time(value)); } this.flip(); @@ -2197,7 +2197,7 @@ var FlipClock; ]; if(includeSeconds !== false) { - data.push(this.getSeconds(true)); + //data.push(this.getSeconds(true)); } return this.digitize(data); @@ -3504,9 +3504,12 @@ var FlipClock; flip: function(time) { if(!time) { time = this.time.getHourCounter(this.getOption('includeSeconds')); - } + } + + console.log(time); this.base(time); + this.autoIncrement(); }, /** diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index e840998f..066aa622 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,7 +15,7 @@ $(document).ready(function() { - clock = $('.clock').FlipClock({ + clock = $('.clock').FlipClock(1000, { clockFace: 'HourlyCounter', clockFaceOptions: { includeSeconds: false diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index d73d9771..a3a325c5 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -55,9 +55,12 @@ flip: function(time) { if(!time) { time = this.time.getHourCounter(this.getOption('includeSeconds')); - } + } + + console.log(time); this.base(time); + this.autoIncrement(); }, /** diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 22d1f024..1c509673 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -434,7 +434,7 @@ this.value = value; if(this.time) { - this.setTimeObject(this.time); + this.setTimeObject(new FlipClock.Time(value)); } this.flip(); diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index ddb4630b..8c31f409 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -201,7 +201,7 @@ ]; if(includeSeconds !== false) { - data.push(this.getSeconds(true)); + //data.push(this.getSeconds(true)); } return this.digitize(data); From bdf74e87f11977e02f477b172e20cc0bf28572a5 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 15:58:22 -0500 Subject: [PATCH 048/129] More updates --- compiled/flipclock.js | 5 +---- compiled/flipclock.min.js | 2 +- examples/hourly-counter.html | 2 +- src/flipclock/js/faces/HourlyCounterFace.js | 2 -- src/flipclock/js/faces/MinuteCounterFace.js | 3 +-- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index abc18515..24fa15d1 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -3506,8 +3506,6 @@ var FlipClock; time = this.time.getHourCounter(this.getOption('includeSeconds')); } - console.log(time); - this.base(time); this.autoIncrement(); }, @@ -3552,7 +3550,7 @@ var FlipClock; if(this.getOption('includeSeconds')) { this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); } - + this.createDivider('Minutes').$el.insertBefore(this.lists[0].$el); return FlipClock.Face.prototype.build.call(this); @@ -3564,7 +3562,6 @@ var FlipClock; flip: function() { this.base(this.time.getMinuteCounter(this.getOption('includeSeconds'))); - this.autoIncrement(); } }); diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 38a2fd3d..f4587197 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                              • ','','
                                                ','
                                                ','
                                                '+b+"
                                                ","
                                                ",'
                                                ','
                                                ','
                                                '+b+"
                                                ","
                                                ","
                                                ","
                                              • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(this.time),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds"))),this.autoIncrement()}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                    ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                  • ','','
                                                    ','
                                                    ','
                                                    '+b+"
                                                    ","
                                                    ",'
                                                    ','
                                                    ','
                                                    '+b+"
                                                    ","
                                                    ","
                                                    ","
                                                  • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                      ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index 066aa622..b6f848a0 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -16,7 +16,7 @@ $(document).ready(function() { clock = $('.clock').FlipClock(1000, { - clockFace: 'HourlyCounter', + clockFace: 'MinuteCounter', clockFaceOptions: { includeSeconds: false } diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index a3a325c5..0a791aed 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -57,8 +57,6 @@ time = this.time.getHourCounter(this.getOption('includeSeconds')); } - console.log(time); - this.base(time); this.autoIncrement(); }, diff --git a/src/flipclock/js/faces/MinuteCounterFace.js b/src/flipclock/js/faces/MinuteCounterFace.js index 8a92406f..b77f4b84 100644 --- a/src/flipclock/js/faces/MinuteCounterFace.js +++ b/src/flipclock/js/faces/MinuteCounterFace.js @@ -26,7 +26,7 @@ if(this.getOption('includeSeconds')) { this.createDivider('Seconds').$el.insertBefore(this.lists[this.lists.length - 2].$el); } - + this.createDivider('Minutes').$el.insertBefore(this.lists[0].$el); return FlipClock.Face.prototype.build.call(this); @@ -38,7 +38,6 @@ flip: function() { this.base(this.time.getMinuteCounter(this.getOption('includeSeconds'))); - this.autoIncrement(); } }); From 6ffc6bb4608b7ad90e28bfdc4d354915ed7d5be9 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 15:59:11 -0500 Subject: [PATCH 049/129] Updates --- examples/hourly-counter.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index b6f848a0..066aa622 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -16,7 +16,7 @@ $(document).ready(function() { clock = $('.clock').FlipClock(1000, { - clockFace: 'MinuteCounter', + clockFace: 'HourlyCounter', clockFaceOptions: { includeSeconds: false } From a5dcc44c3c0a33ce613c421924554849646271de Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:01:54 -0500 Subject: [PATCH 050/129] Recompiled source --- compiled/flipclock.js | 4 +++- compiled/flipclock.min.js | 2 +- examples/hourly-counter.html | 4 ++-- src/flipclock/js/faces/HourlyCounterFace.js | 2 ++ src/flipclock/js/libs/Time.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 24fa15d1..fe959988 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -2197,7 +2197,7 @@ var FlipClock; ]; if(includeSeconds !== false) { - //data.push(this.getSeconds(true)); + data.push(this.getSeconds(true)); } return this.digitize(data); @@ -3480,6 +3480,8 @@ var FlipClock; */ build: function(time) { + console.log(this.time.getHourCounter(this.getOption('includeSeconds'))); + var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index f4587197..39ff3895 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                        ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                      • ','','
                                                        ','
                                                        ','
                                                        '+b+"
                                                        ","
                                                        ",'
                                                        ','
                                                        ','
                                                        '+b+"
                                                        ","
                                                        ","
                                                        ","
                                                      • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                          ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                            ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                          • ','','
                                                            ','
                                                            ','
                                                            '+b+"
                                                            ","
                                                            ",'
                                                            ','
                                                            ','
                                                            '+b+"
                                                            ","
                                                            ","
                                                            ","
                                                          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){console.log(this.time.getHourCounter(this.getOption("includeSeconds")));var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index 066aa622..45691ede 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,10 +15,10 @@ $(document).ready(function() { - clock = $('.clock').FlipClock(1000, { + clock = $('.clock').FlipClock({ clockFace: 'HourlyCounter', clockFaceOptions: { - includeSeconds: false + includeSeconds: true } }); }); diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index 0a791aed..7ca446b8 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -31,6 +31,8 @@ */ build: function(time) { + console.log(this.time.getHourCounter(this.getOption('includeSeconds'))); + var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index 8c31f409..ddb4630b 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -201,7 +201,7 @@ ]; if(includeSeconds !== false) { - //data.push(this.getSeconds(true)); + data.push(this.getSeconds(true)); } return this.digitize(data); From 9afb49e6111603e4ba06156a8ab04b6974dc9bcc Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:04:20 -0500 Subject: [PATCH 051/129] - (Bug Fix) Fixed an issue with the autoPlay class not working correctly. The flip animation would still appear once the clock flipped. --- compiled/flipclock.js | 7 ++----- compiled/flipclock.min.js | 2 +- examples/hourly-counter.html | 3 ++- src/flipclock/js/faces/HourlyCounterFace.js | 2 -- src/flipclock/js/libs/Face.js | 5 ++--- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index fe959988..56e3c1be 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -1428,7 +1428,7 @@ var FlipClock; createList: function(value, options) { var list = this.getListObject(value); - + if(this.getOption('autoPlay') || this.timer.running) { list.addPlayClass(); } @@ -1559,8 +1559,7 @@ var FlipClock; for(var i in time) { if(this.lists[i]) { this.lists[i].select(time[i]); - - if(this.getOption('autoPlay') || this.timer.running) { + if(this.getOption('autoPlay') && this.timer.running) { this.lists[i].addPlayClass(); } } @@ -3480,8 +3479,6 @@ var FlipClock; */ build: function(time) { - console.log(this.time.getHourCounter(this.getOption('includeSeconds'))); - var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 39ff3895..3bbac5b9 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                              • ','','
                                                                ','
                                                                ','
                                                                '+b+"
                                                                ","
                                                                ",'
                                                                ','
                                                                ','
                                                                '+b+"
                                                                ","
                                                                ","
                                                                ","
                                                              • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),(this.getOption("autoPlay")||this.timer.running)&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){console.log(this.time.getHourCounter(this.getOption("includeSeconds")));var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                    ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                  • ','','
                                                                    ','
                                                                    ','
                                                                    '+b+"
                                                                    ","
                                                                    ",'
                                                                    ','
                                                                    ','
                                                                    '+b+"
                                                                    ","
                                                                    ","
                                                                    ","
                                                                  • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                      ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index 45691ede..d868de4a 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,9 +15,10 @@ $(document).ready(function() { - clock = $('.clock').FlipClock({ + clock = $('.clock').FlipClock(1000, { clockFace: 'HourlyCounter', clockFaceOptions: { + autoPlay: false, includeSeconds: true } }); diff --git a/src/flipclock/js/faces/HourlyCounterFace.js b/src/flipclock/js/faces/HourlyCounterFace.js index 7ca446b8..0a791aed 100644 --- a/src/flipclock/js/faces/HourlyCounterFace.js +++ b/src/flipclock/js/faces/HourlyCounterFace.js @@ -31,8 +31,6 @@ */ build: function(time) { - console.log(this.time.getHourCounter(this.getOption('includeSeconds'))); - var offset = 0, time = time ? time : this.time.getHourCounter(this.getOption('includeSeconds')); for(var i in time) { diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index 1c509673..b27eb590 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -252,7 +252,7 @@ createList: function(value, options) { var list = this.getListObject(value); - + if(this.getOption('autoPlay') || this.timer.running) { list.addPlayClass(); } @@ -383,8 +383,7 @@ for(var i in time) { if(this.lists[i]) { this.lists[i].select(time[i]); - - if(this.getOption('autoPlay') || this.timer.running) { + if(this.getOption('autoPlay') && this.timer.running) { this.lists[i].addPlayClass(); } } From 88a4d87a7f6b7e35a97df032299af5faf390d481 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:04:37 -0500 Subject: [PATCH 052/129] Update --- examples/hourly-counter.html | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index d868de4a..d8c6030a 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -18,7 +18,6 @@ clock = $('.clock').FlipClock(1000, { clockFace: 'HourlyCounter', clockFaceOptions: { - autoPlay: false, includeSeconds: true } }); From efd29bc5803d64e30fcf46cccd74ad05ccde2ed5 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:06:33 -0500 Subject: [PATCH 053/129] Updated hourly example --- examples/hourly-counter.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index d8c6030a..b76f7305 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,10 +15,10 @@ $(document).ready(function() { - clock = $('.clock').FlipClock(1000, { + clock = $('.clock').FlipClock(1018, { clockFace: 'HourlyCounter', clockFaceOptions: { - includeSeconds: true + includeSeconds: false } }); }); From c6ddae5cab62a40d7851e856f694a1aa721d39ab Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:27:06 -0500 Subject: [PATCH 054/129] - (Bug Fix) Fixed an issue with properties not getting set if the option was trying to override a function --- compiled/flipclock.js | 4 +++- compiled/flipclock.min.js | 2 +- examples/hourly-counter.html | 21 +++++++++++++++------ src/flipclock/js/libs/Base.js | 2 +- src/flipclock/js/libs/Factory.js | 2 ++ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 56e3c1be..84826a5d 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -310,7 +310,7 @@ var FlipClock; */ setOption: function(index, value) { - if(this.hasOwnProperty(index)) { + if(this.hasOwnProperty(index) || typeof this[index] === "function") { this[index] = value; } else { @@ -1738,6 +1738,8 @@ var FlipClock; this.base(options); + console.log(this.options); + this.lists = []; this.$el = $el.addClass(this.getOption('classes').wrapper); diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 3bbac5b9..0ebeefe7 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                        ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                      • ','','
                                                                        ','
                                                                        ','
                                                                        '+b+"
                                                                        ","
                                                                        ",'
                                                                        ','
                                                                        ','
                                                                        '+b+"
                                                                        ","
                                                                        ","
                                                                        ","
                                                                      • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                          ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                            ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                          • ','','
                                                                            ','
                                                                            ','
                                                                            '+b+"
                                                                            ","
                                                                            ",'
                                                                            ','
                                                                            ','
                                                                            '+b+"
                                                                            ","
                                                                            ","
                                                                            ","
                                                                          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),console.log(this.options),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index b76f7305..9e647175 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,12 +15,21 @@ $(document).ready(function() { - clock = $('.clock').FlipClock(1018, { - clockFace: 'HourlyCounter', - clockFaceOptions: { - includeSeconds: false - } - }); + clock = $('.clock').FlipClock(10, { + clockFace: 'HourlyCounter', + clockFaceOptions: { + countdown: true, + includeSeconds: true + }, + onStop: function() { + console.log('Time finished (callback)'); + } + }); + + clock.face.on('stop', function() { + console.log('Time finished (event)'); + }); + }); diff --git a/src/flipclock/js/libs/Base.js b/src/flipclock/js/libs/Base.js index 97a8d106..6eb5ab72 100644 --- a/src/flipclock/js/libs/Base.js +++ b/src/flipclock/js/libs/Base.js @@ -164,7 +164,7 @@ var FlipClock; */ setOption: function(index, value) { - if(this.hasOwnProperty(index)) { + if(this.hasOwnProperty(index) || typeof this[index] === "function") { this[index] = value; } else { diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index 4b16f2f0..0a7a53f3 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -82,6 +82,8 @@ this.base(options); + console.log(this.options); + this.lists = []; this.$el = $el.addClass(this.getOption('classes').wrapper); From 79b7aff84602e8f6c0aa5175ecc04874683c7998 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 16:29:32 -0500 Subject: [PATCH 055/129] Updates example --- examples/hourly-counter.html | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index 9e647175..b76f7305 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -15,21 +15,12 @@ $(document).ready(function() { - clock = $('.clock').FlipClock(10, { - clockFace: 'HourlyCounter', - clockFaceOptions: { - countdown: true, - includeSeconds: true - }, - onStop: function() { - console.log('Time finished (callback)'); - } - }); - - clock.face.on('stop', function() { - console.log('Time finished (event)'); - }); - + clock = $('.clock').FlipClock(1018, { + clockFace: 'HourlyCounter', + clockFaceOptions: { + includeSeconds: false + } + }); }); From f80cd52f24460bc72bfda942b110811e4334a324 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Tue, 20 Jan 2015 17:15:04 -0500 Subject: [PATCH 056/129] removed console.log --- compiled/flipclock.js | 2 -- compiled/flipclock.min.js | 2 +- src/flipclock/js/libs/Factory.js | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 84826a5d..5eacb730 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -1738,8 +1738,6 @@ var FlipClock; this.base(options); - console.log(this.options); - this.lists = []; this.$el = $el.addClass(this.getOption('classes').wrapper); diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 0ebeefe7..159d7dee 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                              • ','','
                                                                                ','
                                                                                ','
                                                                                '+b+"
                                                                                ","
                                                                                ",'
                                                                                ','
                                                                                ','
                                                                                '+b+"
                                                                                ","
                                                                                ","
                                                                                ","
                                                                              • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),console.log(this.options),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                    ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                  • ','','
                                                                                    ','
                                                                                    ','
                                                                                    '+b+"
                                                                                    ","
                                                                                    ",'
                                                                                    ','
                                                                                    ','
                                                                                    '+b+"
                                                                                    ","
                                                                                    ","
                                                                                    ","
                                                                                  • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                      ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index 0a7a53f3..4b16f2f0 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -82,8 +82,6 @@ this.base(options); - console.log(this.options); - this.lists = []; this.$el = $el.addClass(this.getOption('classes').wrapper); From ca31f3195df06e10d0294a6ecfb2853eaf88819f Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:16:33 -0500 Subject: [PATCH 057/129] Added docs --- docs/Base.md | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 docs/Base.md diff --git a/docs/Base.md b/docs/Base.md new file mode 100644 index 00000000..799ba0c2 --- /dev/null +++ b/docs/Base.md @@ -0,0 +1,109 @@ +#Index + +**Functions** + +* [constructor(options)](#constructor) +* [callback(method)](#callback) +* [log(str)](#log) +* [getOption(index)](#getOption) +* [getOptions()](#getOptions) +* [setOption(index, value)](#setOption) +* [setOptions(options)](#setOptions) + +**Members** + +* [buildDate](#buildDate) +* [version](#version) +* [options](#options) +* [_events](#_events) +* [_uid](#_uid) + + +#constructor(options) +Sets the default options + +**Params** + +- options `mixed` - The default options + + +#callback(method) +Delegates the callback to the defined method + +**Params** + +- method `function` - The callback function + +**Returns**: - object + +#log(str) +Log a string into the console if it exists + +**Params** + +- str `string` - The string to log + +**Returns**: - mixed + +#getOption(index) +Get an single option value. Returns false if option does not exist + +**Params** + +- index `string` - The name of the option + +**Returns**: - mixed + +#getOptions() +Get all options + +**Returns**: - bool + +#setOption(index, value) +Set a single option value + +**Params** + +- index `string` - The name of the option +- value `string` - The value of the option + +**Returns**: - object + +#setOptions(options) +Set a multiple options by passing a JSON object + +**Params** + +- options `object` - An object of options to set + +**Returns**: - object + +#buildDate +**Params** + +- buildDate `string` - The last official build date + + +#version +**Params** + +- version `string` - The current version + + +#options +**Params** + +- options `object` - The available options for this class + + +#_events +**Params** + +- _events `object` - The bound events to this object + + +#_uid +**Params** + +- _uid `object` - The Flipclock.Uuid object instance + From 2af28f41a68ba258f1dc357b195ff7b6d77d39be Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:20:29 -0500 Subject: [PATCH 058/129] Updates --- docs/Divider.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/Divider.md diff --git a/docs/Divider.md b/docs/Divider.md new file mode 100644 index 00000000..43d700a0 --- /dev/null +++ b/docs/Divider.md @@ -0,0 +1,24 @@ +#Index + +**Members** + +* [$el](#$el) +* [options](#options) + * [options.className](#options.className) + * [options.classes](#options.classes) + * [options.excludeDots](#options.excludeDots) + * [options.label](#options.label) +* [translator](#translator) + + +#$el +The jQuery object + + +#options +The available options for this class + + +#translator +The FlipClock.Translator instance + From e96cf7404768261084a457b8005cdb08e60d7ba8 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:23:33 -0500 Subject: [PATCH 059/129] Updated code comments --- Gruntfile.js | 9 + compiled/flipclock.js | 198 +++++++++++++++++----- compiled/flipclock.min.js | 4 +- docs/Divider.md | 4 - package.json | 43 +++-- src/flipclock/js/libs/Base.js | 61 ++++--- src/flipclock/js/libs/Divider.js | 31 ++-- src/flipclock/js/libs/EnglishAlphaList.js | 1 - src/flipclock/js/libs/Event.js | 4 +- src/flipclock/js/libs/Face.js | 140 +++++++++++---- src/flipclock/js/libs/Factory.js | 28 ++- src/flipclock/js/libs/ListItem.js | 1 - src/flipclock/js/libs/Time.js | 4 +- src/flipclock/js/libs/Timer.js | 63 ++++--- src/flipclock/js/libs/Translator.js | 5 +- src/flipclock/js/libs/Uuid.js | 2 +- src/flipclock/js/libs/list.js | 19 ++- 17 files changed, 421 insertions(+), 196 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d16ed54a..deccaa67 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -49,11 +49,20 @@ module.exports = function(grunt) { tasks: ['concat'], } }, + jsdoc2md : { + separateOutputFilePerInput: { + files: [ + { src: "src/flipclock/js/libs/Base.js", dest: "docs/Base.md" }, + { src: "src/flipclock/js/libs/Divider.js", dest: "docs/Divider.md" }, + ] + }, + } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-jsdoc-to-markdown'); // Default task(s). grunt.registerTask('default', ['concat', 'uglify', 'watch']); diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 5eacb730..4506ccbc 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -1358,9 +1358,9 @@ var FlipClock; /* * Attach the FlipClock.List to the DOM of the clock face * - * @param object A jQuery object - * @param object A FlipClock.List object - * @return + * @param object $el + * @param object list + * @return null */ attachList: function($el, list) { @@ -1368,7 +1368,9 @@ var FlipClock; }, /** - * Build the clock face + * Build the clock face. This method is chainable. + * + * @return object */ build: function() { @@ -1377,26 +1379,32 @@ var FlipClock; } this.trigger('build'); + + return this; }, /** * Perform arbirtrary logic when the clock face instantiated. - * The factor object is passed in the first argument + * The factor object is passed in the first argument. This + * method is chainable. * - * @param object + * @param object factory + * @return object */ init: function(factory) { this.setTimeObject(this.value); this.trigger('init'); + + return this; }, /** * Creates a jQuery object used for the digit divider * - * @param mixed The divider label text - * @param mixed Set true to exclude the dots in the divider. - * If not set, is false. + * @param mixed label + * @param mixed className + * @param mixed excludeDots */ createDivider: function(label, className, excludeDots) { @@ -1422,8 +1430,9 @@ var FlipClock; /** * Creates a FlipClock.List object and appends it to the DOM * - * @param mixed The value to select in the list - * @param object An object to override the default properties + * @param mixed value + * @param object options + * @return object */ createList: function(value, options) { @@ -1443,7 +1452,7 @@ var FlipClock; /* * Get the list class object * - * @return object + * @return object */ getListClass: function() { @@ -1453,7 +1462,8 @@ var FlipClock; /* * Get a new list class instance * - * @return object + * @param mixed value + * @return object */ getListObject: function(value) { @@ -1465,7 +1475,10 @@ var FlipClock; }, /** - * Triggers when the clock is reset + * Reset the clock. This method is chainable. + * + * @param function callback + * @return object */ reset: function(callback) { @@ -1473,10 +1486,15 @@ var FlipClock; this.flip(); this.trigger('reset'); this.callback(callback); + + return this; }, /** - * Starts the clock + * Starts the clock. This method is chainable. + * + * @param function callback + * @return object */ start: function(callback) { @@ -1486,10 +1504,15 @@ var FlipClock; this.trigger('start'); this.callback(callback); } + + return this; }, /** - * Stops the clock + * Stops the clock. This method is chainable. + * + * @param function callback + * @return object */ stop: function(callback) { @@ -1501,10 +1524,15 @@ var FlipClock; t.callback(callback); }); } + + return this; }, /** - * Auto increments/decrements the value of the clock face + * Auto increments/decrements the value of the clock face. + * This method is chainable; + * + * @return object */ autoIncrement: function() { @@ -1516,10 +1544,14 @@ var FlipClock; } this.trigger('auto:increment', this.getOption('countdown')); + + return this; }, /** - * Increments the value of the clock face + * Increments the value of the clock face. This method is chainable. + * + * @return object */ increment: function() { @@ -1530,10 +1562,14 @@ var FlipClock; } this.trigger('increment'); + + return this; }, /** - * Decrements the value of the clock face + * Decrements the value of the clock face. This method is chainable. + * + * @return object */ decrement: function() { @@ -1549,10 +1585,15 @@ var FlipClock; } this.trigger('decrement'); + + return this; }, /** - * Triggers when the numbers on the clock flip + * Triggers when the numbers on the clock flip. This method is chainable. + * + * @param array time + * @return object */ flip: function(time) { @@ -1569,40 +1610,56 @@ var FlipClock; } this.trigger('flip'); + + return this; }, /** - * Sets the clock time + * Sets the clock time. This method is chainable. + * + * @param mixed time + * @return object */ setTime: function(time) { this.time.time = time; this.flip(); - this.trigger('set:time', time); + this.trigger('set:time', time); + + return this; }, /** * Get the clock time * - * @return object Returns a FlipClock.Time object + * @return object */ - getTime: function(time) { + getTime: function() { return this.time; }, /** - * Set the time attribute with a new FlipClock.Time object + * Set the time attribute with a new FlipClock.Time object. + * This method is chainable. + * + * @param object time + * @return object */ setTimeObject: function(time) { this.time = new FlipClock.Time(time, { minimumDigits: this.getOption('minimumDigits') }); + + return this; }, /** - * Sets the clock face's time + * Sets the clock face's time. This method is chainable. + * + * @param mixed value + * @return object */ setValue: function(value) { @@ -1614,13 +1671,15 @@ var FlipClock; this.flip(); - this.trigger('set:value', this.value); + this.trigger('set:value', this.value); + + return this; }, /** * Get the clock face's value * - * @return object + * @return mixed */ getValue: function() { @@ -1628,7 +1687,11 @@ var FlipClock; }, /** - * Changes the increment of time to up or down (add/sub) + * Changes the increment of time to up or down (add/sub). + * This method is chainable. + * + * @param bool value + * @return object */ setCountdown: function(value) { @@ -1640,14 +1703,31 @@ var FlipClock; } this.trigger('set:countdown', this.getOption('countdown')); + + return this; }, /** * Get the current countdown option value + * + * @return bool */ - getCountdown: function(value) { + getCountdown: function() { return this.getOption('countdown'); + }, + + /** + * Destroy the clock face. This method is chainable. + * + * @return object + */ + + destroy: function() { + this.timer.destroy(); + this.trigger('destroy'); + + return this; } }); @@ -1830,6 +1910,21 @@ var FlipClock; return this.face.getCountdown(); }, + /** + * Destroy the clock + * + * @return object + */ + + destroy: function() { + this.face.destroy(); + this.face = false; + this.$el.removeClass(this.getOption('classes').wrapper); + this.$el.html(''); + + return this; + }, + /** * Starts the clock * @@ -2534,7 +2629,7 @@ var FlipClock; }, /** - * This method gets the elapsed the time as an interger + * Gets the elapsed the time as an interger * * @return void */ @@ -2544,7 +2639,7 @@ var FlipClock; }, /** - * This method gets the elapsed the time as a Date object + * Gets the elapsed the time as a Date object * * @return void */ @@ -2554,9 +2649,9 @@ var FlipClock; }, /** - * This method is resets the timer + * Resets the timer * - * @param callback This method resets the timer back to 0 + * @param function callback * @return void */ @@ -2568,9 +2663,9 @@ var FlipClock; }, /** - * This method is starts the timer + * Starts the timer * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ @@ -2580,9 +2675,9 @@ var FlipClock; }, /** - * This method is stops the timer + * Stops the timer * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ @@ -2594,11 +2689,24 @@ var FlipClock; setTimeout(function() { t.callback(callback); + t.trigger('stop'); }, this.getOption('interval')); + }, + - t.trigger('stop'); + /** + * Destroy the timer + * + * @param function callback + * @return void + */ + + destroy: function(callback) { + this._destroyTimer(callback); + this.trigger('destroy'); }, + /** * Clear the timer interval * @@ -2612,7 +2720,7 @@ var FlipClock; /** * Create the timer object * - * @param callback A function that is called once the timer is created + * @param function callback * @return void */ @@ -2623,11 +2731,11 @@ var FlipClock; /** * Destroy the timer object * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ - destroyTimer: function(callback) { + _destroyTimer: function(callback) { this._clearInterval(); this.running = false; this.timer = false; @@ -2638,7 +2746,7 @@ var FlipClock; /** * This method is called each time the timer interval is ran * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ @@ -2649,9 +2757,9 @@ var FlipClock; }, /** - * This sets the timer interval + * Sets the timer interval * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 159d7dee..27d8be8f 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-20 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                        ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                      • ','','
                                                                                        ','
                                                                                        ','
                                                                                        '+b+"
                                                                                        ","
                                                                                        ",'
                                                                                        ','
                                                                                        ','
                                                                                        '+b+"
                                                                                        ","
                                                                                        ","
                                                                                        ","
                                                                                      • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){this.getOption("autoStart")&&this.start(),this.trigger("build")},init:function(){this.setTimeObject(this.value),this.trigger("init")},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a)},start:function(a){this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a))},stop:function(a){var b=this;this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)}))},autoIncrement:function(){this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown"))},increment:function(){this.value++,this.time&&this.time.addSecond(),this.trigger("increment")},decrement:function(){0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement")},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);this.trigger("flip")},setTime:function(a){this.time.time=a,this.flip(),this.trigger("set:time",a)},getTime:function(){return this.time},setTimeObject:function(a){this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")})},setValue:function(a){this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value)},getValue:function(){return this.value},setCountdown:function(a){this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown"))},getCountdown:function(){return this.getOption("countdown")}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a)},this.getOption("interval")),b.trigger("stop")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                          ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-24 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                            ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                          • ','','
                                                                                            ','
                                                                                            ','
                                                                                            '+b+"
                                                                                            ","
                                                                                            ",'
                                                                                            ','
                                                                                            ','
                                                                                            '+b+"
                                                                                            ","
                                                                                            ","
                                                                                            ","
                                                                                          • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval"))},destroy:function(a){this._destroyTimer(a),this.trigger("destroy")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/docs/Divider.md b/docs/Divider.md index 43d700a0..b7ac34ed 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -4,10 +4,6 @@ * [$el](#$el) * [options](#options) - * [options.className](#options.className) - * [options.classes](#options.classes) - * [options.excludeDots](#options.excludeDots) - * [options.label](#options.label) * [translator](#translator) diff --git a/package.json b/package.json index 8ce2b4ea..62448062 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,24 @@ { - "name": "flipclock", - "version": "0.7.8", - "email": "support@objectivehtml.com", + "name": "flipclock", + "version": "0.7.8", + "email": "support@objectivehtml.com", "author": "Objective HTML, LLC ", "license": "MIT", - - "devDependencies": { - "grunt": "~0.4.2", - "grunt-contrib-jshint": "~0.6.3", - "grunt-contrib-uglify": "~0.2.7", - "grunt-contrib-concat": "~0.3.0" - }, - - "repository": { - "type": "git", - "url": "https://github.com/objectivehtml/FlipClock" - }, - + "devDependencies": { + "grunt": "~0.4.2", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-jshint": "~0.6.3", + "grunt-contrib-uglify": "~0.2.7", + "grunt-jsdoc": "^0.5.7" + }, + "repository": { + "type": "git", + "url": "https://github.com/objectivehtml/FlipClock" + }, "bugs": { - "url": "https://github.com/nodejitsu/browsenpm.org/issues" - }, - - "dependencies": { - "jquery": ">=1.7" - } -} \ No newline at end of file + "url": "https://github.com/nodejitsu/browsenpm.org/issues" + }, + "dependencies": { + "jquery": ">=1.7" + } +} diff --git a/src/flipclock/js/libs/Base.js b/src/flipclock/js/libs/Base.js index 6eb5ab72..161f4690 100644 --- a/src/flipclock/js/libs/Base.js +++ b/src/flipclock/js/libs/Base.js @@ -17,9 +17,9 @@ var FlipClock; /** * FlipFlock Helper * - * @param object A jQuery object or CSS select - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default + * @param {object} obj - A jQuery object or CSS select + * @param {int} digit - An integer used to start the clock (no. seconds) + * @param {object} options - An object of properties to override the default */ FlipClock = function(obj, digit, options) { @@ -45,31 +45,31 @@ var FlipClock; FlipClock.Base = Base.extend({ /** - * Build Date + * @param {string} buildDate - The last official build date */ buildDate: '2014-12-12', /** - * Version + * @param {string} version - The current version */ version: '0.7.7', /** - * The available options for this class + * @param {object} options - The available options for this class */ options: {}, /** - * The bound events to this object + * @param {object} _events - The bound events to this object */ _events: {}, /** - * The bound events to this object + * @param {object} _uid - The Flipclock.Uuid object instance */ _uid: false, @@ -77,11 +77,10 @@ var FlipClock; /** * Sets the default options * - * @param object The default options - * @param object The override options + * @param {mixed} options - The default options */ - constructor: function(_default, options) { + constructor: function(options) { if(typeof _default !== "object") { _default = {}; } @@ -90,14 +89,13 @@ var FlipClock; } this._events = {}; this._uid = (new FlipClock.Uuid()).toString(); - this.setOptions($.extend(true, {}, _default, options)); + this.setOptions(options); }, /** * Delegates the callback to the defined method * - * @param object The default options - * @param object The override options + * @param {function} method - The callback function * @return object */ @@ -120,7 +118,7 @@ var FlipClock; /** * Log a string into the console if it exists * - * @param string The name of the option + * @param {string} str - The string to log * @return mixed */ @@ -135,7 +133,7 @@ var FlipClock; /** * Get an single option value. Returns false if option does not exist * - * @param string The name of the option + * @param {string} index - The name of the option * @return mixed */ @@ -159,8 +157,9 @@ var FlipClock; /** * Set a single option value * - * @param string The name of the option - * @param mixed The value of the option + * @param {string} index - The name of the option + * @param {string} value - The value of the option + * @return object */ setOption: function(index, value) { @@ -177,8 +176,8 @@ var FlipClock; /** * Set a multiple options by passing a JSON object * - * @param object The object with the options - * @param mixed The value of the option + * @param {object} options - An object of options to set + * @return object */ setOptions: function(options) { @@ -194,8 +193,9 @@ var FlipClock; /* * Bind an event * - * @param string - * @param callback + * @param {string} name - The name of the event + * @param {function} callback - The event callback function or method + * @return object */ on: function(name, callback) { @@ -213,8 +213,9 @@ var FlipClock; /* * Bind an event to be called once * - * @param string - * @param callback + * @param {string} name - The name of the event + * @param {function} callback - The event callback function or method + * @return object */ once: function(name, callback) { @@ -228,7 +229,7 @@ var FlipClock; /* * Remove all bound events for a specific trigger * - * @param string + * @param {string} name - The name of the event * @return object */ @@ -243,8 +244,8 @@ var FlipClock; /* * Remove all bound events for a specific trigger * - * @param string - * @return mixed + * @param {string} name - The name of the event + * @return object */ trigger: function(name) { @@ -260,8 +261,6 @@ var FlipClock; for(var i in this._events[name]) { this._events[name][i].fire(this, params); } - - return this._events[name]; } return this; @@ -270,7 +269,7 @@ var FlipClock; /* * Translate a string to the localized locale * - * @param string + * @param {string} name - The name of the string to localize * @return string */ @@ -285,7 +284,7 @@ var FlipClock; /* * Helper method for localize. t() is just short. * - * @param string + * @param {string} name - The name of the string to localize * @return string */ diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 09c9e126..50eae25a 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -30,33 +30,21 @@ */ options: { - - /** - * The available options for this class - */ + // The available options for this class className: false, - /** - * An object of available CSS classes - */ - + // An object of available CSS classes classes: { divider: 'flip-clock-divider', dot: 'flip-clock-dot', label: 'flip-clock-label' }, - /** - * If true the dots will not be displayed in the divider - */ - + // If true the dots will not be displayed in the divider excludeDots: false, - /** - * The label for the divider - */ - + // The label for the divider label: false }, @@ -69,9 +57,7 @@ /* * Constructor * - * @param string - * @param mixed - * @return + * @param mixed options */ constructor: function(options) { @@ -93,9 +79,14 @@ dots, '
                                                                                              ' ].join('')); - }, + /* + * Output object instance as a string + * + * @return string + */ + toString: function() { return this.$el.html(); } diff --git a/src/flipclock/js/libs/EnglishAlphaList.js b/src/flipclock/js/libs/EnglishAlphaList.js index 4d676dd1..30e5d6cf 100644 --- a/src/flipclock/js/libs/EnglishAlphaList.js +++ b/src/flipclock/js/libs/EnglishAlphaList.js @@ -37,7 +37,6 @@ * * @param string * @param mixed - * @return */ constructor: function(value, options) { diff --git a/src/flipclock/js/libs/Event.js b/src/flipclock/js/libs/Event.js index 2fbed500..ffdd0d58 100644 --- a/src/flipclock/js/libs/Event.js +++ b/src/flipclock/js/libs/Event.js @@ -61,7 +61,6 @@ * * @param string * @param mixed - * @return */ constructor: function(name, callback) { @@ -97,8 +96,7 @@ /* * Prevent the event from firing. This method is chainable. * - * @param - * @return + * @return object */ off: function() { diff --git a/src/flipclock/js/libs/Face.js b/src/flipclock/js/libs/Face.js index b27eb590..13f301b2 100644 --- a/src/flipclock/js/libs/Face.js +++ b/src/flipclock/js/libs/Face.js @@ -182,9 +182,9 @@ /* * Attach the FlipClock.List to the DOM of the clock face * - * @param object A jQuery object - * @param object A FlipClock.List object - * @return + * @param object $el + * @param object list + * @return null */ attachList: function($el, list) { @@ -192,7 +192,9 @@ }, /** - * Build the clock face + * Build the clock face. This method is chainable. + * + * @return object */ build: function() { @@ -201,26 +203,32 @@ } this.trigger('build'); + + return this; }, /** * Perform arbirtrary logic when the clock face instantiated. - * The factor object is passed in the first argument + * The factor object is passed in the first argument. This + * method is chainable. * - * @param object + * @param object factory + * @return object */ init: function(factory) { this.setTimeObject(this.value); this.trigger('init'); + + return this; }, /** * Creates a jQuery object used for the digit divider * - * @param mixed The divider label text - * @param mixed Set true to exclude the dots in the divider. - * If not set, is false. + * @param mixed label + * @param mixed className + * @param mixed excludeDots */ createDivider: function(label, className, excludeDots) { @@ -246,8 +254,9 @@ /** * Creates a FlipClock.List object and appends it to the DOM * - * @param mixed The value to select in the list - * @param object An object to override the default properties + * @param mixed value + * @param object options + * @return object */ createList: function(value, options) { @@ -267,7 +276,7 @@ /* * Get the list class object * - * @return object + * @return object */ getListClass: function() { @@ -277,7 +286,8 @@ /* * Get a new list class instance * - * @return object + * @param mixed value + * @return object */ getListObject: function(value) { @@ -289,7 +299,10 @@ }, /** - * Triggers when the clock is reset + * Reset the clock. This method is chainable. + * + * @param function callback + * @return object */ reset: function(callback) { @@ -297,10 +310,15 @@ this.flip(); this.trigger('reset'); this.callback(callback); + + return this; }, /** - * Starts the clock + * Starts the clock. This method is chainable. + * + * @param function callback + * @return object */ start: function(callback) { @@ -310,10 +328,15 @@ this.trigger('start'); this.callback(callback); } + + return this; }, /** - * Stops the clock + * Stops the clock. This method is chainable. + * + * @param function callback + * @return object */ stop: function(callback) { @@ -325,10 +348,15 @@ t.callback(callback); }); } + + return this; }, /** - * Auto increments/decrements the value of the clock face + * Auto increments/decrements the value of the clock face. + * This method is chainable; + * + * @return object */ autoIncrement: function() { @@ -340,10 +368,14 @@ } this.trigger('auto:increment', this.getOption('countdown')); + + return this; }, /** - * Increments the value of the clock face + * Increments the value of the clock face. This method is chainable. + * + * @return object */ increment: function() { @@ -354,10 +386,14 @@ } this.trigger('increment'); + + return this; }, /** - * Decrements the value of the clock face + * Decrements the value of the clock face. This method is chainable. + * + * @return object */ decrement: function() { @@ -373,10 +409,15 @@ } this.trigger('decrement'); + + return this; }, /** - * Triggers when the numbers on the clock flip + * Triggers when the numbers on the clock flip. This method is chainable. + * + * @param array time + * @return object */ flip: function(time) { @@ -393,40 +434,56 @@ } this.trigger('flip'); + + return this; }, /** - * Sets the clock time + * Sets the clock time. This method is chainable. + * + * @param mixed time + * @return object */ setTime: function(time) { this.time.time = time; this.flip(); - this.trigger('set:time', time); + this.trigger('set:time', time); + + return this; }, /** * Get the clock time * - * @return object Returns a FlipClock.Time object + * @return object */ - getTime: function(time) { + getTime: function() { return this.time; }, /** - * Set the time attribute with a new FlipClock.Time object + * Set the time attribute with a new FlipClock.Time object. + * This method is chainable. + * + * @param object time + * @return object */ setTimeObject: function(time) { this.time = new FlipClock.Time(time, { minimumDigits: this.getOption('minimumDigits') }); + + return this; }, /** - * Sets the clock face's time + * Sets the clock face's time. This method is chainable. + * + * @param mixed value + * @return object */ setValue: function(value) { @@ -438,13 +495,15 @@ this.flip(); - this.trigger('set:value', this.value); + this.trigger('set:value', this.value); + + return this; }, /** * Get the clock face's value * - * @return object + * @return mixed */ getValue: function() { @@ -452,7 +511,11 @@ }, /** - * Changes the increment of time to up or down (add/sub) + * Changes the increment of time to up or down (add/sub). + * This method is chainable. + * + * @param bool value + * @return object */ setCountdown: function(value) { @@ -464,14 +527,31 @@ } this.trigger('set:countdown', this.getOption('countdown')); + + return this; }, /** * Get the current countdown option value + * + * @return bool */ - getCountdown: function(value) { + getCountdown: function() { return this.getOption('countdown'); + }, + + /** + * Destroy the clock face. This method is chainable. + * + * @return object + */ + + destroy: function() { + this.timer.destroy(); + this.trigger('destroy'); + + return this; } }); diff --git a/src/flipclock/js/libs/Factory.js b/src/flipclock/js/libs/Factory.js index 4b16f2f0..efae146d 100644 --- a/src/flipclock/js/libs/Factory.js +++ b/src/flipclock/js/libs/Factory.js @@ -71,7 +71,6 @@ * @param object The wrapping jQuery object * @param object Number of seconds used to start the clock * @param object An object override options - * @return */ constructor: function($el, value, options) { @@ -174,6 +173,21 @@ return this.face.getCountdown(); }, + /** + * Destroy the clock + * + * @return object + */ + + destroy: function() { + this.face.destroy(); + this.face = false; + this.$el.removeClass(this.getOption('classes').wrapper); + this.$el.html(''); + + return this; + }, + /** * Starts the clock * @@ -235,7 +249,7 @@ /* * The onDestroy callback * - * @return + * @return undefined */ onDestroy: function() {}, @@ -243,7 +257,7 @@ /* * The onInit callback * - * @return + * @return undefined */ onInit: function() {}, @@ -251,7 +265,7 @@ /* * The onInterval callback * - * @return + * @return undefined */ onInterval: function() {}, @@ -259,7 +273,7 @@ /* * The onStart callback * - * @return + * @return undefined */ onStart: function() {}, @@ -267,7 +281,7 @@ /* * The onStop callback * - * @return + * @return undefined */ onStop: function() {}, @@ -275,7 +289,7 @@ /* * The onReset callback * - * @return + * @return undefined */ onReset: function() {} diff --git a/src/flipclock/js/libs/ListItem.js b/src/flipclock/js/libs/ListItem.js index 7e1d3082..e88a1b4e 100644 --- a/src/flipclock/js/libs/ListItem.js +++ b/src/flipclock/js/libs/ListItem.js @@ -60,7 +60,6 @@ * * @param mixed * @param mixed - * @return */ constructor: function(value, options) { diff --git a/src/flipclock/js/libs/Time.js b/src/flipclock/js/libs/Time.js index ddb4630b..4cbe4b46 100644 --- a/src/flipclock/js/libs/Time.js +++ b/src/flipclock/js/libs/Time.js @@ -64,8 +64,8 @@ /** * Convert a string or integer to an array of digits * - * @param mixed String or Integer of digits - * @return array An array of digits + * @param mixed str + * @return array */ convertDigitsToArray: function(str) { diff --git a/src/flipclock/js/libs/Timer.js b/src/flipclock/js/libs/Timer.js index 053a3f73..24cc07cb 100644 --- a/src/flipclock/js/libs/Timer.js +++ b/src/flipclock/js/libs/Timer.js @@ -52,7 +52,7 @@ /** * Constructor * - * @return void + * @param mixed mixed */ constructor: function(options) { @@ -61,9 +61,9 @@ }, /** - * This method gets the elapsed the time as an interger + * Gets the elapsed the time as an interger * - * @return void + * @return int */ getElapsed: function() { @@ -71,9 +71,9 @@ }, /** - * This method gets the elapsed the time as a Date object + * Gets the elapsed the time as a Date object * - * @return void + * @return object */ getElapsedTime: function() { @@ -81,10 +81,10 @@ }, /** - * This method is resets the timer + * Resets the timer. This method is chainable. * - * @param callback This method resets the timer back to 0 - * @return void + * @param function callback + * @return object */ reset: function(callback) { @@ -92,25 +92,29 @@ this.count = 0; this._setInterval(callback); this.trigger('reset'); + + return this; }, /** - * This method is starts the timer + * Starts the timer. This method is chainable. * - * @param callback A function that is called once the timer is destroyed - * @return void + * @param function callback + * @return object */ start: function(callback) { this.running = true; this._createTimer(callback); + + return this; }, /** - * This method is stops the timer + * Stops the timer. This method is chainable. * - * @param callback A function that is called once the timer is destroyed - * @return void + * @param function callback + * @return object */ stop: function(callback) { @@ -121,10 +125,27 @@ setTimeout(function() { t.callback(callback); + t.trigger('stop'); }, this.getOption('interval')); - t.trigger('stop'); + return this; }, + + + /** + * Destroy the timer. This method is chainable. + * + * @param function callback + * @return object + */ + + destroy: function(callback) { + this._destroyTimer(callback); + this.trigger('destroy'); + + return this; + }, + /** * Clear the timer interval @@ -139,7 +160,7 @@ /** * Create the timer object * - * @param callback A function that is called once the timer is created + * @param function callback * @return void */ @@ -150,11 +171,11 @@ /** * Destroy the timer object * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ - destroyTimer: function(callback) { + _destroyTimer: function(callback) { this._clearInterval(); this.running = false; this.timer = false; @@ -165,7 +186,7 @@ /** * This method is called each time the timer interval is ran * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ @@ -176,9 +197,9 @@ }, /** - * This sets the timer interval + * Sets the timer interval * - * @param callback A function that is called once the timer is destroyed + * @param function callback * @return void */ diff --git a/src/flipclock/js/libs/Translator.js b/src/flipclock/js/libs/Translator.js index 12bca047..99b9adf8 100644 --- a/src/flipclock/js/libs/Translator.js +++ b/src/flipclock/js/libs/Translator.js @@ -47,8 +47,7 @@ /* * Constructor * - * @param string - * @return + * @param mixed options */ constructor: function(options) { @@ -60,6 +59,7 @@ * Load the FlipClock.Lang object * * @param object The name of the language to load + * @return object */ loadLanguage: function(name) { @@ -83,6 +83,7 @@ * * @param string The index of the localized string * @param object Optionally pass a lang object + * @return string */ localize: function(index, obj) { diff --git a/src/flipclock/js/libs/Uuid.js b/src/flipclock/js/libs/Uuid.js index d6a92607..660957bc 100644 --- a/src/flipclock/js/libs/Uuid.js +++ b/src/flipclock/js/libs/Uuid.js @@ -28,7 +28,7 @@ /* * Constructor * - * @return + * @param string value */ constructor: function(value) { diff --git a/src/flipclock/js/libs/list.js b/src/flipclock/js/libs/list.js index 42f145fe..a0b648c7 100644 --- a/src/flipclock/js/libs/list.js +++ b/src/flipclock/js/libs/list.js @@ -85,7 +85,8 @@ /** * Select the value in the list * - * @param int A value 0-9 + * @param int value + * @return object */ select: function(value) { @@ -116,30 +117,40 @@ this.trigger('select', this.value); } + + return this; }, /* * Add the play class to the list * - * @return + * @return object */ addPlayClass: function() { this.$el.addClass(this.getOption('classes').play); + + return this; }, /* * Remove the play class to the list * - * @return + * @return object */ removePlayClass: function() { this.$el.removeClass(this.getOption('classes').play); + + return this; }, /** * Creates the list item HTML and returns as a string + * + * @param mixed value + * @param string css + * @return object */ createListItem: function(value, css) { @@ -158,6 +169,8 @@ /** * Create the list of values and appends it to the DOM object + * + * @return object */ createList: function() { From 5459cc8f044a77cc733c1604be2ed9ab7f7fef60 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:24:40 -0500 Subject: [PATCH 060/129] Updates --- docs/Divider.md | 4 +++- src/flipclock/js/libs/Divider.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Divider.md b/docs/Divider.md index b7ac34ed..4dfc8db6 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -8,7 +8,9 @@ #$el -The jQuery object +**Properties** + +- `object` - The jQuery object #options diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 50eae25a..871eb95d 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -20,7 +20,7 @@ FlipClock.Divider = FlipClock.Base.extend({ /** - * The jQuery object + * @property {object} - The jQuery object */ $el: false, @@ -30,7 +30,7 @@ */ options: { - + // The available options for this class className: false, From 483109f8f4c29d8b4ad0374933e9aaab99530041 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:26:27 -0500 Subject: [PATCH 061/129] Updatse --- docs/Divider.md | 8 ++++++-- src/flipclock/js/libs/Divider.js | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/Divider.md b/docs/Divider.md index 4dfc8db6..ef5ad844 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -14,9 +14,13 @@ #options -The available options for this class +**Properties** + +- `object` - The available options for this class #translator -The FlipClock.Translator instance +**Properties** + +- `object` - The FlipClock.Translator instance diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 871eb95d..4cf82d1e 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -15,6 +15,7 @@ /* * The FlipClock.Divider class makes visual dividers on clocks * easy to create and manipulate. + * @class */ FlipClock.Divider = FlipClock.Base.extend({ @@ -26,7 +27,7 @@ $el: false, /** - * The available options for this class + * @property {object} - The available options for this class */ options: { @@ -49,7 +50,7 @@ }, /** - * The FlipClock.Translator instance + * @property {object} - The FlipClock.Translator instance */ translator: false, From eff43c8355947314e05a5e8fe4530fe875af3f73 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:28:57 -0500 Subject: [PATCH 062/129] Updates --- docs/Divider.md | 26 -------------------------- src/flipclock/js/libs/Divider.js | 15 +++------------ 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/docs/Divider.md b/docs/Divider.md index ef5ad844..e69de29b 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -1,26 +0,0 @@ -#Index - -**Members** - -* [$el](#$el) -* [options](#options) -* [translator](#translator) - - -#$el -**Properties** - -- `object` - The jQuery object - - -#options -**Properties** - -- `object` - The available options for this class - - -#translator -**Properties** - -- `object` - The FlipClock.Translator instance - diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 4cf82d1e..ed15247d 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -16,20 +16,15 @@ * The FlipClock.Divider class makes visual dividers on clocks * easy to create and manipulate. * @class + * @property {object} - The jQuery object + * @property {object} - The available options for this class + * @property {object} - The FlipClock.Translator instance */ FlipClock.Divider = FlipClock.Base.extend({ - /** - * @property {object} - The jQuery object - */ - $el: false, - /** - * @property {object} - The available options for this class - */ - options: { // The available options for this class @@ -48,10 +43,6 @@ // The label for the divider label: false }, - - /** - * @property {object} - The FlipClock.Translator instance - */ translator: false, From 7ccc35bbe917b73b2cbe6cdc9c3d5087c5dc3d1c Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:34:36 -0500 Subject: [PATCH 063/129] Updates --- docs/Divider.md | 22 ++++++++++++++++++++++ src/flipclock/js/libs/Divider.js | 16 +++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/docs/Divider.md b/docs/Divider.md index e69de29b..3dc0bc45 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -0,0 +1,22 @@ +#Index + +**Members** + +* [$el](#$el) +* [options](#options) +* [translator](#translator) + + +#$el + +#options +**Properties** + +- `object` - The available options for this class + + +#translator +**Properties** + +- `object` - The FlipClock.Translator instance + diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index ed15247d..cd0071b5 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -15,16 +15,22 @@ /* * The FlipClock.Divider class makes visual dividers on clocks * easy to create and manipulate. + * * @class - * @property {object} - The jQuery object - * @property {object} - The available options for this class - * @property {object} - The FlipClock.Translator instance */ FlipClock.Divider = FlipClock.Base.extend({ + /** + * @instance {jQuery} - The jQuery object + */ + $el: false, + /** + * @property {object} - The available options for this class + */ + options: { // The available options for this class @@ -43,6 +49,10 @@ // The label for the divider label: false }, + + /** + * @property {object} - The FlipClock.Translator instance + */ translator: false, From b4e2acd4e2cb1a0175c4b8e7399b864a162dca40 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:36:07 -0500 Subject: [PATCH 064/129] Updates --- docs/Divider.md | 11 ++--------- src/flipclock/js/libs/Divider.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/Divider.md b/docs/Divider.md index 3dc0bc45..c6d5291e 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -3,20 +3,13 @@ **Members** * [$el](#$el) -* [options](#options) * [translator](#translator) #$el - -#options -**Properties** - -- `object` - The available options for this class +The jQuery object #translator -**Properties** - -- `object` - The FlipClock.Translator instance +The FlipClock.Translator instance diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index cd0071b5..09c33ba3 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -22,13 +22,17 @@ FlipClock.Divider = FlipClock.Base.extend({ /** - * @instance {jQuery} - The jQuery object + * The jQuery object + * + * @instance jQuery */ $el: false, /** - * @property {object} - The available options for this class + * The available options for this class + * + * @memberof object */ options: { @@ -51,7 +55,9 @@ }, /** - * @property {object} - The FlipClock.Translator instance + * The FlipClock.Translator instance + * + * @instance FlipClock.Translator */ translator: false, From c8ac431e882eaf5f838bee3362876a4ff678df93 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 03:45:24 -0500 Subject: [PATCH 065/129] Updates --- Gruntfile.js | 6 +- compiled/flipclock.js | 378 +++++++------------------------ compiled/flipclock.min.js | 2 +- docs/Divider.md | 9 + src/flipclock/js/libs/Divider.js | 30 +-- 5 files changed, 117 insertions(+), 308 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index deccaa67..0aff5c01 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -47,6 +47,10 @@ module.exports = function(grunt) { css: { files: ['<%= concat.css.src %>'], tasks: ['concat'], + }, + docs: { + files: ['<%= concat.js.src %>'], + tasks: ['jsdoc2md'] } }, jsdoc2md : { @@ -65,5 +69,5 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-jsdoc-to-markdown'); // Default task(s). - grunt.registerTask('default', ['concat', 'uglify', 'watch']); + grunt.registerTask('default', ['concat', 'uglify', 'watch', 'jsdoc2md']); }; \ No newline at end of file diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 4506ccbc..6f69eb02 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -163,9 +163,9 @@ var FlipClock; /** * FlipFlock Helper * - * @param object A jQuery object or CSS select - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default + * @param {object} obj - A jQuery object or CSS select + * @param {int} digit - An integer used to start the clock (no. seconds) + * @param {object} options - An object of properties to override the default */ FlipClock = function(obj, digit, options) { @@ -191,31 +191,31 @@ var FlipClock; FlipClock.Base = Base.extend({ /** - * Build Date + * @param {string} buildDate - The last official build date */ buildDate: '2014-12-12', /** - * Version + * @param {string} version - The current version */ version: '0.7.7', /** - * The available options for this class + * @param {object} options - The available options for this class */ options: {}, /** - * The bound events to this object + * @param {object} _events - The bound events to this object */ _events: {}, /** - * The bound events to this object + * @param {object} _uid - The Flipclock.Uuid object instance */ _uid: false, @@ -223,11 +223,10 @@ var FlipClock; /** * Sets the default options * - * @param object The default options - * @param object The override options + * @param {mixed} options - The default options */ - constructor: function(_default, options) { + constructor: function(options) { if(typeof _default !== "object") { _default = {}; } @@ -236,14 +235,13 @@ var FlipClock; } this._events = {}; this._uid = (new FlipClock.Uuid()).toString(); - this.setOptions($.extend(true, {}, _default, options)); + this.setOptions(options); }, /** * Delegates the callback to the defined method * - * @param object The default options - * @param object The override options + * @param {function} method - The callback function * @return object */ @@ -266,7 +264,7 @@ var FlipClock; /** * Log a string into the console if it exists * - * @param string The name of the option + * @param {string} str - The string to log * @return mixed */ @@ -281,7 +279,7 @@ var FlipClock; /** * Get an single option value. Returns false if option does not exist * - * @param string The name of the option + * @param {string} index - The name of the option * @return mixed */ @@ -305,8 +303,9 @@ var FlipClock; /** * Set a single option value * - * @param string The name of the option - * @param mixed The value of the option + * @param {string} index - The name of the option + * @param {string} value - The value of the option + * @return object */ setOption: function(index, value) { @@ -323,8 +322,8 @@ var FlipClock; /** * Set a multiple options by passing a JSON object * - * @param object The object with the options - * @param mixed The value of the option + * @param {object} options - An object of options to set + * @return object */ setOptions: function(options) { @@ -340,8 +339,9 @@ var FlipClock; /* * Bind an event * - * @param string - * @param callback + * @param {string} name - The name of the event + * @param {function} callback - The event callback function or method + * @return object */ on: function(name, callback) { @@ -359,8 +359,9 @@ var FlipClock; /* * Bind an event to be called once * - * @param string - * @param callback + * @param {string} name - The name of the event + * @param {function} callback - The event callback function or method + * @return object */ once: function(name, callback) { @@ -374,7 +375,7 @@ var FlipClock; /* * Remove all bound events for a specific trigger * - * @param string + * @param {string} name - The name of the event * @return object */ @@ -389,8 +390,8 @@ var FlipClock; /* * Remove all bound events for a specific trigger * - * @param string - * @return mixed + * @param {string} name - The name of the event + * @return object */ trigger: function(name) { @@ -406,8 +407,6 @@ var FlipClock; for(var i in this._events[name]) { this._events[name][i].fire(this, params); } - - return this._events[name]; } return this; @@ -416,7 +415,7 @@ var FlipClock; /* * Translate a string to the localized locale * - * @param string + * @param {string} name - The name of the string to localize * @return string */ @@ -431,7 +430,7 @@ var FlipClock; /* * Helper method for localize. t() is just short. * - * @param string + * @param {string} name - The name of the string to localize * @return string */ @@ -577,7 +576,8 @@ var FlipClock; /** * Select the value in the list * - * @param int A value 0-9 + * @param int value + * @return object */ select: function(value) { @@ -608,30 +608,40 @@ var FlipClock; this.trigger('select', this.value); } + + return this; }, /* * Add the play class to the list * - * @return + * @return object */ addPlayClass: function() { this.$el.addClass(this.getOption('classes').play); + + return this; }, /* * Remove the play class to the list * - * @return + * @return object */ removePlayClass: function() { this.$el.removeClass(this.getOption('classes').play); + + return this; }, /** * Creates the list item HTML and returns as a string + * + * @param mixed value + * @param string css + * @return object */ createListItem: function(value, css) { @@ -650,6 +660,8 @@ var FlipClock; /** * Create the list of values and appends it to the DOM object + * + * @return object */ createList: function() { @@ -731,7 +743,6 @@ var FlipClock; * * @param mixed * @param mixed - * @return */ constructor: function(value, options) { @@ -806,7 +817,6 @@ var FlipClock; * * @param string * @param mixed - * @return */ constructor: function(value, options) { @@ -959,9 +969,7 @@ var FlipClock; /* * Constructor * - * @param string - * @param mixed - * @return + * @param mixed options */ constructor: function(options) { @@ -983,9 +991,14 @@ var FlipClock; dots, '
                                                                                              ' ].join('')); - }, + /* + * Output object instance as a string + * + * @return string + */ + toString: function() { return this.$el.html(); } @@ -1056,7 +1069,6 @@ var FlipClock; * * @param string * @param mixed - * @return */ constructor: function(name, callback) { @@ -1092,8 +1104,7 @@ var FlipClock; /* * Prevent the event from firing. This method is chainable. * - * @param - * @return + * @return object */ off: function() { @@ -1807,7 +1818,6 @@ var FlipClock; * @param object The wrapping jQuery object * @param object Number of seconds used to start the clock * @param object An object override options - * @return */ constructor: function($el, value, options) { @@ -1986,7 +1996,7 @@ var FlipClock; /* * The onDestroy callback * - * @return + * @return undefined */ onDestroy: function() {}, @@ -1994,7 +2004,7 @@ var FlipClock; /* * The onInit callback * - * @return + * @return undefined */ onInit: function() {}, @@ -2002,7 +2012,7 @@ var FlipClock; /* * The onInterval callback * - * @return + * @return undefined */ onInterval: function() {}, @@ -2010,7 +2020,7 @@ var FlipClock; /* * The onStart callback * - * @return + * @return undefined */ onStart: function() {}, @@ -2018,7 +2028,7 @@ var FlipClock; /* * The onStop callback * - * @return + * @return undefined */ onStop: function() {}, @@ -2026,7 +2036,7 @@ var FlipClock; /* * The onReset callback * - * @return + * @return undefined */ onReset: function() {} @@ -2154,8 +2164,8 @@ var FlipClock; /** * Convert a string or integer to an array of digits * - * @param mixed String or Integer of digits - * @return array An array of digits + * @param mixed str + * @return array */ convertDigitsToArray: function(str) { @@ -2620,7 +2630,7 @@ var FlipClock; /** * Constructor * - * @return void + * @param mixed mixed */ constructor: function(options) { @@ -2631,7 +2641,7 @@ var FlipClock; /** * Gets the elapsed the time as an interger * - * @return void + * @return int */ getElapsed: function() { @@ -2641,7 +2651,7 @@ var FlipClock; /** * Gets the elapsed the time as a Date object * - * @return void + * @return object */ getElapsedTime: function() { @@ -2649,10 +2659,10 @@ var FlipClock; }, /** - * Resets the timer + * Resets the timer. This method is chainable. * * @param function callback - * @return void + * @return object */ reset: function(callback) { @@ -2660,25 +2670,29 @@ var FlipClock; this.count = 0; this._setInterval(callback); this.trigger('reset'); + + return this; }, /** - * Starts the timer + * Starts the timer. This method is chainable. * * @param function callback - * @return void + * @return object */ start: function(callback) { this.running = true; this._createTimer(callback); + + return this; }, /** - * Stops the timer + * Stops the timer. This method is chainable. * * @param function callback - * @return void + * @return object */ stop: function(callback) { @@ -2691,19 +2705,23 @@ var FlipClock; t.callback(callback); t.trigger('stop'); }, this.getOption('interval')); + + return this; }, /** - * Destroy the timer + * Destroy the timer. This method is chainable. * * @param function callback - * @return void + * @return object */ destroy: function(callback) { this._destroyTimer(callback); this.trigger('destroy'); + + return this; }, @@ -2826,8 +2844,7 @@ var FlipClock; /* * Constructor * - * @param string - * @return + * @param mixed options */ constructor: function(options) { @@ -2839,6 +2856,7 @@ var FlipClock; * Load the FlipClock.Lang object * * @param object The name of the language to load + * @return object */ loadLanguage: function(name) { @@ -2862,6 +2880,7 @@ var FlipClock; * * @param string The index of the localized string * @param object Optionally pass a lang object + * @return string */ localize: function(index, obj) { @@ -2917,7 +2936,7 @@ var FlipClock; /* * Constructor * - * @return + * @param string value */ constructor: function(value) { @@ -2977,233 +2996,6 @@ var FlipClock; }); }(jQuery)); -/*jshint smarttabs:true */ - -/** - * FlipClock.js - * - * @author Justin Kimbrell - * @copyright 2013 - Objective HTML, LLC - * @licesnse http://www.opensource.org/licenses/mit-license.php - */ - -(function($) { - - "use strict"; - - /** - * The FlipClock.List class is used to build the list used to create - * the card flip effect. This object fascilates selecting the correct - * node by passing a specific value. - */ - - FlipClock.List = FlipClock.Base.extend({ - - /** - * The jQuery object - */ - - $el: false, - - /** - * The items in the list - */ - - items: [], - - /** - * The available options for this class - */ - - options: { - - /** - * The CSS classes - */ - - classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', - flip: 'flip', - play: 'play' - }, - - /** - * The last value selected in the list - */ - - lastValue: 0 - }, - - /** - * The selected value in the list - */ - - value: 0, - - /** - * Constructor - * - * @param object A FlipClock.Factory object - * @param int An string or integer use to select the correct value - * @param object An object to override the default properties - */ - - constructor: function(value, options) { - this.base(options); - - this.value = value; - - var t = this; - - this.createList(); - - this.trigger('init'); - }, - - /** - * Select the value in the list - * - * @param int A value 0-9 - */ - - select: function(value) { - var _afterListItem = this._afterListItem; - - this.setOption('lastValue', this.value); - - if(typeof value === "undefined") { - value = this.value; - } - else { - this.value = value; - } - - if(this.value != this.getOption('lastValue')) { - this._beforeListItem.$el.removeClass(this.getOption('classes').before); - - this.$el.find('.'+this.getOption('classes').active) - .removeClass(this.getOption('classes').active) - .addClass(this.getOption('classes').before); - - this.items.splice(0, 1); - - this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); - - this._beforeListItem.$el.remove(); - this._beforeListItem = _afterListItem; - - this.trigger('select', this.value); - } - }, - - /* - * Add the play class to the list - * - * @return - */ - - addPlayClass: function() { - this.$el.addClass(this.getOption('classes').play); - }, - - /* - * Remove the play class to the list - * - * @return - */ - - removePlayClass: function() { - this.$el.removeClass(this.getOption('classes').play); - }, - - /** - * Creates the list item HTML and returns as a string - */ - - createListItem: function(value, css) { - var item = new FlipClock.ListItem(value, { - className: css - }); - - this.items.push(item); - - this.$el.append(item.$el); - - this.trigger('create:item', item); - - return item; - }, - - /** - * Create the list of values and appends it to the DOM object - */ - - createList: function() { - var $el = this.$el = $('
                                                                                                '); - - this._beforeListItem = this.createListItem(this.getPrevValue(), this.getOption('classes').before); - this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); - - $el.append(this._beforeListItem.el); - $el.append(this._afterListItem.el); - - this.trigger('create:list', $el); - - return $el; - } - - }); - -}(jQuery)); -/*jshint smarttabs:true */ - -/** - * FlipClock.js - * - * @author Justin Kimbrell - * @copyright 2013 - Objective HTML, LLC - * @licesnse http://www.opensource.org/licenses/mit-license.php - */ - -(function($) { - - "use strict"; - - /** - * Capitalize the first letter in a string - * - * @return string - */ - - String.prototype.ucfirst = function() { - return this.substr(0, 1).toUpperCase() + this.substr(1); - }; - - /** - * jQuery helper method - * - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default - */ - - $.fn.FlipClock = function(digit, options) { - return new FlipClock($(this), digit, options); - }; - - /** - * jQuery helper method - * - * @param int An integer used to start the clock (no. seconds) - * @param object An object of properties to override the default - */ - - $.fn.flipClock = function(digit, options) { - return $.fn.FlipClock(digit, options); - }; - -}(jQuery)); - (function($) { /** diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 27d8be8f..178240c7 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ /*! flipclock 2015-01-24 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b);return this._events[a]}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                                • ','','
                                                                                                  ','
                                                                                                  ','
                                                                                                  '+b+"
                                                                                                  ","
                                                                                                  ",'
                                                                                                  ','
                                                                                                  ','
                                                                                                  '+b+"
                                                                                                  ","
                                                                                                  ","
                                                                                                  ","
                                                                                                • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset")},start:function(a){this.running=!0,this._createTimer(a)},stop:function(a){var b=this;this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval"))},destroy:function(a){this._destroyTimer(a),this.trigger("destroy")},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value))},addPlayClass:function(){this.$el.addClass(this.getOption("classes").play)},removePlayClass:function(){this.$el.removeClass(this.getOption("classes").play)},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                    ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b)}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                      ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                                    • ','','
                                                                                                      ','
                                                                                                      ','
                                                                                                      '+b+"
                                                                                                      ","
                                                                                                      ",'
                                                                                                      ','
                                                                                                      ','
                                                                                                      '+b+"
                                                                                                      ","
                                                                                                      ","
                                                                                                      ","
                                                                                                    • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){return clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset"),this},start:function(a){return this.running=!0,this._createTimer(a),this},stop:function(a){var b=this;return this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval")),this},destroy:function(a){return this._destroyTimer(a),this.trigger("destroy"),this},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/docs/Divider.md b/docs/Divider.md index c6d5291e..43d700a0 100644 --- a/docs/Divider.md +++ b/docs/Divider.md @@ -3,12 +3,21 @@ **Members** * [$el](#$el) +* [options](#options) + * [options.className](#options.className) + * [options.classes](#options.classes) + * [options.excludeDots](#options.excludeDots) + * [options.label](#options.label) * [translator](#translator) #$el The jQuery object + +#options +The available options for this class + #translator The FlipClock.Translator instance diff --git a/src/flipclock/js/libs/Divider.js b/src/flipclock/js/libs/Divider.js index 09c33ba3..dae468f8 100644 --- a/src/flipclock/js/libs/Divider.js +++ b/src/flipclock/js/libs/Divider.js @@ -15,49 +15,53 @@ /* * The FlipClock.Divider class makes visual dividers on clocks * easy to create and manipulate. - * - * @class */ FlipClock.Divider = FlipClock.Base.extend({ /** * The jQuery object - * - * @instance jQuery */ $el: false, /** * The available options for this class - * - * @memberof object */ options: { - - // The available options for this class + + /** + * The available options for this class + */ + className: false, - // An object of available CSS classes + /** + * An object of available CSS classes + */ + classes: { divider: 'flip-clock-divider', dot: 'flip-clock-dot', label: 'flip-clock-label' }, - // If true the dots will not be displayed in the divider + /** + * If true the dots will not be displayed in the divider + */ + excludeDots: false, - // The label for the divider + /** + * The label for the divider + */ + label: false }, /** * The FlipClock.Translator instance - * - * @instance FlipClock.Translator */ translator: false, From 1aa7d6732e6da28580d8e8e0899da50aa65a1214 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Sat, 24 Jan 2015 04:05:59 -0500 Subject: [PATCH 066/129] Updates --- Gruntfile.js | 16 +++++-- docs/Base.md | 109 ------------------------------------------------ docs/Divider.md | 24 ----------- package.json | 3 +- 4 files changed, 14 insertions(+), 138 deletions(-) delete mode 100644 docs/Base.md delete mode 100644 docs/Divider.md diff --git a/Gruntfile.js b/Gruntfile.js index 0aff5c01..ab7f04a6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -50,9 +50,18 @@ module.exports = function(grunt) { }, docs: { files: ['<%= concat.js.src %>'], - tasks: ['jsdoc2md'] + tasks: ['jsdoc'] } }, + jsdoc : { + dist : { + src: ['src/flipclock/js/libs/Divider.js'], + options: { + destination: 'docs' + } + } + } + /* jsdoc2md : { separateOutputFilePerInput: { files: [ @@ -61,13 +70,14 @@ module.exports = function(grunt) { ] }, } + */ }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-jsdoc-to-markdown'); + grunt.loadNpmTasks('grunt-jsdoc'); // Default task(s). - grunt.registerTask('default', ['concat', 'uglify', 'watch', 'jsdoc2md']); + grunt.registerTask('default', ['concat', 'uglify', 'watch', 'jsdoc']); }; \ No newline at end of file diff --git a/docs/Base.md b/docs/Base.md deleted file mode 100644 index 799ba0c2..00000000 --- a/docs/Base.md +++ /dev/null @@ -1,109 +0,0 @@ -#Index - -**Functions** - -* [constructor(options)](#constructor) -* [callback(method)](#callback) -* [log(str)](#log) -* [getOption(index)](#getOption) -* [getOptions()](#getOptions) -* [setOption(index, value)](#setOption) -* [setOptions(options)](#setOptions) - -**Members** - -* [buildDate](#buildDate) -* [version](#version) -* [options](#options) -* [_events](#_events) -* [_uid](#_uid) - - -#constructor(options) -Sets the default options - -**Params** - -- options `mixed` - The default options - - -#callback(method) -Delegates the callback to the defined method - -**Params** - -- method `function` - The callback function - -**Returns**: - object - -#log(str) -Log a string into the console if it exists - -**Params** - -- str `string` - The string to log - -**Returns**: - mixed - -#getOption(index) -Get an single option value. Returns false if option does not exist - -**Params** - -- index `string` - The name of the option - -**Returns**: - mixed - -#getOptions() -Get all options - -**Returns**: - bool - -#setOption(index, value) -Set a single option value - -**Params** - -- index `string` - The name of the option -- value `string` - The value of the option - -**Returns**: - object - -#setOptions(options) -Set a multiple options by passing a JSON object - -**Params** - -- options `object` - An object of options to set - -**Returns**: - object - -#buildDate -**Params** - -- buildDate `string` - The last official build date - - -#version -**Params** - -- version `string` - The current version - - -#options -**Params** - -- options `object` - The available options for this class - - -#_events -**Params** - -- _events `object` - The bound events to this object - - -#_uid -**Params** - -- _uid `object` - The Flipclock.Uuid object instance - diff --git a/docs/Divider.md b/docs/Divider.md deleted file mode 100644 index 43d700a0..00000000 --- a/docs/Divider.md +++ /dev/null @@ -1,24 +0,0 @@ -#Index - -**Members** - -* [$el](#$el) -* [options](#options) - * [options.className](#options.className) - * [options.classes](#options.classes) - * [options.excludeDots](#options.excludeDots) - * [options.label](#options.label) -* [translator](#translator) - - -#$el -The jQuery object - - -#options -The available options for this class - - -#translator -The FlipClock.Translator instance - diff --git a/package.json b/package.json index 62448062..018f5354 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "grunt": "~0.4.2", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-jshint": "~0.6.3", - "grunt-contrib-uglify": "~0.2.7", - "grunt-jsdoc": "^0.5.7" + "grunt-contrib-uglify": "~0.2.7" }, "repository": { "type": "git", From a8be81e992c6675fd031868f5cce72670436542a Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 26 Jan 2015 09:04:38 -0500 Subject: [PATCH 067/129] Fixed syntax in example files --- examples/countdown-to-new-years-without-seconds.html | 2 +- examples/countdown-to-new-years.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/countdown-to-new-years-without-seconds.html b/examples/countdown-to-new-years-without-seconds.html index cc8d735e..a3b2c6d9 100644 --- a/examples/countdown-to-new-years-without-seconds.html +++ b/examples/countdown-to-new-years-without-seconds.html @@ -26,7 +26,7 @@ // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', - clockFaceOption: { + clockFaceOptions: { countdown: true, showSeconds: false } diff --git a/examples/countdown-to-new-years.html b/examples/countdown-to-new-years.html index 30947cd3..ce38293f 100644 --- a/examples/countdown-to-new-years.html +++ b/examples/countdown-to-new-years.html @@ -26,7 +26,7 @@ // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', - clockFaceOption: { + clockFaceOptions: { countdown: true } }); From 96e16f3884ad884336ff235c084283b586d84ff7 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 26 Jan 2015 09:05:06 -0500 Subject: [PATCH 068/129] - (Bug Fix) Removed the _default option from the Base class --- src/flipclock/js/libs/Base.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/flipclock/js/libs/Base.js b/src/flipclock/js/libs/Base.js index 161f4690..86b319a4 100644 --- a/src/flipclock/js/libs/Base.js +++ b/src/flipclock/js/libs/Base.js @@ -81,9 +81,6 @@ var FlipClock; */ constructor: function(options) { - if(typeof _default !== "object") { - _default = {}; - } if(typeof options !== "object") { options = {}; } From c3c04ca6bdcb319e71169f96b30334e0de61f238 Mon Sep 17 00:00:00 2001 From: Justin Kimbrell Date: Mon, 26 Jan 2015 09:05:20 -0500 Subject: [PATCH 069/129] Recompiled source --- compiled/flipclock.js | 3 --- compiled/flipclock.min.js | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/compiled/flipclock.js b/compiled/flipclock.js index 6f69eb02..d4a75461 100644 --- a/compiled/flipclock.js +++ b/compiled/flipclock.js @@ -227,9 +227,6 @@ var FlipClock; */ constructor: function(options) { - if(typeof _default !== "object") { - _default = {}; - } if(typeof options !== "object") { options = {}; } diff --git a/compiled/flipclock.min.js b/compiled/flipclock.min.js index 178240c7..1b19ec93 100644 --- a/compiled/flipclock.min.js +++ b/compiled/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-24 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b)}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                        ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                                      • ','','
                                                                                                        ','
                                                                                                        ','
                                                                                                        '+b+"
                                                                                                        ","
                                                                                                        ",'
                                                                                                        ','
                                                                                                        ','
                                                                                                        '+b+"
                                                                                                        ","
                                                                                                        ","
                                                                                                        ","
                                                                                                      • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){return clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset"),this},start:function(a){return this.running=!0,this._createTimer(a),this},stop:function(a){var b=this;return this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval")),this},destroy:function(a){return this._destroyTimer(a),this.trigger("destroy"),this},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +/*! flipclock 2015-01-26 */ +var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b)}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                          ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                                        • ','','
                                                                                                          ','
                                                                                                          ','
                                                                                                          '+b+"
                                                                                                          ","
                                                                                                          ",'
                                                                                                          ','
                                                                                                          ','
                                                                                                          '+b+"
                                                                                                          ","
                                                                                                          ","
                                                                                                          ","
                                                                                                        • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){return clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset"),this},start:function(a){return this.running=!0,this._createTimer(a),this},stop:function(a){var b=this;return this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval")),this},destroy:function(a){return this._destroyTimer(a),this.trigger("destroy"),this},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file From 3c048a2018ba11779b5bef44ef2f0e6a120cfe40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 1 Dec 2015 15:21:35 +0100 Subject: [PATCH 070/129] pl-pl.js Polish translation. --- src/flipclock/js/lang/pl-pl.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/flipclock/js/lang/pl-pl.js diff --git a/src/flipclock/js/lang/pl-pl.js b/src/flipclock/js/lang/pl-pl.js new file mode 100644 index 00000000..d9a2ad98 --- /dev/null +++ b/src/flipclock/js/lang/pl-pl.js @@ -0,0 +1,27 @@ +(function($) { + + /** + * FlipClock Polish Language Pack + * + * This class will used to translate tokens into the Polish language. + * + */ + + FlipClock.Lang.Polish = { + + 'years' : 'lat', + 'months' : 'miesięcy', + 'days' : 'dni', + 'hours' : 'godzin', + 'minutes' : 'minut', + 'seconds' : 'sekund' + + }; + + /* Create various aliases for convenience */ + + FlipClock.Lang['pl'] = FlipClock.Lang.Polish; + FlipClock.Lang['pl-pl'] = FlipClock.Lang.Polish; + FlipClock.Lang['polish'] = FlipClock.Lang.Polish; + +}(jQuery)); From 60c26ecffae0f1a9deb0a45dee49db14d8c1ffa2 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Mon, 29 Feb 2016 20:12:24 -0800 Subject: [PATCH 071/129] switched "compiled" to "dist" Signed-off-by: Brian Espinosa --- Gruntfile.js | 6 +++--- bower.json | 4 ++-- {compiled => dist}/flipclock.css | 0 {compiled => dist}/flipclock.js | 0 {compiled => dist}/flipclock.min.js | 0 examples/base.html | 4 ++-- examples/countdown-from-new-years-without-seconds.html | 4 ++-- examples/countdown-from-new-years.html | 4 ++-- examples/countdown-start-callback.html | 4 ++-- examples/countdown-stop-callback.html | 4 ++-- examples/countdown-to-new-years-without-seconds.html | 4 ++-- examples/countdown-to-new-years.html | 4 ++-- examples/daily-counter-countdown.html | 4 ++-- examples/daily-counter.html | 4 ++-- examples/english-alphabetical-clock.html | 4 ++-- examples/hourly-counter.html | 4 ++-- examples/interval-callback.html | 4 ++-- examples/load-new-clock-face.html | 4 ++-- examples/localization.html | 4 ++-- examples/minute-counter-overflow.html | 4 ++-- examples/minute-counter.html | 4 ++-- examples/multiple-instances.html | 4 ++-- examples/simple-countdown-autostart.html | 4 ++-- examples/simple-counter-autostart.html | 4 ++-- examples/simple-counter-minimum-digits.html | 4 ++-- examples/simple-counter.html | 4 ++-- examples/test.html | 4 ++-- examples/twelve-hour-clock-custom-time.html | 4 ++-- examples/twelve-hour-clock-without-seconds.html | 4 ++-- examples/twelve-hour-clock.html | 4 ++-- examples/twenty-four-hour-clock-custom-time.html | 4 ++-- examples/twenty-four-hour-clock-without-seconds.html | 4 ++-- examples/twenty-four-hour-clock.html | 4 ++-- 33 files changed, 61 insertions(+), 61 deletions(-) rename {compiled => dist}/flipclock.css (100%) rename {compiled => dist}/flipclock.js (100%) rename {compiled => dist}/flipclock.min.js (100%) diff --git a/Gruntfile.js b/Gruntfile.js index ab7f04a6..59b2f7fa 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ module.exports = function(grunt) { src: [ 'src/flipclock/css/flipclock.css' ], - dest: 'compiled/flipclock.css', + dest: 'dist/flipclock.css', }, js: { src: [ @@ -23,7 +23,7 @@ module.exports = function(grunt) { 'src/flipclock/js/faces/*.js', 'src/flipclock/js/lang/*.js', ], - dest: 'compiled/flipclock.js', + dest: 'dist/flipclock.js', } }, uglify: { @@ -32,7 +32,7 @@ module.exports = function(grunt) { }, dist: { files: { - 'compiled/flipclock.min.js': ['<%= concat.js.dest %>'] + 'dist/flipclock.min.js': ['<%= concat.js.dest %>'] } } }, diff --git a/bower.json b/bower.json index cf588af3..2fbfa611 100644 --- a/bower.json +++ b/bower.json @@ -8,8 +8,8 @@ ], "description": "FlipClock.js is a proper abstract object oriented clock and counter library with a realistic flip effect.", "main": [ - "compiled/flipclock.js", - "compiled/flipclock.css" + "dist/flipclock.js", + "dist/flipclock.css" ], "license": "MIT", "ignore": [ diff --git a/compiled/flipclock.css b/dist/flipclock.css similarity index 100% rename from compiled/flipclock.css rename to dist/flipclock.css diff --git a/compiled/flipclock.js b/dist/flipclock.js similarity index 100% rename from compiled/flipclock.js rename to dist/flipclock.js diff --git a/compiled/flipclock.min.js b/dist/flipclock.min.js similarity index 100% rename from compiled/flipclock.min.js rename to dist/flipclock.min.js diff --git a/examples/base.html b/examples/base.html index 5ed3250d..e2615ce6 100644 --- a/examples/base.html +++ b/examples/base.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-from-new-years-without-seconds.html b/examples/countdown-from-new-years-without-seconds.html index a3c48a56..63805382 100644 --- a/examples/countdown-from-new-years-without-seconds.html +++ b/examples/countdown-from-new-years-without-seconds.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-from-new-years.html b/examples/countdown-from-new-years.html index 65d7cf9b..989fde08 100644 --- a/examples/countdown-from-new-years.html +++ b/examples/countdown-from-new-years.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-start-callback.html b/examples/countdown-start-callback.html index c483493c..f3cfd82f 100644 --- a/examples/countdown-start-callback.html +++ b/examples/countdown-start-callback.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-stop-callback.html b/examples/countdown-stop-callback.html index 395e7c28..fd5270b7 100644 --- a/examples/countdown-stop-callback.html +++ b/examples/countdown-stop-callback.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-to-new-years-without-seconds.html b/examples/countdown-to-new-years-without-seconds.html index a3b2c6d9..d0d172a8 100644 --- a/examples/countdown-to-new-years-without-seconds.html +++ b/examples/countdown-to-new-years-without-seconds.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/countdown-to-new-years.html b/examples/countdown-to-new-years.html index ce38293f..fc794d98 100644 --- a/examples/countdown-to-new-years.html +++ b/examples/countdown-to-new-years.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/daily-counter-countdown.html b/examples/daily-counter-countdown.html index 3048a873..35d86717 100644 --- a/examples/daily-counter-countdown.html +++ b/examples/daily-counter-countdown.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/daily-counter.html b/examples/daily-counter.html index 3afa8adb..4adf7602 100644 --- a/examples/daily-counter.html +++ b/examples/daily-counter.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/english-alphabetical-clock.html b/examples/english-alphabetical-clock.html index 6c6f716f..3a2e4f27 100644 --- a/examples/english-alphabetical-clock.html +++ b/examples/english-alphabetical-clock.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/hourly-counter.html b/examples/hourly-counter.html index b76f7305..9e8c047e 100644 --- a/examples/hourly-counter.html +++ b/examples/hourly-counter.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/interval-callback.html b/examples/interval-callback.html index e283e9c8..07ea7630 100644 --- a/examples/interval-callback.html +++ b/examples/interval-callback.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/load-new-clock-face.html b/examples/load-new-clock-face.html index d4a6e2db..0decff40 100644 --- a/examples/load-new-clock-face.html +++ b/examples/load-new-clock-face.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/localization.html b/examples/localization.html index e480d4f4..042c7467 100644 --- a/examples/localization.html +++ b/examples/localization.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/minute-counter-overflow.html b/examples/minute-counter-overflow.html index dcd8c154..44ffcb8a 100644 --- a/examples/minute-counter-overflow.html +++ b/examples/minute-counter-overflow.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/minute-counter.html b/examples/minute-counter.html index dbba448d..65a16ee1 100644 --- a/examples/minute-counter.html +++ b/examples/minute-counter.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/multiple-instances.html b/examples/multiple-instances.html index 3f7fcb2c..cb5c374b 100644 --- a/examples/multiple-instances.html +++ b/examples/multiple-instances.html @@ -1,10 +1,10 @@ - + - + diff --git a/examples/simple-countdown-autostart.html b/examples/simple-countdown-autostart.html index 9408e9fd..6c2ac4d6 100644 --- a/examples/simple-countdown-autostart.html +++ b/examples/simple-countdown-autostart.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/simple-counter-autostart.html b/examples/simple-counter-autostart.html index 1c2ba649..e6ba494f 100644 --- a/examples/simple-counter-autostart.html +++ b/examples/simple-counter-autostart.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/simple-counter-minimum-digits.html b/examples/simple-counter-minimum-digits.html index ecc708eb..0ab58e54 100644 --- a/examples/simple-counter-minimum-digits.html +++ b/examples/simple-counter-minimum-digits.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/simple-counter.html b/examples/simple-counter.html index 01b95a71..91b1368a 100644 --- a/examples/simple-counter.html +++ b/examples/simple-counter.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/test.html b/examples/test.html index 5a29a8ec..639035e0 100644 --- a/examples/test.html +++ b/examples/test.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twelve-hour-clock-custom-time.html b/examples/twelve-hour-clock-custom-time.html index 226cd5d3..493f6b8a 100644 --- a/examples/twelve-hour-clock-custom-time.html +++ b/examples/twelve-hour-clock-custom-time.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twelve-hour-clock-without-seconds.html b/examples/twelve-hour-clock-without-seconds.html index bdc198f6..232830ac 100644 --- a/examples/twelve-hour-clock-without-seconds.html +++ b/examples/twelve-hour-clock-without-seconds.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twelve-hour-clock.html b/examples/twelve-hour-clock.html index 00246cc8..bf2a01f0 100644 --- a/examples/twelve-hour-clock.html +++ b/examples/twelve-hour-clock.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twenty-four-hour-clock-custom-time.html b/examples/twenty-four-hour-clock-custom-time.html index ea72ecb6..b8d44d5a 100644 --- a/examples/twenty-four-hour-clock-custom-time.html +++ b/examples/twenty-four-hour-clock-custom-time.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twenty-four-hour-clock-without-seconds.html b/examples/twenty-four-hour-clock-without-seconds.html index 51e9607f..9aef6209 100644 --- a/examples/twenty-four-hour-clock-without-seconds.html +++ b/examples/twenty-four-hour-clock-without-seconds.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          diff --git a/examples/twenty-four-hour-clock.html b/examples/twenty-four-hour-clock.html index 01a67456..528f9063 100644 --- a/examples/twenty-four-hour-clock.html +++ b/examples/twenty-four-hour-clock.html @@ -1,10 +1,10 @@ - + - +
                                                                                                          From 7e182db5a02b44cd3b2594cf4a23c6c1a27a0441 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Mon, 29 Feb 2016 22:04:17 -0800 Subject: [PATCH 072/129] SASS compiling to css, sourcemaps enabled Signed-off-by: Brian Espinosa --- dist/flipclock.css | 432 +----------------- dist/flipclock.css.map | 1 + src/flipclock/css/flipclock.scss | 315 ------------- .../flipclock.css => scss/flipclock.scss} | 168 +------ 4 files changed, 18 insertions(+), 898 deletions(-) create mode 100644 dist/flipclock.css.map delete mode 100644 src/flipclock/css/flipclock.scss rename src/flipclock/{css/flipclock.css => scss/flipclock.scss} (69%) diff --git a/dist/flipclock.css b/dist/flipclock.css index 2914ce08..b1068deb 100644 --- a/dist/flipclock.css +++ b/dist/flipclock.css @@ -1,431 +1,3 @@ -/* Get the bourbon mixin from http://bourbon.io */ -/* Reset */ -.flip-clock-wrapper * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - -o-box-sizing: border-box; - box-sizing: border-box; - -webkit-backface-visibility: hidden; - -moz-backface-visibility: hidden; - -ms-backface-visibility: hidden; - -o-backface-visibility: hidden; - backface-visibility: hidden; -} +.flip-clock-wrapper *{box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden}.flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.flip-clock-wrapper a:hover{color:#fff}.flip-clock-wrapper ul{list-style:none}.flip-clock-wrapper.clearfix:before,.flip-clock-wrapper.clearfix:after{content:" ";display:table}.flip-clock-wrapper.clearfix:after{clear:both}.flip-clock-wrapper.clearfix{*zoom:1}.flip-clock-wrapper{font:normal 11px "Helvetica Neue", Helvetica, sans-serif;-webkit-user-select:none}.flip-clock-meridium{background:none !important;box-shadow:0 0 0 !important;font-size:36px !important}.flip-clock-meridium a{color:#313333}.flip-clock-wrapper{text-align:center;position:relative;width:100%;margin:1em}.flip-clock-wrapper:before,.flip-clock-wrapper:after{content:" ";display:table}.flip-clock-wrapper:after{clear:both}.flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:bold;line-height:87px;border-radius:6px;background:#000}.flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none !important}.flip-clock-wrapper ul li:first-child{z-index:2}.flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;perspective:200px;margin:0 !important;overflow:visible !important;cursor:default !important}.flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,0.4)}.flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}.flip-clock-wrapper ul li a div.up div.inn{top:0}.flip-clock-wrapper ul li a div.down div.inn{bottom:0}.flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,0.7)}.flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd 0.5s 0.5s linear both;animation:asd 0.5s 0.5s linear both;z-index:5}.flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flip-clock-divider:first-child{width:0}.flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,0.5);left:5px}.flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:black;text-shadow:none}.flip-clock-divider.minutes .flip-clock-label{right:-88px}.flip-clock-divider.seconds .flip-clock-label{right:-91px}.flip-clock-dot.top{top:30px}.flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}.flip-clock-wrapper ul.play li.flip-clock-active .down{-webkit-animation:turn 0.5s 0.5s linear both;animation:turn 0.5s 0.5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 0.5s linear both;animation:turn2 0.5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}@keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}.flip-clock-wrapper ul li.flip-clock-active{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:hide 0.5s 0.3s linear both;animation:hide 0.5s 0.3s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:hide 0.5s 0.2s linear both;animation:hide 0.5s 0.2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}} -.flip-clock-wrapper a { - cursor: pointer; - text-decoration: none; - color: #ccc; } - -.flip-clock-wrapper a:hover { - color: #fff; } - -.flip-clock-wrapper ul { - list-style: none; } - -.flip-clock-wrapper.clearfix:before, -.flip-clock-wrapper.clearfix:after { - content: " "; - display: table; } - -.flip-clock-wrapper.clearfix:after { - clear: both; } - -.flip-clock-wrapper.clearfix { - *zoom: 1; } - -/* Main */ -.flip-clock-wrapper { - font: normal 11px "Helvetica Neue", Helvetica, sans-serif; - -webkit-user-select: none; } - -.flip-clock-meridium { - background: none !important; - box-shadow: 0 0 0 !important; - font-size: 36px !important; } - -.flip-clock-meridium a { color: #313333; } - -.flip-clock-wrapper { - text-align: center; - position: relative; - width: 100%; - margin: 1em; -} - -.flip-clock-wrapper:before, -.flip-clock-wrapper:after { - content: " "; /* 1 */ - display: table; /* 2 */ -} -.flip-clock-wrapper:after { - clear: both; -} - -/* Skeleton */ -.flip-clock-wrapper ul { - position: relative; - float: left; - margin: 5px; - width: 60px; - height: 90px; - font-size: 80px; - font-weight: bold; - line-height: 87px; - border-radius: 6px; - background: #000; -} - -.flip-clock-wrapper ul li { - z-index: 1; - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - line-height: 87px; - text-decoration: none !important; -} - -.flip-clock-wrapper ul li:first-child { - z-index: 2; } - -.flip-clock-wrapper ul li a { - display: block; - height: 100%; - -webkit-perspective: 200px; - -moz-perspective: 200px; - perspective: 200px; - margin: 0 !important; - overflow: visible !important; - cursor: default !important; } - -.flip-clock-wrapper ul li a div { - z-index: 1; - position: absolute; - left: 0; - width: 100%; - height: 50%; - font-size: 80px; - overflow: hidden; - outline: 1px solid transparent; } - -.flip-clock-wrapper ul li a div .shadow { - position: absolute; - width: 100%; - height: 100%; - z-index: 2; } - -.flip-clock-wrapper ul li a div.up { - -webkit-transform-origin: 50% 100%; - -moz-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - -o-transform-origin: 50% 100%; - transform-origin: 50% 100%; - top: 0; } - -.flip-clock-wrapper ul li a div.up:after { - content: ""; - position: absolute; - top: 44px; - left: 0; - z-index: 5; - width: 100%; - height: 3px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.4); } - -.flip-clock-wrapper ul li a div.down { - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - -ms-transform-origin: 50% 0; - -o-transform-origin: 50% 0; - transform-origin: 50% 0; - bottom: 0; - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; -} - -.flip-clock-wrapper ul li a div div.inn { - position: absolute; - left: 0; - z-index: 1; - width: 100%; - height: 200%; - color: #ccc; - text-shadow: 0 1px 2px #000; - text-align: center; - background-color: #333; - border-radius: 6px; - font-size: 70px; } - -.flip-clock-wrapper ul li a div.up div.inn { - top: 0; } - -.flip-clock-wrapper ul li a div.down div.inn { - bottom: 0; } - -/* PLAY */ -.flip-clock-wrapper ul.play li.flip-clock-before { - z-index: 3; } - -.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); } - -.flip-clock-wrapper ul.play li.flip-clock-active { - -webkit-animation: asd 0.5s 0.5s linear both; - -moz-animation: asd 0.5s 0.5s linear both; - animation: asd 0.5s 0.5s linear both; - z-index: 5; } - -.flip-clock-divider { - float: left; - display: inline-block; - position: relative; - width: 20px; - height: 100px; } - -.flip-clock-divider:first-child { - width: 0; } - -.flip-clock-dot { - display: block; - background: #323434; - width: 10px; - height: 10px; - position: absolute; - border-radius: 50%; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); - left: 5px; } - -.flip-clock-divider .flip-clock-label { - position: absolute; - top: -1.5em; - right: -86px; - color: black; - text-shadow: none; } - -.flip-clock-divider.minutes .flip-clock-label { - right: -88px; } - -.flip-clock-divider.seconds .flip-clock-label { - right: -91px; } - -.flip-clock-dot.top { - top: 30px; } - -.flip-clock-dot.bottom { - bottom: 30px; } - -@-webkit-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -@-moz-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -@-o-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -@keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -.flip-clock-wrapper ul.play li.flip-clock-active .down { - z-index: 2; - -webkit-animation: turn 0.5s 0.5s linear both; - -moz-animation: turn 0.5s 0.5s linear both; - animation: turn 0.5s 0.5s linear both; } - -@-webkit-keyframes turn { - 0% { - -webkit-transform: rotateX(90deg); } - - 100% { - -webkit-transform: rotateX(0deg); } } - -@-moz-keyframes turn { - 0% { - -moz-transform: rotateX(90deg); } - - 100% { - -moz-transform: rotateX(0deg); } } - -@-o-keyframes turn { - 0% { - -o-transform: rotateX(90deg); } - - 100% { - -o-transform: rotateX(0deg); } } - -@keyframes turn { - 0% { - transform: rotateX(90deg); } - - 100% { - transform: rotateX(0deg); } } - -.flip-clock-wrapper ul.play li.flip-clock-before .up { - z-index: 2; - -webkit-animation: turn2 0.5s linear both; - -moz-animation: turn2 0.5s linear both; - animation: turn2 0.5s linear both; } - -@-webkit-keyframes turn2 { - 0% { - -webkit-transform: rotateX(0deg); } - - 100% { - -webkit-transform: rotateX(-90deg); } } - -@-moz-keyframes turn2 { - 0% { - -moz-transform: rotateX(0deg); } - - 100% { - -moz-transform: rotateX(-90deg); } } - -@-o-keyframes turn2 { - 0% { - -o-transform: rotateX(0deg); } - - 100% { - -o-transform: rotateX(-90deg); } } - -@keyframes turn2 { - 0% { - transform: rotateX(0deg); } - - 100% { - transform: rotateX(-90deg); } } - -.flip-clock-wrapper ul li.flip-clock-active { - z-index: 3; } - -/* SHADOW */ -.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); - background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; - background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - -webkit-animation: show 0.5s linear both; - -moz-animation: show 0.5s linear both; - animation: show 0.5s linear both; } - -.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); - background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; - background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - -webkit-animation: hide 0.5s 0.3s linear both; - -moz-animation: hide 0.5s 0.3s linear both; - animation: hide 0.5s 0.3s linear both; } - -/*DOWN*/ -.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { - background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); - background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; - background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - -webkit-animation: show 0.5s linear both; - -moz-animation: show 0.5s linear both; - animation: show 0.5s linear both; } - -.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { - background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); - background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; - background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - -webkit-animation: hide 0.5s 0.3s linear both; - -moz-animation: hide 0.5s 0.3s linear both; - animation: hide 0.5s 0.2s linear both; } - -@-webkit-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-moz-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-o-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-webkit-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-moz-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-o-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } +/*# sourceMappingURL=flipclock.css.map */ diff --git a/dist/flipclock.css.map b/dist/flipclock.css.map new file mode 100644 index 00000000..b4a62c43 --- /dev/null +++ b/dist/flipclock.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["flipclock.scss"],"names":[],"mappings":"AAAA,sBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,sBACE,eACA,qBACA,UAAY,CAAG,4BAGf,UAAY,CAAG,uBAGf,eAAiB,CAAG,uEAIpB,YACA,aAAe,CAEjB,mCACE,UAAY,CAEd,8BACE,MAAS,CAAG,oBAIZ,yDACA,wBAA0B,CAAG,qBAG7B,2BACA,4BACA,yBAA2B,CAE7B,uBAAyB,aAAe,CAAI,oBAG1C,kBACA,kBACA,WACA,UAAY,CAGd,qDAEI,YACA,aAAe,CAEnB,0BACI,UAAY,CAIhB,uBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,0BAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,sCAGC,SAAW,CAEb,4BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,gCAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,wCAGlC,kBACA,WACA,YACA,SAAW,CAAG,mCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,yCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,qCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,wCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,2CAGnB,KAAO,CAAG,6CAGV,QAAU,CAGZ,iDACE,SAAW,CAEb,0BAA8B,oCAA0B,CAAkB,iDAGxE,4CAAA,AACA,oCAAA,SAAW,CAEb,oBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,gCAGjB,OAAS,CAAG,gBAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,sCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,8CAGrB,WAAa,CAEf,8CACE,WAAa,CAAG,oBAGhB,QAAU,CAAG,uBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,uDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,qDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,4CACE,SAAW,CAAG,6DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,6DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,+DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,+DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock.css","sourcesContent":[".flip-clock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flip-clock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flip-clock-wrapper a:hover {\n color: #fff; }\n\n.flip-clock-wrapper ul {\n list-style: none; }\n\n.flip-clock-wrapper.clearfix:before,\n.flip-clock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flip-clock-wrapper.clearfix:after {\n clear: both; }\n\n.flip-clock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flip-clock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flip-clock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flip-clock-meridium a { color: #313333; }\n\n.flip-clock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flip-clock-wrapper:before,\n.flip-clock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flip-clock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flip-clock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flip-clock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flip-clock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flip-clock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flip-clock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flip-clock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flip-clock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flip-clock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flip-clock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flip-clock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flip-clock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flip-clock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flip-clock-wrapper ul.play li.flip-clock-before {\n z-index: 3; }\n\n.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flip-clock-wrapper ul.play li.flip-clock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flip-clock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flip-clock-divider:first-child {\n width: 0; }\n\n.flip-clock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flip-clock-divider .flip-clock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flip-clock-divider.minutes .flip-clock-label {\n right: -88px; }\n\n.flip-clock-divider.seconds .flip-clock-label {\n right: -91px; }\n\n.flip-clock-dot.top {\n top: 30px; }\n\n.flip-clock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flip-clock-wrapper ul.play li.flip-clock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flip-clock-wrapper ul li.flip-clock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/src/flipclock/css/flipclock.scss b/src/flipclock/css/flipclock.scss deleted file mode 100644 index ddb89a55..00000000 --- a/src/flipclock/css/flipclock.scss +++ /dev/null @@ -1,315 +0,0 @@ -@import 'bourbon/bourbon'; -/* Get the bourbon mixin from http://bourbon.io */ - -/* Reset */ -.flip-clock-wrapper * { - margin: 0; - padding: 0; - line-height: normal; - @include box-sizing(border-box); -} - -.flip-clock-wrapper a { - cursor: pointer; - text-decoration: none; - color: #ccc; -} - -.flip-clock-wrapper a:hover { - color: #fff; -} - -.flip-clock-wrapper ul { - list-style: none -} - -.flip-clock-wrapper.clearfix:before, -.flip-clock-wrapper.clearfix:after { - content: " "; - display: table; -} - -.flip-clock-wrapper.clearfix:after { - clear: both; -} - -.flip-clock-wrapper.clearfix { - *zoom: 1; -} - -/* Main */ - -.flip-clock-wrapper { - min-height: 100%; - font: normal 11px "Helvetica Neue", Helvetica, sans-serif; - -webkit-user-select: none; -} - -.flip-clock-meridium { - background: none; - box-shadow: 0 0 0 !important; - font-size: 36px !important; - color: rgb(49, 51, 51); - bottom: 10px; -} - - -.flip-clock-wrapper { - text-align: center; - position: relative; - width: 100%; - margin: 1em; -} - -/* Skeleton */ - -.flip-clock-wrapper ul { - position: relative; - float: left; - margin: 5px; - width: 60px; - height: 90px; - font-size: 80px; - font-weight: bold; - line-height: 87px; - border-radius: 6px_prefixed - ; - box-shadow: 0 2px 5px rgba(0, 0, 0, .7); -} - -.flip-clock-wrapper ul li { - z-index: 1; - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - line-height: 87px; -} - -.flip-clock-wrapper ul li:first-child { - z-index: 2; -} - -.flip-clock-wrapper ul li a { - display: block; - height: 100%; - @include perspective(200px); - margin: 0 !important; - overflow: visible !important; -} - -.flip-clock-wrapper ul li a div { - z-index: 1; - position: absolute; - left: 0; - width: 100%; - height: 50%; - overflow: hidden; -} - -.flip-clock-wrapper ul li a div .shadow { - position: absolute; - width: 100%; - height: 100%; - z-index: 2; -} - -.flip-clock-wrapper ul li a div.up { - @include transform-origin(50% 100%); - top: 0; -} - -.flip-clock-wrapper ul li a div.up:after { - content: ""; - position:absolute; - top:44px; - left:0; - z-index: 5; - width: 100%; - height: 3px; - background-color: #000; - background-color: rgba(0,0,0,.4); -} - -.flip-clock-wrapper ul li a div.down { - @include transform-origin(50% 0); - bottom: 0; -} - -.flip-clock-wrapper ul li a div div.inn { - position: absolute; - left: 0; - z-index: 1; - width: 100%; - height: 200%; - color: #ccc; - text-shadow: 0 1px 2px #000; - text-align: center; - background-color: #333; - border-radius: 6px; - font-size: 70px; -} - -.flip-clock-wrapper ul li a div.up div.inn { - top: 0; - -} - -.flip-clock-wrapper ul li a div.down div.inn { - bottom: 0; -} - -/* PLAY */ - -.flip-clock-wrapper ul.play li.flip-clock-before { - z-index: 3; -} - -.flip-clock-wrapper ul.play li.flip-clock-active { - @include animation(asd .5s .5s linear both); - z-index: 2; -} - -.flip-clock-divider { - float: left; - display: inline-block; - position: relative; - width: 20px; - height: 100px; -} - -.flip-clock-divider:first-child { width: 0; } - -.flip-clock-dot { - display: block; - background: rgb(50, 52, 52); - width: 10px; - height: 10px; - position: absolute; - border-radius: 50%; - box-shadow: 0 0 5px rgba(0, 0, 0, .5); -} - -.flip-clock-divider .flip-clock-label { - position: absolute; - top: -1.5em; - right: -86px; - color: black; - text-shadow: none; -} - -.flip-clock-divider.minutes .flip-clock-label { right: -88px; } -.flip-clock-divider.seconds .flip-clock-label { right: -91px; } - -.flip-clock-dot.top { - top: 30px; -} - -.flip-clock-dot.bottom { - bottom: 30px; -} - -@include keyframes(asd) { - 0% { - z-index:2; - } - 20% { - z-index:4; - } - 100% { - z-index:4; - } -} - -.flip-clock-wrapper ul.play li.flip-clock-active .down { - z-index: 2; - @include animation(turn .5s .5s linear both); -} - -@include keyframes(turn) { - 0% { - @include transform(rotateX(90deg)); - } - 100% { - @include transform(rotateX(0deg)); - } -} - -.flip-clock-wrapper ul.play li.flip-clock-before .up { - z-index: 2; - @include animation(turn2 .5s linear both); -} - -@include keyframes(turn2) { - 0% { - @include transform(rotateX(0deg)); - } - 100% { - @include transform(rotateX(-90deg)); - } -} - -.flip-clock-wrapper ul li.flip-clock-active { z-index: 3; } - -/* SHADOW */ - -.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, .1)), color-stop(100%, rgba(0, 0, 0, 1))); - background: linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -o-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - @include animation(show .5s linear both); -} - -.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, .1)), color-stop(100%, rgba(0, 0, 0, 1))); - background: linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -o-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%); - @include animation(hide .5s .3s linear both); -} - -/*DOWN*/ - -.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 1)), color-stop(100%, rgba(0, 0, 0, .1))); - background: linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -o-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - @include animation(show .5s linear both); -} - -.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 1)), color-stop(100%, rgba(0, 0, 0, .1))); - background: linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -o-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%); - @include animation(hide .5s .3s linear both); -} - -@include keyframes(show) { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@include keyframes(hide) { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} \ No newline at end of file diff --git a/src/flipclock/css/flipclock.css b/src/flipclock/scss/flipclock.scss similarity index 69% rename from src/flipclock/css/flipclock.css rename to src/flipclock/scss/flipclock.scss index 2914ce08..8e02186c 100644 --- a/src/flipclock/css/flipclock.css +++ b/src/flipclock/scss/flipclock.scss @@ -1,15 +1,5 @@ -/* Get the bourbon mixin from http://bourbon.io */ -/* Reset */ .flip-clock-wrapper * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - -o-box-sizing: border-box; box-sizing: border-box; - -webkit-backface-visibility: hidden; - -moz-backface-visibility: hidden; - -ms-backface-visibility: hidden; - -o-backface-visibility: hidden; backface-visibility: hidden; } @@ -118,10 +108,6 @@ z-index: 2; } .flip-clock-wrapper ul li a div.up { - -webkit-transform-origin: 50% 100%; - -moz-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - -o-transform-origin: 50% 100%; transform-origin: 50% 100%; top: 0; } @@ -137,10 +123,6 @@ background-color: rgba(0, 0, 0, 0.4); } .flip-clock-wrapper ul li a div.down { - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - -ms-transform-origin: 50% 0; - -o-transform-origin: 50% 0; transform-origin: 50% 0; bottom: 0; border-bottom-left-radius: 6px; @@ -173,8 +155,6 @@ .flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); } .flip-clock-wrapper ul.play li.flip-clock-active { - -webkit-animation: asd 0.5s 0.5s linear both; - -moz-animation: asd 0.5s 0.5s linear both; animation: asd 0.5s 0.5s linear both; z-index: 5; } @@ -217,36 +197,6 @@ .flip-clock-dot.bottom { bottom: 30px; } -@-webkit-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -@-moz-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -@-o-keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - @keyframes asd { 0% { z-index: 2; } @@ -258,32 +208,8 @@ z-index: 4; } } .flip-clock-wrapper ul.play li.flip-clock-active .down { - z-index: 2; - -webkit-animation: turn 0.5s 0.5s linear both; - -moz-animation: turn 0.5s 0.5s linear both; animation: turn 0.5s 0.5s linear both; } -@-webkit-keyframes turn { - 0% { - -webkit-transform: rotateX(90deg); } - - 100% { - -webkit-transform: rotateX(0deg); } } - -@-moz-keyframes turn { - 0% { - -moz-transform: rotateX(90deg); } - - 100% { - -moz-transform: rotateX(0deg); } } - -@-o-keyframes turn { - 0% { - -o-transform: rotateX(90deg); } - - 100% { - -o-transform: rotateX(0deg); } } - @keyframes turn { 0% { transform: rotateX(90deg); } @@ -293,37 +219,17 @@ .flip-clock-wrapper ul.play li.flip-clock-before .up { z-index: 2; - -webkit-animation: turn2 0.5s linear both; - -moz-animation: turn2 0.5s linear both; animation: turn2 0.5s linear both; } -@-webkit-keyframes turn2 { - 0% { - -webkit-transform: rotateX(0deg); } - - 100% { - -webkit-transform: rotateX(-90deg); } } - -@-moz-keyframes turn2 { - 0% { - -moz-transform: rotateX(0deg); } - - 100% { - -moz-transform: rotateX(-90deg); } } - -@-o-keyframes turn2 { - 0% { - -o-transform: rotateX(0deg); } - - 100% { - -o-transform: rotateX(-90deg); } } - @keyframes turn2 { 0% { - transform: rotateX(0deg); } + transform: rotateX(0deg); + } 100% { - transform: rotateX(-90deg); } } + transform: rotateX(-90deg); + } +} .flip-clock-wrapper ul li.flip-clock-active { z-index: 3; } @@ -336,8 +242,6 @@ background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - -webkit-animation: show 0.5s linear both; - -moz-animation: show 0.5s linear both; animation: show 0.5s linear both; } .flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { @@ -347,8 +251,6 @@ background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - -webkit-animation: hide 0.5s 0.3s linear both; - -moz-animation: hide 0.5s 0.3s linear both; animation: hide 0.5s 0.3s linear both; } /*DOWN*/ @@ -359,8 +261,6 @@ background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - -webkit-animation: show 0.5s linear both; - -moz-animation: show 0.5s linear both; animation: show 0.5s linear both; } .flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { @@ -370,62 +270,24 @@ background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - -webkit-animation: hide 0.5s 0.3s linear both; - -moz-animation: hide 0.5s 0.3s linear both; animation: hide 0.5s 0.2s linear both; } -@-webkit-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-moz-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-o-keyframes show { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - @keyframes show { 0% { - opacity: 0; } + opacity: 0; + } 100% { - opacity: 1; } } - -@-webkit-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-moz-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-o-keyframes hide { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } + opacity: 1; + } +} @keyframes hide { 0% { - opacity: 1; } + opacity: 1; + } 100% { - opacity: 0; } } + opacity: 0; + } +} From 4533da301ece82b2f4668edc2703d074b21d4cd6 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Mon, 29 Feb 2016 22:05:15 -0800 Subject: [PATCH 073/129] converted to gulp, browsersync added Signed-off-by: Brian Espinosa --- dist/flipclock.js | 240 ++++++++++++++++++++++++++++++++++++++++++ dist/flipclock.min.js | 4 +- gulpfile.js | 75 +++++++++++++ package.json | 24 ++++- 4 files changed, 340 insertions(+), 3 deletions(-) create mode 100644 gulpfile.js diff --git a/dist/flipclock.js b/dist/flipclock.js index d4a75461..feeeca09 100644 --- a/dist/flipclock.js +++ b/dist/flipclock.js @@ -2993,6 +2993,246 @@ var FlipClock; }); }(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * The FlipClock.List class is used to build the list used to create + * the card flip effect. This object fascilates selecting the correct + * node by passing a specific value. + */ + + FlipClock.List = FlipClock.Base.extend({ + + /** + * The jQuery object + */ + + $el: false, + + /** + * The items in the list + */ + + items: [], + + /** + * The available options for this class + */ + + options: { + + /** + * The CSS classes + */ + + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + flip: 'flip', + play: 'play' + }, + + /** + * The last value selected in the list + */ + + lastValue: 0 + }, + + /** + * The selected value in the list + */ + + value: 0, + + /** + * Constructor + * + * @param object A FlipClock.Factory object + * @param int An string or integer use to select the correct value + * @param object An object to override the default properties + */ + + constructor: function(value, options) { + this.base(options); + + this.value = value; + + var t = this; + + this.createList(); + + this.trigger('init'); + }, + + /** + * Select the value in the list + * + * @param int value + * @return object + */ + + select: function(value) { + var _afterListItem = this._afterListItem; + + this.setOption('lastValue', this.value); + + if(typeof value === "undefined") { + value = this.value; + } + else { + this.value = value; + } + + if(this.value != this.getOption('lastValue')) { + this._beforeListItem.$el.removeClass(this.getOption('classes').before); + + this.$el.find('.'+this.getOption('classes').active) + .removeClass(this.getOption('classes').active) + .addClass(this.getOption('classes').before); + + this.items.splice(0, 1); + + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); + + this._beforeListItem.$el.remove(); + this._beforeListItem = _afterListItem; + + this.trigger('select', this.value); + } + + return this; + }, + + /* + * Add the play class to the list + * + * @return object + */ + + addPlayClass: function() { + this.$el.addClass(this.getOption('classes').play); + + return this; + }, + + /* + * Remove the play class to the list + * + * @return object + */ + + removePlayClass: function() { + this.$el.removeClass(this.getOption('classes').play); + + return this; + }, + + /** + * Creates the list item HTML and returns as a string + * + * @param mixed value + * @param string css + * @return object + */ + + createListItem: function(value, css) { + var item = new FlipClock.ListItem(value, { + className: css + }); + + this.items.push(item); + + this.$el.append(item.$el); + + this.trigger('create:item', item); + + return item; + }, + + /** + * Create the list of values and appends it to the DOM object + * + * @return object + */ + + createList: function() { + var $el = this.$el = $('
                                                                                                            '); + + this._beforeListItem = this.createListItem(this.getPrevValue(), this.getOption('classes').before); + this._afterListItem = this.createListItem(this.value, this.getOption('classes').active); + + $el.append(this._beforeListItem.el); + $el.append(this._afterListItem.el); + + this.trigger('create:list', $el); + + return $el; + } + + }); + +}(jQuery)); +/*jshint smarttabs:true */ + +/** + * FlipClock.js + * + * @author Justin Kimbrell + * @copyright 2013 - Objective HTML, LLC + * @licesnse http://www.opensource.org/licenses/mit-license.php + */ + +(function($) { + + "use strict"; + + /** + * Capitalize the first letter in a string + * + * @return string + */ + + String.prototype.ucfirst = function() { + return this.substr(0, 1).toUpperCase() + this.substr(1); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.FlipClock = function(digit, options) { + return new FlipClock($(this), digit, options); + }; + + /** + * jQuery helper method + * + * @param int An integer used to start the clock (no. seconds) + * @param object An object of properties to override the default + */ + + $.fn.flipClock = function(digit, options) { + return $.fn.FlipClock(digit, options); + }; + +}(jQuery)); + (function($) { /** diff --git a/dist/flipclock.min.js b/dist/flipclock.min.js index 1b19ec93..85f7e7f4 100644 --- a/dist/flipclock.min.js +++ b/dist/flipclock.min.js @@ -1,2 +1,2 @@ -/*! flipclock 2015-01-26 */ -var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a0&&b.push(arguments[c]);for(var d in this._events[a])this._events[a][d].fire(this,b)}return this},localize:function(a){return this.translator&&this.translator.localize(a),a},t:function(a){return this.localize(a)}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(a,b){this.base(b),this.value=a;this.createList(),this.trigger("init")},select:function(a){var b=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof a?a=this.value:this.value=a,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=b,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(a,b){var c=new FlipClock.ListItem(a,{className:b});return this.items.push(c),this.$el.append(c.$el),this.trigger("create:item",c),c},createList:function(){var b=this.$el=a('
                                                                                                              ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),b.append(this._beforeListItem.el),b.append(this._afterListItem.el),this.trigger("create:list",b),b}})}(jQuery),function(a){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(b,c){this.base(c),this.value=b,this.$el=a(['
                                                                                                            • ','','
                                                                                                              ','
                                                                                                              ','
                                                                                                              '+b+"
                                                                                                              ","
                                                                                                              ",'
                                                                                                              ','
                                                                                                              ','
                                                                                                              '+b+"
                                                                                                              ","
                                                                                                              ","
                                                                                                              ","
                                                                                                            • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(a,b){a||(a=String.fromCharCode(this.getMinCharCode())),this.base(a,b),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var a=this.value.charCodeAt(0)-1,b=this.getMinCharCode(),c=this.getMaxCharCode();return b>a&&(a=c),String.fromCharCode(a)},getNextValue:function(){var a=this.value.charCodeAt(0)+1,b=this.getMinCharCode(),c=this.getMaxCharCode();return a>c&&(a=b),String.fromCharCode(a)}})}(jQuery),function(a){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(b){this.base(b),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var c=this.getOption("excludeDots")?"":['',''].join("");this.$el=a(['',''+(this.getOption("label")?this.getOption("label"):"")+"",c,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(a,b){if(!a)throw"Events must have a name";"function"==typeof b&&(this._callback=b)},fire:function(a,b){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(a,b)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(a){return this._lastResponse=a,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(a){return this._fireOnce=a,this}})}(jQuery),function(){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(a,b){var c=this;a instanceof Date==!1&&"object"==typeof a&&(b=a,a=0),this.dividers=[],this.lists=[],this.originalValue=a,this.value=a,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){c.flip(),c.trigger("interval")}),this.base(b),this.on("add:digit",function(){if(this.dividers.length)for(var a in this.dividers){var b=this.dividers[a];b.$el.is(":first-child")||b.$el.insertAfter(b.$el.next())}})},addDigit:function(a){var b=this.createList(a);return this.trigger("add:digit",b),b},attachList:function(a,b){a.append(b.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(a,b,c){"boolean"!=typeof b&&b||(c=b,b=!1);var d=new FlipClock.Divider({label:a,className:b,excludeDots:c,translator:this.translator});return this.dividers.push(d),this.trigger("create:divider",d),d},createList:function(a){var b=this.getListObject(a);return(this.getOption("autoPlay")||this.timer.running)&&b.addPlayClass(),this.lists.push(b),this.trigger("create:list",b),b},getListClass:function(){return FlipClock.NumericList},getListObject:function(a){var b=this.getListClass();return new b(a,{translator:this.translator})},reset:function(a){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(a),this},start:function(a){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(a)),this},stop:function(a){var b=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){b.trigger("stop"),b.callback(a)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(a){for(var b in a)this.lists[b]?(this.lists[b].select(a[b]),this.getOption("autoPlay")&&this.timer.running&&this.lists[b].addPlayClass()):this.addDigit(a[b]);return this.trigger("flip"),this},setTime:function(a){return this.time.time=a,this.flip(),this.trigger("set:time",a),this},getTime:function(){return this.time},setTimeObject:function(a){return this.time=new FlipClock.Time(a,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(a){return this.value=a,this.time&&this.setTimeObject(new FlipClock.Time(a)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(a){return this.setOption("countdown",a?!0:!1),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(a,b,c){b instanceof Date==!1&&"object"==typeof b&&(c=b,b=0),this.base(c),this.lists=[],this.$el=a.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),b,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(a,b,c){var d=this,e="Face";return a=a.ucfirst()+e,this.face.stop&&this.stop(),this.$el.html(""),this.face=FlipClock[a]?new FlipClock[a](b,c):new(FlipClock[this.getOption("defaultClockFace")+e])(b,c),this.face.on("create:list",function(a){d.face.attachList(d.$el,a)}),this.face.on("destroy",function(){d.callback(d.onDestroy)}),this.face.on("start",function(){d.callback(d.onStart)}),this.face.on("stop",function(){d.callback(d.onStop)}),this.face.on("reset",function(){d.callback(d.onReset)}),this.face.on("interval",function(){d.callback(d.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(d.onInit),this.face},setCountdown:function(a){return this.face.setCountdown(a),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(a){return this.face.setValue(a),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(a,b){"object"!=typeof b&&(b={}),a instanceof Date?this.time=a:a&&(this.time=Math.round(a)),this.base(b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;cthis.getOption("minimumDigits")&&this.setOption("minimumDigits",b.length),this.getOption("minimumDigits")>b.length)for(var e=b.length;e12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(a,b){var c=0,d=[];for(var e in b)a>e?c+=parseInt(b[e],10):d.push(b[e]);return 0===c?d:b},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(a){this.base(a),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){return clearInterval(this.timer),this.count=0,this._setInterval(a),this.trigger("reset"),this},start:function(a){return this.running=!0,this._createTimer(a),this},stop:function(a){var b=this;return this.running=!1,this._clearInterval(),setTimeout(function(){b.callback(a),b.trigger("stop")},this.getOption("interval")),this},destroy:function(a){return this._destroyTimer(a),this.trigger("destroy"),this},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(a),this.trigger("destroy")},_interval:function(a){this.callback(a),this.trigger("interval"),this.count++},_setInterval:function(a){var b=this;this.timer=setInterval(function(){b.running&&b._interval(a)},this.getOption("interval")),this.trigger("start"),this._interval(a)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(a){this.base(a),this.loadLanguage(this.getOption("language"))},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a}})}(),function(){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(a){this.value=a?a:this.generate()},generate:function(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:3&c|8).toString(16)});return b},equals:function(a){return this.isUuid(a)&&value==a},isUuid:function(a){var b=new RegExp("^[a-z0-9]{32}$","i");return a&&(a instanceof Uuid||b.test(a.toString()))},toString:function(){return this.value}})}(jQuery),function(){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(a){var a=a?a:this.time.getMilitaryTime(!1,this.showSeconds);for(var b in a)this.createList(a[b]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a){this.autoIncrement(),a=a?a:this.time.getMilitaryTime(!1,this.showSeconds),this.base(a)}})}(jQuery),function(){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){this.base(a,b),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(a){a.addPlayClass()})},build:function(){var a=this,b=this.getTime().digitize([this.getTime().time]);for(var c in b)a.createList(b[c]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(a){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.getTime().digitize([this.getTime().time])),this.base(a)},init:function(a){var b=this;a.increment=function(){b.increment(),b.flip()},a.decrement=function(){b.decrement(),b.flip()},this.base(a)}})}(jQuery),function(){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var a=0,b=this.time.getDayCounter(this.showSeconds);for(var c in b)this.createList(b[c]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):a=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+a].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+a].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(a){this.base(a),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var a=this.value.split("");for(var b in a)this.createList(a[b]);for(var c in this.lists)this._autoIncrementValues.unshift(this.lists[c].getCharCode());this.base()},increment:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getNextValue(),d.getCharCode()>=d.getMaxCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},decrement:function(){for(var a=!0,b=0,c=this.value.split("");a;){a=!1;var d=(this._autoIncrementValues[b],this.lists[this.lists.length-b-1]);d?(c[this.value.length-b-1]=d.getPrevValue(),d.getCharCode()<=d.getMinCharCode()&&(a=!0,b++)):c.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=c.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(a){var b=this.getListClass();return new b(a,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(a){var b=0,a=a?a:this.time.getHourCounter(this.getOption("includeSeconds"));for(var c in a)this.createList(a[c]);this.getOption("includeSeconds")===!0&&(b=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-b].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-b].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(a){a||(a=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(a),this.autoIncrement()},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var a=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var b in a)this.createList(a[b]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=a(['"].join("")),this.base(b),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return this.t((new Date).getHours()>=12?"PM":"AM")},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file +/* flipclock - v0.7.8 */ +var Base=function(){};Base.extend=function(t,i){"use strict";var e=Base.prototype.extend;Base._prototyping=!0;var s=new this;e.call(s,t),s.base=function(){},delete Base._prototyping;var n=s.constructor,o=s.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==o)this._constructing=!0,n.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||e).call(arguments[0],s)};return o.ancestor=this,o.extend=this.extend,o.forEach=this.forEach,o.implement=this.implement,o.prototype=s,o.toString=this.toString,o.valueOf=function(t){return"object"==t?o:n.valueOf()},e.call(o,i),"function"==typeof o.init&&o.init(),o},Base.prototype={extend:function(t,i){if(arguments.length>1){var e=this[t];if(e&&"function"==typeof i&&(!e.valueOf||e.valueOf()!=i.valueOf())&&/\bbase\b/.test(i)){var s=i.valueOf();i=function(){var t=this.base||Base.prototype.base;this.base=e;var i=s.apply(this,arguments);return this.base=t,i},i.valueOf=function(t){return"object"==t?i:s},i.toString=Base.toString}this[t]=i}else if(t){var n=Base.prototype.extend;Base._prototyping||"function"==typeof this||(n=this.extend||n);for(var o={toSource:null},r=["constructor","toString","valueOf"],a=Base._prototyping?0:1;l=r[a++];)t[l]!=o[l]&&n.call(this,l,t[l]);for(var l in t)o[l]||n.call(this,l,t[l])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(t,i,e){for(var s in t)void 0===this.prototype[s]&&i.call(e,t[s],s,t)},implement:function(){for(var t=0;t0&&i.push(arguments[e]);for(var s in this._events[t])this._events[t][s].fire(this,i)}return this},localize:function(t){return this.translator&&this.translator.localize(t),t},t:function(t){return this.localize(t)}})}(jQuery),function(t){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},t.fn.FlipClock=function(i,e){return new FlipClock(t(this),i,e)},t.fn.flipClock=function(i,e){return t.fn.FlipClock(i,e)}}(jQuery),function(t){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(t,i){this.base(i),this.value=t;this.createList(),this.trigger("init")},select:function(t){var i=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof t?t=this.value:this.value=t,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=i,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(t,i){var e=new FlipClock.ListItem(t,{className:i});return this.items.push(e),this.$el.append(e.$el),this.trigger("create:item",e),e},createList:function(){var i=this.$el=t('
                                                                                                                ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),i.append(this._beforeListItem.el),i.append(this._afterListItem.el),this.trigger("create:list",i),i}})}(jQuery),function(t){"use strict";FlipClock.ListItem=FlipClock.Base.extend({$el:!1,options:{classes:{down:"down",inn:"inn",shadow:"shadow",up:"up"},className:null},value:null,constructor:function(i,e){this.base(e),this.value=i,this.$el=t(['
                                                                                                              • ','','
                                                                                                                ','
                                                                                                                ','
                                                                                                                '+i+"
                                                                                                                ","
                                                                                                                ",'
                                                                                                                ','
                                                                                                                ','
                                                                                                                '+i+"
                                                                                                                ","
                                                                                                                ","
                                                                                                                ","
                                                                                                              • "].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(t){"use strict";FlipClock.EnglishAlphaList=FlipClock.List.extend({options:{capitalLetters:!0},constructor:function(t,i){t||(t=String.fromCharCode(this.getMinCharCode())),this.base(t,i),this.value||(this.value=String.fromCharCode(this.getMinCharCode()))},getMaxCharCode:function(){return this.getOption("capitalLetters")?90:122},getMinCharCode:function(){return this.getOption("capitalLetters")?65:96},getCharCode:function(){return this.value.charCodeAt(0)},getPrevValue:function(){var t=this.value.charCodeAt(0)-1,i=this.getMinCharCode(),e=this.getMaxCharCode();return i>t&&(t=e),String.fromCharCode(t)},getNextValue:function(){var t=this.value.charCodeAt(0)+1,i=this.getMinCharCode(),e=this.getMaxCharCode();return t>e&&(t=i),String.fromCharCode(t)}})}(jQuery),function(t){"use strict";FlipClock.Divider=FlipClock.Base.extend({$el:!1,options:{className:!1,classes:{divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label"},excludeDots:!1,label:!1},translator:!1,constructor:function(i){this.base(i),this.getOption("label")&&this.setOption("label",this.t(this.getOption("label")));var e=this.getOption("excludeDots")?"":['',''].join("");this.$el=t(['',''+(this.getOption("label")?this.getOption("label"):"")+"",e,""].join(""))},toString:function(){return this.$el.html()}})}(jQuery),function(t){"use strict";FlipClock.Event=FlipClock.Base.extend({name:!1,_hasFired:!1,_lastResponse:null,_preventFire:!1,_fireOnce:!1,_callback:function(){},constructor:function(t,i){if(!t)throw"Events must have a name";"function"==typeof i&&(this._callback=i)},fire:function(t,i){return this._preventFire===!1&&(this.setLastResponse(this._callback.apply(t,i)),this._hasFired=!0,this._fireOnce&&(this._preventFire=!0)),this},off:function(){return this._preventFire=!0,this},on:function(){return this._preventFire=!1,this},hasFired:function(){return this._hasFired},getLastResponse:function(){return this._lastResponse},setLastResponse:function(t){return this._lastResponse=t,this},getFireOnce:function(){return this._fireOnce},setFireOnce:function(t){return this._fireOnce=t,this}})}(jQuery),function(t){"use strict";FlipClock.Face=FlipClock.Base.extend({dividers:[],lang:!1,lists:[],options:{animationRate:1e3,autoPlay:!0,autoStart:!0,countdown:!1,defaultLanguage:"english",language:"english",minimumDigits:0},originalValue:0,time:!1,timer:!1,translator:!1,value:0,constructor:function(t,i){var e=this;t instanceof Date==!1&&"object"==typeof t&&(i=t,t=0),this.dividers=[],this.lists=[],this.originalValue=t,this.value=t,this.translator=new FlipClock.Translator({defaultLanguage:this.getOption("defaultLanguage"),language:this.getOption("language")}),this.timer=new FlipClock.Timer,this.timer.on("interval",function(){e.flip(),e.trigger("interval")}),this.base(i),this.on("add:digit",function(t){if(this.dividers.length)for(var i in this.dividers){var e=this.dividers[i];e.$el.is(":first-child")||e.$el.insertAfter(e.$el.next())}})},addDigit:function(t){var i=this.createList(t);return this.trigger("add:digit",i),i},attachList:function(t,i){t.append(i.$el)},build:function(){return this.getOption("autoStart")&&this.start(),this.trigger("build"),this},init:function(t){return this.setTimeObject(this.value),this.trigger("init"),this},createDivider:function(t,i,e){"boolean"!=typeof i&&i||(e=i,i=!1);var s=new FlipClock.Divider({label:t,className:i,excludeDots:e,translator:this.translator});return this.dividers.push(s),this.trigger("create:divider",s),s},createList:function(t,i){var e=this.getListObject(t);return(this.getOption("autoPlay")||this.timer.running)&&e.addPlayClass(),this.lists.push(e),this.trigger("create:list",e),e},getListClass:function(){return FlipClock.NumericList},getListObject:function(t){var i=this.getListClass();return new i(t,{translator:this.translator})},reset:function(t){return this.value=this.originalValue,this.flip(),this.trigger("reset"),this.callback(t),this},start:function(t){return this.timer.running||(this.trigger("before:start"),this.timer.start(),this.trigger("start"),this.callback(t)),this},stop:function(t){var i=this;return this.timer.running&&(this.trigger("before:stop"),this.timer.stop(function(){i.trigger("stop"),i.callback(t)})),this},autoIncrement:function(){return this.getOption("countdown")?this.decrement():this.increment(),this.trigger("auto:increment",this.getOption("countdown")),this},increment:function(){return this.value++,this.time&&this.time.addSecond(),this.trigger("increment"),this},decrement:function(){return 0===this.time.getTimeSeconds()?this.stop():(this.value--,this.time&&this.time.subSecond()),this.trigger("decrement"),this},flip:function(t){for(var i in t)this.lists[i]?(this.lists[i].select(t[i]),this.getOption("autoPlay")&&this.timer.running&&this.lists[i].addPlayClass()):this.addDigit(t[i]);return this.trigger("flip"),this},setTime:function(t){return this.time.time=t,this.flip(),this.trigger("set:time",t),this},getTime:function(){return this.time},setTimeObject:function(t){return this.time=new FlipClock.Time(t,{minimumDigits:this.getOption("minimumDigits")}),this},setValue:function(t){return this.value=t,this.time&&this.setTimeObject(new FlipClock.Time(t)),this.flip(),this.trigger("set:value",this.value),this},getValue:function(){return this.value},setCountdown:function(t){return this.setOption("countdown",!!t),this.timer.running&&(this.stop(),this.start()),this.trigger("set:countdown",this.getOption("countdown")),this},getCountdown:function(){return this.getOption("countdown")},destroy:function(){return this.timer.destroy(),this.trigger("destroy"),this}})}(jQuery),function(t){"use strict";FlipClock.Factory=FlipClock.Base.extend({$el:!1,face:!1,options:{classes:{wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",clockFaceOptions:{},defaultClockFace:"HourlyCounter"},constructor:function(t,i,e){i instanceof Date==!1&&"object"==typeof i&&(e=i,i=0),this.base(e),this.lists=[],this.$el=t.addClass(this.getOption("classes").wrapper),this.loadClockFace(this.getOption("clockFace"),i,this.getOption("clockFaceOptions")),this.trigger("init")},loadClockFace:function(t,i,e){var s=this,n="Face";return t=t.ucfirst()+n,this.face.stop&&this.stop(),this.$el.html(""),FlipClock[t]?this.face=new FlipClock[t](i,e):this.face=new(FlipClock[this.getOption("defaultClockFace")+n])(i,e),this.face.on("create:list",function(t){s.face.attachList(s.$el,t)}),this.face.on("destroy",function(){s.callback(s.onDestroy)}),this.face.on("start",function(){s.callback(s.onStart)}),this.face.on("stop",function(){s.callback(s.onStop)}),this.face.on("reset",function(){s.callback(s.onReset)}),this.face.on("interval",function(){s.callback(s.onInterval)}),this.face.init(this),this.face.build(),this.trigger("load:face",this.face),this.callback(s.onInit),this.face},setCountdown:function(t){return this.face.setCountdown(t),this},getCountdown:function(){return this.face.getCountdown()},destroy:function(){return this.face.destroy(),this.face=!1,this.$el.removeClass(this.getOption("classes").wrapper),this.$el.html(""),this},start:function(){return this.face.start(),this},stop:function(){return this.face.stop(),this},reset:function(){return this.face.reset(),this},setFaceValue:function(t){return this.face.setValue(t),this},getFaceValue:function(){return this.face.getValue()},onDestroy:function(){},onInit:function(){},onInterval:function(){},onStart:function(){},onStop:function(){},onReset:function(){}})}(jQuery),function(t){"use strict";FlipClock.NumericList=FlipClock.List.extend({getPrevValue:function(){return this.value>0?this.value-1:9},getNextValue:function(){return this.value<9?this.value+1:0}})}(jQuery),function(t){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,options:{minimumDigits:0},constructor:function(t,i){"object"!=typeof i&&(i={}),t instanceof Date?this.time=t:t&&(this.time=Math.round(t)),this.base(i)},convertDigitsToArray:function(t){var i=[];t=t.toString();for(var e=0;ethis.getOption("minimumDigits")&&this.setOption("minimumDigits",i.length),this.getOption("minimumDigits")>i.length)for(var n=i.length;n12?e-12:0===e?12:e,t.getMinutes()];return i===!0&&s.push(t.getSeconds()),this.digitize(s)},getSeconds:function(t){var i=this.getTimeSeconds();return t&&(60==i?i=0:i%=60),Math.ceil(i)},getWeeks:function(t){var i=this.getTimeSeconds()/60/60/24/7;return t&&(i%=52),Math.floor(i)},removeLeadingZeros:function(t,i){var e=0,s=[];for(var n in i)t>n?e+=parseInt(i[n],10):s.push(i[n]);return 0===e?s:i},addSeconds:function(t){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+t):this.time+=t},addSecond:function(){this.addSeconds(1)},subSeconds:function(t){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-t):this.time-=t},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(t){"use strict";FlipClock.Timer=FlipClock.Base.extend({count:0,options:{animationRate:1e3,interval:1e3},running:!1,constructor:function(t){this.base(t),this.trigger("init")},getElapsed:function(){return this.count*this.getOption("interval")},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(t){return clearInterval(this.timer),this.count=0,this._setInterval(t),this.trigger("reset"),this},start:function(t){return this.running=!0,this._createTimer(t),this},stop:function(t){var i=this;return this.running=!1,this._clearInterval(),setTimeout(function(){i.callback(t),i.trigger("stop")},this.getOption("interval")),this},destroy:function(t){return this._destroyTimer(t),this.trigger("destroy"),this},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(t){this._setInterval(t)},_destroyTimer:function(t){this._clearInterval(),this.running=!1,this.timer=!1,this.callback(t),this.trigger("destroy")},_interval:function(t){this.callback(t),this.trigger("interval"),this.count++},_setInterval:function(t){var i=this;this.timer=setInterval(function(){i.running&&i._interval(t)},this.getOption("interval")),this.trigger("start"),this._interval(t)}})}(jQuery),function(){"use strict";FlipClock.Translator=FlipClock.Base.extend({lang:!1,options:{defaultLanguage:"english",language:"english"},constructor:function(t){this.base(t),this.loadLanguage(this.getOption("language"))},loadLanguage:function(t){var i;return i=FlipClock.Lang[t.ucfirst()]?FlipClock.Lang[t.ucfirst()]:FlipClock.Lang[t]?FlipClock.Lang[t]:FlipClock.Lang[this.getOption("defaultLanguage")],this.lang=i},localize:function(t,i){var e=this.lang;if(!t)return null;var s=t.toLowerCase();return"object"==typeof i&&(e=i),e&&e[s]?e[s]:t}})}(),function(t){"use strict";FlipClock.Uuid=FlipClock.Base.extend({value:!1,constructor:function(t){this.value=t?t:this.generate()},generate:function(){var t=(new Date).getTime(),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==i?e:3&e|8).toString(16)});return i},equals:function(t){return this.isUuid(t)&&value==t},isUuid:function(t){var i=new RegExp("^[a-z0-9]{32}$","i");return t&&(t instanceof Uuid||i.test(t.toString()))},toString:function(){return this.value}})}(jQuery),function(t){"use strict";FlipClock.List=FlipClock.Base.extend({$el:!1,items:[],options:{classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip",play:"play"},lastValue:0},value:0,constructor:function(t,i){this.base(i),this.value=t;this.createList(),this.trigger("init")},select:function(t){var i=this._afterListItem;return this.setOption("lastValue",this.value),"undefined"==typeof t?t=this.value:this.value=t,this.value!=this.getOption("lastValue")&&(this._beforeListItem.$el.removeClass(this.getOption("classes").before),this.$el.find("."+this.getOption("classes").active).removeClass(this.getOption("classes").active).addClass(this.getOption("classes").before),this.items.splice(0,1),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),this._beforeListItem.$el.remove(),this._beforeListItem=i,this.trigger("select",this.value)),this},addPlayClass:function(){return this.$el.addClass(this.getOption("classes").play),this},removePlayClass:function(){return this.$el.removeClass(this.getOption("classes").play),this},createListItem:function(t,i){var e=new FlipClock.ListItem(t,{className:i});return this.items.push(e),this.$el.append(e.$el),this.trigger("create:item",e),e},createList:function(){var i=this.$el=t('
                                                                                                                  ');return this._beforeListItem=this.createListItem(this.getPrevValue(),this.getOption("classes").before),this._afterListItem=this.createListItem(this.value,this.getOption("classes").active),i.append(this._beforeListItem.el),i.append(this._afterListItem.el),this.trigger("create:list",i),i}})}(jQuery),function(t){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},t.fn.FlipClock=function(i,e){return new FlipClock(t(this),i,e)},t.fn.flipClock=function(i,e){return t.fn.FlipClock(i,e)}}(jQuery),function(t){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({build:function(t){var t=t?t:this.time.getMilitaryTime(!1,this.showSeconds);for(var i in t)this.createList(t[i]);this.createDivider().$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider().$el.insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(t,i){this.autoIncrement(),t=t?t:this.time.getMilitaryTime(!1,this.showSeconds),this.base(t)}})}(jQuery),function(t){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(t,i){this.base(t,i),this.timer.off("stop"),this.on("before:start",function(){this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.on("create:list",function(t){t.addPlayClass()})},build:function(){var t=this,i=this.getTime().digitize([this.getTime().time]);for(var e in i)t.createList(i[e]);this.autoStart&&(this.shouldAutoIncrement=!0),this.base()},flip:function(t){this.shouldAutoIncrement&&this.autoIncrement(),t||(t=this.getTime().digitize([this.getTime().time])),this.base(t)},init:function(t){var i=this;t.increment=function(){i.increment(),i.flip()},t.decrement=function(){i.decrement(),i.flip()},this.base(t)}})}(jQuery),function(t){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,build:function(){var t=0,i=this.time.getDayCounter(this.showSeconds);for(var e in i)this.createList(i[e]);this.showSeconds?this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el):t=2,this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-4+t].$el),this.createDivider("Hours").$el.insertBefore(this.lists[this.lists.length-6+t].$el),this.createDivider("Days",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(){this.base(this.time.getDayCounter(this.showSeconds)),this.autoIncrement()}})}(jQuery),function(t){FlipClock.EnglishAlphabetFace=FlipClock.Face.extend({_autoIncrementValues:[],shouldAutoIncrement:!1,capitalLetters:!0,init:function(t){this.base(t),this.on("before:start",function(){console.log("before"),this.shouldAutoIncrement=!0}),this.on("before:stop",function(){this.shouldAutoIncrement=!1}),this.value||(this.value=this.getListObject(this.value).value)},build:function(){var t=this.value.split("");for(var i in t)this.createList(t[i]);for(var e in this.lists)this._autoIncrementValues.unshift(this.lists[e].getCharCode());this.base()},increment:function(){for(var t=!0,i=0,e=this.value.split("");t;){t=!1;var s=(this._autoIncrementValues[i],this.lists[this.lists.length-i-1]);s?(e[this.value.length-i-1]=s.getNextValue(),s.getCharCode()>=s.getMaxCharCode()&&(t=!0,i++)):e.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=e.join("")},decrement:function(){for(var t=!0,i=0,e=this.value.split("");t;){t=!1;var s=(this._autoIncrementValues[i],this.lists[this.lists.length-i-1]);s?(e[this.value.length-i-1]=s.getPrevValue(),s.getCharCode()<=s.getMinCharCode()&&(t=!0,i++)):e.unshift(String.fromCharCode(this.getListObject(!1).getMinCharCode()))}this.value=e.join("")},flip:function(){this.shouldAutoIncrement&&this.autoIncrement(),this.base(this.value.split(""))},getListClass:function(){return FlipClock.EnglishAlphaList},getListObject:function(t){var i=this.getListClass();return new i(t,{capitalLetters:this.capitalLetters,translator:this.translator})}})}(jQuery),function(t){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(t,i){this.base(t,i),null===this.getOption("includeSeconds")&&this.setOption("includeSeconds",!0)},build:function(t){var i=0,t=t?t:this.time.getHourCounter(this.getOption("includeSeconds"));for(var e in t)this.createList(t[e]);this.getOption("includeSeconds")===!0&&(i=2,this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-i].$el)),this.createDivider("Minutes").$el.insertBefore(this.lists[this.lists.length-2-i].$el),this.createDivider("Hours",!0).$el.insertBefore(this.lists[0].$el),this.base()},flip:function(t){t||(t=this.time.getHourCounter(this.getOption("includeSeconds"))),this.base(t),this.autoIncrement()},appendDigitToClock:function(t){this.base(t),this.dividers[0].insertAfter(this.dividers[0].next())}})}(jQuery),function(t){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({build:function(){var t=this.time.getMinuteCounter(this.getOption("includeSeconds"));for(var i in t)this.createList(t[i]);return this.getOption("includeSeconds")&&this.createDivider("Seconds").$el.insertBefore(this.lists[this.lists.length-2].$el),this.createDivider("Minutes").$el.insertBefore(this.lists[0].$el),FlipClock.Face.prototype.build.call(this)},flip:function(){this.base(this.time.getMinuteCounter(this.getOption("includeSeconds")))}})}(jQuery),function(t){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var i=this.time.getTime(!1,this.showSeconds);this.meridiumText=this.getMeridium(),this.$meridium=t(['"].join("")),this.base(i),this.$meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(t){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.$meridium.find("a").html(this.meridiumText)),this.base(this.time.getTime(!1,this.showSeconds))},getMeridium:function(){return(new Date).getHours()>=12?this.t("PM"):this.t("AM")},isPM:function(){return"PM"==this.getMeridium()},isAM:function(){return"AM"==this.getMeridium()}})}(jQuery),function(t){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(t){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(t){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(t){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(t){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"DÍas",hours:"Horas",minutes:"Minutos",seconds:"Segundo"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(t){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(t){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(t){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(t){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(t){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(t){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norwegian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(t){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(t){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(t){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(t){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..064aab14 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,75 @@ +var + gulp = require('gulp'), + browserSync = require('browser-sync').create(), + sass = require('gulp-sass'), + sourcemaps = require('gulp-sourcemaps'), + autoprefixer = require('gulp-autoprefixer'); + header = require('gulp-header'); + uglify = require('gulp-uglify'); + concat = require('gulp-concat'); + notify = require('gulp-notify'); + rename = require('gulp-rename'); + pkg = require('./package.json'); +; + +var banner = [ + '/* <%= pkg.name %> - v<%= pkg.version %> */', + '' +].join('\n'); + +// Static Server + watching scss/html files +gulp.task('dev', ['sass', 'dist'], function() { + + browserSync.init({ + server: { + baseDir: "examples", + routes: { + "/dist": "dist" + }, + directory: true + } + }); + + gulp.watch("src/flipclock/scss/**/*.scss", ['sass']); + gulp.watch("src/flipclock/js/**/*.js", ['dist']).on('change', browserSync.reload); + gulp.watch("examples/*.html").on('change', browserSync.reload); +}); + +// Minify js files +gulp.task('dist', function () { + return gulp.src([ + 'src/flipclock/js/vendor/*.js', + 'src/flipclock/js/libs/Base.js', + 'src/flipclock/js/libs/Plugins.js', + 'src/flipclock/js/libs/List.js', + 'src/flipclock/js/libs/ListItem.js', + 'src/flipclock/js/libs/EnglishAlphaList.js', + 'src/flipclock/js/libs/*.js', + 'src/flipclock/js/faces/TwentyFourHourClockFace.js', + 'src/flipclock/js/faces/*.js', + 'src/flipclock/js/lang/*.js' + ]) //select all javascript files + .pipe(concat('flipclock.js')) //the name of the resulting file + .pipe(gulp.dest('dist')) //the destination folder + .pipe(rename('flipclock.min.js')) + .pipe(uglify()) + .pipe(header(banner, {pkg: pkg})) + .pipe(gulp.dest('dist')) + .pipe(notify({ message: 'Finished minifying JavaScript'})); +}); + +// Compile sass into CSS & auto-inject into browsers +gulp.task('sass', function() { + return gulp.src("src/flipclock/scss/**/*.scss") + .pipe(sourcemaps.init()) + .pipe(sass({outputStyle: 'compressed'})) + .pipe(autoprefixer({ + browsers: ['last 2 versions'], + cascade: false + })) + .pipe(sourcemaps.write("./")) + .pipe(gulp.dest("dist")) + .pipe(browserSync.stream()); +}); + +gulp.task('default', ['dev']); \ No newline at end of file diff --git a/package.json b/package.json index 018f5354..8cfbe690 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,35 @@ "version": "0.7.8", "email": "support@objectivehtml.com", "author": "Objective HTML, LLC ", + "contributors": [ + "Objective HTML, LLC ", + "Brian Espinosa " + ], + "description": "A fully featured countdown clock.", + "keywords": ["clock", "countdown", "time", "javascript", "html", "css", "sass", "scss"], "license": "MIT", + "engines": { + "node": "^0.12.x", + "npm": "^2.1.x" + }, "devDependencies": { "grunt": "~0.4.2", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-jshint": "~0.6.3", - "grunt-contrib-uglify": "~0.2.7" + "grunt-contrib-uglify": "~0.2.7", + "browser-sync": "^2.11.1", + "gulp": "^3.9.0", + "gulp-autoprefixer": "^2.3.1", + "gulp-concat": "^2.6.0", + "gulp-header": "^1.7.1", + "gulp-notify": "^2.2.0", + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.0.x", + "gulp-sourcemaps": "^1.6.0", + "gulp-strip-css-comments": "^1.2.0", + "gulp-uglify": "^1.4.2" }, + "homepage": "http://flipclockjs.com/", "repository": { "type": "git", "url": "https://github.com/objectivehtml/FlipClock" From 083480b2b522c0a7945117599f5d3bd60b662ad1 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Mon, 29 Feb 2016 22:12:15 -0800 Subject: [PATCH 074/129] updated readme with development info Signed-off-by: Brian Espinosa --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 8b3baf2d..54f225d3 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ Website and documentation at http://flipclockjs.com/ --- +### Development + +All files are compiled with Gulp. Once you are in the FlipClock directory, run the command `npm install` followed by the command `gulp dev` which will compile all source. Additionally, BrowserSync will launch a directory of all examples. Editing anything in the examples or src directory will cause the browser to automatically reload or inject style changes. + +--- + ### License Copyright (c) 2013 Objective HTML, LCC shared under MIT LICENSE From 0b5f05e7d30ad452b59e43e9e97cfe18a38f1699 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Tue, 1 Mar 2016 18:17:31 -0800 Subject: [PATCH 075/129] alert compiled sass Signed-off-by: Brian Espinosa --- gulpfile.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 064aab14..793648a4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,9 +51,9 @@ gulp.task('dist', function () { ]) //select all javascript files .pipe(concat('flipclock.js')) //the name of the resulting file .pipe(gulp.dest('dist')) //the destination folder - .pipe(rename('flipclock.min.js')) + .pipe(rename('flipclock.min.js')) //minify the compiled js .pipe(uglify()) - .pipe(header(banner, {pkg: pkg})) + .pipe(header(banner, {pkg: pkg})) //add a small version banner to the minified js .pipe(gulp.dest('dist')) .pipe(notify({ message: 'Finished minifying JavaScript'})); }); @@ -69,7 +69,8 @@ gulp.task('sass', function() { })) .pipe(sourcemaps.write("./")) .pipe(gulp.dest("dist")) - .pipe(browserSync.stream()); + .pipe(browserSync.stream()) + .pipe(notify({ message: 'Styles recompiled'})); }); gulp.task('default', ['dev']); \ No newline at end of file From 614a1712d68db5e113fbc2d9988ed6621c7aa117 Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Tue, 1 Mar 2016 18:17:46 -0800 Subject: [PATCH 076/129] separate styles to separate modules Signed-off-by: Brian Espinosa --- dist/flipclock copy.css | 3 + dist/flipclock copy.css.map | 1 + dist/flipclock.css.map | 2 +- src/flipclock/scss/_fc-base.scss | 293 ++++++++++++++++++++++++ src/flipclock/scss/_fc-variables.scss | 4 + src/flipclock/scss/_theme-default.scss | 4 + src/flipclock/scss/flipclock.scss | 299 +------------------------ 7 files changed, 315 insertions(+), 291 deletions(-) create mode 100644 dist/flipclock copy.css create mode 100644 dist/flipclock copy.css.map create mode 100644 src/flipclock/scss/_fc-base.scss create mode 100644 src/flipclock/scss/_fc-variables.scss create mode 100644 src/flipclock/scss/_theme-default.scss diff --git a/dist/flipclock copy.css b/dist/flipclock copy.css new file mode 100644 index 00000000..9a33bdf7 --- /dev/null +++ b/dist/flipclock copy.css @@ -0,0 +1,3 @@ +.flip-clock-wrapper *{box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden}.flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.flip-clock-wrapper a:hover{color:#fff}.flip-clock-wrapper ul{list-style:none}.flip-clock-wrapper.clearfix:before,.flip-clock-wrapper.clearfix:after{content:" ";display:table}.flip-clock-wrapper.clearfix:after{clear:both}.flip-clock-wrapper.clearfix{*zoom:1}.flip-clock-wrapper{font:normal 11px "Helvetica Neue", Helvetica, sans-serif;-webkit-user-select:none}.flip-clock-meridium{background:none !important;box-shadow:0 0 0 !important;font-size:36px !important}.flip-clock-meridium a{color:#313333}.flip-clock-wrapper{text-align:center;position:relative;width:100%;margin:1em}.flip-clock-wrapper:before,.flip-clock-wrapper:after{content:" ";display:table}.flip-clock-wrapper:after{clear:both}.flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:bold;line-height:87px;border-radius:6px;background:#000}.flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none !important}.flip-clock-wrapper ul li:first-child{z-index:2}.flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;perspective:200px;margin:0 !important;overflow:visible !important;cursor:default !important}.flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,0.4)}.flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}.flip-clock-wrapper ul li a div.up div.inn{top:0}.flip-clock-wrapper ul li a div.down div.inn{bottom:0}.flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,0.7)}.flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd 0.5s 0.5s linear both;animation:asd 0.5s 0.5s linear both;z-index:5}.flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flip-clock-divider:first-child{width:0}.flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,0.5);left:5px}.flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:black;text-shadow:none}.flip-clock-divider.minutes .flip-clock-label{right:-88px}.flip-clock-divider.seconds .flip-clock-label{right:-91px}.flip-clock-dot.top{top:30px}.flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}.flip-clock-wrapper ul.play li.flip-clock-active .down{-webkit-animation:turn 0.5s 0.5s linear both;animation:turn 0.5s 0.5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 0.5s linear both;animation:turn2 0.5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}@keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}.flip-clock-wrapper ul li.flip-clock-active{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:hide 0.5s 0.3s linear both;animation:hide 0.5s 0.3s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:hide 0.5s 0.2s linear both;animation:hide 0.5s 0.2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}} + +/*# sourceMappingURL=flipclock copy.css.map */ diff --git a/dist/flipclock copy.css.map b/dist/flipclock copy.css.map new file mode 100644 index 00000000..9fceb3c7 --- /dev/null +++ b/dist/flipclock copy.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["flipclock copy.scss"],"names":[],"mappings":"AAAA,sBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,sBACE,eACA,qBACA,UAAY,CAAG,4BAGf,UAAY,CAAG,uBAGf,eAAiB,CAAG,uEAIpB,YACA,aAAe,CAEjB,mCACE,UAAY,CAEd,8BACE,MAAS,CAAG,oBAIZ,yDACA,wBAA0B,CAAG,qBAG7B,2BACA,4BACA,yBAA2B,CAE7B,uBAAyB,aAAe,CAAI,oBAG1C,kBACA,kBACA,WACA,UAAY,CAGd,qDAEI,YACA,aAAe,CAEnB,0BACI,UAAY,CAIhB,uBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,0BAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,sCAGC,SAAW,CAEb,4BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,gCAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,wCAGlC,kBACA,WACA,YACA,SAAW,CAAG,mCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,yCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,qCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,wCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,2CAGnB,KAAO,CAAG,6CAGV,QAAU,CAGZ,iDACE,SAAW,CAEb,0BAA8B,oCAA0B,CAAkB,iDAGxE,4CAAA,AACA,oCAAA,SAAW,CAEb,oBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,gCAGjB,OAAS,CAAG,gBAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,sCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,8CAGrB,WAAa,CAEf,8CACE,WAAa,CAAG,oBAGhB,QAAU,CAAG,uBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,uDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,qDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,4CACE,SAAW,CAAG,6DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,6DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,+DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,+DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock copy.css","sourcesContent":[".flip-clock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flip-clock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flip-clock-wrapper a:hover {\n color: #fff; }\n\n.flip-clock-wrapper ul {\n list-style: none; }\n\n.flip-clock-wrapper.clearfix:before,\n.flip-clock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flip-clock-wrapper.clearfix:after {\n clear: both; }\n\n.flip-clock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flip-clock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flip-clock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flip-clock-meridium a { color: #313333; }\n\n.flip-clock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flip-clock-wrapper:before,\n.flip-clock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flip-clock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flip-clock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flip-clock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flip-clock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flip-clock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flip-clock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flip-clock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flip-clock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flip-clock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flip-clock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flip-clock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flip-clock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flip-clock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flip-clock-wrapper ul.play li.flip-clock-before {\n z-index: 3; }\n\n.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flip-clock-wrapper ul.play li.flip-clock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flip-clock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flip-clock-divider:first-child {\n width: 0; }\n\n.flip-clock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flip-clock-divider .flip-clock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flip-clock-divider.minutes .flip-clock-label {\n right: -88px; }\n\n.flip-clock-divider.seconds .flip-clock-label {\n right: -91px; }\n\n.flip-clock-dot.top {\n top: 30px; }\n\n.flip-clock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flip-clock-wrapper ul.play li.flip-clock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flip-clock-wrapper ul li.flip-clock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/flipclock.css.map b/dist/flipclock.css.map index b4a62c43..2549e0f4 100644 --- a/dist/flipclock.css.map +++ b/dist/flipclock.css.map @@ -1 +1 @@ -{"version":3,"sources":["flipclock.scss"],"names":[],"mappings":"AAAA,sBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,sBACE,eACA,qBACA,UAAY,CAAG,4BAGf,UAAY,CAAG,uBAGf,eAAiB,CAAG,uEAIpB,YACA,aAAe,CAEjB,mCACE,UAAY,CAEd,8BACE,MAAS,CAAG,oBAIZ,yDACA,wBAA0B,CAAG,qBAG7B,2BACA,4BACA,yBAA2B,CAE7B,uBAAyB,aAAe,CAAI,oBAG1C,kBACA,kBACA,WACA,UAAY,CAGd,qDAEI,YACA,aAAe,CAEnB,0BACI,UAAY,CAIhB,uBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,0BAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,sCAGC,SAAW,CAEb,4BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,gCAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,wCAGlC,kBACA,WACA,YACA,SAAW,CAAG,mCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,yCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,qCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,wCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,2CAGnB,KAAO,CAAG,6CAGV,QAAU,CAGZ,iDACE,SAAW,CAEb,0BAA8B,oCAA0B,CAAkB,iDAGxE,4CAAA,AACA,oCAAA,SAAW,CAEb,oBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,gCAGjB,OAAS,CAAG,gBAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,sCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,8CAGrB,WAAa,CAEf,8CACE,WAAa,CAAG,oBAGhB,QAAU,CAAG,uBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,uDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,qDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,4CACE,SAAW,CAAG,6DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,6DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,+DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,+DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock.css","sourcesContent":[".flip-clock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flip-clock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flip-clock-wrapper a:hover {\n color: #fff; }\n\n.flip-clock-wrapper ul {\n list-style: none; }\n\n.flip-clock-wrapper.clearfix:before,\n.flip-clock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flip-clock-wrapper.clearfix:after {\n clear: both; }\n\n.flip-clock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flip-clock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flip-clock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flip-clock-meridium a { color: #313333; }\n\n.flip-clock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flip-clock-wrapper:before,\n.flip-clock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flip-clock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flip-clock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flip-clock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flip-clock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flip-clock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flip-clock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flip-clock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flip-clock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flip-clock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flip-clock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flip-clock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flip-clock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flip-clock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flip-clock-wrapper ul.play li.flip-clock-before {\n z-index: 3; }\n\n.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flip-clock-wrapper ul.play li.flip-clock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flip-clock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flip-clock-divider:first-child {\n width: 0; }\n\n.flip-clock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flip-clock-divider .flip-clock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flip-clock-divider.minutes .flip-clock-label {\n right: -88px; }\n\n.flip-clock-divider.seconds .flip-clock-label {\n right: -91px; }\n\n.flip-clock-dot.top {\n top: 30px; }\n\n.flip-clock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flip-clock-wrapper ul.play li.flip-clock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flip-clock-wrapper ul li.flip-clock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["_fc-base.scss"],"names":[],"mappings":"AAAA,sBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,sBACE,eACA,qBACA,UAAY,CAAG,4BAGf,UAAY,CAAG,uBAGf,eAAiB,CAAG,uEAIpB,YACA,aAAe,CAEjB,mCACE,UAAY,CAEd,8BACE,MAAS,CAAG,oBAIZ,yDACA,wBAA0B,CAAG,qBAG7B,2BACA,4BACA,yBAA2B,CAE7B,uBAAyB,aAAe,CAAI,oBAG1C,kBACA,kBACA,WACA,UAAY,CAGd,qDAEI,YACA,aAAe,CAEnB,0BACI,UAAY,CAIhB,uBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,0BAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,sCAGC,SAAW,CAEb,4BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,gCAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,wCAGlC,kBACA,WACA,YACA,SAAW,CAAG,mCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,yCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,qCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,wCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,2CAGnB,KAAO,CAAG,6CAGV,QAAU,CAGZ,iDACE,SAAW,CAEb,0BAA8B,oCAA0B,CAAkB,iDAGxE,4CAAA,AACA,oCAAA,SAAW,CAEb,oBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,gCAGjB,OAAS,CAAG,gBAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,sCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,8CAGrB,WAAa,CAEf,8CACE,WAAa,CAAG,oBAGhB,QAAU,CAAG,uBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,uDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,qDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,4CACE,SAAW,CAAG,6DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,6DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,+DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,+DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock.css","sourcesContent":[".flip-clock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flip-clock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flip-clock-wrapper a:hover {\n color: #fff; }\n\n.flip-clock-wrapper ul {\n list-style: none; }\n\n.flip-clock-wrapper.clearfix:before,\n.flip-clock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flip-clock-wrapper.clearfix:after {\n clear: both; }\n\n.flip-clock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flip-clock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flip-clock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flip-clock-meridium a { color: #313333; }\n\n.flip-clock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flip-clock-wrapper:before,\n.flip-clock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flip-clock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flip-clock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flip-clock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flip-clock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flip-clock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flip-clock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flip-clock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flip-clock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flip-clock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flip-clock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flip-clock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flip-clock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flip-clock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flip-clock-wrapper ul.play li.flip-clock-before {\n z-index: 3; }\n\n.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flip-clock-wrapper ul.play li.flip-clock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flip-clock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flip-clock-divider:first-child {\n width: 0; }\n\n.flip-clock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flip-clock-divider .flip-clock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flip-clock-divider.minutes .flip-clock-label {\n right: -88px; }\n\n.flip-clock-divider.seconds .flip-clock-label {\n right: -91px; }\n\n.flip-clock-dot.top {\n top: 30px; }\n\n.flip-clock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flip-clock-wrapper ul.play li.flip-clock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flip-clock-wrapper ul li.flip-clock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/src/flipclock/scss/_fc-base.scss b/src/flipclock/scss/_fc-base.scss new file mode 100644 index 00000000..8e02186c --- /dev/null +++ b/src/flipclock/scss/_fc-base.scss @@ -0,0 +1,293 @@ +.flip-clock-wrapper * { + box-sizing: border-box; + backface-visibility: hidden; +} + +.flip-clock-wrapper a { + cursor: pointer; + text-decoration: none; + color: #ccc; } + +.flip-clock-wrapper a:hover { + color: #fff; } + +.flip-clock-wrapper ul { + list-style: none; } + +.flip-clock-wrapper.clearfix:before, +.flip-clock-wrapper.clearfix:after { + content: " "; + display: table; } + +.flip-clock-wrapper.clearfix:after { + clear: both; } + +.flip-clock-wrapper.clearfix { + *zoom: 1; } + +/* Main */ +.flip-clock-wrapper { + font: normal 11px "Helvetica Neue", Helvetica, sans-serif; + -webkit-user-select: none; } + +.flip-clock-meridium { + background: none !important; + box-shadow: 0 0 0 !important; + font-size: 36px !important; } + +.flip-clock-meridium a { color: #313333; } + +.flip-clock-wrapper { + text-align: center; + position: relative; + width: 100%; + margin: 1em; +} + +.flip-clock-wrapper:before, +.flip-clock-wrapper:after { + content: " "; /* 1 */ + display: table; /* 2 */ +} +.flip-clock-wrapper:after { + clear: both; +} + +/* Skeleton */ +.flip-clock-wrapper ul { + position: relative; + float: left; + margin: 5px; + width: 60px; + height: 90px; + font-size: 80px; + font-weight: bold; + line-height: 87px; + border-radius: 6px; + background: #000; +} + +.flip-clock-wrapper ul li { + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + line-height: 87px; + text-decoration: none !important; +} + +.flip-clock-wrapper ul li:first-child { + z-index: 2; } + +.flip-clock-wrapper ul li a { + display: block; + height: 100%; + -webkit-perspective: 200px; + -moz-perspective: 200px; + perspective: 200px; + margin: 0 !important; + overflow: visible !important; + cursor: default !important; } + +.flip-clock-wrapper ul li a div { + z-index: 1; + position: absolute; + left: 0; + width: 100%; + height: 50%; + font-size: 80px; + overflow: hidden; + outline: 1px solid transparent; } + +.flip-clock-wrapper ul li a div .shadow { + position: absolute; + width: 100%; + height: 100%; + z-index: 2; } + +.flip-clock-wrapper ul li a div.up { + transform-origin: 50% 100%; + top: 0; } + +.flip-clock-wrapper ul li a div.up:after { + content: ""; + position: absolute; + top: 44px; + left: 0; + z-index: 5; + width: 100%; + height: 3px; + background-color: #000; + background-color: rgba(0, 0, 0, 0.4); } + +.flip-clock-wrapper ul li a div.down { + transform-origin: 50% 0; + bottom: 0; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +.flip-clock-wrapper ul li a div div.inn { + position: absolute; + left: 0; + z-index: 1; + width: 100%; + height: 200%; + color: #ccc; + text-shadow: 0 1px 2px #000; + text-align: center; + background-color: #333; + border-radius: 6px; + font-size: 70px; } + +.flip-clock-wrapper ul li a div.up div.inn { + top: 0; } + +.flip-clock-wrapper ul li a div.down div.inn { + bottom: 0; } + +/* PLAY */ +.flip-clock-wrapper ul.play li.flip-clock-before { + z-index: 3; } + +.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); } + +.flip-clock-wrapper ul.play li.flip-clock-active { + animation: asd 0.5s 0.5s linear both; + z-index: 5; } + +.flip-clock-divider { + float: left; + display: inline-block; + position: relative; + width: 20px; + height: 100px; } + +.flip-clock-divider:first-child { + width: 0; } + +.flip-clock-dot { + display: block; + background: #323434; + width: 10px; + height: 10px; + position: absolute; + border-radius: 50%; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); + left: 5px; } + +.flip-clock-divider .flip-clock-label { + position: absolute; + top: -1.5em; + right: -86px; + color: black; + text-shadow: none; } + +.flip-clock-divider.minutes .flip-clock-label { + right: -88px; } + +.flip-clock-divider.seconds .flip-clock-label { + right: -91px; } + +.flip-clock-dot.top { + top: 30px; } + +.flip-clock-dot.bottom { + bottom: 30px; } + +@keyframes asd { + 0% { + z-index: 2; } + + 20% { + z-index: 4; } + + 100% { + z-index: 4; } } + +.flip-clock-wrapper ul.play li.flip-clock-active .down { + animation: turn 0.5s 0.5s linear both; } + +@keyframes turn { + 0% { + transform: rotateX(90deg); } + + 100% { + transform: rotateX(0deg); } } + +.flip-clock-wrapper ul.play li.flip-clock-before .up { + z-index: 2; + animation: turn2 0.5s linear both; } + +@keyframes turn2 { + 0% { + transform: rotateX(0deg); + } + + 100% { + transform: rotateX(-90deg); + } +} + +.flip-clock-wrapper ul li.flip-clock-active { + z-index: 3; } + +/* SHADOW */ +.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { + background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; + background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; + animation: show 0.5s linear both; } + +.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { + background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; + background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; + animation: hide 0.5s 0.3s linear both; } + +/*DOWN*/ +.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { + background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); + background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; + animation: show 0.5s linear both; } + +.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { + background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); + background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); + background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; + animation: hide 0.5s 0.2s linear both; } + +@keyframes show { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@keyframes hide { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} diff --git a/src/flipclock/scss/_fc-variables.scss b/src/flipclock/scss/_fc-variables.scss new file mode 100644 index 00000000..81a64be4 --- /dev/null +++ b/src/flipclock/scss/_fc-variables.scss @@ -0,0 +1,4 @@ +// +// FlipClock Variables +// + diff --git a/src/flipclock/scss/_theme-default.scss b/src/flipclock/scss/_theme-default.scss new file mode 100644 index 00000000..4366a103 --- /dev/null +++ b/src/flipclock/scss/_theme-default.scss @@ -0,0 +1,4 @@ +// +// FlipClock Theme: Default +// + diff --git a/src/flipclock/scss/flipclock.scss b/src/flipclock/scss/flipclock.scss index 8e02186c..d0bc9876 100644 --- a/src/flipclock/scss/flipclock.scss +++ b/src/flipclock/scss/flipclock.scss @@ -1,293 +1,12 @@ -.flip-clock-wrapper * { - box-sizing: border-box; - backface-visibility: hidden; -} +// +// Imports +// -.flip-clock-wrapper a { - cursor: pointer; - text-decoration: none; - color: #ccc; } +// Project Variables +@import "fc-variables"; -.flip-clock-wrapper a:hover { - color: #fff; } +// Flipclock Base Styles +@import "fc-base"; -.flip-clock-wrapper ul { - list-style: none; } - -.flip-clock-wrapper.clearfix:before, -.flip-clock-wrapper.clearfix:after { - content: " "; - display: table; } - -.flip-clock-wrapper.clearfix:after { - clear: both; } - -.flip-clock-wrapper.clearfix { - *zoom: 1; } - -/* Main */ -.flip-clock-wrapper { - font: normal 11px "Helvetica Neue", Helvetica, sans-serif; - -webkit-user-select: none; } - -.flip-clock-meridium { - background: none !important; - box-shadow: 0 0 0 !important; - font-size: 36px !important; } - -.flip-clock-meridium a { color: #313333; } - -.flip-clock-wrapper { - text-align: center; - position: relative; - width: 100%; - margin: 1em; -} - -.flip-clock-wrapper:before, -.flip-clock-wrapper:after { - content: " "; /* 1 */ - display: table; /* 2 */ -} -.flip-clock-wrapper:after { - clear: both; -} - -/* Skeleton */ -.flip-clock-wrapper ul { - position: relative; - float: left; - margin: 5px; - width: 60px; - height: 90px; - font-size: 80px; - font-weight: bold; - line-height: 87px; - border-radius: 6px; - background: #000; -} - -.flip-clock-wrapper ul li { - z-index: 1; - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - line-height: 87px; - text-decoration: none !important; -} - -.flip-clock-wrapper ul li:first-child { - z-index: 2; } - -.flip-clock-wrapper ul li a { - display: block; - height: 100%; - -webkit-perspective: 200px; - -moz-perspective: 200px; - perspective: 200px; - margin: 0 !important; - overflow: visible !important; - cursor: default !important; } - -.flip-clock-wrapper ul li a div { - z-index: 1; - position: absolute; - left: 0; - width: 100%; - height: 50%; - font-size: 80px; - overflow: hidden; - outline: 1px solid transparent; } - -.flip-clock-wrapper ul li a div .shadow { - position: absolute; - width: 100%; - height: 100%; - z-index: 2; } - -.flip-clock-wrapper ul li a div.up { - transform-origin: 50% 100%; - top: 0; } - -.flip-clock-wrapper ul li a div.up:after { - content: ""; - position: absolute; - top: 44px; - left: 0; - z-index: 5; - width: 100%; - height: 3px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.4); } - -.flip-clock-wrapper ul li a div.down { - transform-origin: 50% 0; - bottom: 0; - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; -} - -.flip-clock-wrapper ul li a div div.inn { - position: absolute; - left: 0; - z-index: 1; - width: 100%; - height: 200%; - color: #ccc; - text-shadow: 0 1px 2px #000; - text-align: center; - background-color: #333; - border-radius: 6px; - font-size: 70px; } - -.flip-clock-wrapper ul li a div.up div.inn { - top: 0; } - -.flip-clock-wrapper ul li a div.down div.inn { - bottom: 0; } - -/* PLAY */ -.flip-clock-wrapper ul.play li.flip-clock-before { - z-index: 3; } - -.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); } - -.flip-clock-wrapper ul.play li.flip-clock-active { - animation: asd 0.5s 0.5s linear both; - z-index: 5; } - -.flip-clock-divider { - float: left; - display: inline-block; - position: relative; - width: 20px; - height: 100px; } - -.flip-clock-divider:first-child { - width: 0; } - -.flip-clock-dot { - display: block; - background: #323434; - width: 10px; - height: 10px; - position: absolute; - border-radius: 50%; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); - left: 5px; } - -.flip-clock-divider .flip-clock-label { - position: absolute; - top: -1.5em; - right: -86px; - color: black; - text-shadow: none; } - -.flip-clock-divider.minutes .flip-clock-label { - right: -88px; } - -.flip-clock-divider.seconds .flip-clock-label { - right: -91px; } - -.flip-clock-dot.top { - top: 30px; } - -.flip-clock-dot.bottom { - bottom: 30px; } - -@keyframes asd { - 0% { - z-index: 2; } - - 20% { - z-index: 4; } - - 100% { - z-index: 4; } } - -.flip-clock-wrapper ul.play li.flip-clock-active .down { - animation: turn 0.5s 0.5s linear both; } - -@keyframes turn { - 0% { - transform: rotateX(90deg); } - - 100% { - transform: rotateX(0deg); } } - -.flip-clock-wrapper ul.play li.flip-clock-before .up { - z-index: 2; - animation: turn2 0.5s linear both; } - -@keyframes turn2 { - 0% { - transform: rotateX(0deg); - } - - 100% { - transform: rotateX(-90deg); - } -} - -.flip-clock-wrapper ul li.flip-clock-active { - z-index: 3; } - -/* SHADOW */ -.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); - background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; - background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - animation: show 0.5s linear both; } - -.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { - background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black)); - background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%; - background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%); - background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%; - animation: hide 0.5s 0.3s linear both; } - -/*DOWN*/ -.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { - background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); - background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; - background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - animation: show 0.5s linear both; } - -.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { - background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1))); - background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%; - background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%); - background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%; - animation: hide 0.5s 0.2s linear both; } - -@keyframes show { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } -} - -@keyframes hide { - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -} +// Theme Styles +@import "theme-default"; \ No newline at end of file From 81a74ece781f1db89ae07464abe2fbdeb60d5f8a Mon Sep 17 00:00:00 2001 From: Brian Espinosa Date: Wed, 2 Mar 2016 10:15:04 -0800 Subject: [PATCH 077/129] refactor flip-clock to flipclock Signed-off-by: Brian Espinosa --- dist/flipclock.css | 2 +- dist/flipclock.css.map | 2 +- dist/flipclock.js | 18 ++-- dist/flipclock.min.js | 2 +- src/flipclock/js/faces/TwelveHourClockFace.js | 2 +- src/flipclock/js/libs/Divider.js | 6 +- src/flipclock/js/libs/Factory.js | 2 +- src/flipclock/js/libs/list.js | 4 +- src/flipclock/scss/_fc-base.scss | 90 +++++++++---------- 9 files changed, 64 insertions(+), 64 deletions(-) diff --git a/dist/flipclock.css b/dist/flipclock.css index b1068deb..6fff4b35 100644 --- a/dist/flipclock.css +++ b/dist/flipclock.css @@ -1,3 +1,3 @@ -.flip-clock-wrapper *{box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden}.flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.flip-clock-wrapper a:hover{color:#fff}.flip-clock-wrapper ul{list-style:none}.flip-clock-wrapper.clearfix:before,.flip-clock-wrapper.clearfix:after{content:" ";display:table}.flip-clock-wrapper.clearfix:after{clear:both}.flip-clock-wrapper.clearfix{*zoom:1}.flip-clock-wrapper{font:normal 11px "Helvetica Neue", Helvetica, sans-serif;-webkit-user-select:none}.flip-clock-meridium{background:none !important;box-shadow:0 0 0 !important;font-size:36px !important}.flip-clock-meridium a{color:#313333}.flip-clock-wrapper{text-align:center;position:relative;width:100%;margin:1em}.flip-clock-wrapper:before,.flip-clock-wrapper:after{content:" ";display:table}.flip-clock-wrapper:after{clear:both}.flip-clock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:bold;line-height:87px;border-radius:6px;background:#000}.flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none !important}.flip-clock-wrapper ul li:first-child{z-index:2}.flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;perspective:200px;margin:0 !important;overflow:visible !important;cursor:default !important}.flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,0.4)}.flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}.flip-clock-wrapper ul li a div.up div.inn{top:0}.flip-clock-wrapper ul li a div.down div.inn{bottom:0}.flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,0.7)}.flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd 0.5s 0.5s linear both;animation:asd 0.5s 0.5s linear both;z-index:5}.flip-clock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flip-clock-divider:first-child{width:0}.flip-clock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,0.5);left:5px}.flip-clock-divider .flip-clock-label{position:absolute;top:-1.5em;right:-86px;color:black;text-shadow:none}.flip-clock-divider.minutes .flip-clock-label{right:-88px}.flip-clock-divider.seconds .flip-clock-label{right:-91px}.flip-clock-dot.top{top:30px}.flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}.flip-clock-wrapper ul.play li.flip-clock-active .down{-webkit-animation:turn 0.5s 0.5s linear both;animation:turn 0.5s 0.5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 0.5s linear both;animation:turn2 0.5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}@keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}.flip-clock-wrapper ul li.flip-clock-active{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:hide 0.5s 0.3s linear both;animation:hide 0.5s 0.3s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:hide 0.5s 0.2s linear both;animation:hide 0.5s 0.2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}} +.flipclock-wrapper *{box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden}.flipclock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.flipclock-wrapper a:hover{color:#fff}.flipclock-wrapper ul{list-style:none}.flipclock-wrapper.clearfix:before,.flipclock-wrapper.clearfix:after{content:" ";display:table}.flipclock-wrapper.clearfix:after{clear:both}.flipclock-wrapper.clearfix{*zoom:1}.flipclock-wrapper{font:normal 11px "Helvetica Neue", Helvetica, sans-serif;-webkit-user-select:none}.flipclock-meridium{background:none !important;box-shadow:0 0 0 !important;font-size:36px !important}.flipclock-meridium a{color:#313333}.flipclock-wrapper{text-align:center;position:relative;width:100%;margin:1em}.flipclock-wrapper:before,.flipclock-wrapper:after{content:" ";display:table}.flipclock-wrapper:after{clear:both}.flipclock-wrapper ul{position:relative;float:left;margin:5px;width:60px;height:90px;font-size:80px;font-weight:bold;line-height:87px;border-radius:6px;background:#000}.flipclock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:87px;text-decoration:none !important}.flipclock-wrapper ul li:first-child{z-index:2}.flipclock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;perspective:200px;margin:0 !important;overflow:visible !important;cursor:default !important}.flipclock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.flipclock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.flipclock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.flipclock-wrapper ul li a div.up:after{content:"";position:absolute;top:44px;left:0;z-index:5;width:100%;height:3px;background-color:#000;background-color:rgba(0,0,0,0.4)}.flipclock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:6px;border-bottom-right-radius:6px}.flipclock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#ccc;text-shadow:0 1px 2px #000;text-align:center;background-color:#333;border-radius:6px;font-size:70px}.flipclock-wrapper ul li a div.up div.inn{top:0}.flipclock-wrapper ul li a div.down div.inn{bottom:0}.flipclock-wrapper ul.play li.flipclock-before{z-index:3}.flipclock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,0.7)}.flipclock-wrapper ul.play li.flipclock-active{-webkit-animation:asd 0.5s 0.5s linear both;animation:asd 0.5s 0.5s linear both;z-index:5}.flipclock-divider{float:left;display:inline-block;position:relative;width:20px;height:100px}.flipclock-divider:first-child{width:0}.flipclock-dot{display:block;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,0.5);left:5px}.flipclock-divider .flipclock-label{position:absolute;top:-1.5em;right:-86px;color:black;text-shadow:none}.flipclock-divider.minutes .flipclock-label{right:-88px}.flipclock-divider.seconds .flipclock-label{right:-91px}.flipclock-dot.top{top:30px}.flipclock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}.flipclock-wrapper ul.play li.flipclock-active .down{-webkit-animation:turn 0.5s 0.5s linear both;animation:turn 0.5s 0.5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@keyframes turn{0%{-webkit-transform:rotateX(90deg);transform:rotateX(90deg)}100%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}.flipclock-wrapper ul.play li.flipclock-before .up{z-index:2;-webkit-animation:turn2 0.5s linear both;animation:turn2 0.5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}@keyframes turn2{0%{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}100%{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg)}}.flipclock-wrapper ul li.flipclock-active{z-index:3}.flipclock-wrapper ul.play li.flipclock-before .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flipclock-wrapper ul.play li.flipclock-active .up .shadow{background:-moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.1)), color-stop(100%, #000));background:linear,top,rgba(0,0,0,0.1) 0%,#000 100%;background:-ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, #000 100%);background:linear,to bottom,rgba(0,0,0,0.1) 0%,#000 100%;-webkit-animation:hide 0.5s 0.3s linear both;animation:hide 0.5s 0.3s linear both}.flipclock-wrapper ul.play li.flipclock-before .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:show 0.5s linear both;animation:show 0.5s linear both}.flipclock-wrapper ul.play li.flipclock-active .down .shadow{background:-moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #000), color-stop(100%, rgba(0,0,0,0.1)));background:linear,top,#000 0%,rgba(0,0,0,0.1) 100%;background:-ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.1) 100%);background:linear,to bottom,#000 0%,rgba(0,0,0,0.1) 100%;-webkit-animation:hide 0.5s 0.2s linear both;animation:hide 0.5s 0.2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}} /*# sourceMappingURL=flipclock.css.map */ diff --git a/dist/flipclock.css.map b/dist/flipclock.css.map index 2549e0f4..73c8e517 100644 --- a/dist/flipclock.css.map +++ b/dist/flipclock.css.map @@ -1 +1 @@ -{"version":3,"sources":["_fc-base.scss"],"names":[],"mappings":"AAAA,sBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,sBACE,eACA,qBACA,UAAY,CAAG,4BAGf,UAAY,CAAG,uBAGf,eAAiB,CAAG,uEAIpB,YACA,aAAe,CAEjB,mCACE,UAAY,CAEd,8BACE,MAAS,CAAG,oBAIZ,yDACA,wBAA0B,CAAG,qBAG7B,2BACA,4BACA,yBAA2B,CAE7B,uBAAyB,aAAe,CAAI,oBAG1C,kBACA,kBACA,WACA,UAAY,CAGd,qDAEI,YACA,aAAe,CAEnB,0BACI,UAAY,CAIhB,uBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,0BAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,sCAGC,SAAW,CAEb,4BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,gCAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,wCAGlC,kBACA,WACA,YACA,SAAW,CAAG,mCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,yCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,qCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,wCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,2CAGnB,KAAO,CAAG,6CAGV,QAAU,CAGZ,iDACE,SAAW,CAEb,0BAA8B,oCAA0B,CAAkB,iDAGxE,4CAAA,AACA,oCAAA,SAAW,CAEb,oBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,gCAGjB,OAAS,CAAG,gBAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,sCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,8CAGrB,WAAa,CAEf,8CACE,WAAa,CAAG,oBAGhB,QAAU,CAAG,uBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,uDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,qDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,4CACE,SAAW,CAAG,6DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,6DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,+DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,+DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock.css","sourcesContent":[".flip-clock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flip-clock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flip-clock-wrapper a:hover {\n color: #fff; }\n\n.flip-clock-wrapper ul {\n list-style: none; }\n\n.flip-clock-wrapper.clearfix:before,\n.flip-clock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flip-clock-wrapper.clearfix:after {\n clear: both; }\n\n.flip-clock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flip-clock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flip-clock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flip-clock-meridium a { color: #313333; }\n\n.flip-clock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flip-clock-wrapper:before,\n.flip-clock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flip-clock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flip-clock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flip-clock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flip-clock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flip-clock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flip-clock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flip-clock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flip-clock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flip-clock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flip-clock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flip-clock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flip-clock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flip-clock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flip-clock-wrapper ul.play li.flip-clock-before {\n z-index: 3; }\n\n.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flip-clock-wrapper ul.play li.flip-clock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flip-clock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flip-clock-divider:first-child {\n width: 0; }\n\n.flip-clock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flip-clock-divider .flip-clock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flip-clock-divider.minutes .flip-clock-label {\n right: -88px; }\n\n.flip-clock-divider.seconds .flip-clock-label {\n right: -91px; }\n\n.flip-clock-dot.top {\n top: 30px; }\n\n.flip-clock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flip-clock-wrapper ul.play li.flip-clock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flip-clock-wrapper ul li.flip-clock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["_fc-base.scss"],"names":[],"mappings":"AAAA,qBACI,sBACA,mCAAA,AAA4B,0BAAA,CAGhC,qBACE,eACA,qBACA,UAAY,CAAG,2BAGf,UAAY,CAAG,sBAGf,eAAiB,CAAG,qEAIpB,YACA,aAAe,CAEjB,kCACE,UAAY,CAEd,6BACE,MAAS,CAAG,mBAIZ,yDACA,wBAA0B,CAAG,oBAG7B,2BACA,4BACA,yBAA2B,CAE7B,sBAAwB,aAAe,CAAI,mBAGzC,kBACA,kBACA,WACA,UAAY,CAGd,mDAEI,YACA,aAAe,CAEnB,yBACI,UAAY,CAIhB,sBACE,kBACA,WACA,WACA,WACA,YACA,eACA,iBACA,iBACA,kBACA,eAAiB,CAClB,yBAGC,UACA,kBACA,OACA,MACA,WACA,YACA,iBACA,+BAAiC,CAClC,qCAGC,SAAW,CAEb,2BACE,cACA,YACA,0BACA,AACA,kBACA,oBACA,4BACA,yBAA2B,CAAG,+BAG9B,UACA,kBACA,OACA,WACA,WACA,eACA,gBACA,6BAA+B,CAAG,uCAGlC,kBACA,WACA,YACA,SAAW,CAAG,kCAGd,kCAAA,AACA,0BAAA,KAAO,CAAG,wCAGV,WACA,kBACA,SACA,OACA,UACA,WACA,WACA,sBACA,gCAAsB,CAAiB,oCAGvC,+BAAA,AACA,uBAAA,SACA,8BACA,8BAAgC,CAGlC,uCACE,kBACA,OACA,UACA,WACA,YACA,WACA,2BACA,kBACA,sBACA,kBACA,cAAgB,CAAG,0CAGnB,KAAO,CAAG,4CAGV,QAAU,CAGZ,+CACE,SAAW,CAEb,yBAA6B,oCAA0B,CAAkB,+CAGvE,4CAAA,AACA,oCAAA,SAAW,CAEb,mBACE,WACA,qBACA,kBACA,WACA,YAAc,CAAG,+BAGjB,OAAS,CAAG,eAGZ,cACA,mBACA,WACA,YACA,kBACA,kBACA,mCACA,QAAU,CAEZ,oCACE,kBACA,WACA,YACA,YACA,gBAAkB,CAAG,4CAGrB,WAAa,CAEf,4CACE,WAAa,CAAG,mBAGhB,QAAU,CAAG,sBAGb,WAAa,CAAG,uBAGhB,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAVG,AAYlB,eATE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAEf,qDACE,6CAAA,AAAsC,oCAAA,CAAG,wBAGzC,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAPqB,AAS3C,gBANE,GACE,iCAAA,AAAkB,wBAAA,CAEpB,KACE,gCAAA,AAAkB,uBAAA,CAAA,CAEtB,mDACE,UACA,yCAAA,AAAkC,gCAAA,CAAG,yBAGrC,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CARiB,AAYvC,iBATE,GACE,gCAAA,AAAkB,uBAAA,CAGpB,KACE,kCAAA,AAAkB,yBAAA,CAAA,CAItB,0CACE,SAAW,CAAG,2DAId,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAAG,2DAGpC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAAG,6DAIzC,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,wCAAA,AAAiC,+BAAA,CAEnC,6DACE,oEACA,oHACA,mDACA,AACA,mEACA,yDACA,6CAAA,AAAsC,oCAAA,CAExC,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAUA,gBATE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAIf,wBACE,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CANf,AAMe,gBALb,GACE,SAAW,CAGb,KACE,SAAW,CAAA,CAAA","file":"flipclock.css","sourcesContent":[".flipclock-wrapper * {\n box-sizing: border-box;\n backface-visibility: hidden;\n}\n\n.flipclock-wrapper a {\n cursor: pointer;\n text-decoration: none;\n color: #ccc; }\n\n.flipclock-wrapper a:hover {\n color: #fff; }\n\n.flipclock-wrapper ul {\n list-style: none; }\n\n.flipclock-wrapper.clearfix:before,\n.flipclock-wrapper.clearfix:after {\n content: \" \";\n display: table; }\n\n.flipclock-wrapper.clearfix:after {\n clear: both; }\n\n.flipclock-wrapper.clearfix {\n *zoom: 1; }\n\n/* Main */\n.flipclock-wrapper {\n font: normal 11px \"Helvetica Neue\", Helvetica, sans-serif;\n -webkit-user-select: none; }\n\n.flipclock-meridium {\n background: none !important;\n box-shadow: 0 0 0 !important;\n font-size: 36px !important; }\n\n.flipclock-meridium a { color: #313333; }\n\n.flipclock-wrapper {\n text-align: center;\n position: relative;\n width: 100%;\n margin: 1em;\n}\n\n.flipclock-wrapper:before,\n.flipclock-wrapper:after {\n content: \" \"; /* 1 */\n display: table; /* 2 */\n}\n.flipclock-wrapper:after {\n clear: both;\n}\n\n/* Skeleton */\n.flipclock-wrapper ul {\n position: relative;\n float: left;\n margin: 5px;\n width: 60px;\n height: 90px;\n font-size: 80px;\n font-weight: bold;\n line-height: 87px;\n border-radius: 6px;\n background: #000;\n}\n\n.flipclock-wrapper ul li {\n z-index: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n line-height: 87px;\n text-decoration: none !important;\n}\n\n.flipclock-wrapper ul li:first-child {\n z-index: 2; }\n\n.flipclock-wrapper ul li a {\n display: block;\n height: 100%;\n -webkit-perspective: 200px;\n -moz-perspective: 200px;\n perspective: 200px;\n margin: 0 !important;\n overflow: visible !important;\n cursor: default !important; }\n\n.flipclock-wrapper ul li a div {\n z-index: 1;\n position: absolute;\n left: 0;\n width: 100%;\n height: 50%;\n font-size: 80px;\n overflow: hidden; \n outline: 1px solid transparent; }\n\n.flipclock-wrapper ul li a div .shadow {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2; }\n\n.flipclock-wrapper ul li a div.up {\n transform-origin: 50% 100%;\n top: 0; }\n\n.flipclock-wrapper ul li a div.up:after {\n content: \"\";\n position: absolute;\n top: 44px;\n left: 0;\n z-index: 5;\n width: 100%;\n height: 3px;\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.4); }\n\n.flipclock-wrapper ul li a div.down {\n transform-origin: 50% 0;\n bottom: 0;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.flipclock-wrapper ul li a div div.inn {\n position: absolute;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 200%;\n color: #ccc;\n text-shadow: 0 1px 2px #000;\n text-align: center;\n background-color: #333;\n border-radius: 6px;\n font-size: 70px; }\n\n.flipclock-wrapper ul li a div.up div.inn {\n top: 0; }\n\n.flipclock-wrapper ul li a div.down div.inn {\n bottom: 0; }\n\n/* PLAY */\n.flipclock-wrapper ul.play li.flipclock-before {\n z-index: 3; }\n\n.flipclock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }\n\n.flipclock-wrapper ul.play li.flipclock-active {\n animation: asd 0.5s 0.5s linear both;\n z-index: 5; }\n\n.flipclock-divider {\n float: left;\n display: inline-block;\n position: relative;\n width: 20px;\n height: 100px; }\n\n.flipclock-divider:first-child {\n width: 0; }\n\n.flipclock-dot {\n display: block;\n background: #323434;\n width: 10px;\n height: 10px;\n position: absolute;\n border-radius: 50%;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);\n left: 5px; }\n\n.flipclock-divider .flipclock-label {\n position: absolute;\n top: -1.5em;\n right: -86px;\n color: black;\n text-shadow: none; }\n\n.flipclock-divider.minutes .flipclock-label {\n right: -88px; }\n\n.flipclock-divider.seconds .flipclock-label {\n right: -91px; }\n\n.flipclock-dot.top {\n top: 30px; }\n\n.flipclock-dot.bottom {\n bottom: 30px; }\n\n@keyframes asd {\n 0% {\n z-index: 2; }\n\n 20% {\n z-index: 4; }\n\n 100% {\n z-index: 4; } }\n\n.flipclock-wrapper ul.play li.flipclock-active .down {\n animation: turn 0.5s 0.5s linear both; }\n\n@keyframes turn {\n 0% {\n transform: rotateX(90deg); }\n\n 100% {\n transform: rotateX(0deg); } }\n\n.flipclock-wrapper ul.play li.flipclock-before .up {\n z-index: 2;\n animation: turn2 0.5s linear both; }\n\n@keyframes turn2 {\n 0% {\n transform: rotateX(0deg);\n }\n\n 100% {\n transform: rotateX(-90deg);\n }\n}\n\n.flipclock-wrapper ul li.flipclock-active {\n z-index: 3; }\n\n/* SHADOW */\n.flipclock-wrapper ul.play li.flipclock-before .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: show 0.5s linear both; }\n\n.flipclock-wrapper ul.play li.flipclock-active .up .shadow {\n background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));\n background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;\n background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);\n background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;\n animation: hide 0.5s 0.3s linear both; }\n\n/*DOWN*/\n.flipclock-wrapper ul.play li.flipclock-before .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: show 0.5s linear both; }\n\n.flipclock-wrapper ul.play li.flipclock-active .down .shadow {\n background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));\n background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;\n background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);\n background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;\n animation: hide 0.5s 0.2s linear both; }\n\n@keyframes show {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/flipclock.js b/dist/flipclock.js index feeeca09..37599b64 100644 --- a/dist/flipclock.js +++ b/dist/flipclock.js @@ -531,8 +531,8 @@ var FlipClock; */ classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', + active: 'flipclock-active', + before: 'flipclock-before', flip: 'flip', play: 'play' }, @@ -939,9 +939,9 @@ var FlipClock; */ classes: { - divider: 'flip-clock-divider', - dot: 'flip-clock-dot', - label: 'flip-clock-label' + divider: 'flipclock-divider', + dot: 'flipclock-dot', + label: 'flipclock-label' }, /** @@ -1786,7 +1786,7 @@ var FlipClock; */ classes: { - wrapper: 'flip-clock-wrapper' + wrapper: 'flipclock-wrapper' }, /** @@ -3038,8 +3038,8 @@ var FlipClock; */ classes: { - active: 'flip-clock-active', - before: 'flip-clock-before', + active: 'flipclock-active', + before: 'flipclock-before', flip: 'flip', play: 'play' }, @@ -3737,7 +3737,7 @@ var FlipClock; this.meridiumText = this.getMeridium(); this.$meridium = $([ - '