vendor/assets/js/plugins/foundation.interchange.min.js in foundation-rails-6.5.3.0 vs vendor/assets/js/plugins/foundation.interchange.min.js in foundation-rails-6.6.1.0
- old
+ new
@@ -1 +1 @@
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./foundation.core"),require("./foundation.util.mediaQuery"),require("jquery")):"function"==typeof define&&define.amd?define(["./foundation.core","./foundation.util.mediaQuery","jquery"],t):"object"==typeof exports?exports["foundation.interchange"]=t(require("./foundation.core"),require("./foundation.util.mediaQuery"),require("jquery")):(e.__FOUNDATION_EXTERNAL__=e.__FOUNDATION_EXTERNAL__||{},e.__FOUNDATION_EXTERNAL__["foundation.interchange"]=t(e.__FOUNDATION_EXTERNAL__["foundation.core"],e.__FOUNDATION_EXTERNAL__["foundation.util.mediaQuery"],e.jQuery))}(window,function(n,r,i){return function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)}({"./foundation.core":function(e,t){e.exports=n},"./foundation.util.mediaQuery":function(e,t){e.exports=r},"./js/entries/plugins/foundation.interchange.js":function(e,t,n){"use strict";n.r(t);var r=n("./foundation.core");n.d(t,"Foundation",function(){return r.Foundation});var i=n("./js/foundation.interchange.js");n.d(t,"Interchange",function(){return i.Interchange}),r.Foundation.plugin(i.Interchange,"Interchange")},"./js/foundation.interchange.js":function(e,t,n){"use strict";n.r(t),n.d(t,"Interchange",function(){return d});var r=n("jquery"),i=n.n(r),o=n("./foundation.util.mediaQuery"),u=n("./foundation.core");function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d=function(e){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),s(this,f(a).apply(this,arguments))}var t,n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(a,u["Plugin"]),t=a,(n=[{key:"_setup",value:function(e,t){this.$element=e,this.options=i.a.extend({},a.defaults,t),this.rules=[],this.currentPath="",this.className="Interchange",this._init(),this._events()}},{key:"_init",value:function(){o.MediaQuery._init();var e=this.$element[0].id||Object(u.GetYoDigits)(6,"interchange");this.$element.attr({"data-resize":e,id:e}),this._addBreakpoints(),this._generateRules(),this._reflow()}},{key:"_events",value:function(){var e=this;this.$element.off("resizeme.zf.trigger").on("resizeme.zf.trigger",function(){return e._reflow()})}},{key:"_reflow",value:function(){var e;for(var t in this.rules)if(this.rules.hasOwnProperty(t)){var n=this.rules[t];window.matchMedia(n.query).matches&&(e=n)}e&&this.replace(e.path)}},{key:"_addBreakpoints",value:function(){for(var e in o.MediaQuery.queries)if(o.MediaQuery.queries.hasOwnProperty(e)){var t=o.MediaQuery.queries[e];a.SPECIAL_QUERIES[t.name]=t.value}}},{key:"_generateRules",value:function(e){var t,n=[];for(var r in t="string"==typeof(t=this.options.rules?this.options.rules:this.$element.data("interchange"))?t.match(/\[.*?, .*?\]/g):t)if(t.hasOwnProperty(r)){var i=t[r].slice(1,-1).split(", "),o=i.slice(0,-1).join(""),u=i[i.length-1];a.SPECIAL_QUERIES[u]&&(u=a.SPECIAL_QUERIES[u]),n.push({path:o,query:u})}this.rules=n}},{key:"replace",value:function(t){if(this.currentPath!==t){var n=this,r="replaced.zf.interchange";"IMG"===this.$element[0].nodeName?this.$element.attr("src",t).on("load",function(){n.currentPath=t}).trigger(r):t.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)?(t=t.replace(/\(/g,"%28").replace(/\)/g,"%29"),this.$element.css({"background-image":"url("+t+")"}).trigger(r)):i.a.get(t,function(e){n.$element.html(e).trigger(r),i()(e).foundation(),n.currentPath=t})}}},{key:"_destroy",value:function(){this.$element.off("resizeme.zf.trigger")}}])&&c(t.prototype,n),r&&c(t,r),a}();d.defaults={rules:null},d.SPECIAL_QUERIES={landscape:"screen and (orientation: landscape)",portrait:"screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)"}},7:function(e,t,n){e.exports=n("./js/entries/plugins/foundation.interchange.js")},jquery:function(e,t){e.exports=i}})});
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./foundation.core"),require("./foundation.util.mediaQuery"),require("jquery")):"function"==typeof define&&define.amd?define(["./foundation.core","./foundation.util.mediaQuery","jquery"],t):"object"==typeof exports?exports["foundation.interchange"]=t(require("./foundation.core"),require("./foundation.util.mediaQuery"),require("jquery")):(e.__FOUNDATION_EXTERNAL__=e.__FOUNDATION_EXTERNAL__||{},e.__FOUNDATION_EXTERNAL__["foundation.interchange"]=t(e.__FOUNDATION_EXTERNAL__["foundation.core"],e.__FOUNDATION_EXTERNAL__["foundation.util.mediaQuery"],e.jQuery))}(window,function(n,r,o){return a={},i.m=u={"./foundation.core":function(e,t){e.exports=n},"./foundation.util.mediaQuery":function(e,t){e.exports=r},"./js/entries/plugins/foundation.interchange.js":function(e,t,n){"use strict";n.r(t);var r=n("./foundation.core");n.d(t,"Foundation",function(){return r.Foundation});var o=n("./js/foundation.interchange.js");n.d(t,"Interchange",function(){return o.Interchange}),r.Foundation.plugin(o.Interchange,"Interchange")},"./js/foundation.interchange.js":function(e,t,n){"use strict";n.r(t),n.d(t,"Interchange",function(){return p});var r=n("jquery"),o=n.n(r),i=n("./foundation.util.mediaQuery"),u=n("./foundation.core");function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var p=function(){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c(this,f(a).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(a,u["Plugin"]),function(e,t,n){t&&s(e.prototype,t),n&&s(e,n)}(a,[{key:"_setup",value:function(e,t){this.$element=e,this.options=o.a.extend({},a.defaults,this.$element.data(),t),this.rules=[],this.currentPath="",this.className="Interchange",this._init(),this._events()}},{key:"_init",value:function(){i.MediaQuery._init();var e=this.$element[0].id||Object(u.GetYoDigits)(6,"interchange");this.$element.attr({"data-resize":e,id:e}),this._parseOptions(),this._addBreakpoints(),this._generateRules(),this._reflow()}},{key:"_events",value:function(){var e=this;this.$element.off("resizeme.zf.trigger").on("resizeme.zf.trigger",function(){return e._reflow()})}},{key:"_reflow",value:function(){var e;for(var t in this.rules)if(this.rules.hasOwnProperty(t)){var n=this.rules[t];window.matchMedia(n.query).matches&&(e=n)}e&&this.replace(e.path)}},{key:"_parseOptions",value:function(){void 0===this.options.type?this.options.type="auto":-1===["auto","src","background","html"].indexOf(this.options.type)&&(console.log('Warning: invalid value "'.concat(this.options.type,'" for Interchange option "type"')),this.options.type="auto")}},{key:"_addBreakpoints",value:function(){for(var e in i.MediaQuery.queries)if(i.MediaQuery.queries.hasOwnProperty(e)){var t=i.MediaQuery.queries[e];a.SPECIAL_QUERIES[t.name]=t.value}}},{key:"_generateRules",value:function(e){var t,n=[];for(var r in t="string"==typeof(t=this.options.rules?this.options.rules:this.$element.data("interchange"))?t.match(/\[.*?, .*?\]/g):t)if(t.hasOwnProperty(r)){var o=t[r].slice(1,-1).split(", "),i=o.slice(0,-1).join(""),u=o[o.length-1];a.SPECIAL_QUERIES[u]&&(u=a.SPECIAL_QUERIES[u]),n.push({path:i,query:u})}this.rules=n}},{key:"replace",value:function(t){var n=this;if(this.currentPath!==t){var r="replaced.zf.interchange",e=this.options.type;"auto"===e&&(e="IMG"===this.$element[0].nodeName?"src":t.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)?"background":"html"),"src"===e?this.$element.attr("src",t).on("load",function(){n.currentPath=t}).trigger(r):"background"===e?(t=t.replace(/\(/g,"%28").replace(/\)/g,"%29"),this.$element.css({"background-image":"url("+t+")"}).trigger(r)):"html"===e&&o.a.get(t,function(e){n.$element.html(e).trigger(r),o()(e).foundation(),n.currentPath=t})}}},{key:"_destroy",value:function(){this.$element.off("resizeme.zf.trigger")}}]),a}();p.defaults={rules:null,type:"auto"},p.SPECIAL_QUERIES={landscape:"screen and (orientation: landscape)",portrait:"screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)"}},7:function(e,t,n){e.exports=n("./js/entries/plugins/foundation.interchange.js")},jquery:function(e,t){e.exports=o}},i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7);function i(e){if(a[e])return a[e].exports;var t=a[e]={i:e,l:!1,exports:{}};return u[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var u,a});