|
|
Line 9,326: |
Line 9,326: |
| </footer> | | </footer> |
| | | |
− | <script src="js/vendor/jquery-1.11.0.min.js"></script>
| + | |
− | <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.0.min.js"><\/script>')</script>
| + | |
− | <script src="js/bootstrap.js"></script>
| + | |
− | <script src="js/plugins.js"></script>
| + | |
− | <script src="js/main.js"></script>
| + | |
| | | |
| + | <script type="text/javascript"> |
| + | /** |
| + | * bootstrap.js v3.0.0 by @fat and @mdo |
| + | * Copyright 2013 Twitter Inc. |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | */ |
| + | if (!jQuery) { throw new Error("Bootstrap requires jQuery") } |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: transition.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#transitions |
| + | * ======================================================================== |
| + | * Copyright 2013 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) |
| + | // ============================================================ |
| + | |
| + | function transitionEnd() { |
| + | var el = document.createElement('bootstrap') |
| + | |
| + | var transEndEventNames = { |
| + | 'WebkitTransition' : 'webkitTransitionEnd' |
| + | , 'MozTransition' : 'transitionend' |
| + | , 'OTransition' : 'oTransitionEnd otransitionend' |
| + | , 'transition' : 'transitionend' |
| + | } |
| + | |
| + | for (var name in transEndEventNames) { |
| + | if (el.style[name] !== undefined) { |
| + | return { end: transEndEventNames[name] } |
| + | } |
| + | } |
| + | } |
| + | |
| + | // http://blog.alexmaccaw.com/css-transitions |
| + | $.fn.emulateTransitionEnd = function (duration) { |
| + | var called = false, $el = this |
| + | $(this).one($.support.transition.end, function () { called = true }) |
| + | var callback = function () { if (!called) $($el).trigger($.support.transition.end) } |
| + | setTimeout(callback, duration) |
| + | return this |
| + | } |
| + | |
| + | $(function () { |
| + | $.support.transition = transitionEnd() |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: alert.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#alerts |
| + | * ======================================================================== |
| + | * Copyright 2013 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // ALERT CLASS DEFINITION |
| + | // ====================== |
| + | |
| + | var dismiss = '[data-dismiss="alert"]' |
| + | var Alert = function (el) { |
| + | $(el).on('click', dismiss, this.close) |
| + | } |
| + | |
| + | Alert.prototype.close = function (e) { |
| + | var $this = $(this) |
| + | var selector = $this.attr('data-target') |
| + | |
| + | if (!selector) { |
| + | selector = $this.attr('href') |
| + | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 |
| + | } |
| + | |
| + | var $parent = $(selector) |
| + | |
| + | if (e) e.preventDefault() |
| + | |
| + | if (!$parent.length) { |
| + | $parent = $this.hasClass('alert') ? $this : $this.parent() |
| + | } |
| + | |
| + | $parent.trigger(e = $.Event('close.bs.alert')) |
| + | |
| + | if (e.isDefaultPrevented()) return |
| + | |
| + | $parent.removeClass('in') |
| + | |
| + | function removeElement() { |
| + | $parent.trigger('closed.bs.alert').remove() |
| + | } |
| + | |
| + | $.support.transition && $parent.hasClass('fade') ? |
| + | $parent |
| + | .one($.support.transition.end, removeElement) |
| + | .emulateTransitionEnd(150) : |
| + | removeElement() |
| + | } |
| + | |
| + | |
| + | // ALERT PLUGIN DEFINITION |
| + | // ======================= |
| + | |
| + | var old = $.fn.alert |
| + | |
| + | $.fn.alert = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.alert') |
| + | |
| + | if (!data) $this.data('bs.alert', (data = new Alert(this))) |
| + | if (typeof option == 'string') data[option].call($this) |
| + | }) |
| + | } |
| + | |
| + | $.fn.alert.Constructor = Alert |
| + | |
| + | |
| + | // ALERT NO CONFLICT |
| + | // ================= |
| + | |
| + | $.fn.alert.noConflict = function () { |
| + | $.fn.alert = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // ALERT DATA-API |
| + | // ============== |
| + | |
| + | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: button.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#buttons |
| + | * ======================================================================== |
| + | * Copyright 2013 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // BUTTON PUBLIC CLASS DEFINITION |
| + | // ============================== |
| + | |
| + | var Button = function (element, options) { |
| + | this.$element = $(element) |
| + | this.options = $.extend({}, Button.DEFAULTS, options) |
| + | } |
| + | |
| + | Button.DEFAULTS = { |
| + | loadingText: 'loading...' |
| + | } |
| + | |
| + | Button.prototype.setState = function (state) { |
| + | var d = 'disabled' |
| + | var $el = this.$element |
| + | var val = $el.is('input') ? 'val' : 'html' |
| + | var data = $el.data() |
| + | |
| + | state = state + 'Text' |
| + | |
| + | if (!data.resetText) $el.data('resetText', $el[val]()) |
| + | |
| + | $el[val](data[state] || this.options[state]) |
| + | |
| + | // push to event loop to allow forms to submit |
| + | setTimeout(function () { |
| + | state == 'loadingText' ? |
| + | $el.addClass(d).attr(d, d) : |
| + | $el.removeClass(d).removeAttr(d); |
| + | }, 0) |
| + | } |
| + | |
| + | Button.prototype.toggle = function () { |
| + | var $parent = this.$element.closest('[data-toggle="buttons"]') |
| + | |
| + | if ($parent.length) { |
| + | var $input = this.$element.find('input') |
| + | .prop('checked', !this.$element.hasClass('active')) |
| + | .trigger('change') |
| + | if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') |
| + | } |
| + | |
| + | this.$element.toggleClass('active') |
| + | } |
| + | |
| + | |
| + | // BUTTON PLUGIN DEFINITION |
| + | // ======================== |
| + | |
| + | var old = $.fn.button |
| + | |
| + | $.fn.button = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.button') |
| + | var options = typeof option == 'object' && option |
| + | |
| + | if (!data) $this.data('bs.button', (data = new Button(this, options))) |
| + | |
| + | if (option == 'toggle') data.toggle() |
| + | else if (option) data.setState(option) |
| + | }) |
| + | } |
| + | |
| + | $.fn.button.Constructor = Button |
| + | |
| + | |
| + | // BUTTON NO CONFLICT |
| + | // ================== |
| + | |
| + | $.fn.button.noConflict = function () { |
| + | $.fn.button = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // BUTTON DATA-API |
| + | // =============== |
| + | |
| + | $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { |
| + | var $btn = $(e.target) |
| + | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') |
| + | $btn.button('toggle') |
| + | e.preventDefault() |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: carousel.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#carousel |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // CAROUSEL CLASS DEFINITION |
| + | // ========================= |
| + | |
| + | var Carousel = function (element, options) { |
| + | this.$element = $(element) |
| + | this.$indicators = this.$element.find('.carousel-indicators') |
| + | this.options = options |
| + | this.paused = |
| + | this.sliding = |
| + | this.interval = |
| + | this.$active = |
| + | this.$items = null |
| + | |
| + | this.options.pause == 'hover' && this.$element |
| + | .on('mouseenter', $.proxy(this.pause, this)) |
| + | .on('mouseleave', $.proxy(this.cycle, this)) |
| + | } |
| + | |
| + | Carousel.DEFAULTS = { |
| + | interval: 5000 |
| + | , pause: 'hover' |
| + | , wrap: true |
| + | } |
| + | |
| + | Carousel.prototype.cycle = function (e) { |
| + | e || (this.paused = false) |
| + | |
| + | this.interval && clearInterval(this.interval) |
| + | |
| + | this.options.interval |
| + | && !this.paused |
| + | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) |
| + | |
| + | return this |
| + | } |
| + | |
| + | Carousel.prototype.getActiveIndex = function () { |
| + | this.$active = this.$element.find('.item.active') |
| + | this.$items = this.$active.parent().children() |
| + | |
| + | return this.$items.index(this.$active) |
| + | } |
| + | |
| + | Carousel.prototype.to = function (pos) { |
| + | var that = this |
| + | var activeIndex = this.getActiveIndex() |
| + | |
| + | if (pos > (this.$items.length - 1) || pos < 0) return |
| + | |
| + | if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) |
| + | if (activeIndex == pos) return this.pause().cycle() |
| + | |
| + | return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) |
| + | } |
| + | |
| + | Carousel.prototype.pause = function (e) { |
| + | e || (this.paused = true) |
| + | |
| + | if (this.$element.find('.next, .prev').length && $.support.transition.end) { |
| + | this.$element.trigger($.support.transition.end) |
| + | this.cycle(true) |
| + | } |
| + | |
| + | this.interval = clearInterval(this.interval) |
| + | |
| + | return this |
| + | } |
| + | |
| + | Carousel.prototype.next = function () { |
| + | if (this.sliding) return |
| + | return this.slide('next') |
| + | } |
| + | |
| + | Carousel.prototype.prev = function () { |
| + | if (this.sliding) return |
| + | return this.slide('prev') |
| + | } |
| + | |
| + | Carousel.prototype.slide = function (type, next) { |
| + | var $active = this.$element.find('.item.active') |
| + | var $next = next || $active[type]() |
| + | var isCycling = this.interval |
| + | var direction = type == 'next' ? 'left' : 'right' |
| + | var fallback = type == 'next' ? 'first' : 'last' |
| + | var that = this |
| + | |
| + | if (!$next.length) { |
| + | if (!this.options.wrap) return |
| + | $next = this.$element.find('.item')[fallback]() |
| + | } |
| + | |
| + | this.sliding = true |
| + | |
| + | isCycling && this.pause() |
| + | |
| + | var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) |
| + | |
| + | if ($next.hasClass('active')) return |
| + | |
| + | if (this.$indicators.length) { |
| + | this.$indicators.find('.active').removeClass('active') |
| + | this.$element.one('slid', function () { |
| + | var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) |
| + | $nextIndicator && $nextIndicator.addClass('active') |
| + | }) |
| + | } |
| + | |
| + | if ($.support.transition && this.$element.hasClass('slide')) { |
| + | this.$element.trigger(e) |
| + | if (e.isDefaultPrevented()) return |
| + | $next.addClass(type) |
| + | $next[0].offsetWidth // force reflow |
| + | $active.addClass(direction) |
| + | $next.addClass(direction) |
| + | $active |
| + | .one($.support.transition.end, function () { |
| + | $next.removeClass([type, direction].join(' ')).addClass('active') |
| + | $active.removeClass(['active', direction].join(' ')) |
| + | that.sliding = false |
| + | setTimeout(function () { that.$element.trigger('slid') }, 0) |
| + | }) |
| + | .emulateTransitionEnd(600) |
| + | } else { |
| + | this.$element.trigger(e) |
| + | if (e.isDefaultPrevented()) return |
| + | $active.removeClass('active') |
| + | $next.addClass('active') |
| + | this.sliding = false |
| + | this.$element.trigger('slid') |
| + | } |
| + | |
| + | isCycling && this.cycle() |
| + | |
| + | return this |
| + | } |
| + | |
| + | |
| + | // CAROUSEL PLUGIN DEFINITION |
| + | // ========================== |
| + | |
| + | var old = $.fn.carousel |
| + | |
| + | $.fn.carousel = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.carousel') |
| + | var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) |
| + | var action = typeof option == 'string' ? option : options.slide |
| + | |
| + | if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) |
| + | if (typeof option == 'number') data.to(option) |
| + | else if (action) data[action]() |
| + | else if (options.interval) data.pause().cycle() |
| + | }) |
| + | } |
| + | |
| + | $.fn.carousel.Constructor = Carousel |
| + | |
| + | |
| + | // CAROUSEL NO CONFLICT |
| + | // ==================== |
| + | |
| + | $.fn.carousel.noConflict = function () { |
| + | $.fn.carousel = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // CAROUSEL DATA-API |
| + | // ================= |
| + | |
| + | $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { |
| + | var $this = $(this), href |
| + | var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
| + | var options = $.extend({}, $target.data(), $this.data()) |
| + | var slideIndex = $this.attr('data-slide-to') |
| + | if (slideIndex) options.interval = false |
| + | |
| + | $target.carousel(options) |
| + | |
| + | if (slideIndex = $this.attr('data-slide-to')) { |
| + | $target.data('bs.carousel').to(slideIndex) |
| + | } |
| + | |
| + | e.preventDefault() |
| + | }) |
| + | |
| + | $(window).on('load', function () { |
| + | $('[data-ride="carousel"]').each(function () { |
| + | var $carousel = $(this) |
| + | $carousel.carousel($carousel.data()) |
| + | }) |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: collapse.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#collapse |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // COLLAPSE PUBLIC CLASS DEFINITION |
| + | // ================================ |
| + | |
| + | var Collapse = function (element, options) { |
| + | this.$element = $(element) |
| + | this.options = $.extend({}, Collapse.DEFAULTS, options) |
| + | this.transitioning = null |
| + | |
| + | if (this.options.parent) this.$parent = $(this.options.parent) |
| + | if (this.options.toggle) this.toggle() |
| + | } |
| + | |
| + | Collapse.DEFAULTS = { |
| + | toggle: true |
| + | } |
| + | |
| + | Collapse.prototype.dimension = function () { |
| + | var hasWidth = this.$element.hasClass('width') |
| + | return hasWidth ? 'width' : 'height' |
| + | } |
| + | |
| + | Collapse.prototype.show = function () { |
| + | if (this.transitioning || this.$element.hasClass('in')) return |
| + | |
| + | var startEvent = $.Event('show.bs.collapse') |
| + | this.$element.trigger(startEvent) |
| + | if (startEvent.isDefaultPrevented()) return |
| + | |
| + | var actives = this.$parent && this.$parent.find('> .panel > .in') |
| + | |
| + | if (actives && actives.length) { |
| + | var hasData = actives.data('bs.collapse') |
| + | if (hasData && hasData.transitioning) return |
| + | actives.collapse('hide') |
| + | hasData || actives.data('bs.collapse', null) |
| + | } |
| + | |
| + | var dimension = this.dimension() |
| + | |
| + | this.$element |
| + | .removeClass('collapse') |
| + | .addClass('collapsing') |
| + | [dimension](0) |
| + | |
| + | this.transitioning = 1 |
| + | |
| + | var complete = function () { |
| + | this.$element |
| + | .removeClass('collapsing') |
| + | .addClass('in') |
| + | [dimension]('auto') |
| + | this.transitioning = 0 |
| + | this.$element.trigger('shown.bs.collapse') |
| + | } |
| + | |
| + | if (!$.support.transition) return complete.call(this) |
| + | |
| + | var scrollSize = $.camelCase(['scroll', dimension].join('-')) |
| + | |
| + | this.$element |
| + | .one($.support.transition.end, $.proxy(complete, this)) |
| + | .emulateTransitionEnd(350) |
| + | [dimension](this.$element[0][scrollSize]) |
| + | } |
| + | |
| + | Collapse.prototype.hide = function () { |
| + | if (this.transitioning || !this.$element.hasClass('in')) return |
| + | |
| + | var startEvent = $.Event('hide.bs.collapse') |
| + | this.$element.trigger(startEvent) |
| + | if (startEvent.isDefaultPrevented()) return |
| + | |
| + | var dimension = this.dimension() |
| + | |
| + | this.$element |
| + | [dimension](this.$element[dimension]()) |
| + | [0].offsetHeight |
| + | |
| + | this.$element |
| + | .addClass('collapsing') |
| + | .removeClass('collapse') |
| + | .removeClass('in') |
| + | |
| + | this.transitioning = 1 |
| + | |
| + | var complete = function () { |
| + | this.transitioning = 0 |
| + | this.$element |
| + | .trigger('hidden.bs.collapse') |
| + | .removeClass('collapsing') |
| + | .addClass('collapse') |
| + | } |
| + | |
| + | if (!$.support.transition) return complete.call(this) |
| + | |
| + | this.$element |
| + | [dimension](0) |
| + | .one($.support.transition.end, $.proxy(complete, this)) |
| + | .emulateTransitionEnd(350) |
| + | } |
| + | |
| + | Collapse.prototype.toggle = function () { |
| + | this[this.$element.hasClass('in') ? 'hide' : 'show']() |
| + | } |
| + | |
| + | |
| + | // COLLAPSE PLUGIN DEFINITION |
| + | // ========================== |
| + | |
| + | var old = $.fn.collapse |
| + | |
| + | $.fn.collapse = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.collapse') |
| + | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) |
| + | |
| + | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.collapse.Constructor = Collapse |
| + | |
| + | |
| + | // COLLAPSE NO CONFLICT |
| + | // ==================== |
| + | |
| + | $.fn.collapse.noConflict = function () { |
| + | $.fn.collapse = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // COLLAPSE DATA-API |
| + | // ================= |
| + | |
| + | $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { |
| + | var $this = $(this), href |
| + | var target = $this.attr('data-target') |
| + | || e.preventDefault() |
| + | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
| + | var $target = $(target) |
| + | var data = $target.data('bs.collapse') |
| + | var option = data ? 'toggle' : $this.data() |
| + | var parent = $this.attr('data-parent') |
| + | var $parent = parent && $(parent) |
| + | |
| + | if (!data || !data.transitioning) { |
| + | if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') |
| + | $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') |
| + | } |
| + | |
| + | $target.collapse(option) |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: dropdown.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#dropdowns |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // DROPDOWN CLASS DEFINITION |
| + | // ========================= |
| + | |
| + | var backdrop = '.dropdown-backdrop' |
| + | var toggle = '[data-toggle=dropdown]' |
| + | var Dropdown = function (element) { |
| + | var $el = $(element).on('click.bs.dropdown', this.toggle) |
| + | } |
| + | |
| + | Dropdown.prototype.toggle = function (e) { |
| + | var $this = $(this) |
| + | |
| + | if ($this.is('.disabled, :disabled')) return |
| + | |
| + | var $parent = getParent($this) |
| + | var isActive = $parent.hasClass('open') |
| + | |
| + | clearMenus() |
| + | |
| + | if (!isActive) { |
| + | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { |
| + | // if mobile we we use a backdrop because click events don't delegate |
| + | $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) |
| + | } |
| + | |
| + | $parent.trigger(e = $.Event('show.bs.dropdown')) |
| + | |
| + | if (e.isDefaultPrevented()) return |
| + | |
| + | $parent |
| + | .toggleClass('open') |
| + | .trigger('shown.bs.dropdown') |
| + | |
| + | $this.focus() |
| + | } |
| + | |
| + | return false |
| + | } |
| + | |
| + | Dropdown.prototype.keydown = function (e) { |
| + | if (!/(38|40|27)/.test(e.keyCode)) return |
| + | |
| + | var $this = $(this) |
| + | |
| + | e.preventDefault() |
| + | e.stopPropagation() |
| + | |
| + | if ($this.is('.disabled, :disabled')) return |
| + | |
| + | var $parent = getParent($this) |
| + | var isActive = $parent.hasClass('open') |
| + | |
| + | if (!isActive || (isActive && e.keyCode == 27)) { |
| + | if (e.which == 27) $parent.find(toggle).focus() |
| + | return $this.click() |
| + | } |
| + | |
| + | var $items = $('[role=menu] li:not(.divider):visible a', $parent) |
| + | |
| + | if (!$items.length) return |
| + | |
| + | var index = $items.index($items.filter(':focus')) |
| + | |
| + | if (e.keyCode == 38 && index > 0) index-- // up |
| + | if (e.keyCode == 40 && index < $items.length - 1) index++ // down |
| + | if (!~index) index=0 |
| + | |
| + | $items.eq(index).focus() |
| + | } |
| + | |
| + | function clearMenus() { |
| + | $(backdrop).remove() |
| + | $(toggle).each(function (e) { |
| + | var $parent = getParent($(this)) |
| + | if (!$parent.hasClass('open')) return |
| + | $parent.trigger(e = $.Event('hide.bs.dropdown')) |
| + | if (e.isDefaultPrevented()) return |
| + | $parent.removeClass('open').trigger('hidden.bs.dropdown') |
| + | }) |
| + | } |
| + | |
| + | function getParent($this) { |
| + | var selector = $this.attr('data-target') |
| + | |
| + | if (!selector) { |
| + | selector = $this.attr('href') |
| + | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
| + | } |
| + | |
| + | var $parent = selector && $(selector) |
| + | |
| + | return $parent && $parent.length ? $parent : $this.parent() |
| + | } |
| + | |
| + | |
| + | // DROPDOWN PLUGIN DEFINITION |
| + | // ========================== |
| + | |
| + | var old = $.fn.dropdown |
| + | |
| + | $.fn.dropdown = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('dropdown') |
| + | |
| + | if (!data) $this.data('dropdown', (data = new Dropdown(this))) |
| + | if (typeof option == 'string') data[option].call($this) |
| + | }) |
| + | } |
| + | |
| + | $.fn.dropdown.Constructor = Dropdown |
| + | |
| + | |
| + | // DROPDOWN NO CONFLICT |
| + | // ==================== |
| + | |
| + | $.fn.dropdown.noConflict = function () { |
| + | $.fn.dropdown = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // APPLY TO STANDARD DROPDOWN ELEMENTS |
| + | // =================================== |
| + | |
| + | $(document) |
| + | .on('click.bs.dropdown.data-api', clearMenus) |
| + | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) |
| + | .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle) |
| + | .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: modal.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#modals |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // MODAL CLASS DEFINITION |
| + | // ====================== |
| + | |
| + | var Modal = function (element, options) { |
| + | this.options = options |
| + | this.$element = $(element) |
| + | this.$backdrop = |
| + | this.isShown = null |
| + | |
| + | if (this.options.remote) this.$element.load(this.options.remote) |
| + | } |
| + | |
| + | Modal.DEFAULTS = { |
| + | backdrop: true |
| + | , keyboard: true |
| + | , show: true |
| + | } |
| + | |
| + | Modal.prototype.toggle = function (_relatedTarget) { |
| + | return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) |
| + | } |
| + | |
| + | Modal.prototype.show = function (_relatedTarget) { |
| + | var that = this |
| + | var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) |
| + | |
| + | this.$element.trigger(e) |
| + | |
| + | if (this.isShown || e.isDefaultPrevented()) return |
| + | |
| + | this.isShown = true |
| + | |
| + | this.escape() |
| + | |
| + | this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) |
| + | |
| + | this.backdrop(function () { |
| + | var transition = $.support.transition && that.$element.hasClass('fade') |
| + | |
| + | if (!that.$element.parent().length) { |
| + | that.$element.appendTo(document.body) // don't move modals dom position |
| + | } |
| + | |
| + | that.$element.show() |
| + | |
| + | if (transition) { |
| + | that.$element[0].offsetWidth // force reflow |
| + | } |
| + | |
| + | that.$element |
| + | .addClass('in') |
| + | .attr('aria-hidden', false) |
| + | |
| + | that.enforceFocus() |
| + | |
| + | var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) |
| + | |
| + | transition ? |
| + | that.$element.find('.modal-dialog') // wait for modal to slide in |
| + | .one($.support.transition.end, function () { |
| + | that.$element.focus().trigger(e) |
| + | }) |
| + | .emulateTransitionEnd(300) : |
| + | that.$element.focus().trigger(e) |
| + | }) |
| + | } |
| + | |
| + | Modal.prototype.hide = function (e) { |
| + | if (e) e.preventDefault() |
| + | |
| + | e = $.Event('hide.bs.modal') |
| + | |
| + | this.$element.trigger(e) |
| + | |
| + | if (!this.isShown || e.isDefaultPrevented()) return |
| + | |
| + | this.isShown = false |
| + | |
| + | this.escape() |
| + | |
| + | $(document).off('focusin.bs.modal') |
| + | |
| + | this.$element |
| + | .removeClass('in') |
| + | .attr('aria-hidden', true) |
| + | .off('click.dismiss.modal') |
| + | |
| + | $.support.transition && this.$element.hasClass('fade') ? |
| + | this.$element |
| + | .one($.support.transition.end, $.proxy(this.hideModal, this)) |
| + | .emulateTransitionEnd(300) : |
| + | this.hideModal() |
| + | } |
| + | |
| + | Modal.prototype.enforceFocus = function () { |
| + | $(document) |
| + | .off('focusin.bs.modal') // guard against infinite focus loop |
| + | .on('focusin.bs.modal', $.proxy(function (e) { |
| + | if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { |
| + | this.$element.focus() |
| + | } |
| + | }, this)) |
| + | } |
| + | |
| + | Modal.prototype.escape = function () { |
| + | if (this.isShown && this.options.keyboard) { |
| + | this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { |
| + | e.which == 27 && this.hide() |
| + | }, this)) |
| + | } else if (!this.isShown) { |
| + | this.$element.off('keyup.dismiss.bs.modal') |
| + | } |
| + | } |
| + | |
| + | Modal.prototype.hideModal = function () { |
| + | var that = this |
| + | this.$element.hide() |
| + | this.backdrop(function () { |
| + | that.removeBackdrop() |
| + | that.$element.trigger('hidden.bs.modal') |
| + | }) |
| + | } |
| + | |
| + | Modal.prototype.removeBackdrop = function () { |
| + | this.$backdrop && this.$backdrop.remove() |
| + | this.$backdrop = null |
| + | } |
| + | |
| + | Modal.prototype.backdrop = function (callback) { |
| + | var that = this |
| + | var animate = this.$element.hasClass('fade') ? 'fade' : '' |
| + | |
| + | if (this.isShown && this.options.backdrop) { |
| + | var doAnimate = $.support.transition && animate |
| + | |
| + | this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') |
| + | .appendTo(document.body) |
| + | |
| + | this.$element.on('click.dismiss.modal', $.proxy(function (e) { |
| + | if (e.target !== e.currentTarget) return |
| + | this.options.backdrop == 'static' |
| + | ? this.$element[0].focus.call(this.$element[0]) |
| + | : this.hide.call(this) |
| + | }, this)) |
| + | |
| + | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow |
| + | |
| + | this.$backdrop.addClass('in') |
| + | |
| + | if (!callback) return |
| + | |
| + | doAnimate ? |
| + | this.$backdrop |
| + | .one($.support.transition.end, callback) |
| + | .emulateTransitionEnd(150) : |
| + | callback() |
| + | |
| + | } else if (!this.isShown && this.$backdrop) { |
| + | this.$backdrop.removeClass('in') |
| + | |
| + | $.support.transition && this.$element.hasClass('fade')? |
| + | this.$backdrop |
| + | .one($.support.transition.end, callback) |
| + | .emulateTransitionEnd(150) : |
| + | callback() |
| + | |
| + | } else if (callback) { |
| + | callback() |
| + | } |
| + | } |
| + | |
| + | |
| + | // MODAL PLUGIN DEFINITION |
| + | // ======================= |
| + | |
| + | var old = $.fn.modal |
| + | |
| + | $.fn.modal = function (option, _relatedTarget) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.modal') |
| + | var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) |
| + | |
| + | if (!data) $this.data('bs.modal', (data = new Modal(this, options))) |
| + | if (typeof option == 'string') data[option](_relatedTarget) |
| + | else if (options.show) data.show(_relatedTarget) |
| + | }) |
| + | } |
| + | |
| + | $.fn.modal.Constructor = Modal |
| + | |
| + | |
| + | // MODAL NO CONFLICT |
| + | // ================= |
| + | |
| + | $.fn.modal.noConflict = function () { |
| + | $.fn.modal = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // MODAL DATA-API |
| + | // ============== |
| + | |
| + | $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { |
| + | var $this = $(this) |
| + | var href = $this.attr('href') |
| + | var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 |
| + | var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) |
| + | |
| + | e.preventDefault() |
| + | |
| + | $target |
| + | .modal(option, this) |
| + | .one('hide', function () { |
| + | $this.is(':visible') && $this.focus() |
| + | }) |
| + | }) |
| + | |
| + | $(document) |
| + | .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) |
| + | .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: tooltip.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#tooltip |
| + | * Inspired by the original jQuery.tipsy by Jason Frame |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // TOOLTIP PUBLIC CLASS DEFINITION |
| + | // =============================== |
| + | |
| + | var Tooltip = function (element, options) { |
| + | this.type = |
| + | this.options = |
| + | this.enabled = |
| + | this.timeout = |
| + | this.hoverState = |
| + | this.$element = null |
| + | |
| + | this.init('tooltip', element, options) |
| + | } |
| + | |
| + | Tooltip.DEFAULTS = { |
| + | animation: true |
| + | , placement: 'top' |
| + | , selector: false |
| + | , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
| + | , trigger: 'hover focus' |
| + | , title: '' |
| + | , delay: 0 |
| + | , html: false |
| + | , container: false |
| + | } |
| + | |
| + | Tooltip.prototype.init = function (type, element, options) { |
| + | this.enabled = true |
| + | this.type = type |
| + | this.$element = $(element) |
| + | this.options = this.getOptions(options) |
| + | |
| + | var triggers = this.options.trigger.split(' ') |
| + | |
| + | for (var i = triggers.length; i--;) { |
| + | var trigger = triggers[i] |
| + | |
| + | if (trigger == 'click') { |
| + | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) |
| + | } else if (trigger != 'manual') { |
| + | var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' |
| + | var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' |
| + | |
| + | this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) |
| + | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) |
| + | } |
| + | } |
| + | |
| + | this.options.selector ? |
| + | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : |
| + | this.fixTitle() |
| + | } |
| + | |
| + | Tooltip.prototype.getDefaults = function () { |
| + | return Tooltip.DEFAULTS |
| + | } |
| + | |
| + | Tooltip.prototype.getOptions = function (options) { |
| + | options = $.extend({}, this.getDefaults(), this.$element.data(), options) |
| + | |
| + | if (options.delay && typeof options.delay == 'number') { |
| + | options.delay = { |
| + | show: options.delay |
| + | , hide: options.delay |
| + | } |
| + | } |
| + | |
| + | return options |
| + | } |
| + | |
| + | Tooltip.prototype.getDelegateOptions = function () { |
| + | var options = {} |
| + | var defaults = this.getDefaults() |
| + | |
| + | this._options && $.each(this._options, function (key, value) { |
| + | if (defaults[key] != value) options[key] = value |
| + | }) |
| + | |
| + | return options |
| + | } |
| + | |
| + | Tooltip.prototype.enter = function (obj) { |
| + | var self = obj instanceof this.constructor ? |
| + | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) |
| + | |
| + | clearTimeout(self.timeout) |
| + | |
| + | self.hoverState = 'in' |
| + | |
| + | if (!self.options.delay || !self.options.delay.show) return self.show() |
| + | |
| + | self.timeout = setTimeout(function () { |
| + | if (self.hoverState == 'in') self.show() |
| + | }, self.options.delay.show) |
| + | } |
| + | |
| + | Tooltip.prototype.leave = function (obj) { |
| + | var self = obj instanceof this.constructor ? |
| + | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) |
| + | |
| + | clearTimeout(self.timeout) |
| + | |
| + | self.hoverState = 'out' |
| + | |
| + | if (!self.options.delay || !self.options.delay.hide) return self.hide() |
| + | |
| + | self.timeout = setTimeout(function () { |
| + | if (self.hoverState == 'out') self.hide() |
| + | }, self.options.delay.hide) |
| + | } |
| + | |
| + | Tooltip.prototype.show = function () { |
| + | var e = $.Event('show.bs.'+ this.type) |
| + | |
| + | if (this.hasContent() && this.enabled) { |
| + | this.$element.trigger(e) |
| + | |
| + | if (e.isDefaultPrevented()) return |
| + | |
| + | var $tip = this.tip() |
| + | |
| + | this.setContent() |
| + | |
| + | if (this.options.animation) $tip.addClass('fade') |
| + | |
| + | var placement = typeof this.options.placement == 'function' ? |
| + | this.options.placement.call(this, $tip[0], this.$element[0]) : |
| + | this.options.placement |
| + | |
| + | var autoToken = /\s?auto?\s?/i |
| + | var autoPlace = autoToken.test(placement) |
| + | if (autoPlace) placement = placement.replace(autoToken, '') || 'top' |
| + | |
| + | $tip |
| + | .detach() |
| + | .css({ top: 0, left: 0, display: 'block' }) |
| + | .addClass(placement) |
| + | |
| + | this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) |
| + | |
| + | var pos = this.getPosition() |
| + | var actualWidth = $tip[0].offsetWidth |
| + | var actualHeight = $tip[0].offsetHeight |
| + | |
| + | if (autoPlace) { |
| + | var $parent = this.$element.parent() |
| + | |
| + | var orgPlacement = placement |
| + | var docScroll = document.documentElement.scrollTop || document.body.scrollTop |
| + | var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() |
| + | var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() |
| + | var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left |
| + | |
| + | placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : |
| + | placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : |
| + | placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : |
| + | placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : |
| + | placement |
| + | |
| + | $tip |
| + | .removeClass(orgPlacement) |
| + | .addClass(placement) |
| + | } |
| + | |
| + | var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) |
| + | |
| + | this.applyPlacement(calculatedOffset, placement) |
| + | this.$element.trigger('shown.bs.' + this.type) |
| + | } |
| + | } |
| + | |
| + | Tooltip.prototype.applyPlacement = function(offset, placement) { |
| + | var replace |
| + | var $tip = this.tip() |
| + | var width = $tip[0].offsetWidth |
| + | var height = $tip[0].offsetHeight |
| + | |
| + | // manually read margins because getBoundingClientRect includes difference |
| + | var marginTop = parseInt($tip.css('margin-top'), 10) |
| + | var marginLeft = parseInt($tip.css('margin-left'), 10) |
| + | |
| + | // we must check for NaN for ie 8/9 |
| + | if (isNaN(marginTop)) marginTop = 0 |
| + | if (isNaN(marginLeft)) marginLeft = 0 |
| + | |
| + | offset.top = offset.top + marginTop |
| + | offset.left = offset.left + marginLeft |
| + | |
| + | $tip |
| + | .offset(offset) |
| + | .addClass('in') |
| + | |
| + | // check to see if placing tip in new offset caused the tip to resize itself |
| + | var actualWidth = $tip[0].offsetWidth |
| + | var actualHeight = $tip[0].offsetHeight |
| + | |
| + | if (placement == 'top' && actualHeight != height) { |
| + | replace = true |
| + | offset.top = offset.top + height - actualHeight |
| + | } |
| + | |
| + | if (/bottom|top/.test(placement)) { |
| + | var delta = 0 |
| + | |
| + | if (offset.left < 0) { |
| + | delta = offset.left * -2 |
| + | offset.left = 0 |
| + | |
| + | $tip.offset(offset) |
| + | |
| + | actualWidth = $tip[0].offsetWidth |
| + | actualHeight = $tip[0].offsetHeight |
| + | } |
| + | |
| + | this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') |
| + | } else { |
| + | this.replaceArrow(actualHeight - height, actualHeight, 'top') |
| + | } |
| + | |
| + | if (replace) $tip.offset(offset) |
| + | } |
| + | |
| + | Tooltip.prototype.replaceArrow = function(delta, dimension, position) { |
| + | this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') |
| + | } |
| + | |
| + | Tooltip.prototype.setContent = function () { |
| + | var $tip = this.tip() |
| + | var title = this.getTitle() |
| + | |
| + | $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) |
| + | $tip.removeClass('fade in top bottom left right') |
| + | } |
| + | |
| + | Tooltip.prototype.hide = function () { |
| + | var that = this |
| + | var $tip = this.tip() |
| + | var e = $.Event('hide.bs.' + this.type) |
| + | |
| + | function complete() { |
| + | if (that.hoverState != 'in') $tip.detach() |
| + | } |
| + | |
| + | this.$element.trigger(e) |
| + | |
| + | if (e.isDefaultPrevented()) return |
| + | |
| + | $tip.removeClass('in') |
| + | |
| + | $.support.transition && this.$tip.hasClass('fade') ? |
| + | $tip |
| + | .one($.support.transition.end, complete) |
| + | .emulateTransitionEnd(150) : |
| + | complete() |
| + | |
| + | this.$element.trigger('hidden.bs.' + this.type) |
| + | |
| + | return this |
| + | } |
| + | |
| + | Tooltip.prototype.fixTitle = function () { |
| + | var $e = this.$element |
| + | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { |
| + | $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') |
| + | } |
| + | } |
| + | |
| + | Tooltip.prototype.hasContent = function () { |
| + | return this.getTitle() |
| + | } |
| + | |
| + | Tooltip.prototype.getPosition = function () { |
| + | var el = this.$element[0] |
| + | return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { |
| + | width: el.offsetWidth |
| + | , height: el.offsetHeight |
| + | }, this.$element.offset()) |
| + | } |
| + | |
| + | Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { |
| + | return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
| + | placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
| + | placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : |
| + | /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } |
| + | } |
| + | |
| + | Tooltip.prototype.getTitle = function () { |
| + | var title |
| + | var $e = this.$element |
| + | var o = this.options |
| + | |
| + | title = $e.attr('data-original-title') |
| + | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) |
| + | |
| + | return title |
| + | } |
| + | |
| + | Tooltip.prototype.tip = function () { |
| + | return this.$tip = this.$tip || $(this.options.template) |
| + | } |
| + | |
| + | Tooltip.prototype.arrow = function () { |
| + | return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') |
| + | } |
| + | |
| + | Tooltip.prototype.validate = function () { |
| + | if (!this.$element[0].parentNode) { |
| + | this.hide() |
| + | this.$element = null |
| + | this.options = null |
| + | } |
| + | } |
| + | |
| + | Tooltip.prototype.enable = function () { |
| + | this.enabled = true |
| + | } |
| + | |
| + | Tooltip.prototype.disable = function () { |
| + | this.enabled = false |
| + | } |
| + | |
| + | Tooltip.prototype.toggleEnabled = function () { |
| + | this.enabled = !this.enabled |
| + | } |
| + | |
| + | Tooltip.prototype.toggle = function (e) { |
| + | var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this |
| + | self.tip().hasClass('in') ? self.leave(self) : self.enter(self) |
| + | } |
| + | |
| + | Tooltip.prototype.destroy = function () { |
| + | this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) |
| + | } |
| + | |
| + | |
| + | // TOOLTIP PLUGIN DEFINITION |
| + | // ========================= |
| + | |
| + | var old = $.fn.tooltip |
| + | |
| + | $.fn.tooltip = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.tooltip') |
| + | var options = typeof option == 'object' && option |
| + | |
| + | if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.tooltip.Constructor = Tooltip |
| + | |
| + | |
| + | // TOOLTIP NO CONFLICT |
| + | // =================== |
| + | |
| + | $.fn.tooltip.noConflict = function () { |
| + | $.fn.tooltip = old |
| + | return this |
| + | } |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: popover.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#popovers |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // POPOVER PUBLIC CLASS DEFINITION |
| + | // =============================== |
| + | |
| + | var Popover = function (element, options) { |
| + | this.init('popover', element, options) |
| + | } |
| + | |
| + | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') |
| + | |
| + | Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { |
| + | placement: 'right' |
| + | , trigger: 'click' |
| + | , content: '' |
| + | , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' |
| + | }) |
| + | |
| + | |
| + | // NOTE: POPOVER EXTENDS tooltip.js |
| + | // ================================ |
| + | |
| + | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) |
| + | |
| + | Popover.prototype.constructor = Popover |
| + | |
| + | Popover.prototype.getDefaults = function () { |
| + | return Popover.DEFAULTS |
| + | } |
| + | |
| + | Popover.prototype.setContent = function () { |
| + | var $tip = this.tip() |
| + | var title = this.getTitle() |
| + | var content = this.getContent() |
| + | |
| + | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) |
| + | $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) |
| + | |
| + | $tip.removeClass('fade top bottom left right in') |
| + | |
| + | // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do |
| + | // this manually by checking the contents. |
| + | if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() |
| + | } |
| + | |
| + | Popover.prototype.hasContent = function () { |
| + | return this.getTitle() || this.getContent() |
| + | } |
| + | |
| + | Popover.prototype.getContent = function () { |
| + | var $e = this.$element |
| + | var o = this.options |
| + | |
| + | return $e.attr('data-content') |
| + | || (typeof o.content == 'function' ? |
| + | o.content.call($e[0]) : |
| + | o.content) |
| + | } |
| + | |
| + | Popover.prototype.arrow = function () { |
| + | return this.$arrow = this.$arrow || this.tip().find('.arrow') |
| + | } |
| + | |
| + | Popover.prototype.tip = function () { |
| + | if (!this.$tip) this.$tip = $(this.options.template) |
| + | return this.$tip |
| + | } |
| + | |
| + | |
| + | // POPOVER PLUGIN DEFINITION |
| + | // ========================= |
| + | |
| + | var old = $.fn.popover |
| + | |
| + | $.fn.popover = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.popover') |
| + | var options = typeof option == 'object' && option |
| + | |
| + | if (!data) $this.data('bs.popover', (data = new Popover(this, options))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.popover.Constructor = Popover |
| + | |
| + | |
| + | // POPOVER NO CONFLICT |
| + | // =================== |
| + | |
| + | $.fn.popover.noConflict = function () { |
| + | $.fn.popover = old |
| + | return this |
| + | } |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: scrollspy.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#scrollspy |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // SCROLLSPY CLASS DEFINITION |
| + | // ========================== |
| + | |
| + | function ScrollSpy(element, options) { |
| + | var href |
| + | var process = $.proxy(this.process, this) |
| + | |
| + | this.$element = $(element).is('body') ? $(window) : $(element) |
| + | this.$body = $('body') |
| + | this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) |
| + | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) |
| + | this.selector = (this.options.target |
| + | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
| + | || '') + ' .nav li > a' |
| + | this.offsets = $([]) |
| + | this.targets = $([]) |
| + | this.activeTarget = null |
| + | |
| + | this.refresh() |
| + | this.process() |
| + | } |
| + | |
| + | ScrollSpy.DEFAULTS = { |
| + | offset: 10 |
| + | } |
| + | |
| + | ScrollSpy.prototype.refresh = function () { |
| + | var offsetMethod = this.$element[0] == window ? 'offset' : 'position' |
| + | |
| + | this.offsets = $([]) |
| + | this.targets = $([]) |
| + | |
| + | var self = this |
| + | var $targets = this.$body |
| + | .find(this.selector) |
| + | .map(function () { |
| + | var $el = $(this) |
| + | var href = $el.data('target') || $el.attr('href') |
| + | var $href = /^#\w/.test(href) && $(href) |
| + | |
| + | return ($href |
| + | && $href.length |
| + | && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null |
| + | }) |
| + | .sort(function (a, b) { return a[0] - b[0] }) |
| + | .each(function () { |
| + | self.offsets.push(this[0]) |
| + | self.targets.push(this[1]) |
| + | }) |
| + | } |
| + | |
| + | ScrollSpy.prototype.process = function () { |
| + | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset |
| + | var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight |
| + | var maxScroll = scrollHeight - this.$scrollElement.height() |
| + | var offsets = this.offsets |
| + | var targets = this.targets |
| + | var activeTarget = this.activeTarget |
| + | var i |
| + | |
| + | if (scrollTop >= maxScroll) { |
| + | return activeTarget != (i = targets.last()[0]) && this.activate(i) |
| + | } |
| + | |
| + | for (i = offsets.length; i--;) { |
| + | activeTarget != targets[i] |
| + | && scrollTop >= offsets[i] |
| + | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) |
| + | && this.activate( targets[i] ) |
| + | } |
| + | } |
| + | |
| + | ScrollSpy.prototype.activate = function (target) { |
| + | this.activeTarget = target |
| + | |
| + | $(this.selector) |
| + | .parents('.active') |
| + | .removeClass('active') |
| + | |
| + | var selector = this.selector |
| + | + '[data-target="' + target + '"],' |
| + | + this.selector + '[href="' + target + '"]' |
| + | |
| + | var active = $(selector) |
| + | .parents('li') |
| + | .addClass('active') |
| + | |
| + | if (active.parent('.dropdown-menu').length) { |
| + | active = active |
| + | .closest('li.dropdown') |
| + | .addClass('active') |
| + | } |
| + | |
| + | active.trigger('activate') |
| + | } |
| + | |
| + | |
| + | // SCROLLSPY PLUGIN DEFINITION |
| + | // =========================== |
| + | |
| + | var old = $.fn.scrollspy |
| + | |
| + | $.fn.scrollspy = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.scrollspy') |
| + | var options = typeof option == 'object' && option |
| + | |
| + | if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.scrollspy.Constructor = ScrollSpy |
| + | |
| + | |
| + | // SCROLLSPY NO CONFLICT |
| + | // ===================== |
| + | |
| + | $.fn.scrollspy.noConflict = function () { |
| + | $.fn.scrollspy = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // SCROLLSPY DATA-API |
| + | // ================== |
| + | |
| + | $(window).on('load', function () { |
| + | $('[data-spy="scroll"]').each(function () { |
| + | var $spy = $(this) |
| + | $spy.scrollspy($spy.data()) |
| + | }) |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: tab.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#tabs |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // TAB CLASS DEFINITION |
| + | // ==================== |
| + | |
| + | var Tab = function (element) { |
| + | this.element = $(element) |
| + | } |
| + | |
| + | Tab.prototype.show = function () { |
| + | var $this = this.element |
| + | var $ul = $this.closest('ul:not(.dropdown-menu)') |
| + | var selector = $this.attr('data-target') |
| + | |
| + | if (!selector) { |
| + | selector = $this.attr('href') |
| + | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
| + | } |
| + | |
| + | if ($this.parent('li').hasClass('active')) return |
| + | |
| + | var previous = $ul.find('.active:last a')[0] |
| + | var e = $.Event('show.bs.tab', { |
| + | relatedTarget: previous |
| + | }) |
| + | |
| + | $this.trigger(e) |
| + | |
| + | if (e.isDefaultPrevented()) return |
| + | |
| + | var $target = $(selector) |
| + | |
| + | this.activate($this.parent('li'), $ul) |
| + | this.activate($target, $target.parent(), function () { |
| + | $this.trigger({ |
| + | type: 'shown.bs.tab' |
| + | , relatedTarget: previous |
| + | }) |
| + | }) |
| + | } |
| + | |
| + | Tab.prototype.activate = function (element, container, callback) { |
| + | var $active = container.find('> .active') |
| + | var transition = callback |
| + | && $.support.transition |
| + | && $active.hasClass('fade') |
| + | |
| + | function next() { |
| + | $active |
| + | .removeClass('active') |
| + | .find('> .dropdown-menu > .active') |
| + | .removeClass('active') |
| + | |
| + | element.addClass('active') |
| + | |
| + | if (transition) { |
| + | element[0].offsetWidth // reflow for transition |
| + | element.addClass('in') |
| + | } else { |
| + | element.removeClass('fade') |
| + | } |
| + | |
| + | if (element.parent('.dropdown-menu')) { |
| + | element.closest('li.dropdown').addClass('active') |
| + | } |
| + | |
| + | callback && callback() |
| + | } |
| + | |
| + | transition ? |
| + | $active |
| + | .one($.support.transition.end, next) |
| + | .emulateTransitionEnd(150) : |
| + | next() |
| + | |
| + | $active.removeClass('in') |
| + | } |
| + | |
| + | |
| + | // TAB PLUGIN DEFINITION |
| + | // ===================== |
| + | |
| + | var old = $.fn.tab |
| + | |
| + | $.fn.tab = function ( option ) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.tab') |
| + | |
| + | if (!data) $this.data('bs.tab', (data = new Tab(this))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.tab.Constructor = Tab |
| + | |
| + | |
| + | // TAB NO CONFLICT |
| + | // =============== |
| + | |
| + | $.fn.tab.noConflict = function () { |
| + | $.fn.tab = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // TAB DATA-API |
| + | // ============ |
| + | |
| + | $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { |
| + | e.preventDefault() |
| + | $(this).tab('show') |
| + | }) |
| + | |
| + | }(window.jQuery); |
| + | |
| + | /* ======================================================================== |
| + | * Bootstrap: affix.js v3.0.0 |
| + | * http://twbs.github.com/bootstrap/javascript.html#affix |
| + | * ======================================================================== |
| + | * Copyright 2012 Twitter, Inc. |
| + | * |
| + | * Licensed under the Apache License, Version 2.0 (the "License"); |
| + | * you may not use this file except in compliance with the License. |
| + | * You may obtain a copy of the License at |
| + | * |
| + | * http://www.apache.org/licenses/LICENSE-2.0 |
| + | * |
| + | * Unless required by applicable law or agreed to in writing, software |
| + | * distributed under the License is distributed on an "AS IS" BASIS, |
| + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + | * See the License for the specific language governing permissions and |
| + | * limitations under the License. |
| + | * ======================================================================== */ |
| + | |
| + | |
| + | +function ($) { "use strict"; |
| + | |
| + | // AFFIX CLASS DEFINITION |
| + | // ====================== |
| + | |
| + | var Affix = function (element, options) { |
| + | this.options = $.extend({}, Affix.DEFAULTS, options) |
| + | this.$window = $(window) |
| + | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) |
| + | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) |
| + | |
| + | this.$element = $(element) |
| + | this.affixed = |
| + | this.unpin = null |
| + | |
| + | this.checkPosition() |
| + | } |
| + | |
| + | Affix.RESET = 'affix affix-top affix-bottom' |
| + | |
| + | Affix.DEFAULTS = { |
| + | offset: 0 |
| + | } |
| + | |
| + | Affix.prototype.checkPositionWithEventLoop = function () { |
| + | setTimeout($.proxy(this.checkPosition, this), 1) |
| + | } |
| + | |
| + | Affix.prototype.checkPosition = function () { |
| + | if (!this.$element.is(':visible')) return |
| + | |
| + | var scrollHeight = $(document).height() |
| + | var scrollTop = this.$window.scrollTop() |
| + | var position = this.$element.offset() |
| + | var offset = this.options.offset |
| + | var offsetTop = offset.top |
| + | var offsetBottom = offset.bottom |
| + | |
| + | if (typeof offset != 'object') offsetBottom = offsetTop = offset |
| + | if (typeof offsetTop == 'function') offsetTop = offset.top() |
| + | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() |
| + | |
| + | var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : |
| + | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : |
| + | offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false |
| + | |
| + | if (this.affixed === affix) return |
| + | if (this.unpin) this.$element.css('top', '') |
| + | |
| + | this.affixed = affix |
| + | this.unpin = affix == 'bottom' ? position.top - scrollTop : null |
| + | |
| + | this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : '')) |
| + | |
| + | if (affix == 'bottom') { |
| + | this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() }) |
| + | } |
| + | } |
| + | |
| + | |
| + | // AFFIX PLUGIN DEFINITION |
| + | // ======================= |
| + | |
| + | var old = $.fn.affix |
| + | |
| + | $.fn.affix = function (option) { |
| + | return this.each(function () { |
| + | var $this = $(this) |
| + | var data = $this.data('bs.affix') |
| + | var options = typeof option == 'object' && option |
| + | |
| + | if (!data) $this.data('bs.affix', (data = new Affix(this, options))) |
| + | if (typeof option == 'string') data[option]() |
| + | }) |
| + | } |
| + | |
| + | $.fn.affix.Constructor = Affix |
| + | |
| + | |
| + | // AFFIX NO CONFLICT |
| + | // ================= |
| + | |
| + | $.fn.affix.noConflict = function () { |
| + | $.fn.affix = old |
| + | return this |
| + | } |
| + | |
| + | |
| + | // AFFIX DATA-API |
| + | // ============== |
| + | |
| + | $(window).on('load', function () { |
| + | $('[data-spy="affix"]').each(function () { |
| + | var $spy = $(this) |
| + | var data = $spy.data() |
| + | |
| + | data.offset = data.offset || {} |
| + | |
| + | if (data.offsetBottom) data.offset.bottom = data.offsetBottom |
| + | if (data.offsetTop) data.offset.top = data.offsetTop |
| + | |
| + | $spy.affix(data) |
| + | }) |
| + | }) |
| + | |
| + | }(window.jQuery);jQuery(document).ready(function($) { |
| + | |
| + | 'use strict'; |
| + | |
| + | $('.imageGallery1 a').simpleLightbox(); |
| + | |
| + | |
| + | var owl = $("#owl-portfolio"); |
| + | |
| + | owl.owlCarousel({ |
| + | |
| + | pagination : true, |
| + | paginationNumbers: false, |
| + | autoPlay: 6000, //Set AutoPlay to 3 seconds |
| + | items : 4, //10 items above 1000px browser width |
| + | itemsDesktop : [1000,4], //5 items between 1000px and 901px |
| + | itemsDesktopSmall : [900,3], // betweem 900px and 601px |
| + | itemsTablet: [600,2], //2 items between 600 and 0 |
| + | itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option |
| + | |
| + | }); |
| + | |
| + | |
| + | $('.tabgroup > div').hide(); |
| + | $('.tabgroup > div:first-of-type').show(); |
| + | $('.tabs a').click(function(e){ |
| + | e.preventDefault(); |
| + | var $this = $(this), |
| + | tabgroup = '#'+$this.parents('.tabs').data('tabgroup'), |
| + | others = $this.closest('li').siblings().children('a'), |
| + | target = $this.attr('href'); |
| + | others.removeClass('active'); |
| + | $this.addClass('active'); |
| + | $(tabgroup).children('div').hide(); |
| + | $(target).show(); |
| + | |
| + | }) |
| + | |
| + | |
| + | /************** Toggle *********************/ |
| + | // Cache selectors |
| + | var lastId, |
| + | topMenu = $(".menu-first"), |
| + | topMenuHeight = 80, |
| + | // All list items |
| + | menuItems = topMenu.find("a"), |
| + | // Anchors corresponding to menu items |
| + | scrollItems = menuItems.map(function(){ |
| + | |
| + | if($(this).hasClass('external')) { |
| + | return; |
| + | } |
| + | |
| + | var item = $($(this).attr("href")); |
| + | if (item.length) { return item; } |
| + | }); |
| + | |
| + | // Bind click handler to menu items |
| + | // so we can get a fancy scroll animation |
| + | menuItems.click(function(e){ |
| + | var href = $(this).attr("href"), |
| + | offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+1; |
| + | $('html, body').stop().animate({ |
| + | scrollTop: offsetTop |
| + | }, 750); |
| + | e.preventDefault(); |
| + | }); |
| + | |
| + | // Bind to scroll |
| + | $(window).scroll(function(){ |
| + | // Get container scroll position |
| + | var fromTop = $(this).scrollTop()+topMenuHeight; |
| | | |
− | <script src="js/vendor/jquery.gmap3.min.js"></script>
| + | // Get id of current scroll item |
| + | var cur = scrollItems.map(function(){ |
| + | if ($(this).offset().top < fromTop) |
| + | return this; |
| + | }); |
| + | // Get the id of the current element |
| + | cur = cur[cur.length-1]; |
| + | var id = cur && cur.length ? cur[0].id : ""; |
| + | |
| + | if (lastId !== id) { |
| + | lastId = id; |
| + | // Set/remove active class |
| + | menuItems |
| + | .parent().removeClass("active") |
| + | .end().filter("[href=#"+id+"]").parent().addClass("active"); |
| + | } |
| + | }); |
| | | |
− | <script type="text/javascript"> | + | |
| + | |
| + | $(window).scroll(function(){ |
| + | $('.main-header').toggleClass('scrolled', $(this).scrollTop() > 1); |
| + | }); |
| + | |
| + | |
| + | |
| + | $('a[href="#top"]').click(function(){ |
| + | $('html, body').animate({scrollTop: 0}, 'slow'); |
| + | return false; |
| + | }); |
| + | |
| + | |
| + | $('.toggle-menu').click(function(){ |
| + | $('.menu-first').toggleClass('show'); |
| + | // $('.menu-first').slideToggle(); |
| + | }); |
| + | |
| + | $('.menu-first li a').click(function(){ |
| + | $('.menu-first').removeClass('show'); |
| + | }); |
| + | |
| + | |
| + | $('a[href*=#]').on('click', function(e) { |
| + | e.preventDefault(); |
| + | $('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top -79 }, 500, 'linear'); |
| + | }); |
| + | |
| + | |
| + | |
| + | |
| + | }); |
| + | jQuery(document).ready(function(e){"use strict";function o(){e(".sf-menu").superfish({delay:50,autoArrows:!0,animation:{opacity:"show"}})}e(".toggle-id").on("click",function(){var o=e(this).attr("href");return e(o).slideToggle(250),!1}),e("a.toggle-menu").click(function(){return e("#responsive-menu").stop(!0,!0).slideToggle(),!1}),o(),e(".sub-menu").addClass("animated fadeInRight"),e("#search-icon").on("click",function(){return e("#search-overlay").removeClass("animated bounceOutUp"),e("#search-overlay").fadeIn(0).addClass("animated bounceInDown"),e('.search-form-holder input[type="search"]').focus(),!1}),e(".close-search").on("click",function(){return e("#search-overlay").removeClass("animated bounceInDown"),e("#search-overlay").addClass("animated bounceOutUp"),!1}),jQuery(document).keyup(function(o){return 27===o.keyCode?(e("#search-overlay").removeClass("animated bounceInDown"),e("#search-overlay").addClass("animated bounceOutUp"),!1):void 0}),e(window).resize(function(){var o=e(window).height(),a=e(window).width();e(".swiper-container, .swiper-slide").height(o),e(".swiper-container, .swiper-slide").width(a)}),e(window).resize(),e(".arrow-left, .arrow-right").on("click",function(){e(".slider-caption h2").removeClass("animated fadeInDown"),e(".slider-caption h2").fadeIn(0).addClass("animated fadeInDown"),e(".slider-caption p").removeClass("animated fadeInUp"),e(".slider-caption p").fadeIn(0).addClass("animated fadeInUp")});var a=new Swiper(".swiper-container",{mode:"horizontal",loop:!0,keyboardControl:!0});e(".arrow-left").on("click",function(e){e.preventDefault(),a.swipePrev()}),e(".arrow-right").on("click",function(e){e.preventDefault(),a.swipeNext()}),e(".project-slider").slidesjs({pagination:!1,navigation:{active:!1,effect:"fade"}}),e(".staff-member").hover(function(){e(".overlay .social-network").addClass("animated fadeIn")},function(){e(".overlay .social-network").removeClass("animated fadeIn")}),e(".blog-thumb, .project-item").hover(function(){e(".overlay-b a").addClass("animated fadeIn")},function(){e(".overlay-b a").removeClass("animated fadeIn")}),e(".projects-holder").mixitup({effects:["fade","grayscale"],easing:"snap",transitionSpeed:400}),e(".fancybox").fancybox(),e("#contactform").submit(function(){var o=e(this).attr("action");return e("#message").slideUp(750,function(){e("#message").hide(),e("#submit").attr("disabled","disabled"),e.post(o,{name:e("#name").val(),email:e("#email").val(),phone:e("#phone").val(),comments:e("#comments").val()},function(o){document.getElementById("message").innerHTML=o,e("#message").slideDown("slow"),e("#submit").removeAttr("disabled"),null!=o.match("success")&&e("#contactform").slideUp("slow")})}),!1})}),$(window).load(function(){blogisotope=function(){var e,o=$(".blog-masonry").width(),a=Math.floor(o);return $(".blog-masonry").hasClass("masonry-true")===!0&&(a=Math.floor(.3033*o),e=Math.floor(.04*o),a=$(window).width()<1023?$(window).width()<768?Math.floor(1*o):Math.floor(.48*o):Math.floor(.3033*o)),e};var e=$(".blog-masonry");bloggingisotope=function(){e.isotope({itemSelector:".post-masonry",animationEngine:"jquery",masonry:{gutterWidth:blogisotope()}})},bloggingisotope(),$(window).smartresize(bloggingisotope)});(function(factory) { |
| + | |
| + | if (typeof define === 'function' && define.amd) { |
| + | define(['jquery'], factory); |
| + | } else if (typeof module === 'object' && module.exports) { |
| + | module.exports = factory(require('jquery')); |
| + | } else { |
| + | factory(jQuery); |
| + | } |
| + | |
| + | }(function($) { |
| + | |
| + | var instanceNum = 0, |
| + | $html = $('html'), |
| + | $document = $(document), |
| + | $window = $(window); |
| + | |
| + | function SimpleLightbox(options) { |
| + | |
| + | this.init.apply(this, arguments); |
| + | |
| + | } |
| + | |
| + | SimpleLightbox.defaults = { |
| + | |
| + | // add custom classes to lightbox elements |
| + | elementClass: '', |
| + | elementLoadingClass: 'slbLoading', |
| + | htmlClass: 'slbActive', |
| + | closeBtnClass: '', |
| + | nextBtnClass: '', |
| + | prevBtnClass: '', |
| + | loadingTextClass: '', |
| + | |
| + | // customize / localize controls captions |
| + | closeBtnCaption: 'Close', |
| + | nextBtnCaption: 'Next', |
| + | prevBtnCaption: 'Previous', |
| + | loadingCaption: 'Loading...', |
| + | |
| + | bindToItems: true, // set click event handler to trigger lightbox on provided $items |
| + | closeOnOverlayClick: true, |
| + | closeOnEscapeKey: true, |
| + | nextOnImageClick: true, |
| + | showCaptions: true, |
| + | |
| + | captionAttribute: 'title', // choose data source for library to glean image caption from |
| + | urlAttribute: 'href', // where to expect large image |
| + | |
| + | startAt: 0, // start gallery at custom index |
| + | loadingTimeout: 100, // time after loading element will appear |
| + | |
| + | appendTarget: 'body', // append elsewhere if needed |
| + | |
| + | beforeSetContent: null, // convenient hooks for extending library behavoiur |
| + | beforeClose: null, |
| + | beforeDestroy: null, |
| + | |
| + | videoRegex: new RegExp(/youtube.com|vimeo.com/) // regex which tests load url for iframe content |
| + | |
| + | }; |
| + | |
| + | $.extend(SimpleLightbox.prototype, { |
| + | |
| + | init: function(options) { |
| + | |
| + | this.options = $.extend({}, SimpleLightbox.defaults, options); |
| + | this.ens = '.slb' + (++instanceNum); |
| + | this.items = []; |
| + | this.captions = []; |
| + | |
| + | var self = this; |
| + | |
| + | if (this.options.$items) { |
| + | |
| + | this.$items = this.options.$items; |
| + | |
| + | this.$items.each(function() { |
| + | |
| + | var $item = $(this); |
| + | |
| + | self.items.push($item.attr(self.options.urlAttribute)); |
| + | self.captions.push($item.attr(self.options.captionAttribute)); |
| + | |
| + | }); |
| + | |
| + | this.options.bindToItems && this.$items.on('click' + this.ens, function(e) { |
| + | |
| + | e.preventDefault(); |
| + | self.showPosition(self.$items.index($(e.currentTarget))); |
| + | |
| + | }); |
| + | |
| + | } else if (this.options.items) { |
| + | |
| + | this.items = this.options.items; |
| + | |
| + | } |
| + | |
| + | if (this.options.captions) { |
| + | this.captions = this.options.captions; |
| + | } |
| + | |
| + | }, |
| + | |
| + | next: function() { |
| + | |
| + | return this.showPosition(this.currentPosition + 1); |
| + | |
| + | }, |
| + | |
| + | prev: function() { |
| + | |
| + | return this.showPosition(this.currentPosition - 1); |
| + | |
| + | }, |
| + | |
| + | normalizePosition: function(position) { |
| + | |
| + | if (position >= this.items.length) { |
| + | position = 0; |
| + | } else if (position < 0) { |
| + | position = this.items.length - 1; |
| + | } |
| + | |
| + | return position; |
| + | |
| + | }, |
| + | |
| + | showPosition: function(position) { |
| + | |
| + | var self = this; |
| + | |
| + | this.currentPosition = this.normalizePosition(position); |
| + | |
| + | return this.setupLightboxHtml().prepareItem(this.currentPosition, this.setContent).show(); |
| + | |
| + | }, |
| + | |
| + | loading: function(on) { |
| + | |
| + | var self = this; |
| + | |
| + | if (on) { |
| + | |
| + | this.loadingTimeout = setTimeout(function() { |
| + | |
| + | self.$el.addClass(self.options.elementLoadingClass); |
| + | |
| + | self.$content.html('<p class="slbLoadingText ' + self.options.loadingTextClass + '">' + self.options.loadingCaption + '</p>'); |
| + | self.show(); |
| + | |
| + | }, this.options.loadingTimeout); |
| + | |
| + | } else { |
| + | |
| + | this.$el && this.$el.removeClass(this.options.elementLoadingClass); |
| + | clearTimeout(this.loadingTimeout); |
| + | |
| + | } |
| + | |
| + | }, |
| + | |
| + | prepareItem: function(position, callback) { |
| + | |
| + | var self = this, |
| + | url = this.items[position]; |
| + | |
| + | this.loading(true); |
| + | |
| + | if (this.options.videoRegex.test(url)) { |
| + | |
| + | callback.call(self, $('<div class="slbIframeCont"><iframe class="slbIframe" frameborder="0" allowfullscreen src="' + url + '"></iframe></div>')); |
| + | |
| + | } else { |
| + | |
| + | var $imageCont = $('<div class="slbImageWrap"><img class="slbImage" src="' + url + '" /></div>'); |
| + | |
| + | this.$currentImage = $imageCont.find('.slbImage'); |
| + | |
| + | if (this.options.showCaptions && this.captions[position]) { |
| + | $imageCont.append('<div class="slbCaption">' + this.captions[position] + '</div>'); |
| + | } |
| + | |
| + | this.loadImage(url, function() { |
| + | |
| + | self.setImageDimensions(); |
| + | |
| + | callback.call(self, $imageCont); |
| + | |
| + | self.loadImage(self.items[self.normalizePosition(self.currentPosition + 1)]); |
| + | |
| + | }); |
| + | |
| + | } |
| + | |
| + | return this; |
| + | |
| + | }, |
| + | |
| + | loadImage: function(url, callback) { |
| + | |
| + | if (!this.options.videoRegex.test(url)) { |
| + | |
| + | var image = new Image(); |
| + | callback && (image.onload = callback); |
| + | image.src = url; |
| + | |
| + | } |
| + | |
| + | }, |
| + | |
| + | setupLightboxHtml: function() { |
| + | |
| + | var o = this.options; |
| + | |
| + | if (!this.$el) { |
| + | |
| + | this.$el = $( |
| + | '<div class="slbElement ' + o.elementClass + '">' + |
| + | '<div class="slbOverlay"></div>' + |
| + | '<div class="slbWrapOuter">' + |
| + | '<div class="slbWrap">' + |
| + | '<div class="slbContentOuter">' + |
| + | '<div class="slbContent"></div>' + |
| + | '<button type="button" title="' + o.closeBtnCaption + '" class="slbCloseBtn ' + o.closeBtnClass + '">×</button>' + |
| + | '</div>' + |
| + | '</div>' + |
| + | '</div>' + |
| + | '</div>' |
| + | ); |
| + | |
| + | if (this.items.length > 1) { |
| + | |
| + | $( |
| + | '<div class="slbArrows">' + |
| + | '<button type="button" title="' + o.prevBtnCaption + '" class="prev slbArrow' + o.prevBtnClass + '">' + o.prevBtnCaption + '</button>' + |
| + | '<button type="button" title="' + o.nextBtnCaption + '" class="next slbArrow' + o.nextBtnClass + '">' + o.nextBtnCaption + '</button>' + |
| + | '</div>' |
| + | ).appendTo(this.$el.find('.slbContentOuter')); |
| + | |
| + | } |
| + | |
| + | this.$content = this.$el.find('.slbContent'); |
| + | |
| + | } |
| + | |
| + | this.$content.empty(); |
| + | |
| + | return this; |
| + | |
| + | }, |
| + | |
| + | show: function() { |
| + | |
| + | if (!this.modalInDom) { |
| + | |
| + | this.$el.appendTo($(this.options.appendTarget)); |
| + | $html.addClass(this.options.htmlClass); |
| + | this.setupLightboxEvents(); |
| + | |
| + | this.modalInDom = true; |
| + | |
| + | } |
| + | |
| + | return this; |
| + | |
| + | }, |
| + | |
| + | setContent: function(content) { |
| + | |
| + | var $content = $(content); |
| + | |
| + | this.loading(false); |
| + | |
| + | this.setupLightboxHtml(); |
| + | this.options.beforeSetContent && this.options.beforeSetContent($content, this); |
| + | this.$content.html($content); |
| + | |
| + | return this; |
| + | |
| + | }, |
| + | |
| + | setImageDimensions: function() { |
| + | |
| + | this.$currentImage && this.$currentImage.css('max-height', $window.height() + 'px'); |
| + | |
| + | }, |
| + | |
| + | setupLightboxEvents: function() { |
| + | |
| + | var self = this; |
| + | |
| + | if (!this.lightboxEventsSetuped) { |
| + | |
| + | this.$el.on('click' + this.ens, function(e) { |
| + | |
| + | var $target = $(e.target); |
| + | |
| + | if ($target.is('.slbCloseBtn') || (self.options.closeOnOverlayClick && $target.is('.slbWrap'))) { |
| + | |
| + | self.close(); |
| + | |
| + | } else if ($target.is('.slbArrow')) { |
| + | |
| + | $target.hasClass('next') ? self.next() : self.prev(); |
| + | |
| + | } else if (self.options.nextOnImageClick && self.items.length > 1 && $target.is('.slbImage')) { |
| + | |
| + | self.next(); |
| + | |
| + | } |
| + | |
| + | }); |
| + | |
| + | $document.on('keyup' + this.ens, function(e) { |
| + | |
| + | self.options.closeOnEscapeKey && e.keyCode === 27 && self.close(); |
| + | |
| + | if (self.items.length > 1) { |
| + | (e.keyCode === 39 || e.keyCode === 68) && self.next(); |
| + | (e.keyCode === 37 || e.keyCode === 65) && self.prev(); |
| + | } |
| + | |
| + | }); |
| + | |
| + | $window.on('resize' + this.ens, function() { |
| + | |
| + | self.setImageDimensions(); |
| + | |
| + | }); |
| + | |
| + | this.lightboxEventsSetuped = true; |
| + | |
| + | } |
| + | |
| + | }, |
| + | |
| + | close: function() { |
| + | |
| + | if (this.modalInDom) { |
| + | |
| + | this.options.beforeClose && this.options.beforeClose(this); |
| + | |
| + | this.$el && this.$el.off(this.ens); |
| + | $document.off(this.ens); |
| + | $window.off(this.ens); |
| + | this.lightboxEventsSetuped = false; |
| + | |
| + | this.$el.detach(); |
| + | $html.removeClass(this.options.htmlClass); |
| + | this.modalInDom = false; |
| + | } |
| + | |
| + | }, |
| + | |
| + | destroy: function() { |
| + | |
| + | this.close(); |
| + | this.options.beforeDestroy && this.options.beforeDestroy(this); |
| + | this.$items && this.$items.off(this.ens); |
| + | this.$el && this.$el.remove(); |
| + | |
| + | } |
| + | |
| + | }); |
| + | |
| + | SimpleLightbox.open = function(options) { |
| + | |
| + | var instance = new SimpleLightbox(options); |
| + | |
| + | return options.content ? instance.setContent(options.content).show() : instance.showPosition(instance.options.startAt); |
| + | |
| + | }; |
| + | |
| + | $.fn.simpleLightbox = function(options) { |
| + | |
| + | var lightboxInstance, |
| + | $items = this; |
| + | |
| + | return this.each(function() { |
| + | if (!$.data(this, 'simpleLightbox')) { |
| + | lightboxInstance = lightboxInstance || new SimpleLightbox($.extend({}, options, {$items: $items})); |
| + | $.data(this, 'simpleLightbox', lightboxInstance); |
| + | } |
| + | }); |
| + | |
| + | }; |
| + | |
| + | $.simpleLightbox = $.SimpleLightbox = SimpleLightbox; |
| + | |
| + | return $; |
| + | |
| + | })); |
| + | |
| + | /* |
| + | * jQuery OwlCarousel v1.3.3 |
| + | * |
| + | * Copyright (c) 2013 Bartosz Wojciechowski |
| + | * http://www.owlgraphic.com/owlcarousel/ |
| + | * |
| + | * Licensed under MIT |
| + | * |
| + | */ |
| + | |
| + | /*JS Lint helpers: */ |
| + | /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */ |
| + | /*jslint nomen: true, continue:true */ |
| + | |
| + | if (typeof Object.create !== "function") { |
| + | Object.create = function (obj) { |
| + | function F() {} |
| + | F.prototype = obj; |
| + | return new F(); |
| + | }; |
| + | } |
| + | (function ($, window, document) { |
| + | |
| + | var Carousel = { |
| + | init : function (options, el) { |
| + | var base = this; |
| + | |
| + | base.$elem = $(el); |
| + | base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options); |
| + | |
| + | base.userOptions = options; |
| + | base.loadContent(); |
| + | }, |
| + | |
| + | loadContent : function () { |
| + | var base = this, url; |
| + | |
| + | function getData(data) { |
| + | var i, content = ""; |
| + | if (typeof base.options.jsonSuccess === "function") { |
| + | base.options.jsonSuccess.apply(this, [data]); |
| + | } else { |
| + | for (i in data.owl) { |
| + | if (data.owl.hasOwnProperty(i)) { |
| + | content += data.owl[i].item; |
| + | } |
| + | } |
| + | base.$elem.html(content); |
| + | } |
| + | base.logIn(); |
| + | } |
| + | |
| + | if (typeof base.options.beforeInit === "function") { |
| + | base.options.beforeInit.apply(this, [base.$elem]); |
| + | } |
| + | |
| + | if (typeof base.options.jsonPath === "string") { |
| + | url = base.options.jsonPath; |
| + | $.getJSON(url, getData); |
| + | } else { |
| + | base.logIn(); |
| + | } |
| + | }, |
| + | |
| + | logIn : function () { |
| + | var base = this; |
| + | |
| + | base.$elem.data("owl-originalStyles", base.$elem.attr("style")); |
| + | base.$elem.data("owl-originalClasses", base.$elem.attr("class")); |
| + | |
| + | base.$elem.css({opacity: 0}); |
| + | base.orignalItems = base.options.items; |
| + | base.checkBrowser(); |
| + | base.wrapperWidth = 0; |
| + | base.checkVisible = null; |
| + | base.setVars(); |
| + | }, |
| + | |
| + | setVars : function () { |
| + | var base = this; |
| + | if (base.$elem.children().length === 0) {return false; } |
| + | base.baseClass(); |
| + | base.eventTypes(); |
| + | base.$userItems = base.$elem.children(); |
| + | base.itemsAmount = base.$userItems.length; |
| + | base.wrapItems(); |
| + | base.$owlItems = base.$elem.find(".owl-item"); |
| + | base.$owlWrapper = base.$elem.find(".owl-wrapper"); |
| + | base.playDirection = "next"; |
| + | base.prevItem = 0; |
| + | base.prevArr = [0]; |
| + | base.currentItem = 0; |
| + | base.customEvents(); |
| + | base.onStartup(); |
| + | }, |
| + | |
| + | onStartup : function () { |
| + | var base = this; |
| + | base.updateItems(); |
| + | base.calculateAll(); |
| + | base.buildControls(); |
| + | base.updateControls(); |
| + | base.response(); |
| + | base.moveEvents(); |
| + | base.stopOnHover(); |
| + | base.owlStatus(); |
| + | |
| + | if (base.options.transitionStyle !== false) { |
| + | base.transitionTypes(base.options.transitionStyle); |
| + | } |
| + | if (base.options.autoPlay === true) { |
| + | base.options.autoPlay = 5000; |
| + | } |
| + | base.play(); |
| + | |
| + | base.$elem.find(".owl-wrapper").css("display", "block"); |
| + | |
| + | if (!base.$elem.is(":visible")) { |
| + | base.watchVisibility(); |
| + | } else { |
| + | base.$elem.css("opacity", 1); |
| + | } |
| + | base.onstartup = false; |
| + | base.eachMoveUpdate(); |
| + | if (typeof base.options.afterInit === "function") { |
| + | base.options.afterInit.apply(this, [base.$elem]); |
| + | } |
| + | }, |
| + | |
| + | eachMoveUpdate : function () { |
| + | var base = this; |
| + | |
| + | if (base.options.lazyLoad === true) { |
| + | base.lazyLoad(); |
| + | } |
| + | if (base.options.autoHeight === true) { |
| + | base.autoHeight(); |
| + | } |
| + | base.onVisibleItems(); |
| + | |
| + | if (typeof base.options.afterAction === "function") { |
| + | base.options.afterAction.apply(this, [base.$elem]); |
| + | } |
| + | }, |
| + | |
| + | updateVars : function () { |
| + | var base = this; |
| + | if (typeof base.options.beforeUpdate === "function") { |
| + | base.options.beforeUpdate.apply(this, [base.$elem]); |
| + | } |
| + | base.watchVisibility(); |
| + | base.updateItems(); |
| + | base.calculateAll(); |
| + | base.updatePosition(); |
| + | base.updateControls(); |
| + | base.eachMoveUpdate(); |
| + | if (typeof base.options.afterUpdate === "function") { |
| + | base.options.afterUpdate.apply(this, [base.$elem]); |
| + | } |
| + | }, |
| + | |
| + | reload : function () { |
| + | var base = this; |
| + | window.setTimeout(function () { |
| + | base.updateVars(); |
| + | }, 0); |
| + | }, |
| + | |
| + | watchVisibility : function () { |
| + | var base = this; |
| + | |
| + | if (base.$elem.is(":visible") === false) { |
| + | base.$elem.css({opacity: 0}); |
| + | window.clearInterval(base.autoPlayInterval); |
| + | window.clearInterval(base.checkVisible); |
| + | } else { |
| + | return false; |
| + | } |
| + | base.checkVisible = window.setInterval(function () { |
| + | if (base.$elem.is(":visible")) { |
| + | base.reload(); |
| + | base.$elem.animate({opacity: 1}, 200); |
| + | window.clearInterval(base.checkVisible); |
| + | } |
| + | }, 500); |
| + | }, |
| + | |
| + | wrapItems : function () { |
| + | var base = this; |
| + | base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>"); |
| + | base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">"); |
| + | base.wrapperOuter = base.$elem.find(".owl-wrapper-outer"); |
| + | base.$elem.css("display", "block"); |
| + | }, |
| + | |
| + | baseClass : function () { |
| + | var base = this, |
| + | hasBaseClass = base.$elem.hasClass(base.options.baseClass), |
| + | hasThemeClass = base.$elem.hasClass(base.options.theme); |
| + | |
| + | if (!hasBaseClass) { |
| + | base.$elem.addClass(base.options.baseClass); |
| + | } |
| + | |
| + | if (!hasThemeClass) { |
| + | base.$elem.addClass(base.options.theme); |
| + | } |
| + | }, |
| + | |
| + | updateItems : function () { |
| + | var base = this, width, i; |
| + | |
| + | if (base.options.responsive === false) { |
| + | return false; |
| + | } |
| + | if (base.options.singleItem === true) { |
| + | base.options.items = base.orignalItems = 1; |
| + | base.options.itemsCustom = false; |
| + | base.options.itemsDesktop = false; |
| + | base.options.itemsDesktopSmall = false; |
| + | base.options.itemsTablet = false; |
| + | base.options.itemsTabletSmall = false; |
| + | base.options.itemsMobile = false; |
| + | return false; |
| + | } |
| + | |
| + | width = $(base.options.responsiveBaseWidth).width(); |
| + | |
| + | if (width > (base.options.itemsDesktop[0] || base.orignalItems)) { |
| + | base.options.items = base.orignalItems; |
| + | } |
| + | if (base.options.itemsCustom !== false) { |
| + | //Reorder array by screen size |
| + | base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; }); |
| + | |
| + | for (i = 0; i < base.options.itemsCustom.length; i += 1) { |
| + | if (base.options.itemsCustom[i][0] <= width) { |
| + | base.options.items = base.options.itemsCustom[i][1]; |
| + | } |
| + | } |
| + | |
| + | } else { |
| + | |
| + | if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) { |
| + | base.options.items = base.options.itemsDesktop[1]; |
| + | } |
| + | |
| + | if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) { |
| + | base.options.items = base.options.itemsDesktopSmall[1]; |
| + | } |
| + | |
| + | if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) { |
| + | base.options.items = base.options.itemsTablet[1]; |
| + | } |
| + | |
| + | if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) { |
| + | base.options.items = base.options.itemsTabletSmall[1]; |
| + | } |
| + | |
| + | if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) { |
| + | base.options.items = base.options.itemsMobile[1]; |
| + | } |
| + | } |
| + | |
| + | //if number of items is less than declared |
| + | if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) { |
| + | base.options.items = base.itemsAmount; |
| + | } |
| + | }, |
| + | |
| + | response : function () { |
| + | var base = this, |
| + | smallDelay, |
| + | lastWindowWidth; |
| + | |
| + | if (base.options.responsive !== true) { |
| + | return false; |
| + | } |
| + | lastWindowWidth = $(window).width(); |
| + | |
| + | base.resizer = function () { |
| + | if ($(window).width() !== lastWindowWidth) { |
| + | if (base.options.autoPlay !== false) { |
| + | window.clearInterval(base.autoPlayInterval); |
| + | } |
| + | window.clearTimeout(smallDelay); |
| + | smallDelay = window.setTimeout(function () { |
| + | lastWindowWidth = $(window).width(); |
| + | base.updateVars(); |
| + | }, base.options.responsiveRefreshRate); |
| + | } |
| + | }; |
| + | $(window).resize(base.resizer); |
| + | }, |
| + | |
| + | updatePosition : function () { |
| + | var base = this; |
| + | base.jumpTo(base.currentItem); |
| + | if (base.options.autoPlay !== false) { |
| + | base.checkAp(); |
| + | } |
| + | }, |
| + | |
| + | appendItemsSizes : function () { |
| + | var base = this, |
| + | roundPages = 0, |
| + | lastItem = base.itemsAmount - base.options.items; |
| + | |
| + | base.$owlItems.each(function (index) { |
| + | var $this = $(this); |
| + | $this |
| + | .css({"width": base.itemWidth}) |
| + | .data("owl-item", Number(index)); |
| + | |
| + | if (index % base.options.items === 0 || index === lastItem) { |
| + | if (!(index > lastItem)) { |
| + | roundPages += 1; |
| + | } |
| + | } |
| + | $this.data("owl-roundPages", roundPages); |
| + | }); |
| + | }, |
| + | |
| + | appendWrapperSizes : function () { |
| + | var base = this, |
| + | width = base.$owlItems.length * base.itemWidth; |
| + | |
| + | base.$owlWrapper.css({ |
| + | "width": width * 2, |
| + | "left": 0 |
| + | }); |
| + | base.appendItemsSizes(); |
| + | }, |
| + | |
| + | calculateAll : function () { |
| + | var base = this; |
| + | base.calculateWidth(); |
| + | base.appendWrapperSizes(); |
| + | base.loops(); |
| + | base.max(); |
| + | }, |
| + | |
| + | calculateWidth : function () { |
| + | var base = this; |
| + | base.itemWidth = Math.round(base.$elem.width() / base.options.items); |
| + | }, |
| + | |
| + | max : function () { |
| + | var base = this, |
| + | maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1; |
| + | if (base.options.items > base.itemsAmount) { |
| + | base.maximumItem = 0; |
| + | maximum = 0; |
| + | base.maximumPixels = 0; |
| + | } else { |
| + | base.maximumItem = base.itemsAmount - base.options.items; |
| + | base.maximumPixels = maximum; |
| + | } |
| + | return maximum; |
| + | }, |
| + | |
| + | min : function () { |
| + | return 0; |
| + | }, |
| + | |
| + | loops : function () { |
| + | var base = this, |
| + | prev = 0, |
| + | elWidth = 0, |
| + | i, |
| + | item, |
| + | roundPageNum; |
| + | |
| + | base.positionsInArray = [0]; |
| + | base.pagesInArray = []; |
| + | |
| + | for (i = 0; i < base.itemsAmount; i += 1) { |
| + | elWidth += base.itemWidth; |
| + | base.positionsInArray.push(-elWidth); |
| + | |
| + | if (base.options.scrollPerPage === true) { |
| + | item = $(base.$owlItems[i]); |
| + | roundPageNum = item.data("owl-roundPages"); |
| + | if (roundPageNum !== prev) { |
| + | base.pagesInArray[prev] = base.positionsInArray[i]; |
| + | prev = roundPageNum; |
| + | } |
| + | } |
| + | } |
| + | }, |
| + | |
| + | buildControls : function () { |
| + | var base = this; |
| + | if (base.options.navigation === true || base.options.pagination === true) { |
| + | base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem); |
| + | } |
| + | if (base.options.pagination === true) { |
| + | base.buildPagination(); |
| + | } |
| + | if (base.options.navigation === true) { |
| + | base.buildButtons(); |
| + | } |
| + | }, |
| + | |
| + | buildButtons : function () { |
| + | var base = this, |
| + | buttonsWrapper = $("<div class=\"owl-buttons\"/>"); |
| + | base.owlControls.append(buttonsWrapper); |
| + | |
| + | base.buttonPrev = $("<div/>", { |
| + | "class" : "owl-prev", |
| + | "html" : base.options.navigationText[0] || "" |
| + | }); |
| + | |
| + | base.buttonNext = $("<div/>", { |
| + | "class" : "owl-next", |
| + | "html" : base.options.navigationText[1] || "" |
| + | }); |
| + | |
| + | buttonsWrapper |
| + | .append(base.buttonPrev) |
| + | .append(base.buttonNext); |
| + | |
| + | buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) { |
| + | event.preventDefault(); |
| + | }); |
| + | |
| + | buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) { |
| + | event.preventDefault(); |
| + | if ($(this).hasClass("owl-next")) { |
| + | base.next(); |
| + | } else { |
| + | base.prev(); |
| + | } |
| + | }); |
| + | }, |
| + | |
| + | buildPagination : function () { |
| + | var base = this; |
| + | |
| + | base.paginationWrapper = $("<div class=\"owl-pagination\"/>"); |
| + | base.owlControls.append(base.paginationWrapper); |
| + | |
| + | base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) { |
| + | event.preventDefault(); |
| + | if (Number($(this).data("owl-page")) !== base.currentItem) { |
| + | base.goTo(Number($(this).data("owl-page")), true); |
| + | } |
| + | }); |
| + | }, |
| + | |
| + | updatePagination : function () { |
| + | var base = this, |
| + | counter, |
| + | lastPage, |
| + | lastItem, |
| + | i, |
| + | paginationButton, |
| + | paginationButtonInner; |
| + | |
| + | if (base.options.pagination === false) { |
| + | return false; |
| + | } |
| + | |
| + | base.paginationWrapper.html(""); |
| + | |
| + | counter = 0; |
| + | lastPage = base.itemsAmount - base.itemsAmount % base.options.items; |
| + | |
| + | for (i = 0; i < base.itemsAmount; i += 1) { |
| + | if (i % base.options.items === 0) { |
| + | counter += 1; |
| + | if (lastPage === i) { |
| + | lastItem = base.itemsAmount - base.options.items; |
| + | } |
| + | paginationButton = $("<div/>", { |
| + | "class" : "owl-page" |
| + | }); |
| + | paginationButtonInner = $("<span></span>", { |
| + | "text": base.options.paginationNumbers === true ? counter : "", |
| + | "class": base.options.paginationNumbers === true ? "owl-numbers" : "" |
| + | }); |
| + | paginationButton.append(paginationButtonInner); |
| + | |
| + | paginationButton.data("owl-page", lastPage === i ? lastItem : i); |
| + | paginationButton.data("owl-roundPages", counter); |
| + | |
| + | base.paginationWrapper.append(paginationButton); |
| + | } |
| + | } |
| + | base.checkPagination(); |
| + | }, |
| + | checkPagination : function () { |
| + | var base = this; |
| + | if (base.options.pagination === false) { |
| + | return false; |
| + | } |
| + | base.paginationWrapper.find(".owl-page").each(function () { |
| + | if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) { |
| + | base.paginationWrapper |
| + | .find(".owl-page") |
| + | .removeClass("active"); |
| + | $(this).addClass("active"); |
| + | } |
| + | }); |
| + | }, |
| + | |
| + | checkNavigation : function () { |
| + | var base = this; |
| + | |
| + | if (base.options.navigation === false) { |
| + | return false; |
| + | } |
| + | if (base.options.rewindNav === false) { |
| + | if (base.currentItem === 0 && base.maximumItem === 0) { |
| + | base.buttonPrev.addClass("disabled"); |
| + | base.buttonNext.addClass("disabled"); |
| + | } else if (base.currentItem === 0 && base.maximumItem !== 0) { |
| + | base.buttonPrev.addClass("disabled"); |
| + | base.buttonNext.removeClass("disabled"); |
| + | } else if (base.currentItem === base.maximumItem) { |
| + | base.buttonPrev.removeClass("disabled"); |
| + | base.buttonNext.addClass("disabled"); |
| + | } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) { |
| + | base.buttonPrev.removeClass("disabled"); |
| + | base.buttonNext.removeClass("disabled"); |
| + | } |
| + | } |
| + | }, |
| + | |
| + | updateControls : function () { |
| + | var base = this; |
| + | base.updatePagination(); |
| + | base.checkNavigation(); |
| + | if (base.owlControls) { |
| + | if (base.options.items >= base.itemsAmount) { |
| + | base.owlControls.hide(); |
| + | } else { |
| + | base.owlControls.show(); |
| + | } |
| + | } |
| + | }, |
| + | |
| + | destroyControls : function () { |
| + | var base = this; |
| + | if (base.owlControls) { |
| + | base.owlControls.remove(); |
| + | } |
| + | }, |
| + | |
| + | next : function (speed) { |
| + | var base = this; |
| + | |
| + | if (base.isTransition) { |
| + | return false; |
| + | } |
| + | |
| + | base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1; |
| + | if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) { |
| + | if (base.options.rewindNav === true) { |
| + | base.currentItem = 0; |
| + | speed = "rewind"; |
| + | } else { |
| + | base.currentItem = base.maximumItem; |
| + | return false; |
| + | } |
| + | } |
| + | base.goTo(base.currentItem, speed); |
| + | }, |
| + | |
| + | prev : function (speed) { |
| + | var base = this; |
| + | |
| + | if (base.isTransition) { |
| + | return false; |
| + | } |
| + | |
| + | if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) { |
| + | base.currentItem = 0; |
| + | } else { |
| + | base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1; |
| + | } |
| + | if (base.currentItem < 0) { |
| + | if (base.options.rewindNav === true) { |
| + | base.currentItem = base.maximumItem; |
| + | speed = "rewind"; |
| + | } else { |
| + | base.currentItem = 0; |
| + | return false; |
| + | } |
| + | } |
| + | base.goTo(base.currentItem, speed); |
| + | }, |
| + | |
| + | goTo : function (position, speed, drag) { |
| + | var base = this, |
| + | goToPixel; |
| + | |
| + | if (base.isTransition) { |
| + | return false; |
| + | } |
| + | if (typeof base.options.beforeMove === "function") { |
| + | base.options.beforeMove.apply(this, [base.$elem]); |
| + | } |
| + | if (position >= base.maximumItem) { |
| + | position = base.maximumItem; |
| + | } else if (position <= 0) { |
| + | position = 0; |
| + | } |
| + | |
| + | base.currentItem = base.owl.currentItem = position; |
| + | if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) { |
| + | base.swapSpeed(0); |
| + | if (base.browser.support3d === true) { |
| + | base.transition3d(base.positionsInArray[position]); |
| + | } else { |
| + | base.css2slide(base.positionsInArray[position], 1); |
| + | } |
| + | base.afterGo(); |
| + | base.singleItemTransition(); |
| + | return false; |
| + | } |
| + | goToPixel = base.positionsInArray[position]; |
| + | |
| + | if (base.browser.support3d === true) { |
| + | base.isCss3Finish = false; |
| + | |
| + | if (speed === true) { |
| + | base.swapSpeed("paginationSpeed"); |
| + | window.setTimeout(function () { |
| + | base.isCss3Finish = true; |
| + | }, base.options.paginationSpeed); |
| + | |
| + | } else if (speed === "rewind") { |
| + | base.swapSpeed(base.options.rewindSpeed); |
| + | window.setTimeout(function () { |
| + | base.isCss3Finish = true; |
| + | }, base.options.rewindSpeed); |
| + | |
| + | } else { |
| + | base.swapSpeed("slideSpeed"); |
| + | window.setTimeout(function () { |
| + | base.isCss3Finish = true; |
| + | }, base.options.slideSpeed); |
| + | } |
| + | base.transition3d(goToPixel); |
| + | } else { |
| + | if (speed === true) { |
| + | base.css2slide(goToPixel, base.options.paginationSpeed); |
| + | } else if (speed === "rewind") { |
| + | base.css2slide(goToPixel, base.options.rewindSpeed); |
| + | } else { |
| + | base.css2slide(goToPixel, base.options.slideSpeed); |
| + | } |
| + | } |
| + | base.afterGo(); |
| + | }, |
| + | |
| + | jumpTo : function (position) { |
| + | var base = this; |
| + | if (typeof base.options.beforeMove === "function") { |
| + | base.options.beforeMove.apply(this, [base.$elem]); |
| + | } |
| + | if (position >= base.maximumItem || position === -1) { |
| + | position = base.maximumItem; |
| + | } else if (position <= 0) { |
| + | position = 0; |
| + | } |
| + | base.swapSpeed(0); |
| + | if (base.browser.support3d === true) { |
| + | base.transition3d(base.positionsInArray[position]); |
| + | } else { |
| + | base.css2slide(base.positionsInArray[position], 1); |
| + | } |
| + | base.currentItem = base.owl.currentItem = position; |
| + | base.afterGo(); |
| + | }, |
| + | |
| + | afterGo : function () { |
| + | var base = this; |
| + | |
| + | base.prevArr.push(base.currentItem); |
| + | base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2]; |
| + | base.prevArr.shift(0); |
| + | |
| + | if (base.prevItem !== base.currentItem) { |
| + | base.checkPagination(); |
| + | base.checkNavigation(); |
| + | base.eachMoveUpdate(); |
| + | |
| + | if (base.options.autoPlay !== false) { |
| + | base.checkAp(); |
| + | } |
| + | } |
| + | if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) { |
| + | base.options.afterMove.apply(this, [base.$elem]); |
| + | } |
| + | }, |
| + | |
| + | stop : function () { |
| + | var base = this; |
| + | base.apStatus = "stop"; |
| + | window.clearInterval(base.autoPlayInterval); |
| + | }, |
| + | |
| + | checkAp : function () { |
| + | var base = this; |
| + | if (base.apStatus !== "stop") { |
| + | base.play(); |
| + | } |
| + | }, |
| + | |
| + | play : function () { |
| + | var base = this; |
| + | base.apStatus = "play"; |
| + | if (base.options.autoPlay === false) { |
| + | return false; |
| + | } |
| + | window.clearInterval(base.autoPlayInterval); |
| + | base.autoPlayInterval = window.setInterval(function () { |
| + | base.next(true); |
| + | }, base.options.autoPlay); |
| + | }, |
| + | |
| + | swapSpeed : function (action) { |
| + | var base = this; |
| + | if (action === "slideSpeed") { |
| + | base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed)); |
| + | } else if (action === "paginationSpeed") { |
| + | base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed)); |
| + | } else if (typeof action !== "string") { |
| + | base.$owlWrapper.css(base.addCssSpeed(action)); |
| + | } |
| + | }, |
| + | |
| + | addCssSpeed : function (speed) { |
| + | return { |
| + | "-webkit-transition": "all " + speed + "ms ease", |
| + | "-moz-transition": "all " + speed + "ms ease", |
| + | "-o-transition": "all " + speed + "ms ease", |
| + | "transition": "all " + speed + "ms ease" |
| + | }; |
| + | }, |
| + | |
| + | removeTransition : function () { |
| + | return { |
| + | "-webkit-transition": "", |
| + | "-moz-transition": "", |
| + | "-o-transition": "", |
| + | "transition": "" |
| + | }; |
| + | }, |
| + | |
| + | doTranslate : function (pixels) { |
| + | return { |
| + | "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)", |
| + | "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)", |
| + | "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)", |
| + | "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)", |
| + | "transform": "translate3d(" + pixels + "px, 0px,0px)" |
| + | }; |
| + | }, |
| + | |
| + | transition3d : function (value) { |
| + | var base = this; |
| + | base.$owlWrapper.css(base.doTranslate(value)); |
| + | }, |
| + | |
| + | css2move : function (value) { |
| + | var base = this; |
| + | base.$owlWrapper.css({"left" : value}); |
| + | }, |
| + | |
| + | css2slide : function (value, speed) { |
| + | var base = this; |
| + | |
| + | base.isCssFinish = false; |
| + | base.$owlWrapper.stop(true, true).animate({ |
| + | "left" : value |
| + | }, { |
| + | duration : speed || base.options.slideSpeed, |
| + | complete : function () { |
| + | base.isCssFinish = true; |
| + | } |
| + | }); |
| + | }, |
| + | |
| + | checkBrowser : function () { |
| + | var base = this, |
| + | translate3D = "translate3d(0px, 0px, 0px)", |
| + | tempElem = document.createElement("div"), |
| + | regex, |
| + | asSupport, |
| + | support3d, |
| + | isTouch; |
| + | |
| + | tempElem.style.cssText = " -moz-transform:" + translate3D + |
| + | "; -ms-transform:" + translate3D + |
| + | "; -o-transform:" + translate3D + |
| + | "; -webkit-transform:" + translate3D + |
| + | "; transform:" + translate3D; |
| + | regex = /translate3d\(0px, 0px, 0px\)/g; |
| + | asSupport = tempElem.style.cssText.match(regex); |
| + | support3d = (asSupport !== null && asSupport.length === 1); |
| + | |
| + | isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints; |
| + | |
| + | base.browser = { |
| + | "support3d" : support3d, |
| + | "isTouch" : isTouch |
| + | }; |
| + | }, |
| + | |
| + | moveEvents : function () { |
| + | var base = this; |
| + | if (base.options.mouseDrag !== false || base.options.touchDrag !== false) { |
| + | base.gestures(); |
| + | base.disabledEvents(); |
| + | } |
| + | }, |
| + | |
| + | eventTypes : function () { |
| + | var base = this, |
| + | types = ["s", "e", "x"]; |
| + | |
| + | base.ev_types = {}; |
| + | |
| + | if (base.options.mouseDrag === true && base.options.touchDrag === true) { |
| + | types = [ |
| + | "touchstart.owl mousedown.owl", |
| + | "touchmove.owl mousemove.owl", |
| + | "touchend.owl touchcancel.owl mouseup.owl" |
| + | ]; |
| + | } else if (base.options.mouseDrag === false && base.options.touchDrag === true) { |
| + | types = [ |
| + | "touchstart.owl", |
| + | "touchmove.owl", |
| + | "touchend.owl touchcancel.owl" |
| + | ]; |
| + | } else if (base.options.mouseDrag === true && base.options.touchDrag === false) { |
| + | types = [ |
| + | "mousedown.owl", |
| + | "mousemove.owl", |
| + | "mouseup.owl" |
| + | ]; |
| + | } |
| + | |
| + | base.ev_types.start = types[0]; |
| + | base.ev_types.move = types[1]; |
| + | base.ev_types.end = types[2]; |
| + | }, |
| + | |
| + | disabledEvents : function () { |
| + | var base = this; |
| + | base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); }); |
| + | base.$elem.on("mousedown.disableTextSelect", function (e) { |
| + | return $(e.target).is('input, textarea, select, option'); |
| + | }); |
| + | }, |
| + | |
| + | gestures : function () { |
| + | /*jslint unparam: true*/ |
| + | var base = this, |
| + | locals = { |
| + | offsetX : 0, |
| + | offsetY : 0, |
| + | baseElWidth : 0, |
| + | relativePos : 0, |
| + | position: null, |
| + | minSwipe : null, |
| + | maxSwipe: null, |
| + | sliding : null, |
| + | dargging: null, |
| + | targetElement : null |
| + | }; |
| + | |
| + | base.isCssFinish = true; |
| + | |
| + | function getTouches(event) { |
| + | if (event.touches !== undefined) { |
| + | return { |
| + | x : event.touches[0].pageX, |
| + | y : event.touches[0].pageY |
| + | }; |
| + | } |
| + | |
| + | if (event.touches === undefined) { |
| + | if (event.pageX !== undefined) { |
| + | return { |
| + | x : event.pageX, |
| + | y : event.pageY |
| + | }; |
| + | } |
| + | if (event.pageX === undefined) { |
| + | return { |
| + | x : event.clientX, |
| + | y : event.clientY |
| + | }; |
| + | } |
| + | } |
| + | } |
| + | |
| + | function swapEvents(type) { |
| + | if (type === "on") { |
| + | $(document).on(base.ev_types.move, dragMove); |
| + | $(document).on(base.ev_types.end, dragEnd); |
| + | } else if (type === "off") { |
| + | $(document).off(base.ev_types.move); |
| + | $(document).off(base.ev_types.end); |
| + | } |
| + | } |
| + | |
| + | function dragStart(event) { |
| + | var ev = event.originalEvent || event || window.event, |
| + | position; |
| + | |
| + | if (ev.which === 3) { |
| + | return false; |
| + | } |
| + | if (base.itemsAmount <= base.options.items) { |
| + | return; |
| + | } |
| + | if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) { |
| + | return false; |
| + | } |
| + | if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) { |
| + | return false; |
| + | } |
| + | |
| + | if (base.options.autoPlay !== false) { |
| + | window.clearInterval(base.autoPlayInterval); |
| + | } |
| + | |
| + | if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) { |
| + | base.$owlWrapper.addClass("grabbing"); |
| + | } |
| + | |
| + | base.newPosX = 0; |
| + | base.newRelativeX = 0; |
| + | |
| + | $(this).css(base.removeTransition()); |
| + | |
| + | position = $(this).position(); |
| + | locals.relativePos = position.left; |
| + | |
| + | locals.offsetX = getTouches(ev).x - position.left; |
| + | locals.offsetY = getTouches(ev).y - position.top; |
| + | |
| + | swapEvents("on"); |
| + | |
| + | locals.sliding = false; |
| + | locals.targetElement = ev.target || ev.srcElement; |
| + | } |
| + | |
| + | function dragMove(event) { |
| + | var ev = event.originalEvent || event || window.event, |
| + | minSwipe, |
| + | maxSwipe; |
| + | |
| + | base.newPosX = getTouches(ev).x - locals.offsetX; |
| + | base.newPosY = getTouches(ev).y - locals.offsetY; |
| + | base.newRelativeX = base.newPosX - locals.relativePos; |
| + | |
| + | if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) { |
| + | locals.dragging = true; |
| + | base.options.startDragging.apply(base, [base.$elem]); |
| + | } |
| + | |
| + | if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) { |
| + | if (ev.preventDefault !== undefined) { |
| + | ev.preventDefault(); |
| + | } else { |
| + | ev.returnValue = false; |
| + | } |
| + | locals.sliding = true; |
| + | } |
| + | |
| + | if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) { |
| + | $(document).off("touchmove.owl"); |
| + | } |
| + | |
| + | minSwipe = function () { |
| + | return base.newRelativeX / 5; |
| + | }; |
| + | |
| + | maxSwipe = function () { |
| + | return base.maximumPixels + base.newRelativeX / 5; |
| + | }; |
| + | |
| + | base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe()); |
| + | if (base.browser.support3d === true) { |
| + | base.transition3d(base.newPosX); |
| + | } else { |
| + | base.css2move(base.newPosX); |
| + | } |
| + | } |
| + | |
| + | function dragEnd(event) { |
| + | var ev = event.originalEvent || event || window.event, |
| + | newPosition, |
| + | handlers, |
| + | owlStopEvent; |
| + | |
| + | ev.target = ev.target || ev.srcElement; |
| + | |
| + | locals.dragging = false; |
| + | |
| + | if (base.browser.isTouch !== true) { |
| + | base.$owlWrapper.removeClass("grabbing"); |
| + | } |
| + | |
| + | if (base.newRelativeX < 0) { |
| + | base.dragDirection = base.owl.dragDirection = "left"; |
| + | } else { |
| + | base.dragDirection = base.owl.dragDirection = "right"; |
| + | } |
| + | |
| + | if (base.newRelativeX !== 0) { |
| + | newPosition = base.getNewPosition(); |
| + | base.goTo(newPosition, false, "drag"); |
| + | if (locals.targetElement === ev.target && base.browser.isTouch !== true) { |
| + | $(ev.target).on("click.disable", function (ev) { |
| + | ev.stopImmediatePropagation(); |
| + | ev.stopPropagation(); |
| + | ev.preventDefault(); |
| + | $(ev.target).off("click.disable"); |
| + | }); |
| + | handlers = $._data(ev.target, "events").click; |
| + | owlStopEvent = handlers.pop(); |
| + | handlers.splice(0, 0, owlStopEvent); |
| + | } |
| + | } |
| + | swapEvents("off"); |
| + | } |
| + | base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart); |
| + | }, |
| + | |
| + | getNewPosition : function () { |
| + | var base = this, |
| + | newPosition = base.closestItem(); |
| + | |
| + | if (newPosition > base.maximumItem) { |
| + | base.currentItem = base.maximumItem; |
| + | newPosition = base.maximumItem; |
| + | } else if (base.newPosX >= 0) { |
| + | newPosition = 0; |
| + | base.currentItem = 0; |
| + | } |
| + | return newPosition; |
| + | }, |
| + | closestItem : function () { |
| + | var base = this, |
| + | array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray, |
| + | goal = base.newPosX, |
| + | closest = null; |
| + | |
| + | $.each(array, function (i, v) { |
| + | if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") { |
| + | closest = v; |
| + | if (base.options.scrollPerPage === true) { |
| + | base.currentItem = $.inArray(closest, base.positionsInArray); |
| + | } else { |
| + | base.currentItem = i; |
| + | } |
| + | } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") { |
| + | if (base.options.scrollPerPage === true) { |
| + | closest = array[i + 1] || array[array.length - 1]; |
| + | base.currentItem = $.inArray(closest, base.positionsInArray); |
| + | } else { |
| + | closest = array[i + 1]; |
| + | base.currentItem = i + 1; |
| + | } |
| + | } |
| + | }); |
| + | return base.currentItem; |
| + | }, |
| + | |
| + | moveDirection : function () { |
| + | var base = this, |
| + | direction; |
| + | if (base.newRelativeX < 0) { |
| + | direction = "right"; |
| + | base.playDirection = "next"; |
| + | } else { |
| + | direction = "left"; |
| + | base.playDirection = "prev"; |
| + | } |
| + | return direction; |
| + | }, |
| + | |
| + | customEvents : function () { |
| + | /*jslint unparam: true*/ |
| + | var base = this; |
| + | base.$elem.on("owl.next", function () { |
| + | base.next(); |
| + | }); |
| + | base.$elem.on("owl.prev", function () { |
| + | base.prev(); |
| + | }); |
| + | base.$elem.on("owl.play", function (event, speed) { |
| + | base.options.autoPlay = speed; |
| + | base.play(); |
| + | base.hoverStatus = "play"; |
| + | }); |
| + | base.$elem.on("owl.stop", function () { |
| + | base.stop(); |
| + | base.hoverStatus = "stop"; |
| + | }); |
| + | base.$elem.on("owl.goTo", function (event, item) { |
| + | base.goTo(item); |
| + | }); |
| + | base.$elem.on("owl.jumpTo", function (event, item) { |
| + | base.jumpTo(item); |
| + | }); |
| + | }, |
| + | |
| + | stopOnHover : function () { |
| + | var base = this; |
| + | if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) { |
| + | base.$elem.on("mouseover", function () { |
| + | base.stop(); |
| + | }); |
| + | base.$elem.on("mouseout", function () { |
| + | if (base.hoverStatus !== "stop") { |
| + | base.play(); |
| + | } |
| + | }); |
| + | } |
| + | }, |
| + | |
| + | lazyLoad : function () { |
| + | var base = this, |
| + | i, |
| + | $item, |
| + | itemNumber, |
| + | $lazyImg, |
| + | follow; |
| + | |
| + | if (base.options.lazyLoad === false) { |
| + | return false; |
| + | } |
| + | for (i = 0; i < base.itemsAmount; i += 1) { |
| + | $item = $(base.$owlItems[i]); |
| + | |
| + | if ($item.data("owl-loaded") === "loaded") { |
| + | continue; |
| + | } |
| + | |
| + | itemNumber = $item.data("owl-item"); |
| + | $lazyImg = $item.find(".lazyOwl"); |
| + | |
| + | if (typeof $lazyImg.data("src") !== "string") { |
| + | $item.data("owl-loaded", "loaded"); |
| + | continue; |
| + | } |
| + | if ($item.data("owl-loaded") === undefined) { |
| + | $lazyImg.hide(); |
| + | $item.addClass("loading").data("owl-loaded", "checked"); |
| + | } |
| + | if (base.options.lazyFollow === true) { |
| + | follow = itemNumber >= base.currentItem; |
| + | } else { |
| + | follow = true; |
| + | } |
| + | if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) { |
| + | base.lazyPreload($item, $lazyImg); |
| + | } |
| + | } |
| + | }, |
| + | |
| + | lazyPreload : function ($item, $lazyImg) { |
| + | var base = this, |
| + | iterations = 0, |
| + | isBackgroundImg; |
| + | |
| + | if ($lazyImg.prop("tagName") === "DIV") { |
| + | $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")"); |
| + | isBackgroundImg = true; |
| + | } else { |
| + | $lazyImg[0].src = $lazyImg.data("src"); |
| + | } |
| + | |
| + | function showImage() { |
| + | $item.data("owl-loaded", "loaded").removeClass("loading"); |
| + | $lazyImg.removeAttr("data-src"); |
| + | if (base.options.lazyEffect === "fade") { |
| + | $lazyImg.fadeIn(400); |
| + | } else { |
| + | $lazyImg.show(); |
| + | } |
| + | if (typeof base.options.afterLazyLoad === "function") { |
| + | base.options.afterLazyLoad.apply(this, [base.$elem]); |
| + | } |
| + | } |
| + | |
| + | function checkLazyImage() { |
| + | iterations += 1; |
| + | if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) { |
| + | showImage(); |
| + | } else if (iterations <= 100) {//if image loads in less than 10 seconds |
| + | window.setTimeout(checkLazyImage, 100); |
| + | } else { |
| + | showImage(); |
| + | } |
| + | } |
| + | |
| + | checkLazyImage(); |
| + | }, |
| + | |
| + | autoHeight : function () { |
| + | var base = this, |
| + | $currentimg = $(base.$owlItems[base.currentItem]).find("img"), |
| + | iterations; |
| + | |
| + | function addHeight() { |
| + | var $currentItem = $(base.$owlItems[base.currentItem]).height(); |
| + | base.wrapperOuter.css("height", $currentItem + "px"); |
| + | if (!base.wrapperOuter.hasClass("autoHeight")) { |
| + | window.setTimeout(function () { |
| + | base.wrapperOuter.addClass("autoHeight"); |
| + | }, 0); |
| + | } |
| + | } |
| + | |
| + | function checkImage() { |
| + | iterations += 1; |
| + | if (base.completeImg($currentimg.get(0))) { |
| + | addHeight(); |
| + | } else if (iterations <= 100) { //if image loads in less than 10 seconds |
| + | window.setTimeout(checkImage, 100); |
| + | } else { |
| + | base.wrapperOuter.css("height", ""); //Else remove height attribute |
| + | } |
| + | } |
| + | |
| + | if ($currentimg.get(0) !== undefined) { |
| + | iterations = 0; |
| + | checkImage(); |
| + | } else { |
| + | addHeight(); |
| + | } |
| + | }, |
| + | |
| + | completeImg : function (img) { |
| + | var naturalWidthType; |
| + | |
| + | if (!img.complete) { |
| + | return false; |
| + | } |
| + | naturalWidthType = typeof img.naturalWidth; |
| + | if (naturalWidthType !== "undefined" && img.naturalWidth === 0) { |
| + | return false; |
| + | } |
| + | return true; |
| + | }, |
| + | |
| + | onVisibleItems : function () { |
| + | var base = this, |
| + | i; |
| + | |
| + | if (base.options.addClassActive === true) { |
| + | base.$owlItems.removeClass("active"); |
| + | } |
| + | base.visibleItems = []; |
| + | for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) { |
| + | base.visibleItems.push(i); |
| + | |
| + | if (base.options.addClassActive === true) { |
| + | $(base.$owlItems[i]).addClass("active"); |
| + | } |
| + | } |
| + | base.owl.visibleItems = base.visibleItems; |
| + | }, |
| + | |
| + | transitionTypes : function (className) { |
| + | var base = this; |
| + | //Currently available: "fade", "backSlide", "goDown", "fadeUp" |
| + | base.outClass = "owl-" + className + "-out"; |
| + | base.inClass = "owl-" + className + "-in"; |
| + | }, |
| + | |
| + | singleItemTransition : function () { |
| + | var base = this, |
| + | outClass = base.outClass, |
| + | inClass = base.inClass, |
| + | $currentItem = base.$owlItems.eq(base.currentItem), |
| + | $prevItem = base.$owlItems.eq(base.prevItem), |
| + | prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem], |
| + | origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2, |
| + | animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend'; |
| + | |
| + | base.isTransition = true; |
| + | |
| + | base.$owlWrapper |
| + | .addClass('owl-origin') |
| + | .css({ |
| + | "-webkit-transform-origin" : origin + "px", |
| + | "-moz-perspective-origin" : origin + "px", |
| + | "perspective-origin" : origin + "px" |
| + | }); |
| + | function transStyles(prevPos) { |
| + | return { |
| + | "position" : "relative", |
| + | "left" : prevPos + "px" |
| + | }; |
| + | } |
| + | |
| + | $prevItem |
| + | .css(transStyles(prevPos, 10)) |
| + | .addClass(outClass) |
| + | .on(animEnd, function () { |
| + | base.endPrev = true; |
| + | $prevItem.off(animEnd); |
| + | base.clearTransStyle($prevItem, outClass); |
| + | }); |
| + | |
| + | $currentItem |
| + | .addClass(inClass) |
| + | .on(animEnd, function () { |
| + | base.endCurrent = true; |
| + | $currentItem.off(animEnd); |
| + | base.clearTransStyle($currentItem, inClass); |
| + | }); |
| + | }, |
| + | |
| + | clearTransStyle : function (item, classToRemove) { |
| + | var base = this; |
| + | item.css({ |
| + | "position" : "", |
| + | "left" : "" |
| + | }).removeClass(classToRemove); |
| + | |
| + | if (base.endPrev && base.endCurrent) { |
| + | base.$owlWrapper.removeClass('owl-origin'); |
| + | base.endPrev = false; |
| + | base.endCurrent = false; |
| + | base.isTransition = false; |
| + | } |
| + | }, |
| + | |
| + | owlStatus : function () { |
| + | var base = this; |
| + | base.owl = { |
| + | "userOptions" : base.userOptions, |
| + | "baseElement" : base.$elem, |
| + | "userItems" : base.$userItems, |
| + | "owlItems" : base.$owlItems, |
| + | "currentItem" : base.currentItem, |
| + | "prevItem" : base.prevItem, |
| + | "visibleItems" : base.visibleItems, |
| + | "isTouch" : base.browser.isTouch, |
| + | "browser" : base.browser, |
| + | "dragDirection" : base.dragDirection |
| + | }; |
| + | }, |
| + | |
| + | clearEvents : function () { |
| + | var base = this; |
| + | base.$elem.off(".owl owl mousedown.disableTextSelect"); |
| + | $(document).off(".owl owl"); |
| + | $(window).off("resize", base.resizer); |
| + | }, |
| + | |
| + | unWrap : function () { |
| + | var base = this; |
| + | if (base.$elem.children().length !== 0) { |
| + | base.$owlWrapper.unwrap(); |
| + | base.$userItems.unwrap().unwrap(); |
| + | if (base.owlControls) { |
| + | base.owlControls.remove(); |
| + | } |
| + | } |
| + | base.clearEvents(); |
| + | base.$elem |
| + | .attr("style", base.$elem.data("owl-originalStyles") || "") |
| + | .attr("class", base.$elem.data("owl-originalClasses")); |
| + | }, |
| + | |
| + | destroy : function () { |
| + | var base = this; |
| + | base.stop(); |
| + | window.clearInterval(base.checkVisible); |
| + | base.unWrap(); |
| + | base.$elem.removeData(); |
| + | }, |
| + | |
| + | reinit : function (newOptions) { |
| + | var base = this, |
| + | options = $.extend({}, base.userOptions, newOptions); |
| + | base.unWrap(); |
| + | base.init(options, base.$elem); |
| + | }, |
| + | |
| + | addItem : function (htmlString, targetPosition) { |
| + | var base = this, |
| + | position; |
| + | |
| + | if (!htmlString) {return false; } |
| + | |
| + | if (base.$elem.children().length === 0) { |
| + | base.$elem.append(htmlString); |
| + | base.setVars(); |
| + | return false; |
| + | } |
| + | base.unWrap(); |
| + | if (targetPosition === undefined || targetPosition === -1) { |
| + | position = -1; |
| + | } else { |
| + | position = targetPosition; |
| + | } |
| + | if (position >= base.$userItems.length || position === -1) { |
| + | base.$userItems.eq(-1).after(htmlString); |
| + | } else { |
| + | base.$userItems.eq(position).before(htmlString); |
| + | } |
| + | |
| + | base.setVars(); |
| + | }, |
| + | |
| + | removeItem : function (targetPosition) { |
| + | var base = this, |
| + | position; |
| + | |
| + | if (base.$elem.children().length === 0) { |
| + | return false; |
| + | } |
| + | if (targetPosition === undefined || targetPosition === -1) { |
| + | position = -1; |
| + | } else { |
| + | position = targetPosition; |
| + | } |
| + | |
| + | base.unWrap(); |
| + | base.$userItems.eq(position).remove(); |
| + | base.setVars(); |
| + | } |
| + | |
| + | }; |
| + | |
| + | $.fn.owlCarousel = function (options) { |
| + | return this.each(function () { |
| + | if ($(this).data("owl-init") === true) { |
| + | return false; |
| + | } |
| + | $(this).data("owl-init", true); |
| + | var carousel = Object.create(Carousel); |
| + | carousel.init(options, this); |
| + | $.data(this, "owlCarousel", carousel); |
| + | }); |
| + | }; |
| + | |
| + | $.fn.owlCarousel.options = { |
| + | |
| + | items : 5, |
| + | itemsCustom : false, |
| + | itemsDesktop : [1199, 4], |
| + | itemsDesktopSmall : [979, 3], |
| + | itemsTablet : [768, 2], |
| + | itemsTabletSmall : false, |
| + | itemsMobile : [479, 1], |
| + | singleItem : false, |
| + | itemsScaleUp : false, |
| + | |
| + | slideSpeed : 200, |
| + | paginationSpeed : 800, |
| + | rewindSpeed : 1000, |
| + | |
| + | autoPlay : false, |
| + | stopOnHover : false, |
| + | |
| + | navigation : false, |
| + | navigationText : ["prev", "next"], |
| + | rewindNav : true, |
| + | scrollPerPage : false, |
| + | |
| + | pagination : true, |
| + | paginationNumbers : false, |
| + | |
| + | responsive : true, |
| + | responsiveRefreshRate : 200, |
| + | responsiveBaseWidth : window, |
| + | |
| + | baseClass : "owl-carousel", |
| + | theme : "owl-theme", |
| + | |
| + | lazyLoad : false, |
| + | lazyFollow : true, |
| + | lazyEffect : "fade", |
| + | |
| + | autoHeight : false, |
| + | |
| + | jsonPath : false, |
| + | jsonSuccess : false, |
| + | |
| + | dragBeforeAnimFinish : true, |
| + | mouseDrag : true, |
| + | touchDrag : true, |
| + | |
| + | addClassActive : false, |
| + | transitionStyle : false, |
| + | |
| + | beforeUpdate : false, |
| + | afterUpdate : false, |
| + | beforeInit : false, |
| + | afterInit : false, |
| + | beforeMove : false, |
| + | afterMove : false, |
| + | afterAction : false, |
| + | startDragging : false, |
| + | afterLazyLoad: false |
| + | }; |
| + | }(jQuery, window, document)); |
| + | |
| + | |
| + | |
| + | /* |
| + | * jQuery FlexSlider v2.2.0 |
| + | * Copyright 2012 WooThemes |
| + | * Contributing Author: Tyler Smith |
| + | */ |
| + | ; |
| + | (function ($) { |
| + | |
| + | //FlexSlider: Object Instance |
| + | $.flexslider = function(el, options) { |
| + | var slider = $(el); |
| + | |
| + | // making variables public |
| + | slider.vars = $.extend({}, $.flexslider.defaults, options); |
| + | |
| + | var namespace = slider.vars.namespace, |
| + | msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, |
| + | touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, |
| + | // depricating this idea, as devices are being released with both of these events |
| + | //eventType = (touch) ? "touchend" : "click", |
| + | eventType = "click touchend MSPointerUp", |
| + | watchedEvent = "", |
| + | watchedEventClearTimer, |
| + | vertical = slider.vars.direction === "vertical", |
| + | reverse = slider.vars.reverse, |
| + | carousel = (slider.vars.itemWidth > 0), |
| + | fade = slider.vars.animation === "fade", |
| + | asNav = slider.vars.asNavFor !== "", |
| + | methods = {}, |
| + | focused = true; |
| + | |
| + | // Store a reference to the slider object |
| + | $.data(el, "flexslider", slider); |
| + | |
| + | // Private slider methods |
| + | methods = { |
| + | init: function() { |
| + | slider.animating = false; |
| + | // Get current slide and make sure it is a number |
| + | slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0) ); |
| + | if ( isNaN( slider.currentSlide ) ) slider.currentSlide = 0; |
| + | slider.animatingTo = slider.currentSlide; |
| + | slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last); |
| + | slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' ')); |
| + | slider.slides = $(slider.vars.selector, slider); |
| + | slider.container = $(slider.containerSelector, slider); |
| + | slider.count = slider.slides.length; |
| + | // SYNC: |
| + | slider.syncExists = $(slider.vars.sync).length > 0; |
| + | // SLIDE: |
| + | if (slider.vars.animation === "slide") slider.vars.animation = "swing"; |
| + | slider.prop = (vertical) ? "top" : "marginLeft"; |
| + | slider.args = {}; |
| + | // SLIDESHOW: |
| + | slider.manualPause = false; |
| + | slider.stopped = false; |
| + | //PAUSE WHEN INVISIBLE |
| + | slider.started = false; |
| + | slider.startTimeout = null; |
| + | // TOUCH/USECSS: |
| + | slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() { |
| + | var obj = document.createElement('div'), |
| + | props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; |
| + | for (var i in props) { |
| + | if ( obj.style[ props[i] ] !== undefined ) { |
| + | slider.pfx = props[i].replace('Perspective','').toLowerCase(); |
| + | slider.prop = "-" + slider.pfx + "-transform"; |
| + | return true; |
| + | } |
| + | } |
| + | return false; |
| + | }()); |
| + | // CONTROLSCONTAINER: |
| + | if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer); |
| + | // MANUAL: |
| + | if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls); |
| + | |
| + | // RANDOMIZE: |
| + | if (slider.vars.randomize) { |
| + | slider.slides.sort(function() { return (Math.round(Math.random())-0.5); }); |
| + | slider.container.empty().append(slider.slides); |
| + | } |
| + | |
| + | slider.doMath(); |
| + | |
| + | // INIT |
| + | slider.setup("init"); |
| + | |
| + | // CONTROLNAV: |
| + | if (slider.vars.controlNav) methods.controlNav.setup(); |
| + | |
| + | // DIRECTIONNAV: |
| + | if (slider.vars.directionNav) methods.directionNav.setup(); |
| + | |
| + | // KEYBOARD: |
| + | if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) { |
| + | $(document).bind('keyup', function(event) { |
| + | var keycode = event.keyCode; |
| + | if (!slider.animating && (keycode === 39 || keycode === 37)) { |
| + | var target = (keycode === 39) ? slider.getTarget('next') : |
| + | (keycode === 37) ? slider.getTarget('prev') : false; |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } |
| + | }); |
| + | } |
| + | // MOUSEWHEEL: |
| + | if (slider.vars.mousewheel) { |
| + | slider.bind('mousewheel', function(event, delta, deltaX, deltaY) { |
| + | event.preventDefault(); |
| + | var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev'); |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | }); |
| + | } |
| + | |
| + | // PAUSEPLAY |
| + | if (slider.vars.pausePlay) methods.pausePlay.setup(); |
| + | |
| + | //PAUSE WHEN INVISIBLE |
| + | if (slider.vars.slideshow && slider.vars.pauseInvisible) methods.pauseInvisible.init(); |
| + | |
| + | // SLIDSESHOW |
| + | if (slider.vars.slideshow) { |
| + | if (slider.vars.pauseOnHover) { |
| + | slider.hover(function() { |
| + | if (!slider.manualPlay && !slider.manualPause) slider.pause(); |
| + | }, function() { |
| + | if (!slider.manualPause && !slider.manualPlay && !slider.stopped) slider.play(); |
| + | }); |
| + | } |
| + | // initialize animation |
| + | //If we're visible, or we don't use PageVisibility API |
| + | if(!slider.vars.pauseInvisible || !methods.pauseInvisible.isHidden()) { |
| + | (slider.vars.initDelay > 0) ? slider.startTimeout = setTimeout(slider.play, slider.vars.initDelay) : slider.play(); |
| + | } |
| + | } |
| + | |
| + | // ASNAV: |
| + | if (asNav) methods.asNav.setup(); |
| + | |
| + | // TOUCH |
| + | if (touch && slider.vars.touch) methods.touch(); |
| + | |
| + | // FADE&&SMOOTHHEIGHT || SLIDE: |
| + | if (!fade || (fade && slider.vars.smoothHeight)) $(window).bind("resize orientationchange focus", methods.resize); |
| + | |
| + | slider.find("img").attr("draggable", "false"); |
| + | |
| + | // API: start() Callback |
| + | setTimeout(function(){ |
| + | slider.vars.start(slider); |
| + | }, 200); |
| + | }, |
| + | asNav: { |
| + | setup: function() { |
| + | slider.asNav = true; |
| + | slider.animatingTo = Math.floor(slider.currentSlide/slider.move); |
| + | slider.currentItem = slider.currentSlide; |
| + | slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide"); |
| + | if(!msGesture){ |
| + | slider.slides.click(function(e){ |
| + | e.preventDefault(); |
| + | var $slide = $(this), |
| + | target = $slide.index(); |
| + | var posFromLeft = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container |
| + | if( posFromLeft <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) { |
| + | slider.flexAnimate(slider.getTarget("prev"), true); |
| + | } else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) { |
| + | slider.direction = (slider.currentItem < target) ? "next" : "prev"; |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); |
| + | } |
| + | }); |
| + | }else{ |
| + | el._slider = slider; |
| + | slider.slides.each(function (){ |
| + | var that = this; |
| + | that._gesture = new MSGesture(); |
| + | that._gesture.target = that; |
| + | that.addEventListener("MSPointerDown", function (e){ |
| + | e.preventDefault(); |
| + | if(e.currentTarget._gesture) |
| + | e.currentTarget._gesture.addPointer(e.pointerId); |
| + | }, false); |
| + | that.addEventListener("MSGestureTap", function (e){ |
| + | e.preventDefault(); |
| + | var $slide = $(this), |
| + | target = $slide.index(); |
| + | if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) { |
| + | slider.direction = (slider.currentItem < target) ? "next" : "prev"; |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); |
| + | } |
| + | }); |
| + | }); |
| + | } |
| + | } |
| + | }, |
| + | controlNav: { |
| + | setup: function() { |
| + | if (!slider.manualControls) { |
| + | methods.controlNav.setupPaging(); |
| + | } else { // MANUALCONTROLS: |
| + | methods.controlNav.setupManual(); |
| + | } |
| + | }, |
| + | setupPaging: function() { |
| + | var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging', |
| + | j = 1, |
| + | item, |
| + | slide; |
| + | |
| + | slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>'); |
| + | |
| + | if (slider.pagingCount > 1) { |
| + | for (var i = 0; i < slider.pagingCount; i++) { |
| + | slide = slider.slides.eq(i); |
| + | item = (slider.vars.controlNav === "thumbnails") ? '<img src="' + slide.attr( 'data-thumb' ) + '"/>' : '<a>' + j + '</a>'; |
| + | if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) { |
| + | var captn = slide.attr( 'data-thumbcaption' ); |
| + | if ( '' != captn && undefined != captn ) item += '<span class="' + namespace + 'caption">' + captn + '</span>'; |
| + | } |
| + | slider.controlNavScaffold.append('<li>' + item + '</li>'); |
| + | j++; |
| + | } |
| + | } |
| + | |
| + | // CONTROLSCONTAINER: |
| + | (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold); |
| + | methods.controlNav.set(); |
| + | |
| + | methods.controlNav.active(); |
| + | |
| + | slider.controlNavScaffold.delegate('a, img', eventType, function(event) { |
| + | event.preventDefault(); |
| + | |
| + | if (watchedEvent === "" || watchedEvent === event.type) { |
| + | var $this = $(this), |
| + | target = slider.controlNav.index($this); |
| + | |
| + | if (!$this.hasClass(namespace + 'active')) { |
| + | slider.direction = (target > slider.currentSlide) ? "next" : "prev"; |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } |
| + | } |
| + | |
| + | // setup flags to prevent event duplication |
| + | if (watchedEvent === "") { |
| + | watchedEvent = event.type; |
| + | } |
| + | methods.setToClearWatchedEvent(); |
| + | |
| + | }); |
| + | }, |
| + | setupManual: function() { |
| + | slider.controlNav = slider.manualControls; |
| + | methods.controlNav.active(); |
| + | |
| + | slider.controlNav.bind(eventType, function(event) { |
| + | event.preventDefault(); |
| + | |
| + | if (watchedEvent === "" || watchedEvent === event.type) { |
| + | var $this = $(this), |
| + | target = slider.controlNav.index($this); |
| + | |
| + | if (!$this.hasClass(namespace + 'active')) { |
| + | (target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev"; |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } |
| + | } |
| + | |
| + | // setup flags to prevent event duplication |
| + | if (watchedEvent === "") { |
| + | watchedEvent = event.type; |
| + | } |
| + | methods.setToClearWatchedEvent(); |
| + | }); |
| + | }, |
| + | set: function() { |
| + | var selector = (slider.vars.controlNav === "thumbnails") ? 'img' : 'a'; |
| + | slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider); |
| + | }, |
| + | active: function() { |
| + | slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active"); |
| + | }, |
| + | update: function(action, pos) { |
| + | if (slider.pagingCount > 1 && action === "add") { |
| + | slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>')); |
| + | } else if (slider.pagingCount === 1) { |
| + | slider.controlNavScaffold.find('li').remove(); |
| + | } else { |
| + | slider.controlNav.eq(pos).closest('li').remove(); |
| + | } |
| + | methods.controlNav.set(); |
| + | (slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active(); |
| + | } |
| + | }, |
| + | directionNav: { |
| + | setup: function() { |
| + | var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + slider.vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + slider.vars.nextText + '</a></li></ul>'); |
| + | |
| + | // CONTROLSCONTAINER: |
| + | if (slider.controlsContainer) { |
| + | $(slider.controlsContainer).append(directionNavScaffold); |
| + | slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer); |
| + | } else { |
| + | slider.append(directionNavScaffold); |
| + | slider.directionNav = $('.' + namespace + 'direction-nav li a', slider); |
| + | } |
| + | |
| + | methods.directionNav.update(); |
| + | |
| + | slider.directionNav.bind(eventType, function(event) { |
| + | event.preventDefault(); |
| + | var target; |
| + | |
| + | if (watchedEvent === "" || watchedEvent === event.type) { |
| + | target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev'); |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } |
| + | |
| + | // setup flags to prevent event duplication |
| + | if (watchedEvent === "") { |
| + | watchedEvent = event.type; |
| + | } |
| + | methods.setToClearWatchedEvent(); |
| + | }); |
| + | }, |
| + | update: function() { |
| + | var disabledClass = namespace + 'disabled'; |
| + | if (slider.pagingCount === 1) { |
| + | slider.directionNav.addClass(disabledClass).attr('tabindex', '-1'); |
| + | } else if (!slider.vars.animationLoop) { |
| + | if (slider.animatingTo === 0) { |
| + | slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass).attr('tabindex', '-1'); |
| + | } else if (slider.animatingTo === slider.last) { |
| + | slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass).attr('tabindex', '-1'); |
| + | } else { |
| + | slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); |
| + | } |
| + | } else { |
| + | slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); |
| + | } |
| + | } |
| + | }, |
| + | pausePlay: { |
| + | setup: function() { |
| + | var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>'); |
| + | |
| + | // CONTROLSCONTAINER: |
| + | if (slider.controlsContainer) { |
| + | slider.controlsContainer.append(pausePlayScaffold); |
| + | slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer); |
| + | } else { |
| + | slider.append(pausePlayScaffold); |
| + | slider.pausePlay = $('.' + namespace + 'pauseplay a', slider); |
| + | } |
| + | |
| + | methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play'); |
| + | |
| + | slider.pausePlay.bind(eventType, function(event) { |
| + | event.preventDefault(); |
| + | |
| + | if (watchedEvent === "" || watchedEvent === event.type) { |
| + | if ($(this).hasClass(namespace + 'pause')) { |
| + | slider.manualPause = true; |
| + | slider.manualPlay = false; |
| + | slider.pause(); |
| + | } else { |
| + | slider.manualPause = false; |
| + | slider.manualPlay = true; |
| + | slider.play(); |
| + | } |
| + | } |
| + | |
| + | // setup flags to prevent event duplication |
| + | if (watchedEvent === "") { |
| + | watchedEvent = event.type; |
| + | } |
| + | methods.setToClearWatchedEvent(); |
| + | }); |
| + | }, |
| + | update: function(state) { |
| + | (state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').html(slider.vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').html(slider.vars.pauseText); |
| + | } |
| + | }, |
| + | touch: function() { |
| + | var startX, |
| + | startY, |
| + | offset, |
| + | cwidth, |
| + | dx, |
| + | startT, |
| + | scrolling = false, |
| + | localX = 0, |
| + | localY = 0, |
| + | accDx = 0; |
| + | |
| + | if(!msGesture){ |
| + | el.addEventListener('touchstart', onTouchStart, false); |
| + | |
| + | function onTouchStart(e) { |
| + | if (slider.animating) { |
| + | e.preventDefault(); |
| + | } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) { |
| + | slider.pause(); |
| + | // CAROUSEL: |
| + | cwidth = (vertical) ? slider.h : slider. w; |
| + | startT = Number(new Date()); |
| + | // CAROUSEL: |
| + | |
| + | // Local vars for X and Y points. |
| + | localX = e.touches[0].pageX; |
| + | localY = e.touches[0].pageY; |
| + | |
| + | offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : |
| + | (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : |
| + | (carousel && slider.currentSlide === slider.last) ? slider.limit : |
| + | (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : |
| + | (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; |
| + | startX = (vertical) ? localY : localX; |
| + | startY = (vertical) ? localX : localY; |
| + | |
| + | el.addEventListener('touchmove', onTouchMove, false); |
| + | el.addEventListener('touchend', onTouchEnd, false); |
| + | } |
| + | } |
| + | |
| + | function onTouchMove(e) { |
| + | // Local vars for X and Y points. |
| + | |
| + | localX = e.touches[0].pageX; |
| + | localY = e.touches[0].pageY; |
| + | |
| + | dx = (vertical) ? startX - localY : startX - localX; |
| + | scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY)); |
| + | |
| + | var fxms = 500; |
| + | |
| + | if ( ! scrolling || Number( new Date() ) - startT > fxms ) { |
| + | e.preventDefault(); |
| + | if (!fade && slider.transitions) { |
| + | if (!slider.vars.animationLoop) { |
| + | dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1); |
| + | } |
| + | slider.setProps(offset + dx, "setTouch"); |
| + | } |
| + | } |
| + | } |
| + | |
| + | function onTouchEnd(e) { |
| + | // finish the touch by undoing the touch session |
| + | el.removeEventListener('touchmove', onTouchMove, false); |
| + | |
| + | if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { |
| + | var updateDx = (reverse) ? -dx : dx, |
| + | target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); |
| + | |
| + | if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } else { |
| + | if (!fade) slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); |
| + | } |
| + | } |
| + | el.removeEventListener('touchend', onTouchEnd, false); |
| + | |
| + | startX = null; |
| + | startY = null; |
| + | dx = null; |
| + | offset = null; |
| + | } |
| + | }else{ |
| + | el.style.msTouchAction = "none"; |
| + | el._gesture = new MSGesture(); |
| + | el._gesture.target = el; |
| + | el.addEventListener("MSPointerDown", onMSPointerDown, false); |
| + | el._slider = slider; |
| + | el.addEventListener("MSGestureChange", onMSGestureChange, false); |
| + | el.addEventListener("MSGestureEnd", onMSGestureEnd, false); |
| + | |
| + | function onMSPointerDown(e){ |
| + | e.stopPropagation(); |
| + | if (slider.animating) { |
| + | e.preventDefault(); |
| + | }else{ |
| + | slider.pause(); |
| + | el._gesture.addPointer(e.pointerId); |
| + | accDx = 0; |
| + | cwidth = (vertical) ? slider.h : slider. w; |
| + | startT = Number(new Date()); |
| + | // CAROUSEL: |
| + | |
| + | offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : |
| + | (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : |
| + | (carousel && slider.currentSlide === slider.last) ? slider.limit : |
| + | (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : |
| + | (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; |
| + | } |
| + | } |
| + | |
| + | function onMSGestureChange(e) { |
| + | e.stopPropagation(); |
| + | var slider = e.target._slider; |
| + | if(!slider){ |
| + | return; |
| + | } |
| + | var transX = -e.translationX, |
| + | transY = -e.translationY; |
| + | |
| + | //Accumulate translations. |
| + | accDx = accDx + ((vertical) ? transY : transX); |
| + | dx = accDx; |
| + | scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY)); |
| + | |
| + | if(e.detail === e.MSGESTURE_FLAG_INERTIA){ |
| + | setImmediate(function (){ |
| + | el._gesture.stop(); |
| + | }); |
| + | |
| + | return; |
| + | } |
| + | |
| + | if (!scrolling || Number(new Date()) - startT > 500) { |
| + | e.preventDefault(); |
| + | if (!fade && slider.transitions) { |
| + | if (!slider.vars.animationLoop) { |
| + | dx = accDx / ((slider.currentSlide === 0 && accDx < 0 || slider.currentSlide === slider.last && accDx > 0) ? (Math.abs(accDx) / cwidth + 2) : 1); |
| + | } |
| + | slider.setProps(offset + dx, "setTouch"); |
| + | } |
| + | } |
| + | } |
| + | |
| + | function onMSGestureEnd(e) { |
| + | e.stopPropagation(); |
| + | var slider = e.target._slider; |
| + | if(!slider){ |
| + | return; |
| + | } |
| + | if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { |
| + | var updateDx = (reverse) ? -dx : dx, |
| + | target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); |
| + | |
| + | if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { |
| + | slider.flexAnimate(target, slider.vars.pauseOnAction); |
| + | } else { |
| + | if (!fade) slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); |
| + | } |
| + | } |
| + | |
| + | startX = null; |
| + | startY = null; |
| + | dx = null; |
| + | offset = null; |
| + | accDx = 0; |
| + | } |
| + | } |
| + | }, |
| + | resize: function() { |
| + | if (!slider.animating && slider.is(':visible')) { |
| + | if (!carousel) slider.doMath(); |
| + | |
| + | if (fade) { |
| + | // SMOOTH HEIGHT: |
| + | methods.smoothHeight(); |
| + | } else if (carousel) { //CAROUSEL: |
| + | slider.slides.width(slider.computedW); |
| + | slider.update(slider.pagingCount); |
| + | slider.setProps(); |
| + | } |
| + | else if (vertical) { //VERTICAL: |
| + | slider.viewport.height(slider.h); |
| + | slider.setProps(slider.h, "setTotal"); |
| + | } else { |
| + | // SMOOTH HEIGHT: |
| + | if (slider.vars.smoothHeight) methods.smoothHeight(); |
| + | slider.newSlides.width(slider.computedW); |
| + | slider.setProps(slider.computedW, "setTotal"); |
| + | } |
| + | } |
| + | }, |
| + | smoothHeight: function(dur) { |
| + | if (!vertical || fade) { |
| + | var $obj = (fade) ? slider : slider.viewport; |
| + | (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height()); |
| + | } |
| + | }, |
| + | sync: function(action) { |
| + | var $obj = $(slider.vars.sync).data("flexslider"), |
| + | target = slider.animatingTo; |
| + | |
| + | switch (action) { |
| + | case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break; |
| + | case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break; |
| + | case "pause": $obj.pause(); break; |
| + | } |
| + | }, |
| + | pauseInvisible: { |
| + | visProp: null, |
| + | init: function() { |
| + | var prefixes = ['webkit','moz','ms','o']; |
| + | |
| + | if ('hidden' in document) return 'hidden'; |
| + | for (var i = 0; i < prefixes.length; i++) { |
| + | if ((prefixes[i] + 'Hidden') in document) |
| + | methods.pauseInvisible.visProp = prefixes[i] + 'Hidden'; |
| + | } |
| + | if (methods.pauseInvisible.visProp) { |
| + | var evtname = methods.pauseInvisible.visProp.replace(/[H|h]idden/,'') + 'visibilitychange'; |
| + | document.addEventListener(evtname, function() { |
| + | if (methods.pauseInvisible.isHidden()) { |
| + | if(slider.startTimeout) clearTimeout(slider.startTimeout); //If clock is ticking, stop timer and prevent from starting while invisible |
| + | else slider.pause(); //Or just pause |
| + | } |
| + | else { |
| + | if(slider.started) slider.play(); //Initiated before, just play |
| + | else (slider.vars.initDelay > 0) ? setTimeout(slider.play, slider.vars.initDelay) : slider.play(); //Didn't init before: simply init or wait for it |
| + | } |
| + | }); |
| + | } |
| + | }, |
| + | isHidden: function() { |
| + | return document[methods.pauseInvisible.visProp] || false; |
| + | } |
| + | }, |
| + | setToClearWatchedEvent: function() { |
| + | clearTimeout(watchedEventClearTimer); |
| + | watchedEventClearTimer = setTimeout(function() { |
| + | watchedEvent = ""; |
| + | }, 3000); |
| + | } |
| + | } |
| + | |
| + | // public methods |
| + | slider.flexAnimate = function(target, pause, override, withSync, fromNav) { |
| + | if (!slider.vars.animationLoop && target !== slider.currentSlide) { |
| + | slider.direction = (target > slider.currentSlide) ? "next" : "prev"; |
| + | } |
| + | |
| + | if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev"; |
| + | |
| + | if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) { |
| + | if (asNav && withSync) { |
| + | var master = $(slider.vars.asNavFor).data('flexslider'); |
| + | slider.atEnd = target === 0 || target === slider.count - 1; |
| + | master.flexAnimate(target, true, false, true, fromNav); |
| + | slider.direction = (slider.currentItem < target) ? "next" : "prev"; |
| + | master.direction = slider.direction; |
| + | |
| + | if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) { |
| + | slider.currentItem = target; |
| + | slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); |
| + | target = Math.floor(target/slider.visible); |
| + | } else { |
| + | slider.currentItem = target; |
| + | slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); |
| + | return false; |
| + | } |
| + | } |
| + | |
| + | slider.animating = true; |
| + | slider.animatingTo = target; |
| + | |
| + | // SLIDESHOW: |
| + | if (pause) slider.pause(); |
| + | |
| + | // API: before() animation Callback |
| + | slider.vars.before(slider); |
| + | |
| + | // SYNC: |
| + | if (slider.syncExists && !fromNav) methods.sync("animate"); |
| + | |
| + | // CONTROLNAV |
| + | if (slider.vars.controlNav) methods.controlNav.active(); |
| + | |
| + | // !CAROUSEL: |
| + | // CANDIDATE: slide active class (for add/remove slide) |
| + | if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); |
| + | |
| + | // INFINITE LOOP: |
| + | // CANDIDATE: atEnd |
| + | slider.atEnd = target === 0 || target === slider.last; |
| + | |
| + | // DIRECTIONNAV: |
| + | if (slider.vars.directionNav) methods.directionNav.update(); |
| + | |
| + | if (target === slider.last) { |
| + | // API: end() of cycle Callback |
| + | slider.vars.end(slider); |
| + | // SLIDESHOW && !INFINITE LOOP: |
| + | if (!slider.vars.animationLoop) slider.pause(); |
| + | } |
| + | |
| + | // SLIDE: |
| + | if (!fade) { |
| + | var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW, |
| + | margin, slideString, calcNext; |
| + | |
| + | // INFINITE LOOP / REVERSE: |
| + | if (carousel) { |
| + | //margin = (slider.vars.itemWidth > slider.w) ? slider.vars.itemMargin * 2 : slider.vars.itemMargin; |
| + | margin = slider.vars.itemMargin; |
| + | calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo; |
| + | slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext; |
| + | } else if (slider.currentSlide === 0 && target === slider.count - 1 && slider.vars.animationLoop && slider.direction !== "next") { |
| + | slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0; |
| + | } else if (slider.currentSlide === slider.last && target === 0 && slider.vars.animationLoop && slider.direction !== "prev") { |
| + | slideString = (reverse) ? 0 : (slider.count + 1) * dimension; |
| + | } else { |
| + | slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension; |
| + | } |
| + | slider.setProps(slideString, "", slider.vars.animationSpeed); |
| + | if (slider.transitions) { |
| + | if (!slider.vars.animationLoop || !slider.atEnd) { |
| + | slider.animating = false; |
| + | slider.currentSlide = slider.animatingTo; |
| + | } |
| + | slider.container.unbind("webkitTransitionEnd transitionend"); |
| + | slider.container.bind("webkitTransitionEnd transitionend", function() { |
| + | slider.wrapup(dimension); |
| + | }); |
| + | } else { |
| + | slider.container.animate(slider.args, slider.vars.animationSpeed, slider.vars.easing, function(){ |
| + | slider.wrapup(dimension); |
| + | }); |
| + | } |
| + | } else { // FADE: |
| + | if (!touch) { |
| + | //slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing); |
| + | //slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); |
| + | |
| + | slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); |
| + | slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); |
| + | |
| + | } else { |
| + | slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); |
| + | slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); |
| + | slider.wrapup(dimension); |
| + | } |
| + | } |
| + | // SMOOTH HEIGHT: |
| + | if (slider.vars.smoothHeight) methods.smoothHeight(slider.vars.animationSpeed); |
| + | } |
| + | } |
| + | slider.wrapup = function(dimension) { |
| + | // SLIDE: |
| + | if (!fade && !carousel) { |
| + | if (slider.currentSlide === 0 && slider.animatingTo === slider.last && slider.vars.animationLoop) { |
| + | slider.setProps(dimension, "jumpEnd"); |
| + | } else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && slider.vars.animationLoop) { |
| + | slider.setProps(dimension, "jumpStart"); |
| + | } |
| + | } |
| + | slider.animating = false; |
| + | slider.currentSlide = slider.animatingTo; |
| + | // API: after() animation Callback |
| + | slider.vars.after(slider); |
| + | } |
| + | |
| + | // SLIDESHOW: |
| + | slider.animateSlides = function() { |
| + | if (!slider.animating && focused ) slider.flexAnimate(slider.getTarget("next")); |
| + | } |
| + | // SLIDESHOW: |
| + | slider.pause = function() { |
| + | clearInterval(slider.animatedSlides); |
| + | slider.animatedSlides = null; |
| + | slider.playing = false; |
| + | // PAUSEPLAY: |
| + | if (slider.vars.pausePlay) methods.pausePlay.update("play"); |
| + | // SYNC: |
| + | if (slider.syncExists) methods.sync("pause"); |
| + | } |
| + | // SLIDESHOW: |
| + | slider.play = function() { |
| + | if (slider.playing) clearInterval(slider.animatedSlides); |
| + | slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed); |
| + | slider.started = slider.playing = true; |
| + | // PAUSEPLAY: |
| + | if (slider.vars.pausePlay) methods.pausePlay.update("pause"); |
| + | // SYNC: |
| + | if (slider.syncExists) methods.sync("play"); |
| + | } |
| + | // STOP: |
| + | slider.stop = function () { |
| + | slider.pause(); |
| + | slider.stopped = true; |
| + | } |
| + | slider.canAdvance = function(target, fromNav) { |
| + | // ASNAV: |
| + | var last = (asNav) ? slider.pagingCount - 1 : slider.last; |
| + | return (fromNav) ? true : |
| + | (asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true : |
| + | (asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false : |
| + | (target === slider.currentSlide && !asNav) ? false : |
| + | (slider.vars.animationLoop) ? true : |
| + | (slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false : |
| + | (slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false : |
| + | true; |
| + | } |
| + | slider.getTarget = function(dir) { |
| + | slider.direction = dir; |
| + | if (dir === "next") { |
| + | return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1; |
| + | } else { |
| + | return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1; |
| + | } |
| + | } |
| + | |
| + | // SLIDE: |
| + | slider.setProps = function(pos, special, dur) { |
| + | var target = (function() { |
| + | var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo, |
| + | posCalc = (function() { |
| + | if (carousel) { |
| + | return (special === "setTouch") ? pos : |
| + | (reverse && slider.animatingTo === slider.last) ? 0 : |
| + | (reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : |
| + | (slider.animatingTo === slider.last) ? slider.limit : posCheck; |
| + | } else { |
| + | switch (special) { |
| + | case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos; |
| + | case "setTouch": return (reverse) ? pos : pos; |
| + | case "jumpEnd": return (reverse) ? pos : slider.count * pos; |
| + | case "jumpStart": return (reverse) ? slider.count * pos : pos; |
| + | default: return pos; |
| + | } |
| + | } |
| + | }()); |
| + | |
| + | return (posCalc * -1) + "px"; |
| + | }()); |
| + | |
| + | if (slider.transitions) { |
| + | target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)"; |
| + | dur = (dur !== undefined) ? (dur/1000) + "s" : "0s"; |
| + | slider.container.css("-" + slider.pfx + "-transition-duration", dur); |
| + | } |
| + | |
| + | slider.args[slider.prop] = target; |
| + | if (slider.transitions || dur === undefined) slider.container.css(slider.args); |
| + | } |
| + | |
| + | slider.setup = function(type) { |
| + | // SLIDE: |
| + | if (!fade) { |
| + | var sliderOffset, arr; |
| + | |
| + | if (type === "init") { |
| + | slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container); |
| + | // INFINITE LOOP: |
| + | slider.cloneCount = 0; |
| + | slider.cloneOffset = 0; |
| + | // REVERSE: |
| + | if (reverse) { |
| + | arr = $.makeArray(slider.slides).reverse(); |
| + | slider.slides = $(arr); |
| + | slider.container.empty().append(slider.slides); |
| + | } |
| + | } |
| + | // INFINITE LOOP && !CAROUSEL: |
| + | if (slider.vars.animationLoop && !carousel) { |
| + | slider.cloneCount = 2; |
| + | slider.cloneOffset = 1; |
| + | // clear out old clones |
| + | if (type !== "init") slider.container.find('.clone').remove(); |
| + | slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true')); |
| + | } |
| + | slider.newSlides = $(slider.vars.selector, slider); |
| + | |
| + | sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset; |
| + | // VERTICAL: |
| + | if (vertical && !carousel) { |
| + | slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%"); |
| + | setTimeout(function(){ |
| + | slider.newSlides.css({"display": "block"}); |
| + | slider.doMath(); |
| + | slider.viewport.height(slider.h); |
| + | slider.setProps(sliderOffset * slider.h, "init"); |
| + | }, (type === "init") ? 100 : 0); |
| + | } else { |
| + | slider.container.width((slider.count + slider.cloneCount) * 200 + "%"); |
| + | slider.setProps(sliderOffset * slider.computedW, "init"); |
| + | setTimeout(function(){ |
| + | slider.doMath(); |
| + | slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"}); |
| + | // SMOOTH HEIGHT: |
| + | if (slider.vars.smoothHeight) methods.smoothHeight(); |
| + | }, (type === "init") ? 100 : 0); |
| + | } |
| + | } else { // FADE: |
| + | slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"}); |
| + | if (type === "init") { |
| + | if (!touch) { |
| + | //slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing); |
| + | slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); |
| + | } else { |
| + | slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2}); |
| + | } |
| + | } |
| + | // SMOOTH HEIGHT: |
| + | if (slider.vars.smoothHeight) methods.smoothHeight(); |
| + | } |
| + | // !CAROUSEL: |
| + | // CANDIDATE: active slide |
| + | if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); |
| + | } |
| + | |
| + | |
| + | slider.doMath = function() { |
| + | var slide = slider.slides.first(), |
| + | slideMargin = slider.vars.itemMargin, |
| + | minItems = slider.vars.minItems, |
| + | maxItems = slider.vars.maxItems; |
| + | |
| + | slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width(); |
| + | slider.h = slide.height(); |
| + | slider.boxPadding = slide.outerWidth() - slide.width(); |
| + | |
| + | // CAROUSEL: |
| + | if (carousel) { |
| + | slider.itemT = slider.vars.itemWidth + slideMargin; |
| + | slider.minW = (minItems) ? minItems * slider.itemT : slider.w; |
| + | slider.maxW = (maxItems) ? (maxItems * slider.itemT) - slideMargin : slider.w; |
| + | slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * (minItems - 1)))/minItems : |
| + | (slider.maxW < slider.w) ? (slider.w - (slideMargin * (maxItems - 1)))/maxItems : |
| + | (slider.vars.itemWidth > slider.w) ? slider.w : slider.vars.itemWidth; |
| + | |
| + | slider.visible = Math.floor(slider.w/(slider.itemW)); |
| + | slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible; |
| + | slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1); |
| + | slider.last = slider.pagingCount - 1; |
| + | slider.limit = (slider.pagingCount === 1) ? 0 : |
| + | (slider.vars.itemWidth > slider.w) ? (slider.itemW * (slider.count - 1)) + (slideMargin * (slider.count - 1)) : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin; |
| + | } else { |
| + | slider.itemW = slider.w; |
| + | slider.pagingCount = slider.count; |
| + | slider.last = slider.count - 1; |
| + | } |
| + | slider.computedW = slider.itemW - slider.boxPadding; |
| + | } |
| + | |
| + | |
| + | slider.update = function(pos, action) { |
| + | slider.doMath(); |
| + | |
| + | // update currentSlide and slider.animatingTo if necessary |
| + | if (!carousel) { |
| + | if (pos < slider.currentSlide) { |
| + | slider.currentSlide += 1; |
| + | } else if (pos <= slider.currentSlide && pos !== 0) { |
| + | slider.currentSlide -= 1; |
| + | } |
| + | slider.animatingTo = slider.currentSlide; |
| + | } |
| + | |
| + | // update controlNav |
| + | if (slider.vars.controlNav && !slider.manualControls) { |
| + | if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) { |
| + | methods.controlNav.update("add"); |
| + | } else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) { |
| + | if (carousel && slider.currentSlide > slider.last) { |
| + | slider.currentSlide -= 1; |
| + | slider.animatingTo -= 1; |
| + | } |
| + | methods.controlNav.update("remove", slider.last); |
| + | } |
| + | } |
| + | // update directionNav |
| + | if (slider.vars.directionNav) methods.directionNav.update(); |
| + | |
| + | } |
| + | |
| + | slider.addSlide = function(obj, pos) { |
| + | var $obj = $(obj); |
| + | |
| + | slider.count += 1; |
| + | slider.last = slider.count - 1; |
| + | |
| + | // append new slide |
| + | if (vertical && reverse) { |
| + | (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj); |
| + | } else { |
| + | (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj); |
| + | } |
| + | |
| + | // update currentSlide, animatingTo, controlNav, and directionNav |
| + | slider.update(pos, "add"); |
| + | |
| + | // update slider.slides |
| + | slider.slides = $(slider.vars.selector + ':not(.clone)', slider); |
| + | // re-setup the slider to accomdate new slide |
| + | slider.setup(); |
| + | |
| + | //FlexSlider: added() Callback |
| + | slider.vars.added(slider); |
| + | } |
| + | slider.removeSlide = function(obj) { |
| + | var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj; |
| + | |
| + | // update count |
| + | slider.count -= 1; |
| + | slider.last = slider.count - 1; |
| + | |
| + | // remove slide |
| + | if (isNaN(obj)) { |
| + | $(obj, slider.slides).remove(); |
| + | } else { |
| + | (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove(); |
| + | } |
| + | |
| + | // update currentSlide, animatingTo, controlNav, and directionNav |
| + | slider.doMath(); |
| + | slider.update(pos, "remove"); |
| + | |
| + | // update slider.slides |
| + | slider.slides = $(slider.vars.selector + ':not(.clone)', slider); |
| + | // re-setup the slider to accomdate new slide |
| + | slider.setup(); |
| + | |
| + | // FlexSlider: removed() Callback |
| + | slider.vars.removed(slider); |
| + | } |
| + | |
| + | //FlexSlider: Initialize |
| + | methods.init(); |
| + | } |
| + | |
| + | // Ensure the slider isn't focussed if the window loses focus. |
| + | $( window ).blur( function ( e ) { |
| + | focused = false; |
| + | }).focus( function ( e ) { |
| + | focused = true; |
| + | }); |
| + | |
| + | //FlexSlider: Default Settings |
| + | $.flexslider.defaults = { |
| + | namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin |
| + | selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril |
| + | animation: "fade", //String: Select your animation type, "fade" or "slide" |
| + | easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! |
| + | direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" |
| + | reverse: false, //{NEW} Boolean: Reverse the animation direction |
| + | animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end |
| + | smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode |
| + | startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) |
| + | slideshow: true, //Boolean: Animate slider automatically |
| + | slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds |
| + | animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds |
| + | initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds |
| + | randomize: false, //Boolean: Randomize slide order |
| + | thumbCaptions: false, //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav. |
| + | |
| + | // Usability features |
| + | pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. |
| + | pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering |
| + | pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage. |
| + | useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available |
| + | touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices |
| + | video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches |
| + | |
| + | // Primary Controls |
| + | controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage |
| + | directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) |
| + | prevText: "Previous", //String: Set the text for the "previous" directionNav item |
| + | nextText: "Next", //String: Set the text for the "next" directionNav item |
| + | |
| + | // Secondary Navigation |
| + | keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys |
| + | multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present. |
| + | mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel |
| + | pausePlay: false, //Boolean: Create pause/play dynamic element |
| + | pauseText: "Pause", //String: Set the text for the "pause" pausePlay item |
| + | playText: "Play", //String: Set the text for the "play" pausePlay item |
| + | |
| + | // Special properties |
| + | controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found. |
| + | manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. |
| + | sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care. |
| + | asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider |
| + | |
| + | // Carousel Options |
| + | itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding. |
| + | itemMargin: 0, //{NEW} Integer: Margin between carousel items. |
| + | minItems: 1, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this. |
| + | maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit. |
| + | move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items. |
| + | allowOneSlide: true, //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide |
| + | |
| + | // Callback API |
| + | start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide |
| + | before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation |
| + | after: function(){}, //Callback: function(slider) - Fires after each slider animation completes |
| + | end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) |
| + | added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added |
| + | removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed |
| + | } |
| + | |
| + | |
| + | //FlexSlider: Plugin Function |
| + | $.fn.flexslider = function(options) { |
| + | if (options === undefined) options = {}; |
| + | |
| + | if (typeof options === "object") { |
| + | return this.each(function() { |
| + | var $this = $(this), |
| + | selector = (options.selector) ? options.selector : ".slides > li", |
| + | $slides = $this.find(selector); |
| + | |
| + | if ( ( $slides.length === 1 && options.allowOneSlide === true ) || $slides.length === 0 ) { |
| + | $slides.fadeIn(400); |
| + | if (options.start) options.start($this); |
| + | } else if ($this.data('flexslider') === undefined) { |
| + | new $.flexslider(this, options); |
| + | } |
| + | }); |
| + | } else { |
| + | // Helper strings to quickly perform functions on the slider |
| + | var $slider = $(this).data('flexslider'); |
| + | switch (options) { |
| + | case "play": $slider.play(); break; |
| + | case "pause": $slider.pause(); break; |
| + | case "stop": $slider.stop(); break; |
| + | case "next": $slider.flexAnimate($slider.getTarget("next"), true); break; |
| + | case "prev": |
| + | case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break; |
| + | default: if (typeof options === "number") $slider.flexAnimate(options, true); |
| + | } |
| + | } |
| + | } |
| + | })(jQuery); |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | /*! |
| + | * jquery.lightbox.js |
| + | * https://github.com/duncanmcdougall/Responsive-Lightbox |
| + | * Copyright 2013 Duncan McDougall and other contributors; @license Creative Commons Attribution 2.5 |
| + | * |
| + | * Options: |
| + | * margin - int - default 50. Minimum margin around the image |
| + | * nav - bool - default true. enable navigation |
| + | * blur - bool - default true. Blur other content when open using css filter |
| + | * minSize - int - default 0. Min window width or height to open lightbox. Below threshold will open image in a new tab. |
| + | * |
| + | */ |
| + | (function ($) { |
| + | |
| + | 'use strict'; |
| + | |
| + | $.fn.lightbox = function (options) { |
| + | |
| + | var opts = { |
| + | margin: 50, |
| + | nav: true, |
| + | blur: true, |
| + | minSize: 0 |
| + | }; |
| + | |
| + | var plugin = { |
| + | |
| + | items: [], |
| + | lightbox: null, |
| + | image: null, |
| + | current: null, |
| + | locked: false, |
| + | caption: null, |
| + | |
| + | init: function (items) { |
| + | plugin.items = items; |
| + | plugin.selector = "lightbox-"+Math.random().toString().replace('.',''); |
| + | |
| + | if (!plugin.lightbox) { |
| + | $('body').append( |
| + | '<div id="lightbox" style="display:none;">'+ |
| + | '<a href="#" class="lightbox-close lightbox-button"></a>' + |
| + | '<div class="lightbox-nav">'+ |
| + | '<a href="#" class="lightbox-previous lightbox-button"></a>' + |
| + | '<a href="#" class="lightbox-next lightbox-button"></a>' + |
| + | '</div>' + |
| + | '<div href="#" class="lightbox-caption"><p></p></div>' + |
| + | '</div>' |
| + | ); |
| + | |
| + | plugin.lightbox = $("#lightbox"); |
| + | plugin.caption = $('.lightbox-caption', plugin.lightbox); |
| + | } |
| + | |
| + | if (plugin.items.length > 1 && opts.nav) { |
| + | $('.lightbox-nav', plugin.lightbox).show(); |
| + | } else { |
| + | $('.lightbox-nav', plugin.lightbox).hide(); |
| + | } |
| + | |
| + | plugin.bindEvents(); |
| + | |
| + | }, |
| + | |
| + | loadImage: function () { |
| + | if(opts.blur) { |
| + | $("body").addClass("blurred"); |
| + | } |
| + | $("img", plugin.lightbox).remove(); |
| + | plugin.lightbox.fadeIn('fast').append('<span class="lightbox-loading"></span>'); |
| + | |
| + | var img = $('<img src="' + $(plugin.current).attr('href') + '" draggable="false">'); |
| + | |
| + | $(img).load(function () { |
| + | $('.lightbox-loading').remove(); |
| + | plugin.lightbox.append(img); |
| + | plugin.image = $("img", plugin.lightbox).hide(); |
| + | plugin.resizeImage(); |
| + | plugin.setCaption(); |
| + | }); |
| + | }, |
| + | |
| + | setCaption: function () { |
| + | var caption = $(plugin.current).data('caption'); |
| + | if(!!caption && caption.length > 0) { |
| + | plugin.caption.fadeIn(); |
| + | $('p', plugin.caption).text(caption); |
| + | }else{ |
| + | plugin.caption.hide(); |
| + | } |
| + | }, |
| + | |
| + | resizeImage: function () { |
| + | var ratio, wHeight, wWidth, iHeight, iWidth; |
| + | wHeight = $(window).height() - opts.margin; |
| + | wWidth = $(window).outerWidth(true) - opts.margin; |
| + | plugin.image.width('').height(''); |
| + | iHeight = plugin.image.height(); |
| + | iWidth = plugin.image.width(); |
| + | if (iWidth > wWidth) { |
| + | ratio = wWidth / iWidth; |
| + | iWidth = wWidth; |
| + | iHeight = Math.round(iHeight * ratio); |
| + | } |
| + | if (iHeight > wHeight) { |
| + | ratio = wHeight / iHeight; |
| + | iHeight = wHeight; |
| + | iWidth = Math.round(iWidth * ratio); |
| + | } |
| + | |
| + | plugin.image.width(iWidth).height(iHeight).css({ |
| + | 'top': ($(window).height() - plugin.image.outerHeight()) / 2 + 'px', |
| + | 'left': ($(window).width() - plugin.image.outerWidth()) / 2 + 'px' |
| + | }).show(); |
| + | plugin.locked = false; |
| + | }, |
| + | |
| + | getCurrentIndex: function () { |
| + | return $.inArray(plugin.current, plugin.items); |
| + | }, |
| + | |
| + | next: function () { |
| + | if (plugin.locked) { |
| + | return false; |
| + | } |
| + | plugin.locked = true; |
| + | if (plugin.getCurrentIndex() >= plugin.items.length - 1) { |
| + | $(plugin.items[0]).click(); |
| + | } else { |
| + | $(plugin.items[plugin.getCurrentIndex() + 1]).click(); |
| + | } |
| + | }, |
| + | |
| + | previous: function () { |
| + | if (plugin.locked) { |
| + | return false; |
| + | } |
| + | plugin.locked = true; |
| + | if (plugin.getCurrentIndex() <= 0) { |
| + | $(plugin.items[plugin.items.length - 1]).click(); |
| + | } else { |
| + | $(plugin.items[plugin.getCurrentIndex() - 1]).click(); |
| + | } |
| + | }, |
| + | |
| + | bindEvents: function () { |
| + | $(plugin.items).click(function (e) { |
| + | if(!$("#lightbox").is(":visible") && ($(window).width() < opts.minSize || $(window).height() < opts.minSize)) { |
| + | $(this).attr("target", "_blank"); |
| + | return; |
| + | } |
| + | var self = $(this)[0]; |
| + | e.preventDefault(); |
| + | plugin.current = self; |
| + | plugin.loadImage(); |
| + | |
| + | // Bind Keyboard Shortcuts |
| + | $(document).on('keydown', function (e) { |
| + | // Close lightbox with ESC |
| + | if (e.keyCode === 27) { |
| + | plugin.close(); |
| + | } |
| + | // Go to next image pressing the right key |
| + | if (e.keyCode === 39) { |
| + | plugin.next(); |
| + | } |
| + | // Go to previous image pressing the left key |
| + | if (e.keyCode === 37) { |
| + | plugin.previous(); |
| + | } |
| + | }); |
| + | }); |
| + | |
| + | // Add click state on overlay background only |
| + | plugin.lightbox.on('click', function (e) { |
| + | if (this === e.target) { |
| + | plugin.close(); |
| + | } |
| + | }); |
| + | |
| + | // Previous click |
| + | $(plugin.lightbox).on('click', '.lightbox-previous', function () { |
| + | plugin.previous(); |
| + | return false; |
| + | }); |
| + | |
| + | // Next click |
| + | $(plugin.lightbox).on('click', '.lightbox-next', function () { |
| + | plugin.next(); |
| + | return false; |
| + | }); |
| + | |
| + | // Close click |
| + | $(plugin.lightbox).on('click', '.lightbox-close', function () { |
| + | plugin.close(); |
| + | return false; |
| + | }); |
| + | |
| + | $(window).resize(function () { |
| + | if (!plugin.image) { |
| + | return; |
| + | } |
| + | plugin.resizeImage(); |
| + | }); |
| + | }, |
| + | |
| + | close: function () { |
| + | $(document).off('keydown'); // Unbind all key events each time the lightbox is closed |
| + | $(plugin.lightbox).fadeOut('fast'); |
| + | $('body').removeClass('blurred'); |
| + | } |
| + | }; |
| + | |
| + | $.extend(opts, options); |
| + | |
| + | plugin.init(this); |
| + | }; |
| + | |
| + | })(jQuery);!function(e){"use strict";var t=function(){var t={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},i=function(){var t=/iPhone|iPad|iPod/i.test(navigator.userAgent);return t&&e(window).load(function(){e("body").children().on("click",e.noop)}),t}(),n=function(){var e=document.documentElement.style;return"behavior"in e&&"fill"in e&&/iemobile/i.test(navigator.userAgent)}(),s=function(e,i){var n=t.menuClass;i.cssArrows&&(n+=" "+t.menuArrowClass),e.toggleClass(n)},o=function(i,n){return i.find("li."+n.pathClass).slice(0,n.pathLevels).addClass(n.hoverClass+" "+t.bcClass).filter(function(){return e(this).children(n.popUpSelector).hide().show().length}).removeClass(n.pathClass)},a=function(e){e.children("a").toggleClass(t.anchorClass)},r=function(e){var t=e.css("ms-touch-action");t="pan-y"===t?"auto":"pan-y",e.css("ms-touch-action",t)},l=function(t,s){var o="li:has("+s.popUpSelector+")";e.fn.hoverIntent&&!s.disableHI?t.hoverIntent(c,p,o):t.on("mouseenter.superfish",o,c).on("mouseleave.superfish",o,p);var a="MSPointerDown.superfish";i||(a+=" touchend.superfish"),n&&(a+=" mousedown.superfish"),t.on("focusin.superfish","li",c).on("focusout.superfish","li",p).on(a,"a",s,d)},d=function(t){var i=e(this),n=i.siblings(t.data.popUpSelector);n.length>0&&n.is(":hidden")&&(i.one("click.superfish",!1),"MSPointerDown"===t.type?i.trigger("focus"):e.proxy(c,i.parent("li"))())},c=function(){var t=e(this),i=f(t);clearTimeout(i.sfTimer),t.siblings().superfish("hide").end().superfish("show")},p=function(){var t=e(this),n=f(t);i?e.proxy(u,t,n)():(clearTimeout(n.sfTimer),n.sfTimer=setTimeout(e.proxy(u,t,n),n.delay))},u=function(t){t.retainPath=e.inArray(this[0],t.$path)>-1,this.superfish("hide"),this.parents("."+t.hoverClass).length||(t.onIdle.call(h(this)),t.$path.length&&e.proxy(c,t.$path)())},h=function(e){return e.closest("."+t.menuClass)},f=function(e){return h(e).data("sf-options")};return{hide:function(t){if(this.length){var i=this,n=f(i);if(!n)return this;var s=n.retainPath===!0?n.$path:"",o=i.find("li."+n.hoverClass).add(this).not(s).removeClass(n.hoverClass).children(n.popUpSelector),a=n.speedOut;t&&(o.show(),a=0),n.retainPath=!1,n.onBeforeHide.call(o),o.stop(!0,!0).animate(n.animationOut,a,function(){var t=e(this);n.onHide.call(t)})}return this},show:function(){var e=f(this);if(!e)return this;var t=this.addClass(e.hoverClass),i=t.children(e.popUpSelector);return e.onBeforeShow.call(i),i.stop(!0,!0).animate(e.animation,e.speed,function(){e.onShow.call(i)}),this},destroy:function(){return this.each(function(){var i,n=e(this),o=n.data("sf-options");return o?(i=n.find(o.popUpSelector).parent("li"),clearTimeout(o.sfTimer),s(n,o),a(i),r(n),n.off(".superfish").off(".hoverIntent"),i.children(o.popUpSelector).attr("style",function(e,t){return t.replace(/display[^;]+;?/g,"")}),o.$path.removeClass(o.hoverClass+" "+t.bcClass).addClass(o.pathClass),n.find("."+o.hoverClass).removeClass(o.hoverClass),o.onDestroy.call(n),n.removeData("sf-options"),void 0):!1})},init:function(i){return this.each(function(){var n=e(this);if(n.data("sf-options"))return!1;var d=e.extend({},e.fn.superfish.defaults,i),c=n.find(d.popUpSelector).parent("li");d.$path=o(n,d),n.data("sf-options",d),s(n,d),a(c),r(n),l(n,d),c.not("."+t.bcClass).superfish("hide",!0),d.onInit.call(this)})}}}();e.fn.superfish=function(i){return t[i]?t[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?e.error("Method "+i+" does not exist on jQuery.fn.superfish"):t.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop},e.fn.extend({hideSuperfishUl:t.hide,showSuperfishUl:t.show})}(jQuery);var Swiper=function(e,t){"use strict";function i(e,t){return document.querySelectorAll?(t||document).querySelectorAll(e):jQuery(e,t)}function n(e){return"[object Array]"===Object.prototype.toString.apply(e)?!0:!1}function s(){var e=A-D;return t.freeMode&&(e=A-D),t.slidesPerView>_.slides.length&&!t.centeredSlides&&(e=0),0>e&&(e=0),e}function o(){function e(e){var i=new Image;i.onload=function(){_&&void 0!==_.imagesLoaded&&_.imagesLoaded++,_.imagesLoaded===_.imagesToLoad.length&&(_.reInit(),t.onImagesReady&&_.fireCallback(t.onImagesReady,_))},i.src=e}var n=_.h.addEventListener,s="wrapper"===t.eventTarget?_.wrapper:_.container;if(_.browser.ie10||_.browser.ie11?(n(s,_.touchEvents.touchStart,g),n(document,_.touchEvents.touchMove,m),n(document,_.touchEvents.touchEnd,v)):(_.support.touch&&(n(s,"touchstart",g),n(s,"touchmove",m),n(s,"touchend",v)),t.simulateTouch&&(n(s,"mousedown",g),n(document,"mousemove",m),n(document,"mouseup",v))),t.autoResize&&n(window,"resize",_.resizeFix),a(),_._wheelEvent=!1,t.mousewheelControl){if(void 0!==document.onmousewheel&&(_._wheelEvent="mousewheel"),!_._wheelEvent)try{new WheelEvent("wheel"),_._wheelEvent="wheel"}catch(o){}_._wheelEvent||(_._wheelEvent="DOMMouseScroll"),_._wheelEvent&&n(_.container,_._wheelEvent,d)}if(t.keyboardControl&&n(document,"keydown",l),t.updateOnImagesReady){_.imagesToLoad=i("img",_.container);for(var r=0;r<_.imagesToLoad.length;r++)e(_.imagesToLoad[r].getAttribute("src"))}}function a(){var e,n=_.h.addEventListener;if(t.preventLinks){var s=i("a",_.container);for(e=0;e<s.length;e++)n(s[e],"click",h)}if(t.releaseFormElements){var o=i("input, textarea, select",_.container);for(e=0;e<o.length;e++)n(o[e],_.touchEvents.touchStart,f,!0)}if(t.onSlideClick)for(e=0;e<_.slides.length;e++)n(_.slides[e],"click",c);if(t.onSlideTouch)for(e=0;e<_.slides.length;e++)n(_.slides[e],_.touchEvents.touchStart,p)}function r(){var e,n=_.h.removeEventListener;if(t.onSlideClick)for(e=0;e<_.slides.length;e++)n(_.slides[e],"click",c);if(t.onSlideTouch)for(e=0;e<_.slides.length;e++)n(_.slides[e],_.touchEvents.touchStart,p);if(t.releaseFormElements){var s=i("input, textarea, select",_.container);for(e=0;e<s.length;e++)n(s[e],_.touchEvents.touchStart,f,!0)}if(t.preventLinks){var o=i("a",_.container);for(e=0;e<o.length;e++)n(o[e],"click",h)}}function l(e){var t=e.keyCode||e.charCode;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)){if(37===t||39===t||38===t||40===t){for(var i=!1,n=_.h.getOffset(_.container),s=_.h.windowScroll().left,o=_.h.windowScroll().top,a=_.h.windowWidth(),r=_.h.windowHeight(),l=[[n.left,n.top],[n.left+_.width,n.top],[n.left,n.top+_.height],[n.left+_.width,n.top+_.height]],d=0;d<l.length;d++){var c=l[d];c[0]>=s&&c[0]<=s+a&&c[1]>=o&&c[1]<=o+r&&(i=!0)}if(!i)return}W?((37===t||39===t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),39===t&&_.swipeNext(),37===t&&_.swipePrev()):((38===t||40===t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),40===t&&_.swipeNext(),38===t&&_.swipePrev())}}function d(e){var i=_._wheelEvent,n=0;if(e.detail)n=-e.detail;else if("mousewheel"===i)if(t.mousewheelControlForceToAxis)if(W){if(!(Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)))return;n=e.wheelDeltaX}else{if(!(Math.abs(e.wheelDeltaY)>Math.abs(e.wheelDeltaX)))return;n=e.wheelDeltaY}else n=e.wheelDelta;else if("DOMMouseScroll"===i)n=-e.detail;else if("wheel"===i)if(t.mousewheelControlForceToAxis)if(W){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY)))return;n=-e.deltaX}else{if(!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;n=-e.deltaY}else n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-e.deltaX:-e.deltaY;if(t.freeMode){var o=_.getWrapperTranslate()+n;if(o>0&&(o=0),o<-s()&&(o=-s()),_.setWrapperTransition(0),_.setWrapperTranslate(o),_.updateActiveSlide(o),0===o||o===-s())return}else(new Date).getTime()-Y>60&&(0>n?_.swipeNext():_.swipePrev()),Y=(new Date).getTime();return t.autoplay&&_.stopAutoplay(!0),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}function c(e){_.allowSlideClick&&(u(e),_.fireCallback(t.onSlideClick,_,e))}function p(e){u(e),_.fireCallback(t.onSlideTouch,_,e)}function u(e){if(e.currentTarget)_.clickedSlide=e.currentTarget;else{var i=e.srcElement;do{if(i.className.indexOf(t.slideClass)>-1)break;i=i.parentNode}while(i);_.clickedSlide=i}_.clickedSlideIndex=_.slides.indexOf(_.clickedSlide),_.clickedSlideLoopIndex=_.clickedSlideIndex-(_.loopedSlides||0)}function h(e){return _.allowLinks?void 0:(e.preventDefault?e.preventDefault():e.returnValue=!1,t.preventLinksPropagation&&"stopPropagation"in e&&e.stopPropagation(),!1)}function f(e){return e.stopPropagation?e.stopPropagation():e.returnValue=!1,!1}function g(e){if(t.preventLinks&&(_.allowLinks=!0),_.isTouched||t.onlyExternal)return!1;if(t.noSwiping&&(e.target||e.srcElement)&&y(e.target||e.srcElement))return!1;if(Z=!1,_.isTouched=!0,K="touchstart"===e.type,!K||1===e.targetTouches.length){_.callPlugins("onTouchStartBegin"),K||_.isAndroid||(e.preventDefault?e.preventDefault():e.returnValue=!1);var i=K?e.targetTouches[0].pageX:e.pageX||e.clientX,n=K?e.targetTouches[0].pageY:e.pageY||e.clientY;_.touches.startX=_.touches.currentX=i,_.touches.startY=_.touches.currentY=n,_.touches.start=_.touches.current=W?i:n,_.setWrapperTransition(0),_.positions.start=_.positions.current=_.getWrapperTranslate(),_.setWrapperTranslate(_.positions.start),_.times.start=(new Date).getTime(),I=void 0,t.moveStartThreshold>0&&(q=!1),t.onTouchStart&&_.fireCallback(t.onTouchStart,_,e),_.callPlugins("onTouchStartEnd")}}function m(e){if(_.isTouched&&!t.onlyExternal&&(!K||"mousemove"!==e.type)){var i=K?e.targetTouches[0].pageX:e.pageX||e.clientX,n=K?e.targetTouches[0].pageY:e.pageY||e.clientY;if("undefined"==typeof I&&W&&(I=!!(I||Math.abs(n-_.touches.startY)>Math.abs(i-_.touches.startX))),"undefined"!=typeof I||W||(I=!!(I||Math.abs(n-_.touches.startY)<Math.abs(i-_.touches.startX))),I)return _.isTouched=!1,void 0;if(e.assignedToSwiper)return _.isTouched=!1,void 0;if(e.assignedToSwiper=!0,t.preventLinks&&(_.allowLinks=!1),t.onSlideClick&&(_.allowSlideClick=!1),t.autoplay&&_.stopAutoplay(!0),!K||1===e.touches.length){if(_.isMoved||(_.callPlugins("onTouchMoveStart"),t.loop&&(_.fixLoop(),_.positions.start=_.getWrapperTranslate()),t.onTouchMoveStart&&_.fireCallback(t.onTouchMoveStart,_)),_.isMoved=!0,e.preventDefault?e.preventDefault():e.returnValue=!1,_.touches.current=W?i:n,_.positions.current=(_.touches.current-_.touches.start)*t.touchRatio+_.positions.start,_.positions.current>0&&t.onResistanceBefore&&_.fireCallback(t.onResistanceBefore,_,_.positions.current),_.positions.current<-s()&&t.onResistanceAfter&&_.fireCallback(t.onResistanceAfter,_,Math.abs(_.positions.current+s())),t.resistance&&"100%"!==t.resistance){var o;if(_.positions.current>0&&(o=1-_.positions.current/D/2,_.positions.current=.5>o?D/2:_.positions.current*o),_.positions.current<-s()){var a=(_.touches.current-_.touches.start)*t.touchRatio+(s()+_.positions.start);o=(D+a)/D;var r=_.positions.current-a*(1-o)/2,l=-s()-D/2;_.positions.current=l>r||0>=o?l:r}}if(t.resistance&&"100%"===t.resistance&&(_.positions.current>0&&(!t.freeMode||t.freeModeFluid)&&(_.positions.current=0),_.positions.current<-s()&&(!t.freeMode||t.freeModeFluid)&&(_.positions.current=-s())),!t.followFinger)return;if(t.moveStartThreshold)if(Math.abs(_.touches.current-_.touches.start)>t.moveStartThreshold||q){if(!q)return q=!0,_.touches.start=_.touches.current,void 0;_.setWrapperTranslate(_.positions.current)}else _.positions.current=_.positions.start;else _.setWrapperTranslate(_.positions.current);return(t.freeMode||t.watchActiveIndex)&&_.updateActiveSlide(_.positions.current),t.grabCursor&&(_.container.style.cursor="move",_.container.style.cursor="grabbing",_.container.style.cursor="-moz-grabbin",_.container.style.cursor="-webkit-grabbing"),Q||(Q=_.touches.current),U||(U=(new Date).getTime()),_.velocity=(_.touches.current-Q)/((new Date).getTime()-U)/2,Math.abs(_.touches.current-Q)<2&&(_.velocity=0),Q=_.touches.current,U=(new Date).getTime(),_.callPlugins("onTouchMoveEnd"),t.onTouchMove&&_.fireCallback(t.onTouchMove,_,e),!1}}}function v(e){if(I&&_.swipeReset(),!t.onlyExternal&&_.isTouched){_.isTouched=!1,t.grabCursor&&(_.container.style.cursor="move",_.container.style.cursor="grab",_.container.style.cursor="-moz-grab",_.container.style.cursor="-webkit-grab"),_.positions.current||0===_.positions.current||(_.positions.current=_.positions.start),t.followFinger&&_.setWrapperTranslate(_.positions.current),_.times.end=(new Date).getTime(),_.touches.diff=_.touches.current-_.touches.start,_.touches.abs=Math.abs(_.touches.diff),_.positions.diff=_.positions.current-_.positions.start,_.positions.abs=Math.abs(_.positions.diff);var i=_.positions.diff,n=_.positions.abs,o=_.times.end-_.times.start;5>n&&300>o&&_.allowLinks===!1&&(t.freeMode||0===n||_.swipeReset(),t.preventLinks&&(_.allowLinks=!0),t.onSlideClick&&(_.allowSlideClick=!0)),setTimeout(function(){t.preventLinks&&(_.allowLinks=!0),t.onSlideClick&&(_.allowSlideClick=!0)},100);var a=s();if(!_.isMoved&&t.freeMode)return _.isMoved=!1,t.onTouchEnd&&_.fireCallback(t.onTouchEnd,_,e),_.callPlugins("onTouchEnd"),void 0;if(!_.isMoved||_.positions.current>0||_.positions.current<-a)return _.swipeReset(),t.onTouchEnd&&_.fireCallback(t.onTouchEnd,_,e),_.callPlugins("onTouchEnd"),void 0;if(_.isMoved=!1,t.freeMode){if(t.freeModeFluid){var r,l=1e3*t.momentumRatio,d=_.velocity*l,c=_.positions.current+d,p=!1,u=20*Math.abs(_.velocity)*t.momentumBounceRatio;-a>c&&(t.momentumBounce&&_.support.transitions?(-u>c+a&&(c=-a-u),r=-a,p=!0,Z=!0):c=-a),c>0&&(t.momentumBounce&&_.support.transitions?(c>u&&(c=u),r=0,p=!0,Z=!0):c=0),0!==_.velocity&&(l=Math.abs((c-_.positions.current)/_.velocity)),_.setWrapperTranslate(c),_.setWrapperTransition(l),t.momentumBounce&&p&&_.wrapperTransitionEnd(function(){Z&&(t.onMomentumBounce&&_.fireCallback(t.onMomentumBounce,_),_.callPlugins("onMomentumBounce"),_.setWrapperTranslate(r),_.setWrapperTransition(300))}),_.updateActiveSlide(c)}return(!t.freeModeFluid||o>=300)&&_.updateActiveSlide(_.positions.current),t.onTouchEnd&&_.fireCallback(t.onTouchEnd,_,e),_.callPlugins("onTouchEnd"),void 0}O=0>i?"toNext":"toPrev","toNext"===O&&300>=o&&(30>n||!t.shortSwipes?_.swipeReset():_.swipeNext(!0)),"toPrev"===O&&300>=o&&(30>n||!t.shortSwipes?_.swipeReset():_.swipePrev(!0));var h=0;if("auto"===t.slidesPerView){for(var f,g=Math.abs(_.getWrapperTranslate()),m=0,v=0;v<_.slides.length;v++)if(f=W?_.slides[v].getWidth(!0,t.roundLengths):_.slides[v].getHeight(!0,t.roundLengths),m+=f,m>g){h=f;break}h>D&&(h=D)}else h=P*t.slidesPerView;"toNext"===O&&o>300&&(n>=h*t.longSwipesRatio?_.swipeNext(!0):_.swipeReset()),"toPrev"===O&&o>300&&(n>=h*t.longSwipesRatio?_.swipePrev(!0):_.swipeReset()),t.onTouchEnd&&_.fireCallback(t.onTouchEnd,_,e),_.callPlugins("onTouchEnd")}}function y(e){var i=!1;do e.className.indexOf(t.noSwipingClass)>-1&&(i=!0),e=e.parentElement;while(!i&&e.parentElement&&-1===e.className.indexOf(t.wrapperClass));return!i&&e.className.indexOf(t.wrapperClass)>-1&&e.className.indexOf(t.noSwipingClass)>-1&&(i=!0),i}function w(e,t){var i,n=document.createElement("div");return n.innerHTML=t,i=n.firstChild,i.className+=" "+e,i.outerHTML}function x(e,i,n){function s(){var o=+new Date,p=o-a;r+=l*p/(1e3/60),c="toNext"===d?r>e:e>r,c?(_.setWrapperTranslate(Math.round(r)),_._DOMAnimating=!0,window.setTimeout(function(){s()},1e3/60)):(t.onSlideChangeEnd&&("to"===i?n.runCallbacks===!0&&_.fireCallback(t.onSlideChangeEnd,_):_.fireCallback(t.onSlideChangeEnd,_)),_.setWrapperTranslate(e),_._DOMAnimating=!1)}var o="to"===i&&n.speed>=0?n.speed:t.speed,a=+new Date;if(_.support.transitions||!t.DOMAnimation)_.setWrapperTranslate(e),_.setWrapperTransition(o);else{var r=_.getWrapperTranslate(),l=Math.ceil((e-r)/o*(1e3/60)),d=r>e?"toNext":"toPrev",c="toNext"===d?r>e:e>r;if(_._DOMAnimating)return;s()}_.updateActiveSlide(e),t.onSlideNext&&"next"===i&&_.fireCallback(t.onSlideNext,_,e),t.onSlidePrev&&"prev"===i&&_.fireCallback(t.onSlidePrev,_,e),t.onSlideReset&&"reset"===i&&_.fireCallback(t.onSlideReset,_,e),("next"===i||"prev"===i||"to"===i&&n.runCallbacks===!0)&&b(i)}function b(e){if(_.callPlugins("onSlideChangeStart"),t.onSlideChangeStart)if(t.queueStartCallbacks&&_.support.transitions){if(_._queueStartCallbacks)return;_._queueStartCallbacks=!0,_.fireCallback(t.onSlideChangeStart,_,e),_.wrapperTransitionEnd(function(){_._queueStartCallbacks=!1})}else _.fireCallback(t.onSlideChangeStart,_,e);if(t.onSlideChangeEnd)if(_.support.transitions)if(t.queueEndCallbacks){if(_._queueEndCallbacks)return;_._queueEndCallbacks=!0,_.wrapperTransitionEnd(function(i){_.fireCallback(t.onSlideChangeEnd,i,e)})}else _.wrapperTransitionEnd(function(i){_.fireCallback(t.onSlideChangeEnd,i,e)});else t.DOMAnimation||setTimeout(function(){_.fireCallback(t.onSlideChangeEnd,_,e)},10)}function S(){var e=_.paginationButtons;if(e)for(var t=0;t<e.length;t++)_.h.removeEventListener(e[t],"click",T)}function C(){var e=_.paginationButtons;if(e)for(var t=0;t<e.length;t++)_.h.addEventListener(e[t],"click",T)}function T(e){for(var t,i=e.target||e.srcElement,n=_.paginationButtons,s=0;s<n.length;s++)i===n[s]&&(t=s);_.swipeTo(t)}function k(){J=setTimeout(function(){t.loop?(_.fixLoop(),_.swipeNext(!0)):_.swipeNext(!0)||(t.autoplayStopOnLast?(clearTimeout(J),J=void 0):_.swipeTo(0)),_.wrapperTransitionEnd(function(){"undefined"!=typeof J&&k()})},t.autoplay)}function M(){_.calcSlides(),t.loader.slides.length>0&&0===_.slides.length&&_.loadSlides(),t.loop&&_.createLoop(),_.init(),o(),t.pagination&&_.createPagination(!0),t.loop||t.initialSlide>0?_.swipeTo(t.initialSlide,0,!1):_.updateActiveSlide(0),t.autoplay&&_.startAutoplay(),_.centerIndex=_.activeIndex,t.onSwiperCreated&&_.fireCallback(t.onSwiperCreated,_),_.callPlugins("onSwiperCreated")}if(document.body.__defineGetter__&&HTMLElement){var L=HTMLElement.prototype;L.__defineGetter__&&L.__defineGetter__("outerHTML",function(){return(new XMLSerializer).serializeToString(this)})}if(window.getComputedStyle||(window.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var i=t||0,n=this.length;n>i;i++)if(this[i]===e)return i;return-1}),(document.querySelectorAll||window.jQuery)&&"undefined"!=typeof e&&(e.nodeType||0!==i(e).length)){var _=this;_.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0},_.positions={start:0,abs:0,diff:0,current:0},_.times={start:0,end:0},_.id=(new Date).getTime(),_.container=e.nodeType?e:i(e)[0],_.isTouched=!1,_.isMoved=!1,_.activeIndex=0,_.centerIndex=0,_.activeLoaderIndex=0,_.activeLoopIndex=0,_.previousIndex=null,_.velocity=0,_.snapGrid=[],_.slidesGrid=[],_.imagesToLoad=[],_.imagesLoaded=0,_.wrapperLeft=0,_.wrapperRight=0,_.wrapperTop=0,_.wrapperBottom=0,_.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>=0;var E,P,A,O,I,D,z={eventTarget:"wrapper",mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,slidesPerViewFit:!0,simulateTouch:!0,followFinger:!0,shortSwipes:!0,longSwipesRatio:.5,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,preventLinksPropagation:!1,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,mousewheelControlForceToAxis:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,loop:!1,loopAdditionalSlides:0,roundLengths:!1,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};t=t||{};for(var H in z)if(H in t&&"object"==typeof t[H])for(var R in z[H])R in t[H]||(t[H][R]=z[H][R]);else H in t||(t[H]=z[H]);_.params=t,t.scrollContainer&&(t.freeMode=!0,t.freeModeFluid=!0),t.loop&&(t.resistance="100%");var W="horizontal"===t.mode,j=["mousedown","mousemove","mouseup"];_.browser.ie10&&(j=["MSPointerDown","MSPointerMove","MSPointerUp"]),_.browser.ie11&&(j=["pointerdown","pointermove","pointerup"]),_.touchEvents={touchStart:_.support.touch||!t.simulateTouch?"touchstart":j[0],touchMove:_.support.touch||!t.simulateTouch?"touchmove":j[1],touchEnd:_.support.touch||!t.simulateTouch?"touchend":j[2]};for(var B=_.container.childNodes.length-1;B>=0;B--)if(_.container.childNodes[B].className)for(var G=_.container.childNodes[B].className.split(/\s+/),F=0;F<G.length;F++)G[F]===t.wrapperClass&&(E=_.container.childNodes[B]);_.wrapper=E,_._extendSwiperSlide=function(e){return e.append=function(){return t.loop?e.insertAfter(_.slides.length-_.loopedSlides):(_.wrapper.appendChild(e),_.reInit()),e},e.prepend=function(){return t.loop?(_.wrapper.insertBefore(e,_.slides[_.loopedSlides]),_.removeLoopedSlides(),_.calcSlides(),_.createLoop()):_.wrapper.insertBefore(e,_.wrapper.firstChild),_.reInit(),e},e.insertAfter=function(i){if("undefined"==typeof i)return!1;var n;return t.loop?(n=_.slides[i+1+_.loopedSlides],n?_.wrapper.insertBefore(e,n):_.wrapper.appendChild(e),_.removeLoopedSlides(),_.calcSlides(),_.createLoop()):(n=_.slides[i+1],_.wrapper.insertBefore(e,n)),_.reInit(),e},e.clone=function(){return _._extendSwiperSlide(e.cloneNode(!0))},e.remove=function(){_.wrapper.removeChild(e),_.reInit()},e.html=function(t){return"undefined"==typeof t?e.innerHTML:(e.innerHTML=t,e)},e.index=function(){for(var t,i=_.slides.length-1;i>=0;i--)e===_.slides[i]&&(t=i);return t},e.isActive=function(){return e.index()===_.activeIndex?!0:!1},e.swiperSlideDataStorage||(e.swiperSlideDataStorage={}),e.getData=function(t){return e.swiperSlideDataStorage[t]},e.setData=function(t,i){return e.swiperSlideDataStorage[t]=i,e},e.data=function(t,i){return"undefined"==typeof i?e.getAttribute("data-"+t):(e.setAttribute("data-"+t,i),e)},e.getWidth=function(t,i){return _.h.getWidth(e,t,i)},e.getHeight=function(t,i){return _.h.getHeight(e,t,i)},e.getOffset=function(){return _.h.getOffset(e)},e},_.calcSlides=function(e){var i=_.slides?_.slides.length:!1;_.slides=[],_.displaySlides=[];for(var n=0;n<_.wrapper.childNodes.length;n++)if(_.wrapper.childNodes[n].className)for(var s=_.wrapper.childNodes[n].className,o=s.split(/\s+/),l=0;l<o.length;l++)o[l]===t.slideClass&&_.slides.push(_.wrapper.childNodes[n]);for(n=_.slides.length-1;n>=0;n--)_._extendSwiperSlide(_.slides[n]);i!==!1&&(i!==_.slides.length||e)&&(r(),a(),_.updateActiveSlide(),_.params.pagination&&_.createPagination(),_.callPlugins("numberOfSlidesChanged"))},_.createSlide=function(e,i,n){i=i||_.params.slideClass,n=n||t.slideElement;var s=document.createElement(n);return s.innerHTML=e||"",s.className=i,_._extendSwiperSlide(s)},_.appendSlide=function(e,t,i){return e?e.nodeType?_._extendSwiperSlide(e).append():_.createSlide(e,t,i).append():void 0},_.prependSlide=function(e,t,i){return e?e.nodeType?_._extendSwiperSlide(e).prepend():_.createSlide(e,t,i).prepend():void 0},_.insertSlideAfter=function(e,t,i,n){return"undefined"==typeof e?!1:t.nodeType?_._extendSwiperSlide(t).insertAfter(e):_.createSlide(t,i,n).insertAfter(e)},_.removeSlide=function(e){if(_.slides[e]){if(t.loop){if(!_.slides[e+_.loopedSlides])return!1;_.slides[e+_.loopedSlides].remove(),_.removeLoopedSlides(),_.calcSlides(),_.createLoop()}else _.slides[e].remove();return!0}return!1},_.removeLastSlide=function(){return _.slides.length>0?(t.loop?(_.slides[_.slides.length-1-_.loopedSlides].remove(),_.removeLoopedSlides(),_.calcSlides(),_.createLoop()):_.slides[_.slides.length-1].remove(),!0):!1},_.removeAllSlides=function(){for(var e=_.slides.length-1;e>=0;e--)_.slides[e].remove()},_.getSlide=function(e){return _.slides[e]},_.getLastSlide=function(){return _.slides[_.slides.length-1]},_.getFirstSlide=function(){return _.slides[0]},_.activeSlide=function(){return _.slides[_.activeIndex]},_.fireCallback=function(){var e=arguments[0];if("[object Array]"===Object.prototype.toString.call(e))for(var i=0;i<e.length;i++)"function"==typeof e[i]&&e[i](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);else"[object String]"===Object.prototype.toString.call(e)?t["on"+e]&&_.fireCallback(t["on"+e]):e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},_.addCallback=function(e,t){var i,s=this;return s.params["on"+e]?n(this.params["on"+e])?this.params["on"+e].push(t):"function"==typeof this.params["on"+e]?(i=this.params["on"+e],this.params["on"+e]=[],this.params["on"+e].push(i),this.params["on"+e].push(t)):void 0:(this.params["on"+e]=[],this.params["on"+e].push(t))},_.removeCallbacks=function(e){_.params["on"+e]&&(_.params["on"+e]=null)};var N=[];for(var V in _.plugins)if(t[V]){var X=_.plugins[V](_,t[V]);X&&N.push(X)}_.callPlugins=function(e,t){t||(t={});for(var i=0;i<N.length;i++)e in N[i]&&N[i][e](t)},!_.browser.ie10&&!_.browser.ie11||t.onlyExternal||_.wrapper.classList.add("swiper-wp8-"+(W?"horizontal":"vertical")),t.freeMode&&(_.container.className+=" swiper-free-mode"),_.initialized=!1,_.init=function(e,i){var n=_.h.getWidth(_.container,!1,t.roundLengths),s=_.h.getHeight(_.container,!1,t.roundLengths);if(n!==_.width||s!==_.height||e){_.width=n,_.height=s;var o,a,r,l,d,c,p;D=W?n:s;var u=_.wrapper;if(e&&_.calcSlides(i),"auto"===t.slidesPerView){var h=0,f=0;t.slidesOffset>0&&(u.style.paddingLeft="",u.style.paddingRight="",u.style.paddingTop="",u.style.paddingBottom=""),u.style.width="",u.style.height="",t.offsetPxBefore>0&&(W?_.wrapperLeft=t.offsetPxBefore:_.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(W?_.wrapperRight=t.offsetPxAfter:_.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(W?(_.wrapperLeft=(D-this.slides[0].getWidth(!0,t.roundLengths))/2,_.wrapperRight=(D-_.slides[_.slides.length-1].getWidth(!0,t.roundLengths))/2):(_.wrapperTop=(D-_.slides[0].getHeight(!0,t.roundLengths))/2,_.wrapperBottom=(D-_.slides[_.slides.length-1].getHeight(!0,t.roundLengths))/2)),W?(_.wrapperLeft>=0&&(u.style.paddingLeft=_.wrapperLeft+"px"),_.wrapperRight>=0&&(u.style.paddingRight=_.wrapperRight+"px")):(_.wrapperTop>=0&&(u.style.paddingTop=_.wrapperTop+"px"),_.wrapperBottom>=0&&(u.style.paddingBottom=_.wrapperBottom+"px")),c=0;var g=0;for(_.snapGrid=[],_.slidesGrid=[],r=0,p=0;p<_.slides.length;p++){o=_.slides[p].getWidth(!0,t.roundLengths),a=_.slides[p].getHeight(!0,t.roundLengths),t.calculateHeight&&(r=Math.max(r,a));var m=W?o:a;if(t.centeredSlides){var v=p===_.slides.length-1?0:_.slides[p+1].getWidth(!0,t.roundLengths),y=p===_.slides.length-1?0:_.slides[p+1].getHeight(!0,t.roundLengths),w=W?v:y;if(m>D){if(t.slidesPerViewFit)_.snapGrid.push(c+_.wrapperLeft),_.snapGrid.push(c+m-D+_.wrapperLeft);else for(var x=0;x<=Math.floor(m/(D+_.wrapperLeft));x++)0===x?_.snapGrid.push(c+_.wrapperLeft):_.snapGrid.push(c+_.wrapperLeft+D*x);_.slidesGrid.push(c+_.wrapperLeft)}else _.snapGrid.push(g),_.slidesGrid.push(g);g+=m/2+w/2}else{if(m>D)if(t.slidesPerViewFit)_.snapGrid.push(c),_.snapGrid.push(c+m-D);else if(0!==D)for(var b=0;b<=Math.floor(m/D);b++)_.snapGrid.push(c+D*b);else _.snapGrid.push(c);else _.snapGrid.push(c);_.slidesGrid.push(c)}c+=m,h+=o,f+=a}t.calculateHeight&&(_.height=r),W?(A=h+_.wrapperRight+_.wrapperLeft,u.style.width=h+"px",u.style.height=_.height+"px"):(A=f+_.wrapperTop+_.wrapperBottom,u.style.width=_.width+"px",u.style.height=f+"px")}else if(t.scrollContainer)u.style.width="",u.style.height="",l=_.slides[0].getWidth(!0,t.roundLengths),d=_.slides[0].getHeight(!0,t.roundLengths),A=W?l:d,u.style.width=l+"px",u.style.height=d+"px",P=W?l:d;else{if(t.calculateHeight){for(r=0,d=0,W||(_.container.style.height=""),u.style.height="",p=0;p<_.slides.length;p++)_.slides[p].style.height="",r=Math.max(_.slides[p].getHeight(!0),r),W||(d+=_.slides[p].getHeight(!0));a=r,_.height=a,W?d=a:(D=a,_.container.style.height=D+"px")}else a=W?_.height:_.height/t.slidesPerView,t.roundLengths&&(a=Math.round(a)),d=W?_.height:_.slides.length*a;for(o=W?_.width/t.slidesPerView:_.width,t.roundLengths&&(o=Math.round(o)),l=W?_.slides.length*o:_.width,P=W?o:a,t.offsetSlidesBefore>0&&(W?_.wrapperLeft=P*t.offsetSlidesBefore:_.wrapperTop=P*t.offsetSlidesBefore),t.offsetSlidesAfter>0&&(W?_.wrapperRight=P*t.offsetSlidesAfter:_.wrapperBottom=P*t.offsetSlidesAfter),t.offsetPxBefore>0&&(W?_.wrapperLeft=t.offsetPxBefore:_.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(W?_.wrapperRight=t.offsetPxAfter:_.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(W?(_.wrapperLeft=(D-P)/2,_.wrapperRight=(D-P)/2):(_.wrapperTop=(D-P)/2,_.wrapperBottom=(D-P)/2)),W?(_.wrapperLeft>0&&(u.style.paddingLeft=_.wrapperLeft+"px"),_.wrapperRight>0&&(u.style.paddingRight=_.wrapperRight+"px")):(_.wrapperTop>0&&(u.style.paddingTop=_.wrapperTop+"px"),_.wrapperBottom>0&&(u.style.paddingBottom=_.wrapperBottom+"px")),A=W?l+_.wrapperRight+_.wrapperLeft:d+_.wrapperTop+_.wrapperBottom,t.cssWidthAndHeight||(parseFloat(l)>0&&(u.style.width=l+"px"),parseFloat(d)>0&&(u.style.height=d+"px")),c=0,_.snapGrid=[],_.slidesGrid=[],p=0;p<_.slides.length;p++)_.snapGrid.push(c),_.slidesGrid.push(c),c+=P,t.cssWidthAndHeight||(parseFloat(o)>0&&(_.slides[p].style.width=o+"px"),parseFloat(a)>0&&(_.slides[p].style.height=a+"px"))}_.initialized?(_.callPlugins("onInit"),t.onInit&&_.fireCallback(t.onInit,_)):(_.callPlugins("onFirstInit"),t.onFirstInit&&_.fireCallback(t.onFirstInit,_)),_.initialized=!0}},_.reInit=function(e){_.init(!0,e)},_.resizeFix=function(e){_.callPlugins("beforeResizeFix"),_.init(t.resizeReInit||e),t.freeMode?_.getWrapperTranslate()<-s()&&(_.setWrapperTransition(0),_.setWrapperTranslate(-s())):(_.swipeTo(t.loop?_.activeLoopIndex:_.activeIndex,0,!1),t.autoplay&&(_.support.transitions&&"undefined"!=typeof J?"undefined"!=typeof J&&(clearTimeout(J),J=void 0,_.startAutoplay()):"undefined"!=typeof et&&(clearInterval(et),et=void 0,_.startAutoplay()))),_.callPlugins("afterResizeFix")},_.destroy=function(){var e=_.h.removeEventListener,i="wrapper"===t.eventTarget?_.wrapper:_.container;_.browser.ie10||_.browser.ie11?(e(i,_.touchEvents.touchStart,g),e(document,_.touchEvents.touchMove,m),e(document,_.touchEvents.touchEnd,v)):(_.support.touch&&(e(i,"touchstart",g),e(i,"touchmove",m),e(i,"touchend",v)),t.simulateTouch&&(e(i,"mousedown",g),e(document,"mousemove",m),e(document,"mouseup",v))),t.autoResize&&e(window,"resize",_.resizeFix),r(),t.paginationClickable&&S(),t.mousewheelControl&&_._wheelEvent&&e(_.container,_._wheelEvent,d),t.keyboardControl&&e(document,"keydown",l),t.autoplay&&_.stopAutoplay(),_.callPlugins("onDestroy"),_=null},_.disableKeyboardControl=function(){t.keyboardControl=!1,_.h.removeEventListener(document,"keydown",l)},_.enableKeyboardControl=function(){t.keyboardControl=!0,_.h.addEventListener(document,"keydown",l)};var Y=(new Date).getTime();if(_.disableMousewheelControl=function(){return _._wheelEvent?(t.mousewheelControl=!1,_.h.removeEventListener(_.container,_._wheelEvent,d),!0):!1},_.enableMousewheelControl=function(){return _._wheelEvent?(t.mousewheelControl=!0,_.h.addEventListener(_.container,_._wheelEvent,d),!0):!1},t.grabCursor){var $=_.container.style;$.cursor="move",$.cursor="grab",$.cursor="-moz-grab",$.cursor="-webkit-grab"}_.allowSlideClick=!0,_.allowLinks=!0;var q,Q,U,K=!1,Z=!0;_.swipeNext=function(e){!e&&t.loop&&_.fixLoop(),!e&&t.autoplay&&_.stopAutoplay(!0),_.callPlugins("onSwipeNext"); |
| + | var i=_.getWrapperTranslate(),n=i;if("auto"===t.slidesPerView){for(var o=0;o<_.snapGrid.length;o++)if(-i>=_.snapGrid[o]&&-i<_.snapGrid[o+1]){n=-_.snapGrid[o+1];break}}else{var a=P*t.slidesPerGroup;n=-(Math.floor(Math.abs(i)/Math.floor(a))*a+a)}return n<-s()&&(n=-s()),n===i?!1:(x(n,"next"),!0)},_.swipePrev=function(e){!e&&t.loop&&_.fixLoop(),!e&&t.autoplay&&_.stopAutoplay(!0),_.callPlugins("onSwipePrev");var i,n=Math.ceil(_.getWrapperTranslate());if("auto"===t.slidesPerView){i=0;for(var s=1;s<_.snapGrid.length;s++){if(-n===_.snapGrid[s]){i=-_.snapGrid[s-1];break}if(-n>_.snapGrid[s]&&-n<_.snapGrid[s+1]){i=-_.snapGrid[s];break}}}else{var o=P*t.slidesPerGroup;i=-(Math.ceil(-n/o)-1)*o}return i>0&&(i=0),i===n?!1:(x(i,"prev"),!0)},_.swipeReset=function(){_.callPlugins("onSwipeReset");{var e,i=_.getWrapperTranslate(),n=P*t.slidesPerGroup;-s()}if("auto"===t.slidesPerView){e=0;for(var o=0;o<_.snapGrid.length;o++){if(-i===_.snapGrid[o])return;if(-i>=_.snapGrid[o]&&-i<_.snapGrid[o+1]){e=_.positions.diff>0?-_.snapGrid[o+1]:-_.snapGrid[o];break}}-i>=_.snapGrid[_.snapGrid.length-1]&&(e=-_.snapGrid[_.snapGrid.length-1]),i<=-s()&&(e=-s())}else e=0>i?Math.round(i/n)*n:0;return t.scrollContainer&&(e=0>i?i:0),e<-s()&&(e=-s()),t.scrollContainer&&D>P&&(e=0),e===i?!1:(x(e,"reset"),!0)},_.swipeTo=function(e,i,n){e=parseInt(e,10),_.callPlugins("onSwipeTo",{index:e,speed:i}),t.loop&&(e+=_.loopedSlides);var o=_.getWrapperTranslate();if(!(e>_.slides.length-1||0>e)){var a;return a="auto"===t.slidesPerView?-_.slidesGrid[e]:-e*P,a<-s()&&(a=-s()),a===o?!1:(n=n===!1?!1:!0,x(a,"to",{index:e,speed:i,runCallbacks:n}),!0)}},_._queueStartCallbacks=!1,_._queueEndCallbacks=!1,_.updateActiveSlide=function(e){if(_.initialized&&0!==_.slides.length){_.previousIndex=_.activeIndex,"undefined"==typeof e&&(e=_.getWrapperTranslate()),e>0&&(e=0);var i;if("auto"===t.slidesPerView){if(_.activeIndex=_.slidesGrid.indexOf(-e),_.activeIndex<0){for(i=0;i<_.slidesGrid.length-1&&!(-e>_.slidesGrid[i]&&-e<_.slidesGrid[i+1]);i++);var n=Math.abs(_.slidesGrid[i]+e),s=Math.abs(_.slidesGrid[i+1]+e);_.activeIndex=s>=n?i:i+1}}else _.activeIndex=Math[t.visibilityFullFit?"ceil":"round"](-e/P);if(_.activeIndex===_.slides.length&&(_.activeIndex=_.slides.length-1),_.activeIndex<0&&(_.activeIndex=0),_.slides[_.activeIndex]){if(_.calcVisibleSlides(e),_.support.classList){var o;for(i=0;i<_.slides.length;i++)o=_.slides[i],o.classList.remove(t.slideActiveClass),_.visibleSlides.indexOf(o)>=0?o.classList.add(t.slideVisibleClass):o.classList.remove(t.slideVisibleClass);_.slides[_.activeIndex].classList.add(t.slideActiveClass)}else{var a=new RegExp("\\s*"+t.slideActiveClass),r=new RegExp("\\s*"+t.slideVisibleClass);for(i=0;i<_.slides.length;i++)_.slides[i].className=_.slides[i].className.replace(a,"").replace(r,""),_.visibleSlides.indexOf(_.slides[i])>=0&&(_.slides[i].className+=" "+t.slideVisibleClass);_.slides[_.activeIndex].className+=" "+t.slideActiveClass}if(t.loop){var l=_.loopedSlides;_.activeLoopIndex=_.activeIndex-l,_.activeLoopIndex>=_.slides.length-2*l&&(_.activeLoopIndex=_.slides.length-2*l-_.activeLoopIndex),_.activeLoopIndex<0&&(_.activeLoopIndex=_.slides.length-2*l+_.activeLoopIndex),_.activeLoopIndex<0&&(_.activeLoopIndex=0)}else _.activeLoopIndex=_.activeIndex;t.pagination&&_.updatePagination(e)}}},_.createPagination=function(e){if(t.paginationClickable&&_.paginationButtons&&S(),_.paginationContainer=t.pagination.nodeType?t.pagination:i(t.pagination)[0],t.createPagination){var n="",s=_.slides.length,o=s;t.loop&&(o-=2*_.loopedSlides);for(var a=0;o>a;a++)n+="<"+t.paginationElement+' class="'+t.paginationElementClass+'"></'+t.paginationElement+">";_.paginationContainer.innerHTML=n}_.paginationButtons=i("."+t.paginationElementClass,_.paginationContainer),e||_.updatePagination(),_.callPlugins("onCreatePagination"),t.paginationClickable&&C()},_.updatePagination=function(e){if(t.pagination&&!(_.slides.length<1)){var n=i("."+t.paginationActiveClass,_.paginationContainer);if(n){var s=_.paginationButtons;if(0!==s.length){for(var o=0;o<s.length;o++)s[o].className=t.paginationElementClass;var a=t.loop?_.loopedSlides:0;if(t.paginationAsRange){_.visibleSlides||_.calcVisibleSlides(e);var r,l=[];for(r=0;r<_.visibleSlides.length;r++){var d=_.slides.indexOf(_.visibleSlides[r])-a;t.loop&&0>d&&(d=_.slides.length-2*_.loopedSlides+d),t.loop&&d>=_.slides.length-2*_.loopedSlides&&(d=_.slides.length-2*_.loopedSlides-d,d=Math.abs(d)),l.push(d)}for(r=0;r<l.length;r++)s[l[r]]&&(s[l[r]].className+=" "+t.paginationVisibleClass);t.loop?void 0!==s[_.activeLoopIndex]&&(s[_.activeLoopIndex].className+=" "+t.paginationActiveClass):s[_.activeIndex].className+=" "+t.paginationActiveClass}else t.loop?s[_.activeLoopIndex]&&(s[_.activeLoopIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass):s[_.activeIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass}}}},_.calcVisibleSlides=function(e){var i=[],n=0,s=0,o=0;W&&_.wrapperLeft>0&&(e+=_.wrapperLeft),!W&&_.wrapperTop>0&&(e+=_.wrapperTop);for(var a=0;a<_.slides.length;a++){n+=s,s="auto"===t.slidesPerView?W?_.h.getWidth(_.slides[a],!0,t.roundLengths):_.h.getHeight(_.slides[a],!0,t.roundLengths):P,o=n+s;var r=!1;t.visibilityFullFit?(n>=-e&&-e+D>=o&&(r=!0),-e>=n&&o>=-e+D&&(r=!0)):(o>-e&&-e+D>=o&&(r=!0),n>=-e&&-e+D>n&&(r=!0),-e>n&&o>-e+D&&(r=!0)),r&&i.push(_.slides[a])}0===i.length&&(i=[_.slides[_.activeIndex]]),_.visibleSlides=i};var J,et;_.startAutoplay=function(){if(_.support.transitions){if("undefined"!=typeof J)return!1;if(!t.autoplay)return;_.callPlugins("onAutoplayStart"),t.onAutoplayStart&&_.fireCallback(t.onAutoplayStart,_),k()}else{if("undefined"!=typeof et)return!1;if(!t.autoplay)return;_.callPlugins("onAutoplayStart"),t.onAutoplayStart&&_.fireCallback(t.onAutoplayStart,_),et=setInterval(function(){t.loop?(_.fixLoop(),_.swipeNext(!0)):_.swipeNext(!0)||(t.autoplayStopOnLast?(clearInterval(et),et=void 0):_.swipeTo(0))},t.autoplay)}},_.stopAutoplay=function(e){if(_.support.transitions){if(!J)return;J&&clearTimeout(J),J=void 0,e&&!t.autoplayDisableOnInteraction&&_.wrapperTransitionEnd(function(){k()}),_.callPlugins("onAutoplayStop"),t.onAutoplayStop&&_.fireCallback(t.onAutoplayStop,_)}else et&&clearInterval(et),et=void 0,_.callPlugins("onAutoplayStop"),t.onAutoplayStop&&_.fireCallback(t.onAutoplayStop,_)},_.loopCreated=!1,_.removeLoopedSlides=function(){if(_.loopCreated)for(var e=0;e<_.slides.length;e++)_.slides[e].getData("looped")===!0&&_.wrapper.removeChild(_.slides[e])},_.createLoop=function(){if(0!==_.slides.length){_.loopedSlides="auto"===t.slidesPerView?t.loopedSlides||1:t.slidesPerView+t.loopAdditionalSlides,_.loopedSlides>_.slides.length&&(_.loopedSlides=_.slides.length);var e,i="",n="",s="",o=_.slides.length,a=Math.floor(_.loopedSlides/o),r=_.loopedSlides%o;for(e=0;a*o>e;e++){var l=e;if(e>=o){var d=Math.floor(e/o);l=e-o*d}s+=_.slides[l].outerHTML}for(e=0;r>e;e++)n+=w(t.slideDuplicateClass,_.slides[e].outerHTML);for(e=o-r;o>e;e++)i+=w(t.slideDuplicateClass,_.slides[e].outerHTML);var c=i+s+E.innerHTML+s+n;for(E.innerHTML=c,_.loopCreated=!0,_.calcSlides(),e=0;e<_.slides.length;e++)(e<_.loopedSlides||e>=_.slides.length-_.loopedSlides)&&_.slides[e].setData("looped",!0);_.callPlugins("onCreateLoop")}},_.fixLoop=function(){var e;_.activeIndex<_.loopedSlides?(e=_.slides.length-3*_.loopedSlides+_.activeIndex,_.swipeTo(e,0,!1)):("auto"===t.slidesPerView&&_.activeIndex>=2*_.loopedSlides||_.activeIndex>_.slides.length-2*t.slidesPerView)&&(e=-_.slides.length+_.activeIndex+_.loopedSlides,_.swipeTo(e,0,!1))},_.loadSlides=function(){var e="";_.activeLoaderIndex=0;for(var i=t.loader.slides,n=t.loader.loadAllSlides?i.length:t.slidesPerView*(1+t.loader.surroundGroups),s=0;n>s;s++)e+="outer"===t.loader.slidesHTMLType?i[s]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+s+'">'+i[s]+"</"+t.slideElement+">";_.wrapper.innerHTML=e,_.calcSlides(!0),t.loader.loadAllSlides||_.wrapperTransitionEnd(_.reloadSlides,!0)},_.reloadSlides=function(){var e=t.loader.slides,i=parseInt(_.activeSlide().data("swiperindex"),10);if(!(0>i||i>e.length-1)){_.activeLoaderIndex=i;var n=Math.max(0,i-t.slidesPerView*t.loader.surroundGroups),s=Math.min(i+t.slidesPerView*(1+t.loader.surroundGroups)-1,e.length-1);if(i>0){var o=-P*(i-n);_.setWrapperTranslate(o),_.setWrapperTransition(0)}var a;if("reload"===t.loader.logic){_.wrapper.innerHTML="";var r="";for(a=n;s>=a;a++)r+="outer"===t.loader.slidesHTMLType?e[a]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+a+'">'+e[a]+"</"+t.slideElement+">";_.wrapper.innerHTML=r}else{var l=1e3,d=0;for(a=0;a<_.slides.length;a++){var c=_.slides[a].data("swiperindex");n>c||c>s?_.wrapper.removeChild(_.slides[a]):(l=Math.min(c,l),d=Math.max(c,d))}for(a=n;s>=a;a++){var p;l>a&&(p=document.createElement(t.slideElement),p.className=t.slideClass,p.setAttribute("data-swiperindex",a),p.innerHTML=e[a],_.wrapper.insertBefore(p,_.wrapper.firstChild)),a>d&&(p=document.createElement(t.slideElement),p.className=t.slideClass,p.setAttribute("data-swiperindex",a),p.innerHTML=e[a],_.wrapper.appendChild(p))}}_.reInit(!0)}},M()}};Swiper.prototype={plugins:{},wrapperTransitionEnd:function(e,t){"use strict";function i(){if(e(s),s.params.queueEndCallbacks&&(s._queueEndCallbacks=!1),!t)for(n=0;n<a.length;n++)s.h.removeEventListener(o,a[n],i)}var n,s=this,o=s.wrapper,a=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"];if(e)for(n=0;n<a.length;n++)s.h.addEventListener(o,a[n],i)},getWrapperTranslate:function(e){"use strict";var t,i,n,s,o=this.wrapper;return"undefined"==typeof e&&(e="horizontal"===this.params.mode?"x":"y"),this.support.transforms&&this.params.useCSS3Transforms?(n=window.getComputedStyle(o,null),window.WebKitCSSMatrix?s=new WebKitCSSMatrix("none"===n.webkitTransform?"":n.webkitTransform):(s=n.MozTransform||n.OTransform||n.MsTransform||n.msTransform||n.transform||n.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=s.toString().split(",")),"x"===e&&(i=window.WebKitCSSMatrix?s.m41:16===t.length?parseFloat(t[12]):parseFloat(t[4])),"y"===e&&(i=window.WebKitCSSMatrix?s.m42:16===t.length?parseFloat(t[13]):parseFloat(t[5]))):("x"===e&&(i=parseFloat(o.style.left,10)||0),"y"===e&&(i=parseFloat(o.style.top,10)||0)),i||0},setWrapperTranslate:function(e,t,i){"use strict";var n,s=this.wrapper.style,o={x:0,y:0,z:0};3===arguments.length?(o.x=e,o.y=t,o.z=i):("undefined"==typeof t&&(t="horizontal"===this.params.mode?"x":"y"),o[t]=e),this.support.transforms&&this.params.useCSS3Transforms?(n=this.support.transforms3d?"translate3d("+o.x+"px, "+o.y+"px, "+o.z+"px)":"translate("+o.x+"px, "+o.y+"px)",s.webkitTransform=s.MsTransform=s.msTransform=s.MozTransform=s.OTransform=s.transform=n):(s.left=o.x+"px",s.top=o.y+"px"),this.callPlugins("onSetWrapperTransform",o),this.params.onSetWrapperTransform&&this.fireCallback(this.params.onSetWrapperTransform,this,o)},setWrapperTransition:function(e){"use strict";var t=this.wrapper.style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e/1e3+"s",this.callPlugins("onSetWrapperTransition",{duration:e}),this.params.onSetWrapperTransition&&this.fireCallback(this.params.onSetWrapperTransition,this,e)},h:{getWidth:function(e,t,i){"use strict";var n=window.getComputedStyle(e,null).getPropertyValue("width"),s=parseFloat(n);return(isNaN(s)||n.indexOf("%")>0)&&(s=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-left"))-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-right"))),t&&(s+=parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-right"))),i?Math.round(s):s},getHeight:function(e,t,i){"use strict";if(t)return e.offsetHeight;var n=window.getComputedStyle(e,null).getPropertyValue("height"),s=parseFloat(n);return(isNaN(s)||n.indexOf("%")>0)&&(s=e.offsetHeight-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-top"))-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-bottom"))),t&&(s+=parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-bottom"))),i?Math.round(s):s},getOffset:function(e){"use strict";var t=e.getBoundingClientRect(),i=document.body,n=e.clientTop||i.clientTop||0,s=e.clientLeft||i.clientLeft||0,o=window.pageYOffset||e.scrollTop,a=window.pageXOffset||e.scrollLeft;return document.documentElement&&!window.pageYOffset&&(o=document.documentElement.scrollTop,a=document.documentElement.scrollLeft),{top:t.top+o-n,left:t.left+a-s}},windowWidth:function(){"use strict";return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:void 0},windowHeight:function(){"use strict";return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:void 0},windowScroll:function(){"use strict";return"undefined"!=typeof pageYOffset?{left:window.pageXOffset,top:window.pageYOffset}:document.documentElement?{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}:void 0},addEventListener:function(e,t,i,n){"use strict";"undefined"==typeof n&&(n=!1),e.addEventListener?e.addEventListener(t,i,n):e.attachEvent&&e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){"use strict";"undefined"==typeof n&&(n=!1),e.removeEventListener?e.removeEventListener(t,i,n):e.detachEvent&&e.detachEvent("on"+t,i)}},setTransform:function(e,t){"use strict";var i=e.style;i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=t},setTranslate:function(e,t){"use strict";var i=e.style,n={x:t.x||0,y:t.y||0,z:t.z||0},s=this.support.transforms3d?"translate3d("+n.x+"px,"+n.y+"px,"+n.z+"px)":"translate("+n.x+"px,"+n.y+"px)";i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=s,this.support.transforms||(i.left=n.x+"px",i.top=n.y+"px")},setTransition:function(e,t){"use strict";var i=e.style;i.webkitTransitionDuration=i.MsTransitionDuration=i.msTransitionDuration=i.MozTransitionDuration=i.OTransitionDuration=i.transitionDuration=t+"ms"},support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){"use strict";return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){"use strict";var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),transforms:window.Modernizr&&Modernizr.csstransforms===!0||function(){"use strict";var e=document.createElement("div").style;return"transform"in e||"WebkitTransform"in e||"MozTransform"in e||"msTransform"in e||"MsTransform"in e||"OTransform"in e}(),transitions:window.Modernizr&&Modernizr.csstransitions===!0||function(){"use strict";var e=document.createElement("div").style;return"transition"in e||"WebkitTransition"in e||"MozTransition"in e||"msTransition"in e||"MsTransition"in e||"OTransition"in e}(),classList:function(){"use strict";var e=document.createElement("div").style;return"classList"in e}()},browser:{ie8:function(){"use strict";var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var t=navigator.userAgent,i=new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/);null!==i.exec(t)&&(e=parseFloat(RegExp.$1))}return-1!==e&&9>e}(),ie10:window.navigator.msPointerEnabled,ie11:window.navigator.pointerEnabled}},(window.jQuery||window.Zepto)&&!function(e){"use strict";e.fn.swiper=function(t){var i=new Swiper(e(this)[0],t);return e(this).data("swiper",i),i}}(window.jQuery||window.Zepto),"undefined"!=typeof module&&(module.exports=Swiper),"function"==typeof define&&define.amd&&define([],function(){"use strict";return Swiper}),function(){!function(e,t,i){var n,s,o;return o="slidesjs",s={width:940,height:528,start:1,navigation:{active:!0,effect:"slide"},pagination:{active:!0,effect:"slide"},play:{active:!1,effect:"slide",interval:5e3,auto:!1,swap:!0,pauseOnHover:!1,restartDelay:2500},effect:{slide:{speed:500},fade:{speed:300,crossfade:!0}},callback:{loaded:function(){},start:function(){},complete:function(){}}},n=function(){function t(t,i){this.element=t,this.options=e.extend(!0,{},s,i),this._defaults=s,this._name=o,this.init()}return t}(),n.prototype.init=function(){var i,n,s,o,a,r,l=this;return i=e(this.element),this.data=e.data(this),e.data(this,"animating",!1),e.data(this,"total",i.children().not(".slidesjs-navigation",i).length),e.data(this,"current",this.options.start-1),e.data(this,"vendorPrefix",this._getVendorPrefix()),"undefined"!=typeof TouchEvent&&(e.data(this,"touch",!0),this.options.effect.slide.speed=this.options.effect.slide.speed/2),i.css({overflow:"hidden"}),i.slidesContainer=i.children().not(".slidesjs-navigation",i).wrapAll("<div class='slidesjs-container'>",i).parent().css({overflow:"hidden",position:"relative"}),e(".slidesjs-container",i).wrapInner("<div class='slidesjs-control'>",i).children(),e(".slidesjs-control",i).css({position:"relative",left:0}),e(".slidesjs-control",i).children().addClass("slidesjs-slide").css({position:"absolute",top:0,left:0,width:"100%",zIndex:0,display:"none",webkitBackfaceVisibility:"hidden"}),e.each(e(".slidesjs-control",i).children(),function(t){var i;return i=e(this),i.attr("slidesjs-index",t)}),this.data.touch&&(e(".slidesjs-control",i).on("touchstart",function(e){return l._touchstart(e)}),e(".slidesjs-control",i).on("touchmove",function(e){return l._touchmove(e)}),e(".slidesjs-control",i).on("touchend",function(e){return l._touchend(e)})),i.fadeIn(0),this.update(),this.data.touch&&this._setuptouch(),e(".slidesjs-control",i).children(":eq("+this.data.current+")").eq(0).fadeIn(0,function(){return e(this).css({zIndex:10})}),this.options.navigation.active&&(a=e("<a>",{"class":"slidesjs-previous slidesjs-navigation",href:"#",title:"Previous",text:"Previous"}).appendTo(i),n=e("<a>",{"class":"slidesjs-next slidesjs-navigation",href:"#",title:"Next",text:"Next"}).appendTo(i)),e(".slidesjs-next",i).click(function(e){return e.preventDefault(),l.stop(!0),l.next(l.options.navigation.effect)}),e(".slidesjs-previous",i).click(function(e){return e.preventDefault(),l.stop(!0),l.previous(l.options.navigation.effect)}),this.options.play.active&&(o=e("<a>",{"class":"slidesjs-play slidesjs-navigation",href:"#",title:"Play",text:"Play"}).appendTo(i),r=e("<a>",{"class":"slidesjs-stop slidesjs-navigation",href:"#",title:"Stop",text:"Stop"}).appendTo(i),o.click(function(e){return e.preventDefault(),l.play(!0)}),r.click(function(e){return e.preventDefault(),l.stop(!0)}),this.options.play.swap&&r.css({display:"none"})),this.options.pagination.active&&(s=e("<ul>",{"class":"slidesjs-pagination"}).appendTo(i),e.each(new Array(this.data.total),function(t){var i,n;return i=e("<li>",{"class":"slidesjs-pagination-item"}).appendTo(s),n=e("<a>",{href:"#","data-slidesjs-item":t,html:t+1}).appendTo(i),n.click(function(t){return t.preventDefault(),l.stop(!0),l.goto(1*e(t.currentTarget).attr("data-slidesjs-item")+1)})})),e(t).bind("resize",function(){return l.update()}),this._setActive(),this.options.play.auto&&this.play(),this.options.callback.loaded(this.options.start)},n.prototype._setActive=function(t){var i,n;return i=e(this.element),this.data=e.data(this),n=t>-1?t:this.data.current,e(".active",i).removeClass("active"),e(".slidesjs-pagination li:eq("+n+") a",i).addClass("active")},n.prototype.update=function(){var t,i,n;return t=e(this.element),this.data=e.data(this),e(".slidesjs-control",t).children(":not(:eq("+this.data.current+"))").css({display:"none",left:0,zIndex:0}),n=t.width(),i=this.options.height/this.options.width*n,this.options.width=n,this.options.height=i,e(".slidesjs-control, .slidesjs-container",t).css({width:n,height:i})},n.prototype.next=function(t){var i;return i=e(this.element),this.data=e.data(this),e.data(this,"direction","next"),void 0===t&&(t=this.options.navigation.effect),"fade"===t?this._fade():this._slide()},n.prototype.previous=function(t){var i;return i=e(this.element),this.data=e.data(this),e.data(this,"direction","previous"),void 0===t&&(t=this.options.navigation.effect),"fade"===t?this._fade():this._slide()},n.prototype.goto=function(t){var i,n;if(i=e(this.element),this.data=e.data(this),void 0===n&&(n=this.options.pagination.effect),t>this.data.total?t=this.data.total:1>t&&(t=1),"number"==typeof t)return"fade"===n?this._fade(t):this._slide(t);if("string"==typeof t){if("first"===t)return"fade"===n?this._fade(0):this._slide(0);if("last"===t)return"fade"===n?this._fade(this.data.total):this._slide(this.data.total)}},n.prototype._setuptouch=function(){var t,i,n,s;return t=e(this.element),this.data=e.data(this),s=e(".slidesjs-control",t),i=this.data.current+1,n=this.data.current-1,0>n&&(n=this.data.total-1),i>this.data.total-1&&(i=0),s.children(":eq("+i+")").css({display:"block",left:this.options.width}),s.children(":eq("+n+")").css({display:"block",left:-this.options.width})},n.prototype._touchstart=function(t){var i,n;return i=e(this.element),this.data=e.data(this),n=t.originalEvent.touches[0],this._setuptouch(),e.data(this,"touchtimer",Number(new Date)),e.data(this,"touchstartx",n.pageX),e.data(this,"touchstarty",n.pageY),t.stopPropagation()},n.prototype._touchend=function(t){var i,n,s,o,a,r,l,d=this;return i=e(this.element),this.data=e.data(this),r=t.originalEvent.touches[0],o=e(".slidesjs-control",i),o.position().left>.5*this.options.width||o.position().left>.1*this.options.width&&Number(new Date)-this.data.touchtimer<250?(e.data(this,"direction","previous"),this._slide()):o.position().left<-(.5*this.options.width)||o.position().left<-(.1*this.options.width)&&Number(new Date)-this.data.touchtimer<250?(e.data(this,"direction","next"),this._slide()):(s=this.data.vendorPrefix,l=s+"Transform",n=s+"TransitionDuration",a=s+"TransitionTimingFunction",o[0].style[l]="translateX(0px)",o[0].style[n]=.85*this.options.effect.slide.speed+"ms"),o.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){return s=d.data.vendorPrefix,l=s+"Transform",n=s+"TransitionDuration",a=s+"TransitionTimingFunction",o[0].style[l]="",o[0].style[n]="",o[0].style[a]=""}),t.stopPropagation()},n.prototype._touchmove=function(t){var i,n,s,o,a;return i=e(this.element),this.data=e.data(this),o=t.originalEvent.touches[0],n=this.data.vendorPrefix,s=e(".slidesjs-control",i),a=n+"Transform",e.data(this,"scrolling",Math.abs(o.pageX-this.data.touchstartx)<Math.abs(o.pageY-this.data.touchstarty)),this.data.animating||this.data.scrolling||(t.preventDefault(),this._setuptouch(),s[0].style[a]="translateX("+(o.pageX-this.data.touchstartx)+"px)"),t.stopPropagation()},n.prototype.play=function(t){var i,n,s,o=this;return i=e(this.element),this.data=e.data(this),!this.data.playInterval&&(t&&(n=this.data.current,this.data.direction="next","fade"===this.options.play.effect?this._fade():this._slide()),e.data(this,"playInterval",setInterval(function(){return n=o.data.current,o.data.direction="next","fade"===o.options.play.effect?o._fade():o._slide()},this.options.play.interval)),s=e(".slidesjs-container",i),this.options.play.pauseOnHover&&(s.unbind(),s.bind("mouseenter",function(){return o.stop()}),s.bind("mouseleave",function(){return o.options.play.restartDelay?e.data(o,"restartDelay",setTimeout(function(){return o.play(!0)},o.options.play.restartDelay)):o.play()})),e.data(this,"playing",!0),e(".slidesjs-play",i).addClass("slidesjs-playing"),this.options.play.swap)?(e(".slidesjs-play",i).hide(),e(".slidesjs-stop",i).show()):void 0},n.prototype.stop=function(t){var i;return i=e(this.element),this.data=e.data(this),clearInterval(this.data.playInterval),this.options.play.pauseOnHover&&t&&e(".slidesjs-container",i).unbind(),e.data(this,"playInterval",null),e.data(this,"playing",!1),e(".slidesjs-play",i).removeClass("slidesjs-playing"),this.options.play.swap?(e(".slidesjs-stop",i).hide(),e(".slidesjs-play",i).show()):void 0},n.prototype._slide=function(t){var i,n,s,o,a,r,l,d,c,p,u=this;return i=e(this.element),this.data=e.data(this),this.data.animating||t===this.data.current+1?void 0:(e.data(this,"animating",!0),n=this.data.current,t>-1?(t-=1,p=t>n?1:-1,s=t>n?-this.options.width:this.options.width,a=t):(p="next"===this.data.direction?1:-1,s="next"===this.data.direction?-this.options.width:this.options.width,a=n+p),-1===a&&(a=this.data.total-1),a===this.data.total&&(a=0),this._setActive(a),l=e(".slidesjs-control",i),t>-1&&l.children(":not(:eq("+n+"))").css({display:"none",left:0,zIndex:0}),l.children(":eq("+a+")").css({display:"block",left:p*this.options.width,zIndex:10}),this.options.callback.start(n+1),this.data.vendorPrefix?(r=this.data.vendorPrefix,c=r+"Transform",o=r+"TransitionDuration",d=r+"TransitionTimingFunction",l[0].style[c]="translateX("+s+"px)",l[0].style[o]=this.options.effect.slide.speed+"ms",l.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){return l[0].style[c]="",l[0].style[o]="",l.children(":eq("+a+")").css({left:0}),l.children(":eq("+n+")").css({display:"none",left:0,zIndex:0}),e.data(u,"current",a),e.data(u,"animating",!1),l.unbind("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd"),l.children(":not(:eq("+a+"))").css({display:"none",left:0,zIndex:0}),u.data.touch&&u._setuptouch(),u.options.callback.complete(a+1)})):l.stop().animate({left:s},this.options.effect.slide.speed,function(){return l.css({left:0}),l.children(":eq("+a+")").css({left:0}),l.children(":eq("+n+")").css({display:"none",left:0,zIndex:0},e.data(u,"current",a),e.data(u,"animating",!1),u.options.callback.complete(a+1))}))},n.prototype._fade=function(t){var i,n,s,o,a,r=this;return i=e(this.element),this.data=e.data(this),this.data.animating||t===this.data.current+1?void 0:(e.data(this,"animating",!0),n=this.data.current,t?(t-=1,a=t>n?1:-1,s=t):(a="next"===this.data.direction?1:-1,s=n+a),-1===s&&(s=this.data.total-1),s===this.data.total&&(s=0),this._setActive(s),o=e(".slidesjs-control",i),o.children(":eq("+s+")").css({display:"none",left:0,zIndex:10}),this.options.callback.start(n+1),this.options.effect.fade.crossfade?(o.children(":eq("+this.data.current+")").stop().fadeOut(this.options.effect.fade.speed),o.children(":eq("+s+")").stop().fadeIn(this.options.effect.fade.speed,function(){return o.children(":eq("+s+")").css({zIndex:0}),e.data(r,"animating",!1),e.data(r,"current",s),r.options.callback.complete(s+1)})):o.children(":eq("+n+")").stop().fadeOut(this.options.effect.fade.speed,function(){return o.children(":eq("+s+")").stop().fadeIn(r.options.effect.fade.speed,function(){return o.children(":eq("+s+")").css({zIndex:10})}),e.data(r,"animating",!1),e.data(r,"current",s),r.options.callback.complete(s+1)}))},n.prototype._getVendorPrefix=function(){var e,t,n,s,o;for(e=i.body||i.documentElement,n=e.style,s="transition",o=["Moz","Webkit","Khtml","O","ms"],s=s.charAt(0).toUpperCase()+s.substr(1),t=0;t<o.length;){if("string"==typeof n[o[t]+s])return o[t];t++}return!1},e.fn[o]=function(t){return this.each(function(){return e.data(this,"plugin_"+o)?void 0:e.data(this,"plugin_"+o,new n(this,t))})}}(jQuery,window,document)}.call(this),function(e){function t(t,n,a,r,l){function d(){m.unbind("webkitTransitionEnd transitionend otransitionend oTransitionEnd"),n&&i(n,a,r,l),l.startOrder=[],l.newOrder=[],l.origSort=[],l.checkSort=[],g.removeStyle(l.prefix+"filter, filter, "+l.prefix+"transform, transform, opacity, display").css(l.clean).removeAttr("data-checksum"),window.atob||g.css({display:"none",opacity:"0"});var e=l.resizeContainer?"height":"";m.removeStyle(l.prefix+"transition, transition, "+l.prefix+"perspective, perspective, "+l.prefix+"perspective-origin, perspective-origin, "+e),"list"==l.layoutMode?(y.css({display:l.targetDisplayList,opacity:"1"}),l.origDisplay=l.targetDisplayList):(y.css({display:l.targetDisplayGrid,opacity:"1"}),l.origDisplay=l.targetDisplayGrid),l.origLayout=l.layoutMode;setTimeout(function(){if(g.removeStyle(l.prefix+"transition, transition"),l.mixing=!1,"function"==typeof l.onMixEnd){var e=l.onMixEnd.call(this,l);l=e?e:l}})}if(clearInterval(l.failsafe),l.mixing=!0,l.filter=t,"function"==typeof l.onMixStart){var c=l.onMixStart.call(this,l);l=c?c:l}for(var p=l.transitionSpeed,u=0;2>u;u++){var h=0==u?h=l.prefix:"";l.transition[h+"transition"]="all "+p+"ms linear",l.transition[h+"transform"]=h+"translate3d(0,0,0)",l.perspective[h+"perspective"]=l.perspectiveDistance+"px",l.perspective[h+"perspective-origin"]=l.perspectiveOrigin}var f=l.targetSelector,g=r.find(f);g.each(function(){this.data={}});var m=g.parent();m.css(l.perspective),l.easingFallback="ease-in-out","smooth"==l.easing&&(l.easing="cubic-bezier(0.25, 0.46, 0.45, 0.94)"),"snap"==l.easing&&(l.easing="cubic-bezier(0.77, 0, 0.175, 1)"),"windback"==l.easing&&(l.easing="cubic-bezier(0.175, 0.885, 0.320, 1.275)",l.easingFallback="cubic-bezier(0.175, 0.885, 0.320, 1)"),"windup"==l.easing&&(l.easing="cubic-bezier(0.6, -0.28, 0.735, 0.045)",l.easingFallback="cubic-bezier(0.6, 0.28, 0.735, 0.045)");var v="list"==l.layoutMode&&null!=l.listEffects?l.listEffects:l.effects;Array.prototype.indexOf&&(l.fade=v.indexOf("fade")>-1?"0":"",l.scale=v.indexOf("scale")>-1?"scale(.01)":"",l.rotateZ=v.indexOf("rotateZ")>-1?"rotate(180deg)":"",l.rotateY=v.indexOf("rotateY")>-1?"rotateY(90deg)":"",l.rotateX=v.indexOf("rotateX")>-1?"rotateX(90deg)":"",l.blur=v.indexOf("blur")>-1?"blur(8px)":"",l.grayscale=v.indexOf("grayscale")>-1?"grayscale(100%)":"");var y=e(),w=e(),x=[],b=!1;"string"==typeof t?x=o(t):(b=!0,e.each(t,function(e){x[e]=o(this)})),"or"==l.filterLogic?(""==x[0]&&x.shift(),x.length<1?w=w.add(r.find(f+":visible")):g.each(function(){var t=e(this);if(b){var i=0;e.each(x,function(){this.length?t.is("."+this.join(", ."))&&i++:i>0&&i++}),i==x.length?y=y.add(t):w=w.add(t)}else t.is("."+x.join(", ."))?y=y.add(t):w=w.add(t)})):(y=y.add(m.find(f+"."+x.join("."))),w=w.add(m.find(f+":not(."+x.join(".")+"):visible")));var S=y.length,C=e(),T=e(),k=e();if(w.each(function(){var t=e(this);"none"!=t.css("display")&&(C=C.add(t),k=k.add(t))}),y.filter(":visible").length==S&&!C.length&&!n){if(l.origLayout==l.layoutMode)return d(),!1;if(1==y.length)return"list"==l.layoutMode?(r.addClass(l.listClass),r.removeClass(l.gridClass),k.css("display",l.targetDisplayList)):(r.addClass(l.gridClass),r.removeClass(l.listClass),k.css("display",l.targetDisplayGrid)),d(),!1}if(l.origHeight=m.height(),y.length){if(r.removeClass(l.failClass),y.each(function(){var t=e(this);"none"==t.css("display")?T=T.add(t):k=k.add(t)}),l.origLayout!=l.layoutMode&&0==l.animateGridList)return"list"==l.layoutMode?(r.addClass(l.listClass),r.removeClass(l.gridClass),k.css("display",l.targetDisplayList)):(r.addClass(l.gridClass),r.removeClass(l.listClass),k.css("display",l.targetDisplayGrid)),d(),!1;if(!window.atob)return d(),!1;if(g.css(l.clean),k.each(function(){this.data.origPos=e(this).offset()}),"list"==l.layoutMode?(r.addClass(l.listClass),r.removeClass(l.gridClass),T.css("display",l.targetDisplayList)):(r.addClass(l.gridClass),r.removeClass(l.listClass),T.css("display",l.targetDisplayGrid)),T.each(function(){this.data.showInterPos=e(this).offset()}),C.each(function(){this.data.hideInterPos=e(this).offset()}),k.each(function(){this.data.preInterPos=e(this).offset()}),"list"==l.layoutMode?k.css("display",l.targetDisplayList):k.css("display",l.targetDisplayGrid),n&&i(n,a,r,l),n&&s(l.origSort,l.checkSort))return d(),!1;C.hide(),T.each(function(){this.data.finalPos=e(this).offset()}),k.each(function(){this.data.finalPrePos=e(this).offset()}),l.newHeight=m.height(),n&&i("reset",null,r,l),T.hide(),k.css("display",l.origDisplay),"block"==l.origDisplay?(r.addClass(l.listClass),T.css("display",l.targetDisplayList)):(r.removeClass(l.listClass),T.css("display",l.targetDisplayGrid)),l.resizeContainer&&m.css("height",l.origHeight+"px"); |
| + | for(var M={},u=0;2>u;u++){var h=0==u?h=l.prefix:"";M[h+"transform"]=l.scale+" "+l.rotateX+" "+l.rotateY+" "+l.rotateZ,M[h+"filter"]=l.blur+" "+l.grayscale}T.css(M),k.each(function(){var t=this.data,i=e(this);i.hasClass("mix_tohide")?(t.preTX=t.origPos.left-t.hideInterPos.left,t.preTY=t.origPos.top-t.hideInterPos.top):(t.preTX=t.origPos.left-t.preInterPos.left,t.preTY=t.origPos.top-t.preInterPos.top);for(var n={},s=0;2>s;s++){var o=0==s?o=l.prefix:"";n[o+"transform"]="translate("+t.preTX+"px,"+t.preTY+"px)"}i.css(n)}),"list"==l.layoutMode?(r.addClass(l.listClass),r.removeClass(l.gridClass)):(r.addClass(l.gridClass),r.removeClass(l.listClass));{setTimeout(function(){if(l.resizeContainer){for(var t={},i=0;2>i;i++){var n=0==i?n=l.prefix:"";t[n+"transition"]="all "+p+"ms ease-in-out",t.height=l.newHeight+"px"}m.css(t)}C.css("opacity",l.fade),T.css("opacity",1),T.each(function(){var t=this.data;t.tX=t.finalPos.left-t.showInterPos.left,t.tY=t.finalPos.top-t.showInterPos.top;for(var i={},n=0;2>n;n++){var s=0==n?s=l.prefix:"";i[s+"transition-property"]=s+"transform, "+s+"filter, opacity",i[s+"transition-timing-function"]=l.easing+", linear, linear",i[s+"transition-duration"]=p+"ms",i[s+"transition-delay"]="0",i[s+"transform"]="translate("+t.tX+"px,"+t.tY+"px)",i[s+"filter"]="none"}e(this).css("-webkit-transition","all "+p+"ms "+l.easingFallback).css(i)}),k.each(function(){var t=this.data;t.tX=0!=t.finalPrePos.left?t.finalPrePos.left-t.preInterPos.left:0,t.tY=0!=t.finalPrePos.left?t.finalPrePos.top-t.preInterPos.top:0;for(var i={},n=0;2>n;n++){var s=0==n?s=l.prefix:"";i[s+"transition"]="all "+p+"ms "+l.easing,i[s+"transform"]="translate("+t.tX+"px,"+t.tY+"px)"}e(this).css("-webkit-transition","all "+p+"ms "+l.easingFallback).css(i)});for(var s={},i=0;2>i;i++){var n=0==i?n=l.prefix:"";s[n+"transition"]="all "+p+"ms "+l.easing+", "+n+"filter "+p+"ms linear, opacity "+p+"ms linear",s[n+"transform"]=l.scale+" "+l.rotateX+" "+l.rotateY+" "+l.rotateZ,s[n+"filter"]=l.blur+" "+l.grayscale,s.opacity=l.fade}C.css(s),m.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd",function(t){(t.originalEvent.propertyName.indexOf("transform")>-1||t.originalEvent.propertyName.indexOf("opacity")>-1)&&(f.indexOf(".")>-1?e(t.target).hasClass(f.replace(".",""))&&d():e(t.target).is(f)&&d())})},10)}l.failsafe=setTimeout(function(){l.mixing&&d()},p+400)}else{if(l.resizeContainer&&m.css("height",l.origHeight+"px"),!window.atob)return d(),!1;C=w;{setTimeout(function(){if(m.css(l.perspective),l.resizeContainer){for(var e={},t=0;2>t;t++){var i=0==t?i=l.prefix:"";e[i+"transition"]="height "+p+"ms ease-in-out",e.height=l.minHeight+"px"}m.css(e)}g.css(l.transition);var n=w.length;if(n){for(var s={},t=0;2>t;t++){var i=0==t?i=l.prefix:"";s[i+"transform"]=l.scale+" "+l.rotateX+" "+l.rotateY+" "+l.rotateZ,s[i+"filter"]=l.blur+" "+l.grayscale,s.opacity=l.fade}C.css(s),m.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd",function(e){(e.originalEvent.propertyName.indexOf("transform")>-1||e.originalEvent.propertyName.indexOf("opacity")>-1)&&(r.addClass(l.failClass),d())})}else l.mixing=!1},10)}}}function i(t,i,n,s){function o(e,i){var n=isNaN(1*e.attr(t))?e.attr(t).toLowerCase():1*e.attr(t),s=isNaN(1*i.attr(t))?i.attr(t).toLowerCase():1*i.attr(t);return s>n?-1:n>s?1:0}function a(e){"asc"==i?l.prepend(e).prepend(" "):l.append(e).append(" ")}function r(e){for(var t=e.slice(),i=t.length,n=i;n--;){var s=parseInt(Math.random()*i),o=t[n];t[n]=t[s],t[s]=o}return t}n.find(s.targetSelector).wrapAll('<div class="mix_sorter"/>');var l=n.find(".mix_sorter");if(s.origSort.length||l.find(s.targetSelector+":visible").each(function(){e(this).wrap("<s/>"),s.origSort.push(e(this).parent().html().replace(/\s+/g,"")),e(this).unwrap()}),l.empty(),"reset"==t)e.each(s.startOrder,function(){l.append(this).append(" ")});else if("default"==t)e.each(s.origOrder,function(){a(this)});else if("random"==t)s.newOrder.length||(s.newOrder=r(s.startOrder)),e.each(s.newOrder,function(){l.append(this).append(" ")});else if("custom"==t)e.each(i,function(){a(this)});else{if("undefined"==typeof s.origOrder[0].attr(t))return console.log("No such attribute found. Terminating"),!1;s.newOrder.length||(e.each(s.origOrder,function(){s.newOrder.push(e(this))}),s.newOrder.sort(o)),e.each(s.newOrder,function(){a(this)})}s.checkSort=[],l.find(s.targetSelector+":visible").each(function(t){var i=e(this);0==t&&i.attr("data-checksum","1"),i.wrap("<s/>"),s.checkSort.push(i.parent().html().replace(/\s+/g,"")),i.unwrap()}),n.find(s.targetSelector).unwrap()}function n(e){for(var t=["Webkit","Moz","O","ms"],i=0;i<t.length;i++)if(t[i]+"Transition"in e.style)return t[i];return"transition"in e.style?"":!1}function s(e,t){if(e.length!=t.length)return!1;for(var i=0;i<t.length;i++){if(e[i].compare&&!e[i].compare(t[i]))return!1;if(e[i]!==t[i])return!1}return!0}function o(t){t=t.replace(/\s{2,}/g," ");var i=t.split(" ");return e.each(i,function(e){"all"==this&&(i[e]="mix_all")}),""==i[0]&&i.shift(),i}var a={init:function(s){return this.each(function(){var o=window.navigator.appVersion.match(/Chrome\/(\d+)\./),a=o?parseInt(o[1],10):!1,r=function(e){var t=document.getElementById(e),i=t.parentElement,n=document.createElement("div"),s=document.createDocumentFragment();i.insertBefore(n,t),s.appendChild(t),i.replaceChild(t,n),s=null,n=null};(a&&31==a||32==a)&&r(this.id);var l={targetSelector:".mix",filterSelector:".filter",sortSelector:".sort",buttonEvent:"click",effects:["fade","scale"],listEffects:null,easing:"smooth",layoutMode:"grid",targetDisplayGrid:"inline-block",targetDisplayList:"block",listClass:"",gridClass:"",transitionSpeed:600,showOnLoad:"all",sortOnLoad:!1,multiFilter:!1,filterLogic:"or",resizeContainer:!0,minHeight:0,failClass:"fail",perspectiveDistance:"3000",perspectiveOrigin:"50% 50%",animateGridList:!0,onMixLoad:null,onMixStart:null,onMixEnd:null,container:null,origOrder:[],startOrder:[],newOrder:[],origSort:[],checkSort:[],filter:"",mixing:!1,origDisplay:"",origLayout:"",origHeight:0,newHeight:0,isTouch:!1,resetDelay:0,failsafe:null,prefix:"",easingFallback:"ease-in-out",transition:{},perspective:{},clean:{},fade:"1",scale:"",rotateX:"",rotateY:"",rotateZ:"",blur:"",grayscale:""};s&&e.extend(l,s),this.config=l,e.support.touch="ontouchend"in document,e.support.touch&&(l.isTouch=!0,l.resetDelay=350),l.container=e(this);var d=l.container;if(l.prefix=n(d[0]),l.prefix=l.prefix?"-"+l.prefix.toLowerCase()+"-":"",d.find(l.targetSelector).each(function(){l.origOrder.push(e(this))}),l.sortOnLoad){var c,p;e.isArray(l.sortOnLoad)?(c=l.sortOnLoad[0],p=l.sortOnLoad[1],e(l.sortSelector+"[data-sort="+l.sortOnLoad[0]+"][data-order="+l.sortOnLoad[1]+"]").addClass("active")):(e(l.sortSelector+"[data-sort="+l.sortOnLoad+"]").addClass("active"),c=l.sortOnLoad,l.sortOnLoad="desc"),i(c,p,d,l)}for(var u=0;2>u;u++){var h=0==u?h=l.prefix:"";l.transition[h+"transition"]="all "+l.transitionSpeed+"ms ease-in-out",l.perspective[h+"perspective"]=l.perspectiveDistance+"px",l.perspective[h+"perspective-origin"]=l.perspectiveOrigin}for(var u=0;2>u;u++){var h=0==u?h=l.prefix:"";l.clean[h+"transition"]="none"}"list"==l.layoutMode?(d.addClass(l.listClass),l.origDisplay=l.targetDisplayList):(d.addClass(l.gridClass),l.origDisplay=l.targetDisplayGrid),l.origLayout=l.layoutMode;var f=l.showOnLoad.split(" ");e.each(f,function(){e(l.filterSelector+'[data-filter="'+this+'"]').addClass("active")}),d.find(l.targetSelector).addClass("mix_all"),"all"==f[0]&&(f[0]="mix_all",l.showOnLoad="mix_all");var g=e();e.each(f,function(){g=g.add(e("."+this))}),g.each(function(){var t=e(this);"list"==l.layoutMode?t.css("display",l.targetDisplayList):t.css("display",l.targetDisplayGrid),t.css(l.transition)});setTimeout(function(){l.mixing=!0,g.css("opacity","1");setTimeout(function(){if("list"==l.layoutMode?g.removeStyle(l.prefix+"transition, transition").css({display:l.targetDisplayList,opacity:1}):g.removeStyle(l.prefix+"transition, transition").css({display:l.targetDisplayGrid,opacity:1}),l.mixing=!1,"function"==typeof l.onMixLoad){var e=l.onMixLoad.call(this,l);l=e?e:l}},l.transitionSpeed)},10);l.filter=l.showOnLoad,e(l.sortSelector).bind(l.buttonEvent,function(){if(!l.mixing){var i=e(this),n=i.attr("data-sort"),s=i.attr("data-order");if(i.hasClass("active")){if("random"!=n)return!1}else e(l.sortSelector).removeClass("active"),i.addClass("active");d.find(l.targetSelector).each(function(){l.startOrder.push(e(this))}),t(l.filter,n,s,d,l)}}),e(l.filterSelector).bind(l.buttonEvent,function(){if(!l.mixing){var i=e(this);if(0==l.multiFilter)e(l.filterSelector).removeClass("active"),i.addClass("active"),l.filter=i.attr("data-filter"),e(l.filterSelector+'[data-filter="'+l.filter+'"]').addClass("active");else{var n=i.attr("data-filter");if(i.hasClass("active")){i.removeClass("active");var s=new RegExp("(\\s|^)"+n);l.filter=l.filter.replace(s,"")}else i.addClass("active"),l.filter=l.filter+" "+n}t(l.filter,null,null,d,l)}})})},toGrid:function(){return this.each(function(){var i=this.config;"grid"!=i.layoutMode&&(i.layoutMode="grid",t(i.filter,null,null,e(this),i))})},toList:function(){return this.each(function(){var i=this.config;"list"!=i.layoutMode&&(i.layoutMode="list",t(i.filter,null,null,e(this),i))})},filter:function(i){return this.each(function(){var n=this.config;n.mixing||(e(n.filterSelector).removeClass("active"),e(n.filterSelector+'[data-filter="'+i+'"]').addClass("active"),t(i,null,null,e(this),n))})},sort:function(i){return this.each(function(){var n=this.config,s=e(this);if(!n.mixing){if(e(n.sortSelector).removeClass("active"),e.isArray(i)){var o=i[0],a=i[1];e(n.sortSelector+'[data-sort="'+i[0]+'"][data-order="'+i[1]+'"]').addClass("active")}else{e(n.sortSelector+'[data-sort="'+i+'"]').addClass("active");var o=i,a="desc"}s.find(n.targetSelector).each(function(){n.startOrder.push(e(this))}),t(n.filter,o,a,s,n)}})},multimix:function(i){return this.each(function(){var n=this.config,s=e(this);multiOut={filter:n.filter,sort:null,order:"desc",layoutMode:n.layoutMode},e.extend(multiOut,i),n.mixing||(e(n.filterSelector).add(n.sortSelector).removeClass("active"),e(n.filterSelector+'[data-filter="'+multiOut.filter+'"]').addClass("active"),"undefined"!=typeof multiOut.sort&&(e(n.sortSelector+'[data-sort="'+multiOut.sort+'"][data-order="'+multiOut.order+'"]').addClass("active"),s.find(n.targetSelector).each(function(){n.startOrder.push(e(this))})),n.layoutMode=multiOut.layoutMode,t(multiOut.filter,multiOut.sort,multiOut.order,s,n))})},remix:function(i){return this.each(function(){var n=this.config,s=e(this);n.origOrder=[],s.find(n.targetSelector).each(function(){var t=e(this);t.addClass("mix_all"),n.origOrder.push(t)}),n.mixing||"undefined"==typeof i||(e(n.filterSelector).removeClass("active"),e(n.filterSelector+'[data-filter="'+i+'"]').addClass("active"),t(i,null,null,s,n))})}};e.fn.mixitup=function(e){return a[e]?a[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void 0:a.init.apply(this,arguments)},e.fn.removeStyle=function(t){return this.each(function(){var i=e(this);t=t.replace(/\s+/g,"");var n=t.split(",");e.each(n,function(){var e=new RegExp(this.toString()+"[^;]+;?","g");i.attr("style",function(t,i){return i?i.replace(e,""):void 0})})})}}(jQuery),function(e,t){"use strict";var i,n=e.document,s=e.Modernizr,o=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},a="Moz Webkit O Ms".split(" "),r=function(e){var t,i=n.documentElement.style;if("string"==typeof i[e])return e;e=o(e);for(var s=0,r=a.length;r>s;s++)if(t=a[s]+e,"string"==typeof i[t])return t},l=r("transform"),d=r("transitionProperty"),c={csstransforms:function(){return!!l},csstransforms3d:function(){var e=!!r("perspective");if(e){var i=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),n="@media ("+i.join("transform-3d),(")+"modernizr)",s=t("<style>"+n+"{#modernizr{height:3px}}</style>").appendTo("head"),o=t('<div id="modernizr" />').appendTo("html");e=3===o.height(),o.remove(),s.remove()}return e},csstransitions:function(){return!!d}};if(s)for(i in c)s.hasOwnProperty(i)||s.addTest(i,c[i]);else{s=e.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var p,u=" ";for(i in c)p=c[i](),s[i]=p,u+=" "+(p?"":"no-")+i;t("html").addClass(u)}if(s.csstransforms){var h=s.csstransforms3d?{translate:function(e){return"translate3d("+e[0]+"px, "+e[1]+"px, 0) "},scale:function(e){return"scale3d("+e+", "+e+", 1) "}}:{translate:function(e){return"translate("+e[0]+"px, "+e[1]+"px) "},scale:function(e){return"scale("+e+") "}},f=function(e,i,n){var s,o,a=t.data(e,"isoTransform")||{},r={},d={};r[i]=n,t.extend(a,r);for(s in a)o=a[s],d[s]=h[s](o);var c=d.translate||"",p=d.scale||"",u=c+p;t.data(e,"isoTransform",a),e.style[l]=u};t.cssNumber.scale=!0,t.cssHooks.scale={set:function(e,t){f(e,"scale",t)},get:function(e){var i=t.data(e,"isoTransform");return i&&i.scale?i.scale:1}},t.fx.step.scale=function(e){t.cssHooks.scale.set(e.elem,e.now+e.unit)},t.cssNumber.translate=!0,t.cssHooks.translate={set:function(e,t){f(e,"translate",t)},get:function(e){var i=t.data(e,"isoTransform");return i&&i.translate?i.translate:[0,0]}}}var g,m;s.csstransitions&&(g={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[d],m=r("transitionDuration"));var v,y=t.event,w=t.event.handle?"handle":"dispatch";y.special.smartresize={setup:function(){t(this).bind("resize",y.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",y.special.smartresize.handler)},handler:function(e,t){var i=this,n=arguments;e.type="smartresize",v&&clearTimeout(v),v=setTimeout(function(){y[w].apply(i,n)},"execAsap"===t?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Isotope=function(e,i,n){this.element=t(i),this._create(e),this._init(n)};var x=["width","height"],b=t(e);t.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},t.Isotope.prototype={_create:function(e){this.options=t.extend({},t.Isotope.settings,e),this.styleQueue=[],this.elemCount=0;var i=this.element[0].style;this.originalStyle={};var n=x.slice(0);for(var s in this.options.containerStyle)n.push(s);for(var o=0,a=n.length;a>o;o++)s=n[o],this.originalStyle[s]=i[s]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var r={"original-order":function(e,t){return t.elemCount++,t.elemCount},random:function(){return Math.random()}};this.options.getSortData=t.extend(this.options.getSortData,r),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var l=this;setTimeout(function(){l.element.addClass(l.options.containerClass)},0),this.options.resizable&&b.bind("smartresize.isotope",function(){l.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(e){var t=this.options.itemSelector,i=t?e.filter(t).add(e.find(t)):e,n={position:"absolute"};return i=i.filter(function(e,t){return 1===t.nodeType}),this.usingTransforms&&(n.left=0,n.top=0),i.css(n).addClass(this.options.itemClass),this.updateSortData(i,!0),i},_init:function(e){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(e)},option:function(e){if(t.isPlainObject(e)){this.options=t.extend(!0,this.options,e);var i;for(var n in e)i="_update"+o(n),this[i]&&this[i]()}},_updateAnimationEngine:function(){var e,t=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,"");switch(t){case"css":case"none":e=!1;break;case"jquery":e=!0;break;default:e=!s.csstransitions}this.isUsingJQueryAnimation=e,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var e=this.usingTransforms=this.options.transformsEnabled&&s.csstransforms&&s.csstransitions&&!this.isUsingJQueryAnimation;e||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=e?this._translate:this._positionAbs},_filter:function(e){var t=""===this.options.filter?"*":this.options.filter;if(!t)return e;var i=this.options.hiddenClass,n="."+i,s=e.filter(n),o=s;if("*"!==t){o=s.filter(t);var a=e.not(n).not(t).addClass(i);this.styleQueue.push({$el:a,style:this.options.hiddenStyle})}return this.styleQueue.push({$el:o,style:this.options.visibleStyle}),o.removeClass(i),e.filter(t)},updateSortData:function(e,i){var n,s,o=this,a=this.options.getSortData;e.each(function(){n=t(this),s={};for(var e in a)s[e]=i||"original-order"!==e?a[e](n,o):t.data(this,"isotope-sort-data")[e];t.data(this,"isotope-sort-data",s)})},_sort:function(){var e=this.options.sortBy,t=this._getSorter,i=this.options.sortAscending?1:-1,n=function(n,s){var o=t(n,e),a=t(s,e);return o===a&&"original-order"!==e&&(o=t(n,"original-order"),a=t(s,"original-order")),(o>a?1:a>o?-1:0)*i};this.$filteredAtoms.sort(n)},_getSorter:function(e,i){return t.data(e,"isotope-sort-data")[i]},_translate:function(e,t){return{translate:[e,t]}},_positionAbs:function(e,t){return{left:e,top:t}},_pushPosition:function(e,t,i){t=Math.round(t+this.offset.left),i=Math.round(i+this.offset.top);var n=this.getPositionStyles(t,i);this.styleQueue.push({$el:e,style:n}),this.options.itemPositionDataEnabled&&e.data("isotope-item-position",{x:t,y:i})},layout:function(e,t){var i=this.options.layoutMode;if(this["_"+i+"Layout"](e),this.options.resizesContainer){var n=this["_"+i+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:n})}this._processStyleQueue(e,t),this.isLaidOut=!0},_processStyleQueue:function(e,i){var n,o,a,r,l=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",d=this.options.animationOptions,c=this.options.onLayout;if(o=function(e,t){t.$el[l](t.style,d)},this._isInserting&&this.isUsingJQueryAnimation)o=function(e,t){n=t.$el.hasClass("no-transition")?"css":l,t.$el[n](t.style,d)};else if(i||c||d.complete){var p=!1,u=[i,c,d.complete],h=this;if(a=!0,r=function(){if(!p){for(var t,i=0,n=u.length;n>i;i++)t=u[i],"function"==typeof t&&t.call(h.element,e,h);p=!0}},this.isUsingJQueryAnimation&&"animate"===l)d.complete=r,a=!1;else if(s.csstransitions){for(var f,v=0,y=this.styleQueue[0],w=y&&y.$el;!w||!w.length;){if(f=this.styleQueue[v++],!f)return;w=f.$el}var x=parseFloat(getComputedStyle(w[0])[m]);x>0&&(o=function(e,t){t.$el[l](t.style,d).one(g,r)},a=!1)}}t.each(this.styleQueue,o),a&&r(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(e){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,e)},addItems:function(e,t){var i=this._getAtoms(e);this.$allAtoms=this.$allAtoms.add(i),t&&t(i)},insert:function(e,t){this.element.append(e);var i=this;this.addItems(e,function(e){var n=i._filter(e);i._addHideAppended(n),i._sort(),i.reLayout(),i._revealAppended(n,t)})},appended:function(e,t){var i=this;this.addItems(e,function(e){i._addHideAppended(e),i.layout(e),i._revealAppended(e,t)})},_addHideAppended:function(e){this.$filteredAtoms=this.$filteredAtoms.add(e),e.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:e,style:this.options.hiddenStyle})},_revealAppended:function(e,t){var i=this;setTimeout(function(){e.removeClass("no-transition"),i.styleQueue.push({$el:e,style:i.options.visibleStyle}),i._isInserting=!1,i._processStyleQueue(e,t)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(e,t){this.$allAtoms=this.$allAtoms.not(e),this.$filteredAtoms=this.$filteredAtoms.not(e);var i=this,n=function(){e.remove(),t&&t.call(i.element)};e.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:e,style:this.options.hiddenStyle}),this._sort(),this.reLayout(n)):n()},shuffle:function(e){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(e)},destroy:function(){var e=this.usingTransforms,t=this.options;this.$allAtoms.removeClass(t.hiddenClass+" "+t.itemClass).each(function(){var t=this.style;t.position="",t.top="",t.left="",t.opacity="",e&&(t[l]="")});var i=this.element[0].style;for(var n in this.originalStyle)i[n]=this.originalStyle[n];this.element.unbind(".isotope").undelegate("."+t.hiddenClass,"click").removeClass(t.containerClass).removeData("isotope"),b.unbind(".isotope")},_getSegments:function(e){var t,i=this.options.layoutMode,n=e?"rowHeight":"columnWidth",s=e?"height":"width",a=e?"rows":"cols",r=this.element[s](),l=this.options[i]&&this.options[i][n]||this.$filteredAtoms["outer"+o(s)](!0)||r;t=Math.floor(r/l),t=Math.max(t,1),this[i][a]=t,this[i][n]=l},_checkIfSegmentsChanged:function(e){var t=this.options.layoutMode,i=e?"rows":"cols",n=this[t][i];return this._getSegments(e),this[t][i]!==n},_masonryReset:function(){this.masonry={},this._getSegments();var e=this.masonry.cols;for(this.masonry.colYs=[];e--;)this.masonry.colYs.push(0)},_masonryLayout:function(e){var i=this,n=i.masonry;e.each(function(){var e=t(this),s=Math.ceil(e.outerWidth(!0)/n.columnWidth);if(s=Math.min(s,n.cols),1===s)i._masonryPlaceBrick(e,n.colYs);else{var o,a,r=n.cols+1-s,l=[];for(a=0;r>a;a++)o=n.colYs.slice(a,a+s),l[a]=Math.max.apply(Math,o);i._masonryPlaceBrick(e,l)}})},_masonryPlaceBrick:function(e,t){for(var i=Math.min.apply(Math,t),n=0,s=0,o=t.length;o>s;s++)if(t[s]===i){n=s;break}var a=this.masonry.columnWidth*n,r=i;this._pushPosition(e,a,r);var l=i+e.outerHeight(!0),d=this.masonry.cols+1-o;for(s=0;d>s;s++)this.masonry.colYs[n+s]=l},_masonryGetContainerSize:function(){var e=Math.max.apply(Math,this.masonry.colYs);return{height:e}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(e){var i=this,n=this.element.width(),s=this.fitRows;e.each(function(){var e=t(this),o=e.outerWidth(!0),a=e.outerHeight(!0);0!==s.x&&o+s.x>n&&(s.x=0,s.y=s.height),i._pushPosition(e,s.x,s.y),s.height=Math.max(s.y+a,s.height),s.x+=o})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(e){var i=this,n=this.cellsByRow;e.each(function(){var e=t(this),s=n.index%n.cols,o=Math.floor(n.index/n.cols),a=(s+.5)*n.columnWidth-e.outerWidth(!0)/2,r=(o+.5)*n.rowHeight-e.outerHeight(!0)/2;i._pushPosition(e,a,r),n.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(e){var i=this;e.each(function(){var e=t(this);i._pushPosition(e,0,i.straightDown.y),i.straightDown.y+=e.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var e=this.masonryHorizontal.rows;for(this.masonryHorizontal.rowXs=[];e--;)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(e){var i=this,n=i.masonryHorizontal;e.each(function(){var e=t(this),s=Math.ceil(e.outerHeight(!0)/n.rowHeight);if(s=Math.min(s,n.rows),1===s)i._masonryHorizontalPlaceBrick(e,n.rowXs);else{var o,a,r=n.rows+1-s,l=[];for(a=0;r>a;a++)o=n.rowXs.slice(a,a+s),l[a]=Math.max.apply(Math,o);i._masonryHorizontalPlaceBrick(e,l)}})},_masonryHorizontalPlaceBrick:function(e,t){for(var i=Math.min.apply(Math,t),n=0,s=0,o=t.length;o>s;s++)if(t[s]===i){n=s;break}var a=i,r=this.masonryHorizontal.rowHeight*n;this._pushPosition(e,a,r);var l=i+e.outerWidth(!0),d=this.masonryHorizontal.rows+1-o;for(s=0;d>s;s++)this.masonryHorizontal.rowXs[n+s]=l},_masonryHorizontalGetContainerSize:function(){var e=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:e}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(e){var i=this,n=this.element.height(),s=this.fitColumns;e.each(function(){var e=t(this),o=e.outerWidth(!0),a=e.outerHeight(!0);0!==s.y&&a+s.y>n&&(s.x=s.width,s.y=0),i._pushPosition(e,s.x,s.y),s.width=Math.max(s.x+o,s.width),s.y+=a})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(e){var i=this,n=this.cellsByColumn;e.each(function(){var e=t(this),s=Math.floor(n.index/n.rows),o=n.index%n.rows,a=(s+.5)*n.columnWidth-e.outerWidth(!0)/2,r=(o+.5)*n.rowHeight-e.outerHeight(!0)/2;i._pushPosition(e,a,r),n.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(e){var i=this;e.each(function(){var e=t(this);i._pushPosition(e,i.straightAcross.x,0),i.straightAcross.x+=e.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},t.fn.imagesLoaded=function(e){function i(){e.call(s,o)}function n(e){var s=e.target;s.src!==r&&-1===t.inArray(s,l)&&(l.push(s),--a<=0&&(setTimeout(i),o.unbind(".imagesLoaded",n)))}var s=this,o=s.find("img").add(s.filter("img")),a=o.length,r="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",l=[];return a||i(),o.bind("load.imagesLoaded error.imagesLoaded",n).each(function(){var e=this.src;this.src=r,this.src=e}),s};var S=function(t){e.console&&e.console.error(t)};t.fn.isotope=function(e,i){if("string"==typeof e){var n=Array.prototype.slice.call(arguments,1);this.each(function(){var i=t.data(this,"isotope");return i?t.isFunction(i[e])&&"_"!==e.charAt(0)?(i[e].apply(i,n),void 0):(S("no such method '"+e+"' for isotope instance"),void 0):(S("cannot call methods on isotope prior to initialization; attempted to call method '"+e+"'"),void 0)})}else this.each(function(){var n=t.data(this,"isotope");n?(n.option(e),n._init(i)):t.data(this,"isotope",new t.Isotope(e,this,i))});return this}}(window,jQuery),function(e,t,i,n){"use strict";var s=i("html"),o=i(e),a=i(t),r=i.fancybox=function(){r.open.apply(this,arguments)},l=navigator.userAgent.match(/msie/i),d=null,c=t.createTouch!==n,p=function(e){return e&&e.hasOwnProperty&&e instanceof i},u=function(e){return e&&"string"===i.type(e)},h=function(e){return u(e)&&e.indexOf("%")>0},f=function(e){return e&&!(e.style.overflow&&"hidden"===e.style.overflow)&&(e.clientWidth&&e.scrollWidth>e.clientWidth||e.clientHeight&&e.scrollHeight>e.clientHeight)},g=function(e,t){var i=parseInt(e,10)||0;return t&&h(e)&&(i=r.getViewport()[t]/100*i),Math.ceil(i)},m=function(e,t){return g(e,t)+"px"};i.extend(r,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!c,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(l?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){return e&&(i.isPlainObject(t)||(t={}),!1!==r.close(!0))?(i.isArray(e)||(e=p(e)?i(e).get():[e]),i.each(e,function(s,o){var a,l,d,c,h,f,g,m={};"object"===i.type(o)&&(o.nodeType&&(o=i(o)),p(o)?(m={href:o.data("fancybox-href")||o.attr("href"),title:o.data("fancybox-title")||o.attr("title"),isDom:!0,element:o},i.metadata&&i.extend(!0,m,o.metadata())):m=o),a=t.href||m.href||(u(o)?o:null),l=t.title!==n?t.title:m.title||"",d=t.content||m.content,c=d?"html":t.type||m.type,!c&&m.isDom&&(c=o.data("fancybox-type"),c||(h=o.prop("class").match(/fancybox\.(\w+)/),c=h?h[1]:null)),u(a)&&(c||(r.isImage(a)?c="image":r.isSWF(a)?c="swf":"#"===a.charAt(0)?c="inline":u(o)&&(c="html",d=o)),"ajax"===c&&(f=a.split(/\s+/,2),a=f.shift(),g=f.shift())),d||("inline"===c?a?d=i(u(a)?a.replace(/.*(?=#[^\s]+$)/,""):a):m.isDom&&(d=o):"html"===c?d=a:c||a||!m.isDom||(c="inline",d=o)),i.extend(m,{href:a,type:c,content:d,title:l,selector:g}),e[s]=m}),r.opts=i.extend(!0,{},r.defaults,t),t.keys!==n&&(r.opts.keys=t.keys?i.extend({},r.defaults.keys,t.keys):!1),r.group=e,r._start(r.opts.index)):void 0},cancel:function(){var e=r.coming;e&&!1!==r.trigger("onCancel")&&(r.hideLoading(),r.ajaxLoad&&r.ajaxLoad.abort(),r.ajaxLoad=null,r.imgPreload&&(r.imgPreload.onload=r.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),r.coming=null,r.current||r._afterZoomOut(e))},close:function(e){r.cancel(),!1!==r.trigger("beforeClose")&&(r.unbindEvents(),r.isActive&&(r.isOpen&&e!==!0?(r.isOpen=r.isOpened=!1,r.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),r.wrap.stop(!0,!0).removeClass("fancybox-opened"),r.transitions[r.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),r._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(r.player.timer)},i=function(){t(),r.current&&r.player.isActive&&(r.player.timer=setTimeout(r.next,r.current.playSpeed))},n=function(){t(),a.unbind(".player"),r.player.isActive=!1,r.trigger("onPlayEnd")},s=function(){r.current&&(r.current.loop||r.current.index<r.group.length-1)&&(r.player.isActive=!0,a.bind({"onCancel.player beforeClose.player":n,"onUpdate.player":i,"beforeLoad.player":t}),i(),r.trigger("onPlayStart")) |
| + | };e===!0||!r.player.isActive&&e!==!1?s():n()},next:function(e){var t=r.current;t&&(u(e)||(e=t.direction.next),r.jumpto(t.index+1,e,"next"))},prev:function(e){var t=r.current;t&&(u(e)||(e=t.direction.prev),r.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,i){var s=r.current;s&&(e=g(e),r.direction=t||s.direction[e>=s.index?"next":"prev"],r.router=i||"jumpto",s.loop&&(0>e&&(e=s.group.length+e%s.group.length),e%=s.group.length),s.group[e]!==n&&(r.cancel(),r._start(e)))},reposition:function(e,t){var n,s=r.current,o=s?s.wrap:null;o&&(n=r._getPosition(t),e&&"scroll"===e.type?(delete n.position,o.stop(!0,!0).animate(n,200)):(o.css(n),s.pos=i.extend({},s.dim,n)))},update:function(e){var t=e&&e.type,i=!t||"orientationchange"===t;i&&(clearTimeout(d),d=null),r.isOpen&&!d&&(d=setTimeout(function(){var n=r.current;n&&!r.isClosing&&(r.wrap.removeClass("fancybox-tmp"),(i||"load"===t||"resize"===t&&n.autoResize)&&r._setDimension(),"scroll"===t&&n.canShrink||r.reposition(e),r.trigger("onUpdate"),d=null)},i&&!c?0:300))},toggle:function(e){r.isOpen&&(r.current.fitToView="boolean"===i.type(e)?e:!r.current.fitToView,c&&(r.wrap.removeAttr("style").addClass("fancybox-tmp"),r.trigger("onUpdate")),r.update())},hideLoading:function(){a.unbind(".loading"),i("#fancybox-loading").remove()},showLoading:function(){var e,t;r.hideLoading(),e=i('<div id="fancybox-loading"><div></div></div>').click(r.cancel).appendTo("body"),a.bind("keydown.loading",function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),r.cancel())}),r.defaults.fixed||(t=r.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x}))},getViewport:function(){var t=r.current&&r.current.locked||!1,i={x:o.scrollLeft(),y:o.scrollTop()};return t?(i.w=t[0].clientWidth,i.h=t[0].clientHeight):(i.w=c&&e.innerWidth?e.innerWidth:o.width(),i.h=c&&e.innerHeight?e.innerHeight:o.height()),i},unbindEvents:function(){r.wrap&&p(r.wrap)&&r.wrap.unbind(".fb"),a.unbind(".fb"),o.unbind(".fb")},bindEvents:function(){var e,t=r.current;t&&(o.bind("orientationchange.fb"+(c?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),r.update),e=t.keys,e&&a.bind("keydown.fb",function(s){var o=s.which||s.keyCode,a=s.target||s.srcElement;return 27===o&&r.coming?!1:(s.ctrlKey||s.altKey||s.shiftKey||s.metaKey||a&&(a.type||i(a).is("[contenteditable]"))||i.each(e,function(e,a){return t.group.length>1&&a[o]!==n?(r[e](a[o]),s.preventDefault(),!1):i.inArray(o,a)>-1?(r[e](),s.preventDefault(),!1):void 0}),void 0)}),i.fn.mousewheel&&t.mouseWheel&&r.wrap.bind("mousewheel.fb",function(e,n,s,o){for(var a=e.target||null,l=i(a),d=!1;l.length&&!(d||l.is(".fancybox-skin")||l.is(".fancybox-wrap"));)d=f(l[0]),l=i(l).parent();0===n||d||r.group.length>1&&!t.canShrink&&(o>0||s>0?r.prev(o>0?"down":"left"):(0>o||0>s)&&r.next(0>o?"up":"right"),e.preventDefault())}))},trigger:function(e,t){var n,s=t||r.coming||r.current;if(s){if(i.isFunction(s[e])&&(n=s[e].apply(s,Array.prototype.slice.call(arguments,1))),n===!1)return!1;s.helpers&&i.each(s.helpers,function(t,n){n&&r.helpers[t]&&i.isFunction(r.helpers[t][e])&&r.helpers[t][e](i.extend(!0,{},r.helpers[t].defaults,n),s)}),a.trigger(e)}},isImage:function(e){return u(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return u(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,n,s,o,a,l={};if(e=g(e),t=r.group[e]||null,!t)return!1;if(l=i.extend(!0,{},r.opts,t),o=l.margin,a=l.padding,"number"===i.type(o)&&(l.margin=[o,o,o,o]),"number"===i.type(a)&&(l.padding=[a,a,a,a]),l.modal&&i.extend(!0,l,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),l.autoSize&&(l.autoWidth=l.autoHeight=!0),"auto"===l.width&&(l.autoWidth=!0),"auto"===l.height&&(l.autoHeight=!0),l.group=r.group,l.index=e,r.coming=l,!1===r.trigger("beforeLoad"))return r.coming=null,void 0;if(s=l.type,n=l.href,!s)return r.coming=null,r.current&&r.router&&"jumpto"!==r.router?(r.current.index=e,r[r.router](r.direction)):!1;if(r.isActive=!0,("image"===s||"swf"===s)&&(l.autoHeight=l.autoWidth=!1,l.scrolling="visible"),"image"===s&&(l.aspectRatio=!0),"iframe"===s&&c&&(l.scrolling="scroll"),l.wrap=i(l.tpl.wrap).addClass("fancybox-"+(c?"mobile":"desktop")+" fancybox-type-"+s+" fancybox-tmp "+l.wrapCSS).appendTo(l.parent||"body"),i.extend(l,{skin:i(".fancybox-skin",l.wrap),outer:i(".fancybox-outer",l.wrap),inner:i(".fancybox-inner",l.wrap)}),i.each(["Top","Right","Bottom","Left"],function(e,t){l.skin.css("padding"+t,m(l.padding[e]))}),r.trigger("onReady"),"inline"===s||"html"===s){if(!l.content||!l.content.length)return r._error("content")}else if(!n)return r._error("href");"image"===s?r._loadImage():"ajax"===s?r._loadAjax():"iframe"===s?r._loadIframe():r._afterLoad()},_error:function(e){i.extend(r.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:r.coming.tpl.error}),r._afterLoad()},_loadImage:function(){var e=r.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,r.coming.width=this.width/r.opts.pixelRatio,r.coming.height=this.height/r.opts.pixelRatio,r._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,r._error("image")},e.src=r.coming.href,e.complete!==!0&&r.showLoading()},_loadAjax:function(){var e=r.coming;r.showLoading(),r.ajaxLoad=i.ajax(i.extend({},e.ajax,{url:e.href,error:function(e,t){r.coming&&"abort"!==t?r._error("ajax",e):r.hideLoading()},success:function(t,i){"success"===i&&(e.content=t,r._afterLoad())}}))},_loadIframe:function(){var e=r.coming,t=i(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",c?"auto":e.iframe.scrolling).attr("src",e.href);i(e.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}}),e.iframe.preload&&(r.showLoading(),t.one("load",function(){i(this).data("ready",1),c||i(this).bind("load.fb",r.update),i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),r._afterLoad()})),e.content=t.appendTo(e.inner),e.iframe.preload||r._afterLoad()},_preloadImages:function(){var e,t,i=r.group,n=r.current,s=i.length,o=n.preload?Math.min(n.preload,s-1):0;for(t=1;o>=t;t+=1)e=i[(n.index+t)%s],"image"===e.type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,n,s,o,a,l=r.coming,d=r.current,c="fancybox-placeholder";if(r.hideLoading(),l&&r.isActive!==!1){if(!1===r.trigger("afterLoad",l,d))return l.wrap.stop(!0).trigger("onReset").remove(),r.coming=null,void 0;switch(d&&(r.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),r.unbindEvents(),e=l,t=l.content,n=l.type,s=l.scrolling,i.extend(r,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:d}),o=e.href,n){case"inline":case"ajax":case"html":e.selector?t=i("<div>").html(t).find(e.selector):p(t)&&(t.data(c)||t.data(c,i('<div class="'+c+'"></div>').insertAfter(t).hide()),t=t.show().detach(),e.wrap.bind("onReset",function(){i(this).find(t).length&&t.hide().replaceAll(t.data(c)).data(c,!1)}));break;case"image":t=e.tpl.image.replace("{href}",o);break;case"swf":t='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+o+'"></param>',a="",i.each(e.swf,function(e,i){t+='<param name="'+e+'" value="'+i+'"></param>',a+=" "+e+'="'+i+'"'}),t+='<embed src="'+o+'" type="application/x-shockwave-flash" width="100%" height="100%"'+a+"></embed></object>"}p(t)&&t.parent().is(e.inner)||e.inner.append(t),r.trigger("beforeShow"),e.inner.css("overflow","yes"===s?"scroll":"no"===s?"hidden":s),r._setDimension(),r.reposition(),r.isOpen=!1,r.coming=null,r.bindEvents(),r.isOpened?d.prevMethod&&r.transitions[d.prevMethod]():i(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),r.transitions[r.isOpened?e.nextMethod:e.openMethod](),r._preloadImages()}},_setDimension:function(){var e,t,n,s,o,a,l,d,c,p,u,f,v,y,w,x=r.getViewport(),b=0,S=!1,C=!1,T=r.wrap,k=r.skin,M=r.inner,L=r.current,_=L.width,E=L.height,P=L.minWidth,A=L.minHeight,O=L.maxWidth,I=L.maxHeight,D=L.scrolling,z=L.scrollOutside?L.scrollbarWidth:0,H=L.margin,R=g(H[1]+H[3]),W=g(H[0]+H[2]);if(T.add(k).add(M).width("auto").height("auto").removeClass("fancybox-tmp"),e=g(k.outerWidth(!0)-k.width()),t=g(k.outerHeight(!0)-k.height()),n=R+e,s=W+t,o=h(_)?(x.w-n)*g(_)/100:_,a=h(E)?(x.h-s)*g(E)/100:E,"iframe"===L.type){if(y=L.content,L.autoHeight&&1===y.data("ready"))try{y[0].contentWindow.document.location&&(M.width(o).height(9999),w=y.contents().find("body"),z&&w.css("overflow-x","hidden"),a=w.outerHeight(!0))}catch(j){}}else(L.autoWidth||L.autoHeight)&&(M.addClass("fancybox-tmp"),L.autoWidth||M.width(o),L.autoHeight||M.height(a),L.autoWidth&&(o=M.width()),L.autoHeight&&(a=M.height()),M.removeClass("fancybox-tmp"));if(_=g(o),E=g(a),c=o/a,P=g(h(P)?g(P,"w")-n:P),O=g(h(O)?g(O,"w")-n:O),A=g(h(A)?g(A,"h")-s:A),I=g(h(I)?g(I,"h")-s:I),l=O,d=I,L.fitToView&&(O=Math.min(x.w-n,O),I=Math.min(x.h-s,I)),f=x.w-R,v=x.h-W,L.aspectRatio?(_>O&&(_=O,E=g(_/c)),E>I&&(E=I,_=g(E*c)),P>_&&(_=P,E=g(_/c)),A>E&&(E=A,_=g(E*c))):(_=Math.max(P,Math.min(_,O)),L.autoHeight&&"iframe"!==L.type&&(M.width(_),E=M.height()),E=Math.max(A,Math.min(E,I))),L.fitToView)if(M.width(_).height(E),T.width(_+e),p=T.width(),u=T.height(),L.aspectRatio)for(;(p>f||u>v)&&_>P&&E>A&&!(b++>19);)E=Math.max(A,Math.min(I,E-10)),_=g(E*c),P>_&&(_=P,E=g(_/c)),_>O&&(_=O,E=g(_/c)),M.width(_).height(E),T.width(_+e),p=T.width(),u=T.height();else _=Math.max(P,Math.min(_,_-(p-f))),E=Math.max(A,Math.min(E,E-(u-v)));z&&"auto"===D&&a>E&&f>_+e+z&&(_+=z),M.width(_).height(E),T.width(_+e),p=T.width(),u=T.height(),S=(p>f||u>v)&&_>P&&E>A,C=L.aspectRatio?l>_&&d>E&&o>_&&a>E:(l>_||d>E)&&(o>_||a>E),i.extend(L,{dim:{width:m(p),height:m(u)},origWidth:o,origHeight:a,canShrink:S,canExpand:C,wPadding:e,hPadding:t,wrapSpace:u-k.outerHeight(!0),skinSpace:k.height()-E}),!y&&L.autoHeight&&E>A&&I>E&&!C&&M.height("auto")},_getPosition:function(e){var t=r.current,i=r.getViewport(),n=t.margin,s=r.wrap.width()+n[1]+n[3],o=r.wrap.height()+n[0]+n[2],a={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&o<=i.h&&s<=i.w?a.position="fixed":t.locked||(a.top+=i.y,a.left+=i.x),a.top=m(Math.max(a.top,a.top+(i.h-o)*t.topRatio)),a.left=m(Math.max(a.left,a.left+(i.w-s)*t.leftRatio)),a},_afterZoomIn:function(){var e=r.current;e&&(r.isOpen=r.isOpened=!0,r.wrap.css("overflow","visible").addClass("fancybox-opened"),r.update(),(e.closeClick||e.nextClick&&r.group.length>1)&&r.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),r[e.closeClick?"close":"next"]())}),e.closeBtn&&i(e.tpl.closeBtn).appendTo(r.skin).bind("click.fb",function(e){e.preventDefault(),r.close()}),e.arrows&&r.group.length>1&&((e.loop||e.index>0)&&i(e.tpl.prev).appendTo(r.outer).bind("click.fb",r.prev),(e.loop||e.index<r.group.length-1)&&i(e.tpl.next).appendTo(r.outer).bind("click.fb",r.next)),r.trigger("afterShow"),e.loop||e.index!==e.group.length-1?r.opts.autoPlay&&!r.player.isActive&&(r.opts.autoPlay=!1,r.play()):r.play(!1))},_afterZoomOut:function(e){e=e||r.current,i(".fancybox-wrap").trigger("onReset").remove(),i.extend(r,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),r.trigger("afterClose",e)}}),r.transitions={getOrigPosition:function(){var e=r.current,t=e.element,i=e.orig,n={},s=50,o=50,a=e.hPadding,l=e.wPadding,d=r.getViewport();return!i&&e.isDom&&t.is(":visible")&&(i=t.find("img:first"),i.length||(i=t)),p(i)?(n=i.offset(),i.is("img")&&(s=i.outerWidth(),o=i.outerHeight())):(n.top=d.y+(d.h-o)*e.topRatio,n.left=d.x+(d.w-s)*e.leftRatio),("fixed"===r.wrap.css("position")||e.locked)&&(n.top-=d.y,n.left-=d.x),n={top:m(n.top-a*e.topRatio),left:m(n.left-l*e.leftRatio),width:m(s+l),height:m(o+a)}},step:function(e,t){var i,n,s,o=t.prop,a=r.current,l=a.wrapSpace,d=a.skinSpace;("width"===o||"height"===o)&&(i=t.end===t.start?1:(e-t.start)/(t.end-t.start),r.isClosing&&(i=1-i),n="width"===o?a.wPadding:a.hPadding,s=e-n,r.skin[o](g("width"===o?s:s-l*i)),r.inner[o](g("width"===o?s:s-l*i-d*i)))},zoomIn:function(){var e=r.current,t=e.pos,n=e.openEffect,s="elastic"===n,o=i.extend({opacity:1},t);delete o.position,s?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===n&&(t.opacity=.1),r.wrap.css(t).animate(o,{duration:"none"===n?0:e.openSpeed,easing:e.openEasing,step:s?this.step:null,complete:r._afterZoomIn})},zoomOut:function(){var e=r.current,t=e.closeEffect,i="elastic"===t,n={opacity:.1};i&&(n=this.getOrigPosition(),e.closeOpacity&&(n.opacity=.1)),r.wrap.animate(n,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:i?this.step:null,complete:r._afterZoomOut})},changeIn:function(){var e,t=r.current,i=t.nextEffect,n=t.pos,s={opacity:1},o=r.direction,a=200;n.opacity=.1,"elastic"===i&&(e="down"===o||"up"===o?"top":"left","down"===o||"right"===o?(n[e]=m(g(n[e])-a),s[e]="+="+a+"px"):(n[e]=m(g(n[e])+a),s[e]="-="+a+"px")),"none"===i?r._afterZoomIn():r.wrap.css(n).animate(s,{duration:t.nextSpeed,easing:t.nextEasing,complete:r._afterZoomIn})},changeOut:function(){var e=r.previous,t=e.prevEffect,n={opacity:.1},s=r.direction,o=200;"elastic"===t&&(n["down"===s||"up"===s?"top":"left"]=("up"===s||"left"===s?"-":"+")+"="+o+"px"),e.wrap.animate(n,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}},r.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!c,fixed:!0},overlay:null,fixed:!1,el:i("html"),create:function(e){e=i.extend({},this.defaults,e),this.overlay&&this.close(),this.overlay=i('<div class="fancybox-overlay"></div>').appendTo(r.coming?r.coming.parent:e.parent),this.fixed=!1,e.fixed&&r.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=i.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(o.bind("resize.overlay",i.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",function(e){return i(e.target).hasClass("fancybox-overlay")?(r.isActive?r.close():t.close(),!1):void 0}),this.overlay.css(e.css).show()},close:function(){var e,t;o.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(i(".fancybox-margin").removeClass("fancybox-margin"),e=o.scrollTop(),t=o.scrollLeft(),this.el.removeClass("fancybox-lock"),o.scrollTop(e).scrollLeft(t)),i(".fancybox-overlay").remove().hide(),i.extend(this,{overlay:null,fixed:!1})},update:function(){var e,i="100%";this.overlay.width(i).height("100%"),l?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),a.width()>e&&(i=a.width())):a.width()>o.width()&&(i=a.width()),this.overlay.width(i).height(a.height())},onReady:function(e,t){var n=this.overlay;i(".fancybox-overlay").stop(!0,!0),n||this.create(e),e.locked&&this.fixed&&t.fixed&&(n||(this.margin=a.height()>o.height()?i("html").css("margin-right").replace("px",""):!1),t.locked=this.overlay.append(t.wrap),t.fixed=!1),e.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){var n,s;t.locked&&(this.margin!==!1&&(i("*").filter(function(){return"fixed"===i(this).css("position")&&!i(this).hasClass("fancybox-overlay")&&!i(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),n=o.scrollTop(),s=o.scrollLeft(),this.el.addClass("fancybox-lock"),o.scrollTop(n).scrollLeft(s)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!r.coming&&this.overlay.fadeOut(e.speedOut,i.proxy(this.close,this))}},r.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,n,s=r.current,o=s.title,a=e.type;if(i.isFunction(o)&&(o=o.call(s.element,s)),u(o)&&""!==i.trim(o)){switch(t=i('<div class="fancybox-title fancybox-title-'+a+'-wrap">'+o+"</div>"),a){case"inside":n=r.skin;break;case"outside":n=r.wrap;break;case"over":n=r.inner;break;default:n=r.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),r.current.margin[2]+=Math.abs(g(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](n)}}},i.fn.fancybox=function(e){var t,n=i(this),s=this.selector||"",o=function(o){var a,l,d=i(this).blur(),c=t;o.ctrlKey||o.altKey||o.shiftKey||o.metaKey||d.is(".fancybox-wrap")||(a=e.groupAttr||"data-fancybox-group",l=d.attr(a),l||(a="rel",l=d.get(0)[a]),l&&""!==l&&"nofollow"!==l&&(d=s.length?i(s):n,d=d.filter("["+a+'="'+l+'"]'),c=d.index(this)),e.index=c,r.open(d,e)!==!1&&o.preventDefault())};return e=e||{},t=e.index||0,s&&e.live!==!1?a.undelegate(s,"click.fb-start").delegate(s+":not('.fancybox-item, .fancybox-nav')","click.fb-start",o):n.unbind("click.fb-start").bind("click.fb-start",o),this.filter("[data-fancybox-start=1]").trigger("click"),this},a.ready(function(){var t,o;i.scrollbarWidth===n&&(i.scrollbarWidth=function(){var e=i('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=e.children(),n=t.innerWidth()-t.height(99).innerWidth();return e.remove(),n}),i.support.fixedPosition===n&&(i.support.fixedPosition=function(){var e=i('<div style="position:fixed;top:20px;"></div>').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop;return e.remove(),t}()),i.extend(r.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")}),t=i(e).width(),s.addClass("fancybox-lock-test"),o=i(e).width(),s.removeClass("fancybox-lock-test"),i("<style type='text/css'>.fancybox-margin{margin-right:"+(o-t)+"px;}</style>").appendTo("head")})}(window,document,jQuery); |
| $(document).ready(function() { | | $(document).ready(function() { |
| | | |