3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./foundation.util.motion"),require("./foundation.core"),require("jquery"),require("./foundation.util.keyboard"),require("./foundation.util.timer"),require("./foundation.util.imageLoader"),require("./foundation.core.utils"),require("./foundation.core.plugin"),require("./foundation.util.touch")):"function"==typeof define&&define.amd?define(["./foundation.util.motion","./foundation.core","jquery","./foundation.util.keyboard","./foundation.util.timer","./foundation.util.imageLoader","./foundation.core.utils","./foundation.core.plugin","./foundation.util.touch"],e):"object"==typeof exports?exports["foundation.orbit"]=e(require("./foundation.util.motion"),require("./foundation.core"),require("jquery"),require("./foundation.util.keyboard"),require("./foundation.util.timer"),require("./foundation.util.imageLoader"),require("./foundation.core.utils"),require("./foundation.core.plugin"),require("./foundation.util.touch")):(t.__FOUNDATION_EXTERNAL__=t.__FOUNDATION_EXTERNAL__||{},t.__FOUNDATION_EXTERNAL__["foundation.orbit"]=e(t.__FOUNDATION_EXTERNAL__["foundation.util.motion"],t.__FOUNDATION_EXTERNAL__["foundation.core"],t.jQuery,t.__FOUNDATION_EXTERNAL__["foundation.util.keyboard"],t.__FOUNDATION_EXTERNAL__["foundation.util.timer"],t.__FOUNDATION_EXTERNAL__["foundation.util.imageLoader"],t.__FOUNDATION_EXTERNAL__["foundation.core"],t.__FOUNDATION_EXTERNAL__["foundation.core"],t.__FOUNDATION_EXTERNAL__["foundation.util.touch"]))}(window,function(i,n,o,s,r,a,u,l,f){return function(i){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=10)}({"./foundation.core":function(t,e){t.exports=n},"./foundation.core.plugin":function(t,e){t.exports=l},"./foundation.core.utils":function(t,e){t.exports=u},"./foundation.util.imageLoader":function(t,e){t.exports=a},"./foundation.util.keyboard":function(t,e){t.exports=s},"./foundation.util.motion":function(t,e){t.exports=i},"./foundation.util.timer":function(t,e){t.exports=r},"./foundation.util.touch":function(t,e){t.exports=f},"./js/entries/plugins/foundation.orbit.js":function(t,e,i){"use strict";i.r(e);var n=i("./foundation.core");i.d(e,"Foundation",function(){return n.Foundation});var o=i("./js/foundation.orbit.js");i.d(e,"Orbit",function(){return o.Orbit}),n.Foundation.plugin(o.Orbit,"Orbit")},"./js/foundation.orbit.js":function(t,e,i){"use strict";i.r(e),i.d(e,"Orbit",function(){return _});var n=i("jquery"),s=i.n(n),r=i("./foundation.util.keyboard"),f=i("./foundation.util.motion"),a=i("./foundation.util.timer"),u=i("./foundation.util.imageLoader"),l=i("./foundation.core.utils"),c=i("./foundation.core.plugin"),d=i("./foundation.util.touch");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t):e}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var _=function(t){function i(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),p(this,b(i).apply(this,arguments))}var e,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(i,c["Plugin"]),e=i,(n=[{key:"_setup",value:function(t,e){this.$element=t,this.options=s.a.extend({},i.defaults,this.$element.data(),e),this.className="Orbit",d.Touch.init(s.a),this._init(),r.Keyboard.register("Orbit",{ltr:{ARROW_RIGHT:"next",ARROW_LEFT:"previous"},rtl:{ARROW_LEFT:"next",ARROW_RIGHT:"previous"}})}},{key:"_init",value:function(){this._reset(),this.$wrapper=this.$element.find(".".concat(this.options.containerClass)),this.$slides=this.$element.find(".".concat(this.options.slideClass));var t=this.$element.find("img"),e=this.$slides.filter(".is-active"),i=this.$element[0].id||Object(l.GetYoDigits)(6,"orbit");this.$element.attr({"data-resize":i,id:i}),e.length||this.$slides.eq(0).addClass("is-active"),this.options.useMUI||this.$slides.addClass("no-motionui"),t.length?Object(u.onImagesLoaded)(t,this._prepareForOrbit.bind(this)):this._prepareForOrbit(),this.options.bullets&&this._loadBullets(),this._events(),this.options.autoPlay&&1<this.$slides.length&&this.geoSync(),this.options.accessible&&this.$wrapper.attr("tabindex",0)}},{key:"_loadBullets",value:function(){this.$bullets=this.$element.find(".".concat(this.options.boxOfBullets)).find("button")}},{key:"geoSync",value:function(){var t=this;this.timer=new a.Timer(this.$element,{duration:this.options.timerDelay,infinite:!1},function(){t.changeSlide(!0)}),this.timer.start()}},{key:"_prepareForOrbit",value:function(){this._setWrapperHeight()}},{key:"_setWrapperHeight",value:function(t){var e,i=0,n=0,o=this;this.$slides.each(function(){e=this.getBoundingClientRect().height,s()(this).attr("data-slide",n),/mui/g.test(s()(this)[0].className)||o.$slides.filter(".is-active")[0]===o.$slides.eq(n)[0]||s()(this).css({display:"none"}),i=i<e?e:i,n++}),n===this.$slides.length&&(this.$wrapper.css({height:i}),t&&t(i))}},{key:"_setSlideHeight",value:function(t){this.$slides.each(function(){s()(this).css("max-height",t)})}},{key:"_events",value:function(){var n=this;if(this.$element.off(".resizeme.zf.trigger").on({"resizeme.zf.trigger":this._prepareForOrbit.bind(this)}),1<this.$slides.length){if(this.options.swipe&&this.$slides.off("swipeleft.zf.orbit swiperight.zf.orbit").on("swipeleft.zf.orbit",function(t){t.preventDefault(),n.changeSlide(!0)}).on("swiperight.zf.orbit",function(t){t.preventDefault(),n.changeSlide(!1)}),this.options.autoPlay&&(this.$slides.on("click.zf.orbit",function(){n.$element.data("clickedOn",!n.$element.data("clickedOn")),n.timer[n.$element.data("clickedOn")?"pause":"start"]()}),this.options.pauseOnHover&&this.$element.on("mouseenter.zf.orbit",function(){n.timer.pause()}).on("mouseleave.zf.orbit",function(){n.$element.data("clickedOn")||n.timer.start()})),this.options.navButtons)this.$element.find(".".concat(this.options.nextClass,", .").concat(this.options.prevClass)).attr("tabindex",0).on("click.zf.orbit touchend.zf.orbit",function(t){t.preventDefault(),n.changeSlide(s()(this).hasClass(n.options.nextClass))});this.options.bullets&&this.$bullets.on("click.zf.orbit touchend.zf.orbit",function(){if(/is-active/g.test(this.className))return!1;var t=s()(this).data("slide"),e=t>n.$slides.filter(".is-active").data("slide"),i=n.$slides.eq(t);n.changeSlide(e,i,t)}),this.options.accessible&&this.$wrapper.add(this.$bullets).on("keydown.zf.orbit",function(t){r.Keyboard.handleKey(t,"Orbit",{next:function(){n.changeSlide(!0)},previous:function(){n.changeSlide(!1)},handled:function(){s()(t.target).is(n.$bullets)&&n.$bullets.filter(".is-active").focus()}})})}}},{key:"_reset",value:function(){void 0!==this.$slides&&1<this.$slides.length&&(this.$element.off(".zf.orbit").find("*").off(".zf.orbit"),this.options.autoPlay&&this.timer.restart(),this.$slides.each(function(t){s()(t).removeClass("is-active is-active is-in").removeAttr("aria-live").hide()}),this.$slides.first().addClass("is-active").show(),this.$element.trigger("slidechange.zf.orbit",[this.$slides.first()]),this.options.bullets&&this._updateBullets(0))}},{key:"changeSlide",value:function(t,e,i){if(this.$slides){var n=this.$slides.filter(".is-active").eq(0);if(/mui/g.test(n[0].className))return!1;var o,s=this.$slides.first(),r=this.$slides.last(),a=t?"Right":"Left",u=t?"Left":"Right",l=this;(o=e||(t?this.options.infiniteWrap?n.next(".".concat(this.options.slideClass)).length?n.next(".".concat(this.options.slideClass)):s:n.next(".".concat(this.options.slideClass)):this.options.infiniteWrap?n.prev(".".concat(this.options.slideClass)).length?n.prev(".".concat(this.options.slideClass)):r:n.prev(".".concat(this.options.slideClass)))).length&&(this.$element.trigger("beforeslidechange.zf.orbit",[n,o]),this.options.bullets&&(i=i||this.$slides.index(o),this._updateBullets(i)),this.options.useMUI&&!this.$element.is(":hidden")?(f.Motion.animateIn(o.addClass("is-active"),this.options["animInFrom".concat(a)],function(){o.css({display:"block"}).attr("aria-live","polite")}),f.Motion.animateOut(n.removeClass("is-active"),this.options["animOutTo".concat(u)],function(){n.removeAttr("aria-live"),l.options.autoPlay&&!l.timer.isPaused&&l.timer.restart()})):(n.removeClass("is-active is-in").removeAttr("aria-live").hide(),o.addClass("is-active is-in").attr("aria-live","polite").show(),this.options.autoPlay&&!this.timer.isPaused&&this.timer.restart()),this.$element.trigger("slidechange.zf.orbit",[o]))}}},{key:"_updateBullets",value:function(t){var e=this.$element.find(".".concat(this.options.boxOfBullets)).find(".is-active").removeClass("is-active").blur().find("span:last").detach();this.$bullets.eq(t).addClass("is-active").append(e)}},{key:"_destroy",value:function(){this.$element.off(".zf.orbit").find("*").off(".zf.orbit").end().hide()}}])&&h(e.prototype,n),o&&h(e,o),i}();_.defaults={bullets:!0,navButtons:!0,animInFromRight:"slide-in-right",animOutToRight:"slide-out-right",animInFromLeft:"slide-in-left",animOutToLeft:"slide-out-left",autoPlay:!0,timerDelay:5e3,infiniteWrap:!0,swipe:!0,pauseOnHover:!0,accessible:!0,containerClass:"orbit-container",slideClass:"orbit-slide",boxOfBullets:"orbit-bullets",nextClass:"orbit-next",prevClass:"orbit-previous",useMUI:!0}},10:function(t,e,i){t.exports=i("./js/entries/plugins/foundation.orbit.js")},jquery:function(t,e){t.exports=o}})});
|
|
//# sourceMappingURL=foundation.orbit.min.js.map
|