8 lines
24 KiB
JavaScript
8 lines
24 KiB
JavaScript
/*!
|
|
* Masonry PACKAGED v4.2.2
|
|
* Cascading grid layout library
|
|
* https://masonry.desandro.com
|
|
* MIT License
|
|
* by David DeSandro
|
|
*/(function(d,c){typeof define=="function"&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(l){return c(d,l)}):typeof module=="object"&&module.exports?module.exports=c(d,require("jquery")):d.jQueryBridget=c(d,d.jQuery)})(window,function(d,c){"use strict";function l(u,v,p){function f(g,n,o){var t,e="$()."+u+'("'+n+'")';return g.each(function(r,m){var _=p.data(m,u);if(!_)return void s(u+" not initialized. Cannot call methods, i.e. "+e);var z=_[n];if(!z||n.charAt(0)=="_")return void s(e+" is not a valid method");var E=z.apply(_,o);t=t===void 0?E:t}),t!==void 0?t:g}function y(g,n){g.each(function(o,t){var e=p.data(t,u);e?(e.option(n),e._init()):(e=new v(t,n),p.data(t,u,e))})}p=p||c||d.jQuery,p&&(v.prototype.option||(v.prototype.option=function(g){p.isPlainObject(g)&&(this.options=p.extend(!0,this.options,g))}),p.fn[u]=function(g){if(typeof g=="string"){var n=a.call(arguments,1);return f(this,g,n)}return y(this,g),this},h(p))}function h(u){!u||u&&u.bridget||(u.bridget=l)}var a=Array.prototype.slice,i=d.console,s=typeof i=="undefined"?function(){}:function(u){i.error(u)};return h(c||d.jQuery),l}),function(d,c){typeof define=="function"&&define.amd?define("ev-emitter/ev-emitter",c):typeof module=="object"&&module.exports?module.exports=c():d.EvEmitter=c()}(typeof window!="undefined"?window:this,function(){function d(){}var c=d.prototype;return c.on=function(l,h){if(l&&h){var a=this._events=this._events||{},i=a[l]=a[l]||[];return i.indexOf(h)==-1&&i.push(h),this}},c.once=function(l,h){if(l&&h){this.on(l,h);var a=this._onceEvents=this._onceEvents||{},i=a[l]=a[l]||{};return i[h]=!0,this}},c.off=function(l,h){var a=this._events&&this._events[l];if(a&&a.length){var i=a.indexOf(h);return i!=-1&&a.splice(i,1),this}},c.emitEvent=function(l,h){var a=this._events&&this._events[l];if(a&&a.length){a=a.slice(0),h=h||[];for(var i=this._onceEvents&&this._onceEvents[l],s=0;s<a.length;s++){var u=a[s],v=i&&i[u];v&&(this.off(l,u),delete i[u]),u.apply(this,h)}return this}},c.allOff=function(){delete this._events,delete this._onceEvents},d}),function(d,c){typeof define=="function"&&define.amd?define("get-size/get-size",c):typeof module=="object"&&module.exports?module.exports=c():d.getSize=c()}(window,function(){"use strict";function d(y){var g=parseFloat(y),n=y.indexOf("%")==-1&&!isNaN(g);return n&&g}function c(){}function l(){for(var y={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},g=0;p>g;g++){var n=v[g];y[n]=0}return y}function h(y){var g=getComputedStyle(y);return g||u("Style returned "+g+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),g}function a(){if(!f){f=!0;var y=document.createElement("div");y.style.width="200px",y.style.padding="1px 2px 3px 4px",y.style.borderStyle="solid",y.style.borderWidth="1px 2px 3px 4px",y.style.boxSizing="border-box";var g=document.body||document.documentElement;g.appendChild(y);var n=h(y);s=Math.round(d(n.width))==200,i.isBoxSizeOuter=s,g.removeChild(y)}}function i(y){if(a(),typeof y=="string"&&(y=document.querySelector(y)),y&&typeof y=="object"&&y.nodeType){var g=h(y);if(g.display=="none")return l();var n={};n.width=y.offsetWidth,n.height=y.offsetHeight;for(var o=n.isBorderBox=g.boxSizing=="border-box",t=0;p>t;t++){var e=v[t],r=g[e],m=parseFloat(r);n[e]=isNaN(m)?0:m}var _=n.paddingLeft+n.paddingRight,z=n.paddingTop+n.paddingBottom,E=n.marginLeft+n.marginRight,b=n.marginTop+n.marginBottom,x=n.borderLeftWidth+n.borderRightWidth,T=n.borderTopWidth+n.borderBottomWidth,I=o&&s,W=d(g.width);W!==!1&&(n.width=W+(I?0:_+x));var S=d(g.height);return S!==!1&&(n.height=S+(I?0:z+T)),n.innerWidth=n.width-(_+x),n.innerHeight=n.height-(z+T),n.outerWidth=n.width+E,n.outerHeight=n.height+b,n}}var s,u=typeof console=="undefined"?c:function(y){console.error(y)},v=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],p=v.length,f=!1;return i}),function(d,c){"use strict";typeof define=="function"&&define.amd?define("desandro-matches-selector/matches-selector",c):typeof module=="object"&&module.exports?module.exports=c():d.matchesSelector=c()}(window,function(){"use strict";var d=function(){var c=window.Element.prototype;if(c.matches)return"matches";if(c.matchesSelector)return"matchesSelector";for(var l=["webkit","moz","ms","o"],h=0;h<l.length;h++){var a=l[h],i=a+"MatchesSelector";if(c[i])return i}}();return function(c,l){return c[d](l)}}),function(d,c){typeof define=="function"&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(l){return c(d,l)}):typeof module=="object"&&module.exports?module.exports=c(d,require("desandro-matches-selector")):d.fizzyUIUtils=c(d,d.matchesSelector)}(window,function(d,c){var l={};l.extend=function(i,s){for(var u in s)i[u]=s[u];return i},l.modulo=function(i,s){return(i%s+s)%s};var h=Array.prototype.slice;l.makeArray=function(i){if(Array.isArray(i))return i;if(i==null)return[];var s=typeof i=="object"&&typeof i.length=="number";return s?h.call(i):[i]},l.removeFrom=function(i,s){var u=i.indexOf(s);u!=-1&&i.splice(u,1)},l.getParent=function(i,s){for(;i.parentNode&&i!=document.body;)if(i=i.parentNode,c(i,s))return i},l.getQueryElement=function(i){return typeof i=="string"?document.querySelector(i):i},l.handleEvent=function(i){var s="on"+i.type;this[s]&&this[s](i)},l.filterFindElements=function(i,s){i=l.makeArray(i);var u=[];return i.forEach(function(v){if(v instanceof HTMLElement){if(!s)return void u.push(v);c(v,s)&&u.push(v);for(var p=v.querySelectorAll(s),f=0;f<p.length;f++)u.push(p[f])}}),u},l.debounceMethod=function(i,s,u){u=u||100;var v=i.prototype[s],p=s+"Timeout";i.prototype[s]=function(){var f=this[p];clearTimeout(f);var y=arguments,g=this;this[p]=setTimeout(function(){v.apply(g,y),delete g[p]},u)}},l.docReady=function(i){var s=document.readyState;s=="complete"||s=="interactive"?setTimeout(i):document.addEventListener("DOMContentLoaded",i)},l.toDashed=function(i){return i.replace(/(.)([A-Z])/g,function(s,u,v){return u+"-"+v}).toLowerCase()};var a=d.console;return l.htmlInit=function(i,s){l.docReady(function(){var u=l.toDashed(s),v="data-"+u,p=document.querySelectorAll("["+v+"]"),f=document.querySelectorAll(".js-"+u),y=l.makeArray(p).concat(l.makeArray(f)),g=v+"-options",n=d.jQuery;y.forEach(function(o){var t,e=o.getAttribute(v)||o.getAttribute(g);try{t=e&&JSON.parse(e)}catch(m){return void(a&&a.error("Error parsing "+v+" on "+o.className+": "+m))}var r=new i(o,t);n&&n.data(o,s,r)})})},l}),function(d,c){typeof define=="function"&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],c):typeof module=="object"&&module.exports?module.exports=c(require("ev-emitter"),require("get-size")):(d.Outlayer={},d.Outlayer.Item=c(d.EvEmitter,d.getSize))}(window,function(d,c){"use strict";function l(o){for(var t in o)return!1;return t=null,!0}function h(o,t){o&&(this.element=o,this.layout=t,this.position={x:0,y:0},this._create())}function a(o){return o.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var i=document.documentElement.style,s=typeof i.transition=="string"?"transition":"WebkitTransition",u=typeof i.transform=="string"?"transform":"WebkitTransform",v={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],p={transform:u,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},f=h.prototype=Object.create(d.prototype);f.constructor=h,f._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},f.handleEvent=function(o){var t="on"+o.type;this[t]&&this[t](o)},f.getSize=function(){this.size=c(this.element)},f.css=function(o){var t=this.element.style;for(var e in o){var r=p[e]||e;t[r]=o[e]}},f.getPosition=function(){var o=getComputedStyle(this.element),t=this.layout._getOption("originLeft"),e=this.layout._getOption("originTop"),r=o[t?"left":"right"],m=o[e?"top":"bottom"],_=parseFloat(r),z=parseFloat(m),E=this.layout.size;r.indexOf("%")!=-1&&(_=_/100*E.width),m.indexOf("%")!=-1&&(z=z/100*E.height),_=isNaN(_)?0:_,z=isNaN(z)?0:z,_-=t?E.paddingLeft:E.paddingRight,z-=e?E.paddingTop:E.paddingBottom,this.position.x=_,this.position.y=z},f.layoutPosition=function(){var o=this.layout.size,t={},e=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),m=e?"paddingLeft":"paddingRight",_=e?"left":"right",z=e?"right":"left",E=this.position.x+o[m];t[_]=this.getXValue(E),t[z]="";var b=r?"paddingTop":"paddingBottom",x=r?"top":"bottom",T=r?"bottom":"top",I=this.position.y+o[b];t[x]=this.getYValue(I),t[T]="",this.css(t),this.emitEvent("layout",[this])},f.getXValue=function(o){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!t?o/this.layout.size.width*100+"%":o+"px"},f.getYValue=function(o){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&t?o/this.layout.size.height*100+"%":o+"px"},f._transitionTo=function(o,t){this.getPosition();var e=this.position.x,r=this.position.y,m=o==this.position.x&&t==this.position.y;if(this.setPosition(o,t),m&&!this.isTransitioning)return void this.layoutPosition();var _=o-e,z=t-r,E={};E.transform=this.getTranslate(_,z),this.transition({to:E,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},f.getTranslate=function(o,t){var e=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop");return o=e?o:-o,t=r?t:-t,"translate3d("+o+"px, "+t+"px, 0)"},f.goTo=function(o,t){this.setPosition(o,t),this.layoutPosition()},f.moveTo=f._transitionTo,f.setPosition=function(o,t){this.position.x=parseFloat(o),this.position.y=parseFloat(t)},f._nonTransition=function(o){this.css(o.to),o.isCleaning&&this._removeStyles(o.to);for(var t in o.onTransitionEnd)o.onTransitionEnd[t].call(this)},f.transition=function(o){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(o);var t=this._transn;for(var e in o.onTransitionEnd)t.onEnd[e]=o.onTransitionEnd[e];for(e in o.to)t.ingProperties[e]=!0,o.isCleaning&&(t.clean[e]=!0);if(o.from){this.css(o.from);var r=this.element.offsetHeight;r=null}this.enableTransition(o.to),this.css(o.to),this.isTransitioning=!0};var y="opacity,"+a(u);f.enableTransition=function(){if(!this.isTransitioning){var o=this.layout.options.transitionDuration;o=typeof o=="number"?o+"ms":o,this.css({transitionProperty:y,transitionDuration:o,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(v,this,!1)}},f.onwebkitTransitionEnd=function(o){this.ontransitionend(o)},f.onotransitionend=function(o){this.ontransitionend(o)};var g={"-webkit-transform":"transform"};f.ontransitionend=function(o){if(o.target===this.element){var t=this._transn,e=g[o.propertyName]||o.propertyName;if(delete t.ingProperties[e],l(t.ingProperties)&&this.disableTransition(),e in t.clean&&(this.element.style[o.propertyName]="",delete t.clean[e]),e in t.onEnd){var r=t.onEnd[e];r.call(this),delete t.onEnd[e]}this.emitEvent("transitionEnd",[this])}},f.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(v,this,!1),this.isTransitioning=!1},f._removeStyles=function(o){var t={};for(var e in o)t[e]="";this.css(t)};var n={transitionProperty:"",transitionDuration:"",transitionDelay:""};return f.removeTransitionStyles=function(){this.css(n)},f.stagger=function(o){o=isNaN(o)?0:o,this.staggerDelay=o+"ms"},f.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},f.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},f.reveal=function(){delete this.isHidden,this.css({display:""});var o=this.layout.options,t={},e=this.getHideRevealTransitionEndProperty("visibleStyle");t[e]=this.onRevealTransitionEnd,this.transition({from:o.hiddenStyle,to:o.visibleStyle,isCleaning:!0,onTransitionEnd:t})},f.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},f.getHideRevealTransitionEndProperty=function(o){var t=this.layout.options[o];if(t.opacity)return"opacity";for(var e in t)return e},f.hide=function(){this.isHidden=!0,this.css({display:""});var o=this.layout.options,t={},e=this.getHideRevealTransitionEndProperty("hiddenStyle");t[e]=this.onHideTransitionEnd,this.transition({from:o.visibleStyle,to:o.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},f.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},f.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}),function(d,c){"use strict";typeof define=="function"&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(l,h,a,i){return c(d,l,h,a,i)}):typeof module=="object"&&module.exports?module.exports=c(d,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):d.Outlayer=c(d,d.EvEmitter,d.getSize,d.fizzyUIUtils,d.Outlayer.Item)}(window,function(d,c,l,h,a){"use strict";function i(t,e){var r=h.getQueryElement(t);if(!r)return void(v&&v.error("Bad element for "+this.constructor.namespace+": "+(r||t)));this.element=r,p&&(this.$element=p(this.element)),this.options=h.extend({},this.constructor.defaults),this.option(e);var m=++y;this.element.outlayerGUID=m,g[m]=this,this._create();var _=this._getOption("initLayout");_&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function u(t){if(typeof t=="number")return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),r=e&&e[1],m=e&&e[2];if(!r.length)return 0;r=parseFloat(r);var _=o[m]||1;return r*_}var v=d.console,p=d.jQuery,f=function(){},y=0,g={};i.namespace="outlayer",i.Item=a,i.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var n=i.prototype;h.extend(n,c.prototype),n.option=function(t){h.extend(this.options,t)},n._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&this.options[e]!==void 0?this.options[e]:this.options[t]},i.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},n._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),h.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},n.reloadItems=function(){this.items=this._itemize(this.element.children)},n._itemize=function(t){for(var e=this._filterFindItemElements(t),r=this.constructor.Item,m=[],_=0;_<e.length;_++){var z=e[_],E=new r(z,this);m.push(E)}return m},n._filterFindItemElements=function(t){return h.filterFindElements(t,this.options.itemSelector)},n.getItemElements=function(){return this.items.map(function(t){return t.element})},n.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=t!==void 0?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},n._init=n.layout,n._resetLayout=function(){this.getSize()},n.getSize=function(){this.size=l(this.element)},n._getMeasurement=function(t,e){var r,m=this.options[t];m?(typeof m=="string"?r=this.element.querySelector(m):m instanceof HTMLElement&&(r=m),this[t]=r?l(r)[e]:m):this[t]=0},n.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},n._getItemsForLayout=function(t){return t.filter(function(e){return!e.isIgnored})},n._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var r=[];t.forEach(function(m){var _=this._getItemLayoutPosition(m);_.item=m,_.isInstant=e||m.isLayoutInstant,r.push(_)},this),this._processLayoutQueue(r)}},n._getItemLayoutPosition=function(){return{x:0,y:0}},n._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(e,r){this._positionItem(e.item,e.x,e.y,e.isInstant,r)},this)},n.updateStagger=function(){var t=this.options.stagger;return t==null?void(this.stagger=0):(this.stagger=u(t),this.stagger)},n._positionItem=function(t,e,r,m,_){m?t.goTo(e,r):(t.stagger(_*this.stagger),t.moveTo(e,r))},n._postLayout=function(){this.resizeContainer()},n.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},n._getContainerSize=f,n._setContainerMeasure=function(t,e){if(t!==void 0){var r=this.size;r.isBorderBox&&(t+=e?r.paddingLeft+r.paddingRight+r.borderLeftWidth+r.borderRightWidth:r.paddingBottom+r.paddingTop+r.borderTopWidth+r.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},n._emitCompleteOnItems=function(t,e){function r(){_.dispatchEvent(t+"Complete",null,[e])}function m(){E++,E==z&&r()}var _=this,z=e.length;if(!e||!z)return void r();var E=0;e.forEach(function(b){b.once(t,m)})},n.dispatchEvent=function(t,e,r){var m=e?[e].concat(r):r;if(this.emitEvent(t,m),p)if(this.$element=this.$element||p(this.element),e){var _=p.Event(e);_.type=t,this.$element.trigger(_,r)}else this.$element.trigger(t,r)},n.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},n.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},n.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},n.unstamp=function(t){t=this._find(t),t&&t.forEach(function(e){h.removeFrom(this.stamps,e),this.unignore(e)},this)},n._find=function(t){return t?(typeof t=="string"&&(t=this.element.querySelectorAll(t)),t=h.makeArray(t)):void 0},n._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},n._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},n._manageStamp=f,n._getElementOffset=function(t){var e=t.getBoundingClientRect(),r=this._boundingRect,m=l(t),_={left:e.left-r.left-m.marginLeft,top:e.top-r.top-m.marginTop,right:r.right-e.right-m.marginRight,bottom:r.bottom-e.bottom-m.marginBottom};return _},n.handleEvent=h.handleEvent,n.bindResize=function(){d.addEventListener("resize",this),this.isResizeBound=!0},n.unbindResize=function(){d.removeEventListener("resize",this),this.isResizeBound=!1},n.onresize=function(){this.resize()},h.debounceMethod(i,"onresize",100),n.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},n.needsResizeLayout=function(){var t=l(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},n.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},n.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},n.prepended=function(t){var e=this._itemize(t);if(e.length){var r=this.items.slice(0);this.items=e.concat(r),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(r)}},n.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(r,m){r.stagger(m*e),r.reveal()})}},n.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(r,m){r.stagger(m*e),r.hide()})}},n.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},n.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},n.getItem=function(t){for(var e=0;e<this.items.length;e++){var r=this.items[e];if(r.element==t)return r}},n.getItems=function(t){t=h.makeArray(t);var e=[];return t.forEach(function(r){var m=this.getItem(r);m&&e.push(m)},this),e},n.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(r){r.remove(),h.removeFrom(this.items,r)},this)},n.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(r){r.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete g[e],delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},i.data=function(t){t=h.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&g[e]},i.create=function(t,e){var r=s(i);return r.defaults=h.extend({},i.defaults),h.extend(r.defaults,e),r.compatOptions=h.extend({},i.compatOptions),r.namespace=t,r.data=i.data,r.Item=s(a),h.htmlInit(r,t),p&&p.bridget&&p.bridget(t,r),r};var o={ms:1,s:1e3};return i.Item=a,i}),function(d,c){typeof define=="function"&&define.amd?define(["outlayer/outlayer","get-size/get-size"],c):typeof module=="object"&&module.exports?module.exports=c(require("outlayer"),require("get-size")):d.Masonry=c(d.Outlayer,d.getSize)}(window,function(d,c){var l=d.create("masonry");l.compatOptions.fitWidth="isFitWidth";var h=l.prototype;return h._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var a=0;a<this.cols;a++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},h.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],i=a&&a.element;this.columnWidth=i&&c(i).outerWidth||this.containerWidth}var s=this.columnWidth+=this.gutter,u=this.containerWidth+this.gutter,v=u/s,p=s-u%s,f=p&&1>p?"round":"floor";v=Math[f](v),this.cols=Math.max(v,1)},h.getContainerWidth=function(){var a=this._getOption("fitWidth"),i=a?this.element.parentNode:this.element,s=c(i);this.containerWidth=s&&s.innerWidth},h._getItemLayoutPosition=function(a){a.getSize();var i=a.size.outerWidth%this.columnWidth,s=i&&1>i?"round":"ceil",u=Math[s](a.size.outerWidth/this.columnWidth);u=Math.min(u,this.cols);for(var v=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",p=this[v](u,a),f={x:this.columnWidth*p.col,y:p.y},y=p.y+a.size.outerHeight,g=u+p.col,n=p.col;g>n;n++)this.colYs[n]=y;return f},h._getTopColPosition=function(a){var i=this._getTopColGroup(a),s=Math.min.apply(Math,i);return{col:i.indexOf(s),y:s}},h._getTopColGroup=function(a){if(2>a)return this.colYs;for(var i=[],s=this.cols+1-a,u=0;s>u;u++)i[u]=this._getColGroupY(u,a);return i},h._getColGroupY=function(a,i){if(2>i)return this.colYs[a];var s=this.colYs.slice(a,a+i);return Math.max.apply(Math,s)},h._getHorizontalColPosition=function(a,i){var s=this.horizontalColIndex%this.cols,u=a>1&&s+a>this.cols;s=u?0:s;var v=i.size.outerWidth&&i.size.outerHeight;return this.horizontalColIndex=v?s+a:this.horizontalColIndex,{col:s,y:this._getColGroupY(s,a)}},h._manageStamp=function(a){var i=c(a),s=this._getElementOffset(a),u=this._getOption("originLeft"),v=u?s.left:s.right,p=v+i.outerWidth,f=Math.floor(v/this.columnWidth);f=Math.max(0,f);var y=Math.floor(p/this.columnWidth);y-=p%this.columnWidth?0:1,y=Math.min(this.cols-1,y);for(var g=this._getOption("originTop"),n=(g?s.top:s.bottom)+i.outerHeight,o=f;y>=o;o++)this.colYs[o]=Math.max(n,this.colYs[o])},h._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this._getOption("fitWidth")&&(a.width=this._getContainerFitWidth()),a},h._getContainerFitWidth=function(){for(var a=0,i=this.cols;--i&&this.colYs[i]===0;)a++;return(this.cols-a)*this.columnWidth-this.gutter},h.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!=this.containerWidth},l});
|