/* * TypeWatch 3 * * Examples/Docs: github.com/dennyferra/TypeWatch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ !function(root, factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports === 'object') { factory(require('jquery')); } else { factory(root.jQuery); } }(this, function($) { 'use strict'; $.fn.typeWatch = function(o) { // The default input types that are supported var _supportedInputTypes = ['TEXT', 'TEXTAREA', 'PASSWORD', 'TEL', 'SEARCH', 'URL', 'EMAIL', 'DATETIME', 'DATE', 'MONTH', 'WEEK', 'TIME', 'DATETIME-LOCAL', 'NUMBER', 'RANGE', 'DIV']; // Options var options = $.extend({ wait: 750, callback: function() { }, highlight: true, captureLength: 2, allowSubmit: false, inputTypes: _supportedInputTypes }, o); function checkElement(timer, override) { var value = timer.type === 'DIV' ? jQuery(timer.el).html() : jQuery(timer.el).val(); // If has capture length and has changed value // Or override and has capture length or allowSubmit option is true // Or capture length is zero and changed value if ((value.length >= options.captureLength && value != timer.text) || (override && (value.length >= options.captureLength || options.allowSubmit)) || (value.length == 0 && timer.text)) { timer.text = value; timer.cb.call(timer.el, value); } }; function watchElement(elem) { var elementType = (elem.type || elem.nodeName).toUpperCase(); if (jQuery.inArray(elementType, options.inputTypes) >= 0) { // Allocate timer element var timer = { timer: null, text: (elementType === 'DIV') ? jQuery(elem).html() : jQuery(elem).val(), cb: options.callback, el: elem, type: elementType, wait: options.wait }; // Set focus action (highlight) if (options.highlight && elementType !== 'DIV') jQuery(elem).focus(function() { this.select(); }); // Key watcher / clear and reset the timer var startWatch = function(evt) { var timerWait = timer.wait; var overrideBool = false; var evtElementType = elementType; // If enter key is pressed and not a TEXTAREA or DIV if (typeof evt.keyCode != 'undefined' && evt.keyCode == 13 && evtElementType !== 'TEXTAREA' && elementType !== 'DIV') { timerWait = 1; overrideBool = true; } var timerCallbackFx = function() { checkElement(timer, overrideBool) } // Clear timer clearTimeout(timer.timer); timer.timer = setTimeout(timerCallbackFx, timerWait); }; jQuery(elem).on('keydown paste cut input', startWatch); } }; // Watch each element return this.each(function() { watchElement(this); }); }; }); ; /** * Featherlight - ultra slim jQuery lightbox * Version 1.7.14-UMD - http://noelboss.github.io/featherlight/ * * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com) * MIT Licensed. **/ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function (root, jQuery) { if (jQuery === undefined) { // require('jQuery') returns a factory that requires window to // build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop // if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } })(function ($) { "use strict"; if ('undefined' === typeof $) { if ('console' in window) { window.console.info('Too much lightness, Featherlight needs jQuery.'); } return; } if ($.fn.jquery.match(/-ajax/)) { if ('console' in window) { window.console.info('Featherlight needs regular jQuery, not the slim version.'); } return; } /* Featherlight is exported as $.featherlight. It is a function used to open a featherlight lightbox. [tech] Featherlight uses prototype inheritance. Each opened lightbox will have a corresponding object. That object may have some attributes that override the prototype's. Extensions created with Featherlight.extend will have their own prototype that inherits from Featherlight's prototype, thus attributes can be overriden either at the object level, or at the extension level. To create callbacks that chain themselves instead of overriding, use chainCallbacks. For those familiar with CoffeeScript, this correspond to Featherlight being a class and the Gallery being a class extending Featherlight. The chainCallbacks is used since we don't have access to CoffeeScript's `super`. */ function Featherlight($content, config) { if (this instanceof Featherlight) { /* called with new */ this.id = Featherlight.id++; this.setup($content, config); this.chainCallbacks(Featherlight._callbackChain); } else { var fl = new Featherlight($content, config); fl.open(); return fl; } } var opened = [], pruneOpened = function (remove) { opened = $.grep(opened, function (fl) { return fl !== remove && fl.$instance.closest('body').length > 0; }); return opened; }; // Removes keys of `set` from `obj` and returns the removed key/values. function slice(obj, set) { var r = {}; for (var key in obj) { if (key in set) { r[key] = obj[key]; delete obj[key]; } } return r; } // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe). var iFrameAttributeSet = { allow: 1, allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1, mozallowfullscreen: 1, name: 1, referrerpolicy: 1, sandbox: 1, scrolling: 1, src: 1, srcdoc: 1, style: 1, webkitallowfullscreen: 1, width: 1 }; // Converts camelCased attributes to dasherized versions for given prefix: // parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2} function parseAttrs(obj, prefix) { var attrs = {}, regex = new RegExp('^' + prefix + '([A-Z])(.*)'); for (var key in obj) { var match = key.match(regex); if (match) { var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase(); attrs[dasherized] = obj[key]; } } return attrs; } /* document wide key handler */ var eventMap = { keyup: 'onKeyUp', resize: 'onResize' }; var globalEventHandler = function (event) { $.each(Featherlight.opened().reverse(), function () { if (!event.isDefaultPrevented()) { if (false === this[eventMap[event.type]](event)) { event.preventDefault(); event.stopPropagation(); return false; } } }); }; var toggleGlobalEvents = function (set) { if (set !== Featherlight._globalHandlerInstalled) { Featherlight._globalHandlerInstalled = set; var events = $.map(eventMap, function (_, name) { return name + '.' + Featherlight.prototype.namespace; }).join(' '); $(window)[set ? 'on' : 'off'](events, globalEventHandler); } }; Featherlight.prototype = { constructor: Featherlight, /*** defaults ***/ /* extend featherlight with defaults and methods */ namespace: 'featherlight', /* Name of the events and css class prefix */ targetAttr: 'data-featherlight', /* Attribute of the triggered element that contains the selector to the lightbox content */ variant: null, /* Class that will be added to change look of the lightbox */ resetCss: false, /* Reset all css */ background: null, /* Custom DOM for the background, wrapper and the closebutton */ openTrigger: 'click', /* Event that triggers the lightbox */ closeTrigger: 'click', /* Event that triggers the closing of the lightbox */ filter: null, /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */ root: 'body', /* Where to append featherlights */ openSpeed: 250, /* Duration of opening animation */ closeSpeed: 250, /* Duration of closing animation */ closeOnClick: 'background', /* Close lightbox on click ('background', 'anywhere' or false) */ closeOnEsc: true, /* Close lightbox when pressing esc */ closeIcon: '✕', /* Close icon */ loading: '', /* Content to show while initial content is loading */ persist: false, /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */ otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */ beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */ beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */ beforeClose: $.noop, /* Called before close. can return false to prevent closing of lightbox. Gets event as parameter, this contains all data */ afterOpen: $.noop, /* Called after open. Gets event as parameter, this contains all data */ afterContent: $.noop, /* Called after content is ready and has been set. Gets event as parameter, this contains all data */ afterClose: $.noop, /* Called after close. Gets event as parameter, this contains all data */ onKeyUp: $.noop, /* Called on key up for the frontmost featherlight */ onResize: $.noop, /* Called after new content and when a window is resized */ type: null, /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */ contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */ /*** methods ***/ /* setup iterates over a single instance of featherlight and prepares the background and binds the events */ setup: function (target, config) { /* all arguments are optional */ if (typeof target === 'object' && target instanceof $ === false && !config) { config = target; target = undefined; } var self = $.extend(this, config, { target: target }), css = !self.resetCss ? self.namespace : self.namespace + '-reset', /* by adding -reset to the classname, we reset all the default css */ $background = $(self.background || [ '
', '
', '', '
' + self.loading + '
', '
', '
'].join('')), closeButtonSelector = '.' + self.namespace + '-close' + (self.otherClose ? ',' + self.otherClose : ''); self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */ /* close when click on background/anywhere/null or closebox */ self.$instance.on(self.closeTrigger + '.' + self.namespace, function (event) { if (event.isDefaultPrevented()) { return; } var $target = $(event.target); if (('background' === self.closeOnClick && $target.is('.' + self.namespace)) || 'anywhere' === self.closeOnClick || $target.closest(closeButtonSelector).length) { self.close(event); event.preventDefault(); } }); return this; }, /* this method prepares the content and converts it into a jQuery object or a promise */ getContent: function () { if (this.persist !== false && this.$content) { return this.$content; } var self = this, filters = this.constructor.contentFilters, readTargetAttr = function (name) { return self.$currentTarget && self.$currentTarget.attr(name); }, targetValue = readTargetAttr(self.targetAttr), data = self.target || targetValue || ''; /* Find which filter applies */ var filter = filters[self.type]; /* check explicit type like {type: 'image'} */ /* check explicit type like data-featherlight="image" */ if (!filter && data in filters) { filter = filters[data]; data = self.target && targetValue; } data = data || readTargetAttr('href') || ''; /* check explicity type & content like {image: 'photo.jpg'} */ if (!filter) { for (var filterName in filters) { if (self[filterName]) { filter = filters[filterName]; data = self[filterName]; } } } /* otherwise it's implicit, run checks */ if (!filter) { var target = data; data = null; $.each(self.contentFilters, function () { filter = filters[this]; if (filter.test) { data = filter.test(target); } if (!data && filter.regex && target.match && target.match(filter.regex)) { data = target; } return !data; }); if (!data) { if ('console' in window) { window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); } return false; } } /* Process it */ return filter.process.call(self, data); }, /* sets the content of $instance to $content */ setContent: function ($content) { this.$instance.removeClass(this.namespace + '-loading'); /* we need a special class for the iframe */ this.$instance.toggleClass(this.namespace + '-iframe', $content.is('iframe')); /* replace content by appending to existing one before it is removed this insures that featherlight-inner remain at the same relative position to any other items added to featherlight-content */ this.$instance.find('.' + this.namespace + '-inner') .not($content) /* excluded new content, important if persisted */ .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */ .replaceWith($.contains(this.$instance[0], $content[0]) ? '' : $content); this.$content = $content.addClass(this.namespace + '-inner'); return this; }, /* opens the lightbox. "this" contains $instance with the lightbox, and with the config. Returns a promise that is resolved after is successfully opened. */ open: function (event) { var self = this; self.$instance.hide().appendTo(self.root); if ((!event || !event.isDefaultPrevented()) && self.beforeOpen(event) !== false) { if (event) { event.preventDefault(); } var $content = self.getContent(); if ($content) { opened.push(self); toggleGlobalEvents(true); self.$instance.fadeIn(self.openSpeed); self.beforeContent(event); /* Set content and show */ return $.when($content) .always(function ($openendContent) { if ($openendContent) { self.setContent($openendContent); self.afterContent(event); } }) .then(self.$instance.promise()) /* Call afterOpen after fadeIn is done */ .done(function () { self.afterOpen(event); }); } } self.$instance.detach(); return $.Deferred().reject().promise(); }, /* closes the lightbox. "this" contains $instance with the lightbox, and with the config returns a promise, resolved after the lightbox is successfully closed. */ close: function (event) { var self = this, deferred = $.Deferred(); if (self.beforeClose(event) === false) { deferred.reject(); } else { if (0 === pruneOpened(self).length) { toggleGlobalEvents(false); } self.$instance.fadeOut(self.closeSpeed, function () { self.$instance.detach(); self.afterClose(event); deferred.resolve(); }); } return deferred.promise(); }, /* resizes the content so it fits in visible area and keeps the same aspect ratio. Does nothing if either the width or the height is not specified. Called automatically on window resize. Override if you want different behavior. */ resize: function (w, h) { if (w && h) { /* Reset apparent image size first so container grows */ this.$content.css('width', '').css('height', ''); /* Calculate the worst ratio so that dimensions fit */ /* Note: -1 to avoid rounding errors */ var ratio = Math.max( w / (this.$content.parent().width() - 1), h / (this.$content.parent().height() - 1)); /* Resize content */ if (ratio > 1) { ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */ this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px'); } } }, /* Utility function to chain callbacks [Warning: guru-level] Used be extensions that want to let users specify callbacks but also need themselves to use the callbacks. The argument 'chain' has callback names as keys and function(super, event) as values. That function is meant to call `super` at some point. */ chainCallbacks: function (chain) { for (var name in chain) { this[name] = $.proxy(chain[name], this, $.proxy(this[name], this)); } } }; $.extend(Featherlight, { id: 0, /* Used to id single featherlight instances */ autoBind: '[data-featherlight]', /* Will automatically bind elements matching this selector. Clear or set before onReady */ defaults: Featherlight.prototype, /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */ /* Contains the logic to determine content */ contentFilters: { jquery: { regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */ test: function (elem) { return elem instanceof $ && elem; }, process: function (elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); } }, image: { regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i, process: function (url) { var self = this, deferred = $.Deferred(), img = new Image(), $img = $(''); img.onload = function () { /* Store naturalWidth & height for IE8 */ $img.naturalWidth = img.width; $img.naturalHeight = img.height; deferred.resolve($img); }; img.onerror = function () { deferred.reject($img); }; img.src = url; return deferred.promise(); } }, html: { regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */ process: function (html) { return $(html); } }, ajax: { regex: /./, /* At this point, any content is assumed to be an URL */ process: function (url) { var self = this, deferred = $.Deferred(); /* we are using load so one can specify a target with: url.html #targetelement */ var $container = $('
').load(url, function (response, status) { if (status !== "error") { deferred.resolve($container.contents()); } deferred.reject(); }); return deferred.promise(); } }, iframe: { process: function (url) { var deferred = new $.Deferred(); var $content = $(''); html.attr('height', height); html.attr('width', width); if (video.type === 'youtube') { html.attr('src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id); } else if (video.type === 'vimeo') { html.attr('src', '//player.vimeo.com/video/' + video.id + '?autoplay=1'); } else if (video.type === 'vzaar') { html.attr('src', '//view.vzaar.com/' + video.id + '/player?autoplay=true'); } iframe = $(html).wrap('
').insertAfter(item.find('.owl-video')); this._playing = item.addClass('owl-video-playing'); }; /** * Checks whether an video is currently in full screen mode or not. * @todo Bad style because looks like a readonly method but changes members. * @protected * @returns {Boolean} */ Video.prototype.isInFullScreen = function () { var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; return element && $(element).parent().hasClass('owl-video-frame'); }; /** * Destroys the plugin. */ Video.prototype.destroy = function () { var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Video = Video; })(window.Zepto || window.jQuery, window, document); /** * Animate Plugin * @version 2.3.4 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) */ ; (function ($, window, document, undefined) { /** * Creates the animate plugin. * @class The Navigation Plugin * @param {Owl} scope - The Owl Carousel */ var Animate = function (scope) { this.core = scope; this.core.options = $.extend({}, Animate.Defaults, this.core.options); this.swapping = true; this.previous = undefined; this.next = undefined; this.handlers = { 'change.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name == 'position') { this.previous = this.core.current(); this.next = e.property.value; } }, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e) { if (e.namespace) { this.swapping = e.type == 'translated'; } }, this), 'translate.owl.carousel': $.proxy(function (e) { if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { this.swap(); } }, this) }; this.core.$element.on(this.handlers); }; /** * Default options. * @public */ Animate.Defaults = { animateOut: false, animateIn: false }; /** * Toggles the animation classes whenever an translations starts. * @protected * @returns {Boolean|undefined} */ Animate.prototype.swap = function () { if (this.core.settings.items !== 1) { return; } if (!$.support.animation || !$.support.transition) { return; } this.core.speed(0); var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; if (this.core.current() === this.previous) { return; } if (outgoing) { left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear) .css({ 'left': left + 'px' }) .addClass('animated owl-animated-out') .addClass(outgoing); } if (incoming) { next.one($.support.animation.end, clear) .addClass('animated owl-animated-in') .addClass(incoming); } }; Animate.prototype.clear = function (e) { $(e.target).css({ 'left': '' }) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.onTransitionEnd(); }; /** * Destroys the plugin. * @public */ Animate.prototype.destroy = function () { var handler, property; for (handler in this.handlers) { this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; })(window.Zepto || window.jQuery, window, document); /** * Autoplay Plugin * @version 2.3.4 * @author Bartosz Wojciechowski * @author Artus Kolanowski * @author David Deutsch * @author Tom De Caluwé * @license The MIT License (MIT) */ ; (function ($, window, document, undefined) { /** * Creates the autoplay plugin. * @class The Autoplay Plugin * @param {Owl} scope - The Owl Carousel */ var Autoplay = function (carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * The autoplay timeout id. * @type {Number} */ this._call = null; /** * Depending on the state of the plugin, this variable contains either * the start time of the timer or the current timer value if it's * paused. Since we start in a paused state we initialize the timer * value. * @type {Number} */ this._time = 0; /** * Stores the timeout currently used. * @type {Number} */ this._timeout = 0; /** * Indicates whenever the autoplay is paused. * @type {Boolean} */ this._paused = true; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'changed.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name === 'settings') { if (this._core.settings.autoplay) { this.play(); } else { this.stop(); } } else if (e.namespace && e.property.name === 'position' && this._paused) { // Reset the timer. This code is triggered when the position // of the carousel was changed through user interaction. this._time = 0; } }, this), 'initialized.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.autoplay) { this.play(); } }, this), 'play.owl.autoplay': $.proxy(function (e, t, s) { if (e.namespace) { this.play(t, s); } }, this), 'stop.owl.autoplay': $.proxy(function (e) { if (e.namespace) { this.stop(); } }, this), 'mouseover.owl.autoplay': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause(); } }, this), 'mouseleave.owl.autoplay': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.play(); } }, this), 'touchstart.owl.core': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause(); } }, this), 'touchend.owl.core': $.proxy(function () { if (this._core.settings.autoplayHoverPause) { this.play(); } }, this) }; // register event handlers this._core.$element.on(this._handlers); // set default options this._core.options = $.extend({}, Autoplay.Defaults, this._core.options); }; /** * Default options. * @public */ Autoplay.Defaults = { autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; /** * Transition to the next slide and set a timeout for the next transition. * @private * @param {Number} [speed] - The animation speed for the animations. */ Autoplay.prototype._next = function (speed) { this._call = window.setTimeout( $.proxy(this._next, this, speed), this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read() ); if (this._core.is('interacting') || document.hidden) { return; } this._core.next(speed || this._core.settings.autoplaySpeed); } /** * Reads the current timer value when the timer is playing. * @public */ Autoplay.prototype.read = function () { return new Date().getTime() - this._time; }; /** * Starts the autoplay. * @public * @param {Number} [timeout] - The interval before the next animation starts. * @param {Number} [speed] - The animation speed for the animations. */ Autoplay.prototype.play = function (timeout, speed) { var elapsed; if (!this._core.is('rotating')) { this._core.enter('rotating'); } timeout = timeout || this._core.settings.autoplayTimeout; // Calculate the elapsed time since the last transition. If the carousel // wasn't playing this calculation will yield zero. elapsed = Math.min(this._time % (this._timeout || timeout), timeout); if (this._paused) { // Start the clock. this._time = this.read(); this._paused = false; } else { // Clear the active timeout to allow replacement. window.clearTimeout(this._call); } // Adjust the origin of the timer to match the new timeout value. this._time += this.read() % timeout - elapsed; this._timeout = timeout; this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed); }; /** * Stops the autoplay. * @public */ Autoplay.prototype.stop = function () { if (this._core.is('rotating')) { // Reset the clock. this._time = 0; this._paused = true; window.clearTimeout(this._call); this._core.leave('rotating'); } }; /** * Pauses the autoplay. * @public */ Autoplay.prototype.pause = function () { if (this._core.is('rotating') && !this._paused) { // Pause the clock. this._time = this.read(); this._paused = true; window.clearTimeout(this._call); } }; /** * Destroys the plugin. */ Autoplay.prototype.destroy = function () { var handler, property; this.stop(); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; })(window.Zepto || window.jQuery, window, document); /** * Navigation Plugin * @version 2.3.4 * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ; (function ($, window, document, undefined) { 'use strict'; /** * Creates the navigation plugin. * @class The Navigation Plugin * @param {Owl} carousel - The Owl Carousel. */ var Navigation = function (carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Indicates whether the plugin is initialized or not. * @protected * @type {Boolean} */ this._initialized = false; /** * The current paging indexes. * @protected * @type {Array} */ this._pages = []; /** * All DOM elements of the user interface. * @protected * @type {Object} */ this._controls = {}; /** * Markup for an indicator. * @protected * @type {Array.} */ this._templates = []; /** * The carousel element. * @type {jQuery} */ this.$element = this._core.$element; /** * Overridden methods of the carousel. * @protected * @type {Object} */ this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'prepared.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.push('
' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '
'); } }, this), 'added.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 0, this._templates.pop()); } }, this), 'remove.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 1); } }, this), 'changed.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name == 'position') { this.draw(); } }, this), 'initialized.owl.carousel': $.proxy(function (e) { if (e.namespace && !this._initialized) { this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized = true; this._core.trigger('initialized', null, 'navigation'); } }, this), 'refreshed.owl.carousel': $.proxy(function (e) { if (e.namespace && this._initialized) { this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); } }, this) }; // set default options this._core.options = $.extend({}, Navigation.Defaults, this._core.options); // register event handlers this.$element.on(this._handlers); }; /** * Default options. * @public * @todo Rename `slideBy` to `navBy` */ Navigation.Defaults = { nav: false, navText: [ '', '' ], navSpeed: false, navElement: 'button type="button" role="presentation"', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotsData: false, dotsSpeed: false, dotsContainer: false }; /** * Initializes the layout of the plugin and extends the carousel. * @protected */ Navigation.prototype.initialize = function () { var override, settings = this._core.settings; // create DOM structure for relative navigation this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $('
').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous = $('<' + settings.navElement + '>') .addClass(settings.navClass[0]) .html(settings.navText[0]) .prependTo(this._controls.$relative) .on('click', $.proxy(function (e) { this.prev(settings.navSpeed); }, this)); this._controls.$next = $('<' + settings.navElement + '>') .addClass(settings.navClass[1]) .html(settings.navText[1]) .appendTo(this._controls.$relative) .on('click', $.proxy(function (e) { this.next(settings.navSpeed); }, this)); // create DOM structure for absolute navigation if (!settings.dotsData) { this._templates = [$('