/** * Isotope v1.5.26 * An exquisite jQuery plugin for magical layouts * http://isotope.metafizzy.co * * Commercial use requires one-time purchase of a commercial license * http://isotope.metafizzy.co/docs/license.html * * Non-commercial use is licensed under the MIT License * * Copyright 2014 Metafizzy *//*jshint asi: true, browser: true, curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, strict: true, undef: true *//*global jQuery: false */(function(e,t,n){"use strict";var r=e.document,i=r.documentElement,s=e.Modernizr,o=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},u="Moz Webkit O Ms".split(" "),a=function(e){var t=i.style,n;if(typeof t[e]=="string")return e;e=o(e);for(var r=0,s=u.length;r@media (transform-3d),(-webkit-transform-3d){#modernizr{height:3px}}").appendTo("head"),r=t('
').appendTo("html");e=r.height()===3,r.remove(),n.remove()}return e},csstransitions:function(){return!!l}},h;if(s)for(h in c)s.hasOwnProperty(h)||s.addTest(h,c[h]);else{s=e.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var p=" ",d;for(h in c)d=c[h](),s[h]=d,p+=" "+(d?"":"no-")+h;t("html").addClass(p)}if(s.csstransforms){var v=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+") "}},m=function(e,n,r){var i=t.data(e,"isoTransform")||{},s={},o,u={},a;s[n]=r,t.extend(i,s);for(o in i)a=i[o],u[o]=v[o](a);var l=u.translate||"",c=u.scale||"",h=l+c;t.data(e,"isoTransform",i),e.style[f]=h};t.cssNumber.scale=!0,t.cssHooks.scale={set:function(e,t){m(e,"scale",t)},get:function(e,n){var r=t.data(e,"isoTransform");return r&&r.scale?r.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){m(e,"translate",t)},get:function(e,n){var r=t.data(e,"isoTransform");return r&&r.translate?r.translate:[0,0]}}}var g,y;s.csstransitions&&(g={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[l],y=a("transitionDuration"));var b=t.event,w=t.event.handle?"handle":"dispatch",E;b.special.smartresize={setup:function(){t(this).bind("resize",b.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",b.special.smartresize.handler)},handler:function(e,t){var n=this,r=arguments;e.type="smartresize",E&&clearTimeout(E),E=setTimeout(function(){b[w].apply(n,r)},t==="execAsap"?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Isotope=function(e,n,r){this.element=t(n),this._create(e),this._init(r)};var S=["width","height"],x=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 n=this.element[0].style;this.originalStyle={};var r=S.slice(0);for(var i in this.options.containerStyle)r.push(i);for(var s=0,o=r.length;su?1:o0&&(a=function(e,t){t.$el[r](t.style,i).one(g,l)},f=!1)}}t.each(this.styleQueue,a),f&&l(),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 n=this._getAtoms(e);this.$allAtoms=this.$allAtoms.add(n),t&&t(n)},insert:function(e,t){this.element.append(e);var n=this;this.addItems(e,function(e){var r=n._filter(e);n._addHideAppended(r),n._sort(),n.reLayout(),n._revealAppended(r,t)})},appended:function(e,t){var n=this;this.addItems(e,function(e){n._addHideAppended(e),n.layout(e),n._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 n=this;setTimeout(function(){e.removeClass("no-transition"),n.styleQueue.push({$el:e,style:n.options.visibleStyle}),n._isInserting=!1,n._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 n=this,r=function(){e.remove(),t&&t.call(n.element)};e.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:e,style:this.options.hiddenStyle}),this._sort(),this.reLayout(r)):r()},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[f]="")});var n=this.element[0].style;for(var r in this.originalStyle)n[r]=this.originalStyle[r];this.element.unbind(".isotope").undelegate("."+t.hiddenClass,"click").removeClass(t.containerClass).removeData("isotope"),x.unbind(".isotope")},_getSegments:function(e){var t=this.options.layoutMode,n=e?"rowHeight":"columnWidth",r=e?"height":"width",i=e?"rows":"cols",s=this.element[r](),u,a=this.options[t]&&this.options[t][n]||this.$filteredAtoms["outer"+o(r)](!0)||s;u=Math.floor(s/a),u=Math.max(u,1),this[t][i]=u,this[t][n]=a},_checkIfSegmentsChanged:function(e){var t=this.options.layoutMode,n=e?"rows":"cols",r=this[t][n];return this._getSegments(e),this[t][n]!==r},_masonryReset:function(){this.masonry={},this._getSegments();var e=this.masonry.cols;this.masonry.colYs=[];while(e--)this.masonry.colYs.push(0)},_masonryLayout:function(e){var n=this,r=n.masonry;e.each(function(){var e=t(this),i=Math.ceil(e.outerWidth(!0)/r.columnWidth);i=Math.min(i,r.cols);if(i===1)n._masonryPlaceBrick(e,r.colYs);else{var s=r.cols+1-i,o=[],u,a;for(a=0;ar&&(i.x=0,i.y=i.height),n._pushPosition(e,i.x,i.y),i.height=Math.max(i.y+o,i.height),i.x+=s})},_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 n=this,r=this.cellsByRow;e.each(function(){var e=t(this),i=r.index%r.cols,s=Math.floor(r.index/r.cols),o=(i+.5)*r.columnWidth-e.outerWidth(!0)/2,u=(s+.5)*r.rowHeight-e.outerHeight(!0)/2;n._pushPosition(e,o,u),r.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 n=this;e.each(function(e){var r=t(this);n._pushPosition(r,0,n.straightDown.y),n.straightDown.y+=r.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;this.masonryHorizontal.rowXs=[];while(e--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(e){var n=this,r=n.masonryHorizontal;e.each(function(){var e=t(this),i=Math.ceil(e.outerHeight(!0)/r.rowHeight);i=Math.min(i,r.rows);if(i===1)n._masonryHorizontalPlaceBrick(e,r.rowXs);else{var s=r.rows+1-i,o=[],u,a;for(a=0;ar&&(i.x=i.width,i.y=0),n._pushPosition(e,i.x,i.y),i.width=Math.max(i.x+s,i.width),i.y+=o})},_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 n=this,r=this.cellsByColumn;e.each(function(){var e=t(this),i=Math.floor(r.index/r.rows),s=r.index%r.rows,o=(i+.5)*r.columnWidth-e.outerWidth(!0)/2,u=(s+.5)*r.rowHeight-e.outerHeight(!0)/2;n._pushPosition(e,o,u),r.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 n=this;e.each(function(e){var r=t(this);n._pushPosition(r,n.straightAcross.x,0),n.straightAcross.x+=r.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},t.fn.imagesLoaded=function(e){function u(){e.call(n,r)}function a(e){var n=e.target;n.src!==s&&t.inArray(n,o)===-1&&(o.push(n),--i<=0&&(setTimeout(u),r.unbind(".imagesLoaded",a)))}var n=this,r=n.find("img").add(n.filter("img")),i=r.length,s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",o=[];return i||u(),r.bind("load.imagesLoaded error.imagesLoaded",a).each(function(){var e=this.src;this.src=s,this.src=e}),n};var T=function(t){e.console&&e.console.error(t)};t.fn.isotope=function(e,n){if(typeof e=="string"){var r=Array.prototype.slice.call(arguments,1);this.each(function(){var n=t.data(this,"isotope");if(!n){T("cannot call methods on isotope prior to initialization; attempted to call method '"+e+"'");return}if(!t.isFunction(n[e])||e.charAt(0)==="_"){T("no such method '"+e+"' for isotope instance");return}n[e].apply(n,r)})}else this.each(function(){var r=t.data(this,"isotope");r?(r.option(e),r._init(n)):t.data(this,"isotope",new t.Isotope(e,this,n))});return this}})(window,jQuery);