PageSourceSearch

https://middleburgborough.com/wp-content/plugins/modern-events-cal…/js/flipcount.js?ver=7.36.3.1788886014

js middleburgborough.com collected 2026-10-02 13:58:55 UTC 52,907 bytes, 1,951 lines download raw bytes

vendor: 4,236 bytes, lines 1-121
1/*
2    Base.js, version 1.1a
3    Copyright 2006-2010, Dean Edwards
4    License: http://www.opensource.org/licenses/mit-license.php
5*/
6
7var Base = function() {
8    // dummy
9};
10
11Base.extend = function(_instance, _static) { // subclass
12    
13    "use strict";
14    
15    var extend = Base.prototype.extend;
16    
17    // build the prototype
18    Base._prototyping = true;
19    
20    var proto = new this();
21    
22    extend.call(proto, _instance);
23    
24    proto.base = function() {
25    // call this method from any other method to invoke that method's ancestor
26    };
27
28    delete Base._prototyping;
29    
30    // create the wrapper for the constructor function
31    //var constructor = proto.constructor.valueOf(); //-dean
32    var constructor = proto.constructor;
33    var klass = proto.constructor = function() {
34        if (!Base._prototyping) {
35            if (this._constructing || this.constructor == klass) { // instantiation
36                this._constructing = true;
37                constructor.apply(this, arguments);
38                delete this._constructing;
39            } else if (arguments[0] !== null) { // casting
40                return (arguments[0].extend || extend).call(arguments[0], proto);
41            }
42        }
43    };
44    
45    // build the class interface
46    klass.ancestor = this;
47    klass.extend = this.extend;
48    klass.forEach = this.forEach;
49    klass.implement = this.implement;
50    klass.prototype = proto;
51    klass.toString = this.toString;
52    klass.valueOf = function(type) {
53        //return (type == "object") ? klass : constructor; //-dean
54        return (type == "object") ? klass : constructor.valueOf();
55    };
56    extend.call(klass, _static);
57    // class initialisation
58    if (typeof klass.init == "function") klass.init();
59    return klass;
60};
61
62Base.prototype = {  
63    extend: function(source, value) {
64        if (arguments.length > 1) { // extending with a name/value pair
65            var ancestor = this[source];
66            if (ancestor && (typeof value == "function") && // overriding a method?
67                // the valueOf() comparison is to avoid circular references
68                (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) &&
69                /\bbase\b/.test(value)) {
70                // get the underlying method
71                var method = value.valueOf();
72                // override
73                value = function() {
74                    var previous = this.base || Base.prototype.base;
75                    this.base = ancestor;
76                    var returnValue = method.apply(this, arguments);
77                    this.base = previous;
78                    return returnValue;
79                };
80                // point to the underlying method
81                value.valueOf = function(type) {
82                    return (type == "object") ? value : method;
83                };
84                value.toString = Base.toString;
85            }
86            this[source] = value;
87        } else if (source) { // extending with an object literal
88            var extend = Base.prototype.extend;
89            // if this object has a customised extend method then use it
90            if (!Base._prototyping && typeof this != "function") {
91                extend = this.extend || extend;
92            }
93            var proto = {toSource: null};
94            // do the "toString" and other methods manually
95            var hidden = ["constructor", "toString", "valueOf"];
96            // if we are prototyping then include the constructor
97            var i = Base._prototyping ? 0 : 1;
98            while (key = hidden[i++]) {
99                if (source[key] != proto[key]) {
100                    extend.call(this, key, source[key]);
101
102                }
103            }
104            // copy each of the source object's properties to this object
105            for (var key in source) {
106                if (!proto[key]) extend.call(this, key, source[key]);
107            }
108        }
109        return this;
110    }
111};
112
113// initialise
114Base = Base.extend({
115    constructor: function() {
116        this.extend(arguments[0]);
117    }
118}, {
119    ancestor: Object,
120    version: "1.1",
121    
122    forEach: function(object, block, context) {
123        for (var key in object) {
124            if (this.prototype[key] === undefined) {
125                block.call(context, object[key], key, object);
126            }
127        }
128    },
129        
130    implement: function() {
131        for (var i = 0; i < arguments.length; i++) {
132            if (typeof arguments[i] == "function") {
133                // if it's a function, call it
134                arguments[i](this.prototype);
135            } else {
136                // add the interface using the extend method
137                this.prototype.extend(arguments[i]);
138            }
139        }
140        return this;
141    },
142    
143    toString: function() {
144        return String(this.valueOf());
145    }
146});
147/*jshint smarttabs:true */
148
149var FlipClock;
150    
151/**
152 * FlipClock.js
153 *
154 * @author     Justin Kimbrell
155 * @copyright  2013 - Objective HTML, LLC
156 * @licesnse   http://www.opensource.org/licenses/mit-license.php
157 */
158    
159(function($) {
160    
161    "use strict";
162    
163    /**
164     * FlipFlock Helper
165     *
166     * @param  object  A jQuery object or CSS select
167     * @param  int     An integer used to start the clock (no. seconds)
168     * @param  object  An object of properties to override the default  
169     */
170     
171    FlipClock = function(obj, digit, options) {
172        if(digit instanceof Object && digit instanceof Date === false) {
173            options = digit;
174            digit = 0;
175        }
176
177        return new FlipClock.Factory(obj, digit, options);
178    };
179
180    /**
181     * The global FlipClock.Lang object
182     */
183
184    FlipClock.Lang = {};
185    
186    /**
187     * The Base FlipClock class is used to extend all other FlipFlock
188     * classes. It handles the callbacks and the basic setters/getters
189     *  
190     * @param   object  An object of the default properties
191     * @param   object  An object of properties to override the default 
192     */
193
194    FlipClock.Base = Base.extend({
195        
196        /**
197         * Build Date
198         */
199         
200        buildDate: '2014-12-12',
201        
202        /**
203         * Version
204         */
205         
206        version: '0.7.7',
207        
208        /**
209         * Sets the default options
210         *
211         * @param   object  The default options
212         * @param   object  The override options
213         */
214         
215        constructor: function(_default, options) {
216            if(typeof _default !== "object") {
217                _default = {};
218            }
219            if(typeof options !== "object") {
220                options = {};
221            }
222            this.setOptions($.extend(true, {}, _default, options));
223        },
224        
225        /**
226         * Delegates the callback to the defined method
227         *
228         * @param   object  The default options
229         * @param   object  The override options
230         */
231         
232        callback: function(method) {
233            if(typeof method === "function") {
234                var args = [];
235                                
236                for(var x = 1; x <= arguments.length; x++) {
237                    if(arguments[x]) {
238                        args.push(arguments[x]);
239                    }
240                }
241                
242                method.apply(this, args);
243            }
244        },
245         
246        /**
247         * Log a string into the console if it exists
248         *
249         * @param   string  The name of the option
250         * @return  mixed
251         */     
252         
253        log: function(str) {
254            if(window.console && console.log) {
255                console.log(str);
256            }
257        },
258         
259        /**
260         * Get an single option value. Returns false if option does not exist
261         *
262         * @param   string  The name of the option
263         * @return  mixed
264         */     
265         
266        getOption: function(index) {
267            if(this[index]) {
268                return this[index];
269            }
270            return false;
271        },
272        
273        /**
274         * Get all options
275         *
276         * @return  bool
277         */     
278         
279        getOptions: function() {
280            return this;
281        },
282        
283        /**
284         * Set a single option value
285         *
286         * @param   string  The name of the option
287         * @param   mixed   The value of the option
288         */     
289         
290        setOption: function(index, value) {
291            this[index] = value;
292        },
293        
294        /**
295         * Set a multiple options by passing a JSON object
296         *
297         * @param   object  The object with the options
298         * @param   mixed   The value of the option
299         */     
300        
301        setOptions: function(options) {
302            for(var key in options) {
303                if(typeof options[key] !== "undefined") {
304                    this.setOption(key, options[key]);
305                }
306            }
307        }
308        
309    });
310    
311}(jQuery));
312
313/*jshint smarttabs:true */
314
315/**
316 * FlipClock.js
317 *
318 * @author     Justin Kimbrell
319 * @copyright  2013 - Objective HTML, LLC
320 * @licesnse   http://www.opensource.org/licenses/mit-license.php
321 */
322    
323(function($) {
324    
325    "use strict";
326    
327    /**
328     * The FlipClock Face class is the base class in which to extend
329     * all other FlockClock.Face classes.
330     *
331     * @param   object  The parent FlipClock.Factory object
332     * @param   object  An object of properties to override the default 
333     */
334     
335    FlipClock.Face = FlipClock.Base.extend({
336        
337        /**
338         * Sets whether or not the clock should start upon instantiation
339         */
340         
341        autoStart: true,
342
343        /**
344         * An array of jQuery objects used for the dividers (the colons)
345         */
346         
347        dividers: [],
348
349        /**
350         * An array of FlipClock.List objects
351         */     
352         
353        factory: false,
354        
355        /**
356         * An array of FlipClock.List objects
357         */     
358         
359        lists: [],
360
361        /**
362         * Constructor
363         *
364         * @param   object  The parent FlipClock.Factory object
365         * @param   object  An object of properties to override the default 
366         */
367         
368        constructor: function(factory, options) {
369            this.dividers = [];
370            this.lists = [];
371            this.base(options);
372            this.factory = factory;
373        },
374        
375        /**
376         * Build the clock face
377         */
378         
379        build: function() {
380            if(this.autoStart) {
381                this.start();
382            }
383        },
384        
385        /**
386         * Creates a jQuery object used for the digit divider
387         *
388         * @param   mixed   The divider label text
389         * @param   mixed   Set true to exclude the dots in the divider. 
390         *                  If not set, is false.
391         */
392         
393        createDivider: function(label, css, excludeDots) {
394            if(typeof css == "boolean" || !css) {
395                excludeDots = css;
396                css = label;
397            }
398
399            var dots = [
400                '<span class="'+this.factory.classes.dot+' top"></span>',
401                '<span class="'+this.factory.classes.dot+' bottom"></span>'
402            ].join('');
403
404            if(excludeDots) {
405                dots = '';  
406            }
407
408            label = this.factory.localize(label);
409
410            var html = [
411                '<span class="'+this.factory.classes.divider+' '+(css ? css : '').toLowerCase()+'">',
412                    '<span class="'+this.factory.classes.label+'">'+(label ? label : '')+'</span>',
413                    dots,
414                '</span>'
415            ];  
416            
417            var $html = $(html.join(''));
418
419            this.dividers.push($html);
420
421            return $html;
422        },
423        
424        /**
425         * Creates a FlipClock.List object and appends it to the DOM
426         *
427         * @param   mixed   The digit to select in the list
428         * @param   object  An object to override the default properties
429         */
430         
431        createList: function(digit, options) {
432            if(typeof digit === "object") {
433                options = digit;
434                digit = 0;
435            }
436
437            var obj = new FlipClock.List(this.factory, digit, options);
438        
439            this.lists.push(obj);
440
441            return obj;
442        },
443        
444        /**
445         * Triggers when the clock is reset
446         */
447
448        reset: function() {
449            this.factory.time = new FlipClock.Time(
450                this.factory, 
451                this.factory.original ? Math.round(this.factory.original) : 0,
452                {
453                    minimumDigits: this.factory.minimumDigits
454                }
455            );
456
457            this.flip(this.factory.original, false);
458        },
459
460        /**
461         * Append a newly created list to the clock
462         */
463
464        appendDigitToClock: function(obj) {
465            obj.$el.append(false);
466        },
467
468        /**
469         * Add a digit to the clock face
470         */
471         
472        addDigit: function(digit) {
473            var obj = this.createList(digit, {
474                classes: {
475                    active: this.factory.classes.active,
476                    before: this.factory.classes.before,
477                    flip: this.factory.classes.flip
478                }
479            });
480
481            this.appendDigitToClock(obj);
482        },
483        
484        /**
485         * Triggers when the clock is started
486         */
487         
488        start: function() {},
489        
490        /**
491         * Triggers when the time on the clock stops
492         */
493         
494        stop: function() {},
495        
496        /**
497         * Auto increments/decrements the value of the clock face
498         */
499         
500        autoIncrement: function() {
501            if(!this.factory.countdown) {
502                this.increment();
503            }
504            else {
505                this.decrement();
506            }
507        },
508
509        /**
510         * Increments the value of the clock face
511         */
512         
513        increment: function() {
514            this.factory.time.addSecond();
515        },
516
517        /**
518         * Decrements the value of the clock face
519         */
520
521        decrement: function() {
522            if(this.factory.time.getTimeSeconds() == 0) {
523                this.factory.stop()
524            }
525            else {
526                this.factory.time.subSecond();
527            }
528        },
529            
530        /**
531         * Triggers when the numbers on the clock flip
532         */
533         
534        flip: function(time, doNotAddPlayClass) {
535            var t = this;
536
537            $.each(time, function(i, digit) {
538                var list = t.lists[i];
539
540                if(list) {
541                    if(!doNotAddPlayClass && digit != list.digit) {
542                        list.play();    
543                    }
544
545                    list.select(digit);
546                }   
547                else {
548                    t.addDigit(digit);
549                }
550            });
551        }
552                    
553    });
554    
555}(jQuery));
556
557/*jshint smarttabs:true */
558
559/**
560 * FlipClock.js
561 *
562 * @author     Justin Kimbrell
563 * @copyright  2013 - Objective HTML, LLC
564 * @licesnse   http://www.opensource.org/licenses/mit-license.php
565 */
566    
567(function($) {
568    
569    "use strict";
570    
571    /**
572     * The FlipClock Factory class is used to build the clock and manage
573     * all the public methods.
574     *
575     * @param   object  A jQuery object or CSS selector used to fetch
576                        the wrapping DOM nodes
577     * @param   mixed   This is the digit used to set the clock. If an 
578                        object is passed, 0 will be used.   
579     * @param   object  An object of properties to override the default 
580     */
581        
582    FlipClock.Factory = FlipClock.Base.extend({
583        
584        /**
585         * The clock's animation rate.
586         * 
587         * Note, currently this property doesn't do anything.
588         * This property is here to be used in the future to
589         * programmaticaly set the clock's animation speed
590         */     
591
592        animationRate: 1000,
593
594        /**
595         * Auto start the clock on page load (True|False)
596         */ 
597         
598        autoStart: true,
599        
600        /**
601         * The callback methods
602         */     
603         
604        callbacks: {
605            destroy: false,
606            create: false,
607            init: false,
608            interval: false,
609            start: false,
610            stop: false,
611            reset: false
612        },
613        
614        /**
615         * The CSS classes
616         */     
617         
618        classes: {
619            active: 'flip-clock-active',
620            before: 'flip-clock-before',
621            divider: 'flip-clock-divider',
622            dot: 'flip-clock-dot',
623            label: 'flip-clock-label',
624            flip: 'flip',
625            play: 'play',
626            wrapper: 'flip-clock-wrapper'
627        },
628        
629        /**
630         * The name of the clock face class in use
631         */ 
632         
633        clockFace: 'HourlyCounter',
634         
635        /**
636         * The name of the clock face class in use
637         */ 
638         
639        countdown: false,
640         
641        /**
642         * The name of the default clock face class to use if the defined
643         * clockFace variable is not a valid FlipClock.Face object
644         */ 
645         
646        defaultClockFace: 'HourlyCounter',
647         
648        /**
649         * The default language
650         */ 
651         
652        defaultLanguage: 'english',
653         
654        /**
655         * The jQuery object
656         */     
657         
658        $el: false,
659
660        /**
661         * The FlipClock.Face object
662         */ 
663         
664        face: true,
665         
666        /**
667         * The language object after it has been loaded
668         */ 
669         
670        lang: false,
671         
672        /**
673         * The language being used to display labels (string)
674         */ 
675         
676        language: 'english',
677         
678        /**
679         * The minimum digits the clock must have
680         */     
681
682        minimumDigits: 0,
683
684        /**
685         * The original starting value of the clock. Used for the reset method.
686         */     
687         
688        original: false,
689        
690        /**
691         * Is the clock running? (True|False)
692         */     
693         
694        running: false,
695        
696        /**
697         * The FlipClock.Time object
698         */     
699         
700        time: false,
701        
702        /**
703         * The FlipClock.Timer object
704         */     
705         
706        timer: false,
707        
708        /**
709         * The jQuery object (depcrecated)
710         */     
711         
712        $wrapper: false,
713        
714        /**
715         * Constructor
716         *
717         * @param   object  The wrapping jQuery object
718         * @param   object  Number of seconds used to start the clock
719         * @param   object  An object override options
720         */
721         
722        constructor: function(obj, digit, options) {
723
724            if(!options) {
725                options = {};
726            }
727
728            this.lists = [];
729            this.running = false;
730            this.base(options); 
731
732            this.$el = $(obj).addClass(this.classes.wrapper);
733
734            // Depcrated support of the $wrapper property.
735            this.$wrapper = this.$el;
736
737            this.original = (digit instanceof Date) ? digit : (digit ? Math.round(digit) : 0);
738
739            this.time = new FlipClock.Time(this, this.original, {
740                minimumDigits: this.minimumDigits,
741                animationRate: this.animationRate 
742            });
743
744            this.timer = new FlipClock.Timer(this, options);
745
746            this.loadLanguage(this.language);
747            
748            this.loadClockFace(this.clockFace, options);
749
750            if(this.autoStart) {
751                this.start();
752            }
753
754        },
755        
756        /**
757         * Load the FlipClock.Face object
758         *
759         * @param   object  The name of the FlickClock.Face class
760         * @param   object  An object override options
761         */
762         
763        loadClockFace: function(name, options) {    
764            var face, suffix = 'Face', hasStopped = false;
765            
766            name = name.ucfirst()+suffix;
767
768            if(this.face.stop) {
769                this.stop();
770                hasStopped = true;
771            }
772
773            this.$el.html('');
774
775            this.time.minimumDigits = this.minimumDigits;
776            
777            if(FlipClock[name]) {
778                face = new FlipClock[name](this, options);
779            }
780            else {
781                face = new FlipClock[this.defaultClockFace+suffix](this, options);
782            }
783            
784            face.build();
785
786            this.face = face
787
788            if(hasStopped) {
789                this.start();
790            }
791            
792            return this.face;
793        },
794                
795        /**
796         * Load the FlipClock.Lang object
797         *
798         * @param   object  The name of the language to load
799         */
800         
801        loadLanguage: function(name) {  
802            var lang;
803            
804            if(FlipClock.Lang[name.ucfirst()]) {
805                lang = FlipClock.Lang[name.ucfirst()];
806            }
807            else if(FlipClock.Lang[name]) {
808                lang = FlipClock.Lang[name];
809            }
810            else {
811                lang = FlipClock.Lang[this.defaultLanguage];
812            }
813            
814            return this.lang = lang;
815        },
816                    
817        /**
818         * Localize strings into various languages
819         *
820         * @param   string  The index of the localized string
821         * @param   object  Optionally pass a lang object
822         */
823
824        localize: function(index, obj) {
825            var lang = this.lang;
826
827            if(!index) {
828                return null;
829            }
830
831            var lindex = index.toLowerCase();
832
833            if(typeof obj == "object") {
834                lang = obj;
835            }
836
837            if(lang && lang[lindex]) {
838                return lang[lindex];
839            }
840
841            return index;
842        },
843         
844
845        /**
846         * Starts the clock
847         */
848         
849        start: function(callback) {
850            var t = this;
851
852            if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) {
853                t.face.start(t.time);
854                t.timer.start(function() {
855                    t.flip();
856                    
857                    if(typeof callback === "function") {
858                        callback();
859                    }   
860                });
861            }
862            else {
863                t.log('Trying to start timer when countdown already at 0');
864            }
865        },
866        
867        /**
868         * Stops the clock
869         */
870         
871        stop: function(callback) {
872            this.face.stop();
873            this.timer.stop(callback);
874            
875            for(var x in this.lists) {
876                if (this.lists.hasOwnProperty(x)) {
877                    this.lists[x].stop();
878                }
879            }   
880        },
881        
882        /**
883         * Reset the clock
884         */
885         
886        reset: function(callback) {
887            this.timer.reset(callback);
888            this.face.reset();
889        },
890        
891        /**
892         * Sets the clock time
893         */
894         
895        setTime: function(time) {
896            this.time.time = time;
897            this.flip(true);        
898        },
899        
900        /**
901         * Get the clock time
902         *
903         * @return  object  Returns a FlipClock.Time object
904         */
905         
906        getTime: function(time) {
907            return this.time;       
908        },
909        
910        /**
911         * Changes the increment of time to up or down (add/sub)
912         */
913         
914        setCountdown: function(value) {
915            var running = this.running;
916            
917            this.countdown = value ? true : false;
918                
919            if(running) {
920                this.stop();
921                this.start();
922            }
923        },
924        
925        /**
926         * Flip the digits on the clock
927         *
928         * @param  array  An array of digits     
929         */
930        flip: function(doNotAddPlayClass) { 
931            this.face.flip(false, doNotAddPlayClass);
932        }
933        
934    });
935        
936}(jQuery));
937
938/*jshint smarttabs:true */
939
940/**
941 * FlipClock.js
942 *
943 * @author     Justin Kimbrell
944 * @copyright  2013 - Objective HTML, LLC
945 * @licesnse   http://www.opensource.org/licenses/mit-license.php
946 */
947    
948(function($) {
949    
950    "use strict";
951    
952    /**
953     * The FlipClock List class is used to build the list used to create 
954     * the card flip effect. This object fascilates selecting the correct
955     * node by passing a specific digit.
956     *
957     * @param   object  A FlipClock.Factory object
958     * @param   mixed   This is the digit used to set the clock. If an 
959     *                  object is passed, 0 will be used.   
960     * @param   object  An object of properties to override the default 
961     */
962        
963    FlipClock.List = FlipClock.Base.extend({
964        
965        /**
966         * The digit (0-9)
967         */     
968         
969        digit: 0,
970        
971        /**
972         * The CSS classes
973         */     
974         
975        classes: {
976            active: 'flip-clock-active',
977            before: 'flip-clock-before',
978            flip: 'flip'    
979        },
980                
981        /**
982         * The parent FlipClock.Factory object
983         */     
984         
985        factory: false,
986        
987        /**
988         * The jQuery object
989         */     
990         
991        $el: false,
992
993        /**
994         * The jQuery object (deprecated)
995         */     
996         
997        $obj: false,
998        
999        /**
1000         * The items in the list
1001         */     
1002         
1003        items: [],
1004        
1005        /**
1006         * The last digit
1007         */     
1008         
1009        lastDigit: 0,
1010            
1011        /**
1012         * Constructor
1013         *
1014         * @param  object  A FlipClock.Factory object
1015         * @param  int     An integer use to select the correct digit
1016         * @param  object  An object to override the default properties  
1017         */
1018         
1019        constructor: function(factory, digit, options) {
1020            this.factory = factory;
1021            this.digit = digit;
1022            this.lastDigit = digit;
1023            this.$el = this.createList();
1024            
1025            // Depcrated support of the $obj property.
1026            this.$obj = this.$el;
1027
1028            if(digit > 0) {
1029                this.select(digit);
1030            }
1031
1032            this.factory.$el.append(this.$el);
1033        },
1034        
1035        /**
1036         * Select the digit in the list
1037         *
1038         * @param  int  A digit 0-9  
1039         */
1040         
1041        select: function(digit) {
1042            if(typeof digit === "undefined") {
1043                digit = this.digit;
1044            }
1045            else {
1046                this.digit = digit;
1047            }
1048
1049            if(this.digit != this.lastDigit) {
1050                var $delete = this.$el.find('.'+this.classes.before).removeClass(this.classes.before);
1051
1052                this.$el.find('.'+this.classes.active).removeClass(this.classes.active)
1053                                                      .addClass(this.classes.before);
1054
1055                this.appendListItem(this.classes.active, this.digit);
1056
1057                $delete.remove();
1058
1059                this.lastDigit = this.digit;
1060            }   
1061        },
1062        
1063        /**
1064         * Adds the play class to the DOM object
1065         */
1066                
1067        play: function() {
1068            this.$el.addClass(this.factory.classes.play);
1069        },
1070        
1071        /**
1072         * Removes the play class to the DOM object 
1073         */
1074         
1075        stop: function() {
1076            var t = this;
1077
1078            setTimeout(function() {
1079                t.$el.removeClass(t.factory.classes.play);
1080            }, this.factory.timer.interval);
1081        },
1082        
1083        /**
1084         * Creates the list item HTML and returns as a string 
1085         */
1086         
1087        createListItem: function(css, value) {
1088            return [
1089                '<li class="'+(css ? css : '')+'">',
1090                    '<a href="#">',
1091                        '<div class="up">',
1092                            '<div class="shadow"></div>',
1093                            '<div class="inn">'+(value ? value : '')+'</div>',
1094                        '</div>',
1095                        '<div class="down">',
1096                            '<div class="shadow"></div>',
1097                            '<div class="inn">'+(value ? value : '')+'</div>',
1098                        '</div>',
1099                    '</a>',
1100                '</li>'
1101            ].join('');
1102        },
1103
1104        /**
1105         * Append the list item to the parent DOM node 
1106         */
1107
1108        appendListItem: function(css, value) {
1109            var html = this.createListItem(css, value);
1110
1111            this.$el.append(html);
1112        },
1113
1114        /**
1115         * Create the list of digits and appends it to the DOM object 
1116         */
1117         
1118        createList: function() {
1119
1120            var lastDigit = this.getPrevDigit() ? this.getPrevDigit() : this.digit;
1121
1122            var html = $([
1123                '<ul class="'+this.classes.flip+' '+(this.factory.running ? this.factory.classes.play : '')+'">',
1124                    this.createListItem(this.classes.before, lastDigit),
1125                    this.createListItem(this.classes.active, this.digit),
1126                '</ul>'
1127            ].join(''));
1128                    
1129            return html;
1130        },
1131
1132        getNextDigit: function() {
1133            return this.digit == 9 ? 0 : this.digit + 1;
1134        },
1135
1136        getPrevDigit: function() {
1137            return this.digit == 0 ? 9 : this.digit - 1;
1138        }
1139
1140    });
1141    
1142    
1143}(jQuery));
1144
1145/*jshint smarttabs:true */
1146
1147/**
1148 * FlipClock.js
1149 *
1150 * @author     Justin Kimbrell
1151 * @copyright  2013 - Objective HTML, LLC
1152 * @licesnse   http://www.opensource.org/licenses/mit-license.php
1153 */
1154    
1155(function($) {
1156    
1157    "use strict";
1158    
1159    /**
1160     * Capitalize the first letter in a string
1161     *
1162     * @return string
1163     */
1164     
1165    String.prototype.ucfirst = function() {
1166        return this.substr(0, 1).toUpperCase() + this.substr(1);
1167    };
1168    
1169    /**
1170     * jQuery helper method
1171     *
1172     * @param  int     An integer used to start the clock (no. seconds)
1173     * @param  object  An object of properties to override the default  
1174     */
1175     
1176    $.fn.FlipClock = function(digit, options) { 
1177        return new FlipClock($(this), digit, options);
1178    };
1179    
1180    /**
1181     * jQuery helper method
1182     *
1183     * @param  int     An integer used to start the clock (no. seconds)
1184     * @param  object  An object of properties to override the default  
1185     */
1186     
1187    $.fn.flipClock = function(digit, options) {
1188        return $.fn.FlipClock(digit, options);
1189    };
1190    
1191}(jQuery));
1192
1193/*jshint smarttabs:true */
1194
1195/**
1196 * FlipClock.js
1197 *
1198 * @author     Justin Kimbrell
1199 * @copyright  2013 - Objective HTML, LLC
1200 * @licesnse   http://www.opensource.org/licenses/mit-license.php
1201 */
1202    
1203(function($) {
1204    
1205    "use strict";
1206            
1207    /**
1208     * The FlipClock Time class is used to manage all the time 
1209     * calculations.
1210     *
1211     * @param   object  A FlipClock.Factory object
1212     * @param   mixed   This is the digit used to set the clock. If an 
1213     *                  object is passed, 0 will be used.   
1214     * @param   object  An object of properties to override the default 
1215     */
1216        
1217    FlipClock.Time = FlipClock.Base.extend({
1218        
1219        /**
1220         * The time (in seconds) or a date object
1221         */     
1222         
1223        time: 0,
1224        
1225        /**
1226         * The parent FlipClock.Factory object
1227         */     
1228         
1229        factory: false,
1230        
1231        /**
1232         * The minimum number of digits the clock face must have
1233         */     
1234         
1235        minimumDigits: 0,
1236
1237        /**
1238         * Constructor
1239         *
1240         * @param  object  A FlipClock.Factory object
1241         * @param  int     An integer use to select the correct digit
1242         * @param  object  An object to override the default properties  
1243         */
1244         
1245        constructor: function(factory, time, options) {
1246            if(typeof options != "object") {
1247                options = {};
1248            }
1249
1250            if(!options.minimumDigits) {
1251                options.minimumDigits = factory.minimumDigits;
1252            }
1253
1254            this.base(options);
1255            this.factory = factory;
1256
1257            if(time) {
1258                this.time = time;
1259            }
1260        },
1261
1262        /**
1263         * Convert a string or integer to an array of digits
1264         *
1265         * @param   mixed  String or Integer of digits   
1266         * @return  array  An array of digits 
1267         */
1268         
1269        convertDigitsToArray: function(str) {
1270            var data = [];
1271            
1272            str = str.toString();
1273            
1274            for(var x = 0;x < str.length; x++) {
1275                if(str[x].match(/^\d*$/g)) {
1276                    data.push(str[x]);  
1277                }
1278            }
1279            
1280            return data;
1281        },
1282        
1283        /**
1284         * Get a specific digit from the time integer
1285         *
1286         * @param   int    The specific digit to select from the time    
1287         * @return  mixed  Returns FALSE if no digit is found, otherwise
1288         *                 the method returns the defined digit  
1289         */
1290         
1291        digit: function(i) {
1292            var timeStr = this.toString();
1293            var length  = timeStr.length;
1294            
1295            if(timeStr[length - i])  {
1296                return timeStr[length - i];
1297            }
1298            
1299            return false;
1300        },
1301
1302        /**
1303         * Formats any array of digits into a valid array of digits
1304         *
1305         * @param   mixed  An array of digits    
1306         * @return  array  An array of digits 
1307         */
1308         
1309        digitize: function(obj) {
1310            var data = [];
1311
1312            $.each(obj, function(i, value) {
1313                value = value.toString();
1314                
1315                if(value.length == 1) {
1316                    value = '0'+value;
1317                }
1318                
1319                for(var x = 0; x < value.length; x++) {
1320                    data.push(value.charAt(x));
1321                }               
1322            });
1323
1324            if(data.length > this.minimumDigits) {
1325                this.minimumDigits = data.length;
1326            }
1327            
1328            if(this.minimumDigits > data.length) {
1329                for(var x = data.length; x < this.minimumDigits; x++) {
1330                    data.unshift('0');
1331                }
1332            }
1333
1334            return data;
1335        },
1336        
1337        /**
1338         * Gets a new Date object for the current time
1339         *
1340         * @return  array  Returns a Date object
1341         */
1342
1343        getDateObject: function() {
1344            if(this.time instanceof Date) {
1345                return this.time;
1346            }
1347
1348            return new Date((new Date()).getTime() + this.getTimeSeconds() * 1000);
1349        },
1350        
1351        /**
1352         * Gets a digitized daily counter
1353         *
1354         * @return  object  Returns a digitized object
1355         */
1356
1357        getDayCounter: function(includeSeconds) {
1358            var digits = [
1359                this.getDays(),
1360                this.getHours(true),
1361                this.getMinutes(true)
1362            ];
1363
1364            if(includeSeconds) {
1365                digits.push(this.getSeconds(true));
1366            }
1367
1368            return this.digitize(digits);
1369        },
1370
1371        /**
1372         * Gets number of days
1373         *
1374         * @param   bool  Should perform a modulus? If not sent, then no.
1375         * @return  int   Retuns a floored integer
1376         */
1377         
1378        getDays: function(mod) {
1379            var days = this.getTimeSeconds() / 60 / 60 / 24;
1380            
1381            if(mod) {
1382                days = days % 7;
1383            }
1384            
1385            return Math.floor(days);
1386        },
1387        
1388        /**
1389         * Gets an hourly breakdown
1390         *
1391         * @return  object  Returns a digitized object
1392         */
1393         
1394        getHourCounter: function() {
1395            var obj = this.digitize([
1396                this.getHours(),
1397                this.getMinutes(true),
1398                this.getSeconds(true)
1399            ]);
1400            
1401            return obj;
1402        },
1403        
1404        /**
1405         * Gets an hourly breakdown
1406         *
1407         * @return  object  Returns a digitized object
1408         */
1409         
1410        getHourly: function() {
1411            return this.getHourCounter();
1412        },
1413        
1414        /**
1415         * Gets number of hours
1416         *
1417         * @param   bool  Should perform a modulus? If not sent, then no.
1418         * @return  int   Retuns a floored integer
1419         */
1420         
1421        getHours: function(mod) {
1422            var hours = this.getTimeSeconds() / 60 / 60;
1423            
1424            if(mod) {
1425                hours = hours % 24; 
1426            }
1427            
1428            return Math.floor(hours);
1429        },
1430        
1431        /**
1432         * Gets the twenty-four hour time
1433         *
1434         * @return  object  returns a digitized object
1435         */
1436         
1437        getMilitaryTime: function(date, showSeconds) {
1438            if(typeof showSeconds === "undefined") {
1439                showSeconds = true;
1440            }
1441
1442            if(!date) {
1443                date = this.getDateObject();
1444            }
1445
1446            var data  = [
1447                date.getHours(),
1448                date.getMinutes()           
1449            ];
1450
1451            if(showSeconds === true) {
1452                data.push(date.getSeconds());
1453            }
1454
1455            return this.digitize(data);
1456        },
1457                
1458        /**
1459         * Gets number of minutes
1460         *
1461         * @param   bool  Should perform a modulus? If not sent, then no.
1462         * @return  int   Retuns a floored integer
1463         */
1464         
1465        getMinutes: function(mod) {
1466            var minutes = this.getTimeSeconds() / 60;
1467            
1468            if(mod) {
1469                minutes = minutes % 60;
1470            }
1471            
1472            return Math.floor(minutes);
1473        },
1474        
1475        /**
1476         * Gets a minute breakdown
1477         */
1478         
1479        getMinuteCounter: function() {
1480            var obj = this.digitize([
1481                this.getMinutes(),
1482                this.getSeconds(true)
1483            ]);
1484
1485            return obj;
1486        },
1487        
1488        /**
1489         * Gets time count in seconds regardless of if targetting date or not.
1490         *
1491         * @return  int   Returns a floored integer
1492         */
1493         
1494        getTimeSeconds: function(date) {
1495            if(!date) {
1496                date = new Date();
1497            }
1498
1499            if (this.time instanceof Date) {
1500                if (this.factory.countdown) {
1501                    return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0);
1502                } else {
1503                    return date.getTime()/1000 - this.time.getTime()/1000 ;
1504                }
1505            } else {
1506                return this.time;
1507            }
1508        },
1509        
1510        /**
1511         * Gets the current twelve hour time
1512         *
1513         * @return  object  Returns a digitized object
1514         */
1515         
1516        getTime: function(date, showSeconds) {
1517            if(typeof showSeconds === "undefined") {
1518                showSeconds = true;
1519            }
1520
1521            if(!date) {
1522                date = this.getDateObject();
1523            }
1524
1525            
1526            var hours = date.getHours();
1527            var merid = hours > 12 ? 'PM' : 'AM';
1528            var data   = [
1529                hours > 12 ? hours - 12 : (hours === 0 ? 12 : hours),
1530                date.getMinutes()           
1531            ];
1532
1533            if(showSeconds === true) {
1534                data.push(date.getSeconds());
1535            }
1536
1537            return this.digitize(data);
1538        },
1539        
1540        /**
1541         * Gets number of seconds
1542         *
1543         * @param   bool  Should perform a modulus? If not sent, then no.
1544         * @return  int   Retuns a ceiled integer
1545         */
1546         
1547        getSeconds: function(mod) {
1548            var seconds = this.getTimeSeconds();
1549            
1550            if(mod) {
1551                if(seconds == 60) {
1552                    seconds = 0;
1553                }
1554                else {
1555                    seconds = seconds % 60;
1556                }
1557            }
1558            
1559            return Math.ceil(seconds);
1560        },
1561
1562        /**
1563         * Gets number of weeks
1564         *
1565         * @param   bool  Should perform a modulus? If not sent, then no.
1566         * @return  int   Retuns a floored integer
1567         */
1568         
1569        getWeeks: function(mod) {
1570            var weeks = this.getTimeSeconds() / 60 / 60 / 24 / 7;
1571            
1572            if(mod) {
1573                weeks = weeks % 52;
1574            }
1575            
1576            return Math.floor(weeks);
1577        },
1578        
1579        /**
1580         * Removes a specific number of leading zeros from the array.
1581         * This method prevents you from removing too many digits, even
1582         * if you try.
1583         *
1584         * @param   int    Total number of digits to remove 
1585         * @return  array  An array of digits 
1586         */
1587         
1588        removeLeadingZeros: function(totalDigits, digits) {
1589            var total    = 0;
1590            var newArray = [];
1591            
1592            $.each(digits, function(i, digit) {
1593                if(i < totalDigits) {
1594                    total += parseInt(digits[i], 10);
1595                }
1596                else {
1597                    newArray.push(digits[i]);
1598                }
1599            });
1600            
1601            if(total === 0) {
1602                return newArray;
1603            }
1604            
1605            return digits;
1606        },
1607
1608        /**
1609         * Adds X second to the current time
1610         */
1611
1612        addSeconds: function(x) {
1613            if(this.time instanceof Date) {
1614                this.time.setSeconds(this.time.getSeconds() + x);
1615            }
1616            else {
1617                this.time += x;
1618            }
1619        },
1620
1621        /**
1622         * Adds 1 second to the current time
1623         */
1624
1625        addSecond: function() {
1626            this.addSeconds(1);
1627        },
1628
1629        /**
1630         * Substracts X seconds from the current time
1631         */
1632
1633        subSeconds: function(x) {
1634            if(this.time instanceof Date) {
1635                this.time.setSeconds(this.time.getSeconds() - x);
1636            }
1637            else {
1638                this.time -= x;
1639            }
1640        },
1641
1642        /**
1643         * Substracts 1 second from the current time
1644         */
1645
1646        subSecond: function() {
1647            this.subSeconds(1);
1648        },
1649        
1650        /**
1651         * Converts the object to a human readable string
1652         */
1653         
1654        toString: function() {
1655            return this.getTimeSeconds().toString();
1656        }
1657        
1658        /*
1659        getYears: function() {
1660            return Math.floor(this.time / 60 / 60 / 24 / 7 / 52);
1661        },
1662        
1663        getDecades: function() {
1664            return Math.floor(this.getWeeks() / 10);
1665        }*/
1666    });
1667    
1668}(jQuery));
1669
1670/*jshint smarttabs:true */
1671
1672/**
1673 * FlipClock.js
1674 *
1675 * @author     Justin Kimbrell
1676 * @copyright  2013 - Objective HTML, LLC
1677 * @licesnse   http://www.opensource.org/licenses/mit-license.php
1678 */
1679    
1680(function($) {
1681    
1682    "use strict";
1683    
1684    /**
1685     * The FlipClock.Timer object managers the JS timers
1686     *
1687     * @param   object  The parent FlipClock.Factory object
1688     * @param   object  Override the default options
1689     */
1690    
1691    FlipClock.Timer = FlipClock.Base.extend({
1692        
1693        /**
1694         * Callbacks
1695         */     
1696         
1697        callbacks: {
1698            destroy: false,
1699            create: false,
1700            init: false,
1701            interval: false,
1702            start: false,
1703            stop: false,
1704            reset: false
1705        },
1706        
1707        /**
1708         * FlipClock timer count (how many intervals have passed)
1709         */     
1710         
1711        count: 0,
1712        
1713        /**
1714         * The parent FlipClock.Factory object
1715         */     
1716         
1717        factory: false,
1718        
1719        /**
1720         * Timer interval (1 second by default)
1721         */     
1722         
1723        interval: 1000,
1724
1725        /**
1726         * The rate of the animation in milliseconds (not currently in use)
1727         */     
1728         
1729        animationRate: 1000,
1730                
1731        /**
1732         * Constructor
1733         *
1734         * @return  void
1735         */     
1736         
1737        constructor: function(factory, options) {
1738            this.base(options);
1739            this.factory = factory;
1740            this.callback(this.callbacks.init); 
1741            this.callback(this.callbacks.create);
1742        },
1743        
1744        /**
1745         * This method gets the elapsed the time as an interger
1746         *
1747         * @return  void
1748         */     
1749         
1750        getElapsed: function() {
1751            return this.count * this.interval;
1752        },
1753        
1754        /**
1755         * This method gets the elapsed the time as a Date object
1756         *
1757         * @return  void
1758         */     
1759         
1760        getElapsedTime: function() {
1761            return new Date(this.time + this.getElapsed());
1762        },
1763        
1764        /**
1765         * This method is resets the timer
1766         *
1767         * @param   callback  This method resets the timer back to 0
1768         * @return  void
1769         */     
1770         
1771        reset: function(callback) {
1772            clearInterval(this.timer);
1773            this.count = 0;
1774            this._setInterval(callback);            
1775            this.callback(this.callbacks.reset);
1776        },
1777        
1778        /**
1779         * This method is starts the timer
1780         *
1781         * @param   callback  A function that is called once the timer is destroyed
1782         * @return  void
1783         */     
1784         
1785        start: function(callback) {     
1786            this.factory.running = true;
1787            this._createTimer(callback);
1788            this.callback(this.callbacks.start);
1789        },
1790        
1791        /**
1792         * This method is stops the timer
1793         *
1794         * @param   callback  A function that is called once the timer is destroyed
1795         * @return  void
1796         */     
1797         
1798        stop: function(callback) {
1799            this.factory.running = false;
1800            this._clearInterval(callback);
1801            this.callback(this.callbacks.stop);
1802            this.callback(callback);
1803        },
1804        
1805        /**
1806         * Clear the timer interval
1807         *
1808         * @return  void
1809         */     
1810         
1811        _clearInterval: function() {
1812            clearInterval(this.timer);
1813        },
1814        
1815        /**
1816         * Create the timer object
1817         *
1818         * @param   callback  A function that is called once the timer is created
1819         * @return  void
1820         */     
1821         
1822        _createTimer: function(callback) {
1823            this._setInterval(callback);        
1824        },
1825        
1826        /**
1827         * Destroy the timer object
1828         *
1829         * @param   callback  A function that is called once the timer is destroyed
1830         * @return  void
1831         */     
1832            
1833        _destroyTimer: function(callback) {
1834            this._clearInterval();          
1835            this.timer = false;
1836            this.callback(callback);
1837            this.callback(this.callbacks.destroy);
1838        },
1839        
1840        /**
1841         * This method is called each time the timer interval is ran
1842         *
1843         * @param   callback  A function that is called once the timer is destroyed
1844         * @return  void
1845         */     
1846         
1847        _interval: function(callback) {
1848            this.callback(this.callbacks.interval);
1849            this.callback(callback);
1850            this.count++;
1851        },
1852        
1853        /**
1854         * This sets the timer interval
1855         *
1856         * @param   callback  A function that is called once the timer is destroyed
1857         * @return  void
1858         */     
1859         
1860        _setInterval: function(callback) {
1861            var t = this;
1862    
1863            t._interval(callback);
1864
1865            t.timer = setInterval(function() {      
1866                t._interval(callback);
1867            }, this.interval);
1868        }
1869            
1870    });
1871    
1872}(jQuery));
1873
1874(function($) {
1875
1876    /**
1877     * Daily Counter Clock Face
1878     *
1879     * This class will generate a daily counter for FlipClock.js. A
1880     * daily counter will track days, hours, minutes, and seconds. If
1881     * the number of available digits is exceeded in the count, a new
1882     * digit will be created.
1883     *
1884     * @param  object  The parent FlipClock.Factory object
1885     * @param  object  An object of properties to override the default
1886     */
1887
1888    FlipClock.DailyCounterFace = FlipClock.Face.extend({
1889
1890        showSeconds: true,
1891
1892        /**
1893         * Constructor
1894         *
1895         * @param  object  The parent FlipClock.Factory object
1896         * @param  object  An object of properties to override the default
1897         */
1898
1899        constructor: function(factory, options) {
1900            this.base(factory, options);
1901        },
1902
1903        /**
1904         * Build the clock face
1905         */
1906
1907        build: function(time) {
1908            var t = this;
1909            var children = this.factory.$el.find('ul');
1910            var offset = 0;
1911
1912            time = time ? time : this.factory.time.getDayCounter(this.showSeconds);
1913
1914            if(time.length > children.length) {
1915                $.each(time, function(i, digit) {
1916                    t.createList(digit);
1917                });
1918            }
1919
1920            if(this.showSeconds) {
1921                $(this.createDivider(mecdata.seconds)).insertBefore(this.lists[this.lists.length - 2].$el);
1922            }
1923            else
1924            {
1925                offset = 2;
1926            }
1927
1928            $(this.createDivider(mecdata.minutes)).insertBefore(this.lists[this.lists.length - 4 + offset].$el);
1929            $(this.createDivider(mecdata.hours)).insertBefore(this.lists[this.lists.length - 6 + offset].$el);
1930            $(this.createDivider(mecdata.days, true)).insertBefore(this.lists[0].$el);
1931
1932            this.base();
1933        },
1934
1935        /**
1936         * Flip the clock face
1937         */
1938
1939        flip: function(time, doNotAddPlayClass) {
1940            if(!time) {
1941                time = this.factory.time.getDayCounter(this.showSeconds);
1942            }
1943
1944            this.autoIncrement();
1945
1946            this.base(time, doNotAddPlayClass);
1947        }
1948
1949    });
1950
1951}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.