/** * isotope v1.5.25 * an exquisite jquery plugin for magical layouts * http://isotope.metafizzy.co * * commercial use requires one-time license fee * http://metafizzy.co/#licenses * * copyright 2012 david desandro / metafizzy */ (function(a,b,c){"use strict";var d=a.document,e=a.modernizr,f=function(a){return a.charat(0).touppercase()+a.slice(1)},g="moz webkit o ms".split(" "),h=function(a){var b=d.documentelement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e"+d+"{#modernizr{height:3px}}"+"").appendto("head"),f=b('
').appendto("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasownproperty(l)||e.addtest(l,k[l]);else{e=a.modernizr={_version:"1.6ish: minimodernizr for isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addclass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isotransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isotransform",e),a.style[i]=m};b.cssnumber.scale=!0,b.csshooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isotransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.csshooks.scale.set(a.elem,a.now+a.unit)},b.cssnumber.translate=!0,b.csshooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isotransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={webkittransitionproperty:"webkittransitionend",moztransitionproperty:"transitionend",otransitionproperty:"otransitionend otransitionend",transitionproperty:"transitionend"}[j],r=h("transitionduration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&cleartimeout(u),u=settimeout(function(){s[t].apply(c,d)},b==="execasap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execasap"])},b.isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.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},b.isotope.prototype={_create:function(a){this.options=b.extend({},b.isotope.settings,a),this.stylequeue=[],this.elemcount=0;var c=this.element[0].style;this.originalstyle={};var d=v.slice(0);for(var e in this.options.containerstyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.stylequeue,i),j&&k(),this.stylequeue=[]},resize:function(){this["_"+this.options.layoutmode+"resizechanged"]()&&this.relayout()},relayout:function(a){this["_"+this.options.layoutmode+"reset"](),this.layout(this.$filteredatoms,a)},additems:function(a,b){var c=this._getatoms(a);this.$allatoms=this.$allatoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.additems(a,function(a){var d=c._filter(a);c._addhideappended(d),c._sort(),c.relayout(),c._revealappended(d,b)})},appended:function(a,b){var c=this;this.additems(a,function(a){c._addhideappended(a),c.layout(a),c._revealappended(a,b)})},_addhideappended:function(a){this.$filteredatoms=this.$filteredatoms.add(a),a.addclass("no-transition"),this._isinserting=!0,this.stylequeue.push({$el:a,style:this.options.hiddenstyle})},_revealappended:function(a,b){var c=this;settimeout(function(){a.removeclass("no-transition"),c.stylequeue.push({$el:a,style:c.options.visiblestyle}),c._isinserting=!1,c._processstylequeue(a,b)},10)},reloaditems:function(){this.$allatoms=this._getatoms(this.element.children())},remove:function(a,b){this.$allatoms=this.$allatoms.not(a),this.$filteredatoms=this.$filteredatoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenclass+")").length?(this.stylequeue.push({$el:a,style:this.options.hiddenstyle}),this._sort(),this.relayout(d)):d()},shuffle:function(a){this.updatesortdata(this.$allatoms),this.options.sortby="random",this._sort(),this.relayout(a)},destroy:function(){var a=this.usingtransforms,b=this.options;this.$allatoms.removeclass(b.hiddenclass+" "+b.itemclass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalstyle)c[d]=this.originalstyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenclass,"click").removeclass(b.containerclass).removedata("isotope"),w.unbind(".isotope")},_getsegments:function(a){var b=this.options.layoutmode,c=a?"rowheight":"columnwidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredatoms["outer"+f(d)](!0)||g;h=math.floor(g/i),h=math.max(h,1),this[b][e]=h,this[b][c]=i},_checkifsegmentschanged:function(a){var b=this.options.layoutmode,c=a?"rows":"cols",d=this[b][c];return this._getsegments(a),this[b][c]!==d},_masonryreset:function(){this.masonry={},this._getsegments();var a=this.masonry.cols;this.masonry.colys=[];while(a--)this.masonry.colys.push(0)},_masonrylayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=math.ceil(a.outerwidth(!0)/d.columnwidth);e=math.min(e,d.cols);if(e===1)c._masonryplacebrick(a,d.colys);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushposition(a,e.x,e.y),e.height=math.max(e.y+g,e.height),e.x+=f})},_fitrowsgetcontainersize:function(){return{height:this.fitrows.height}},_fitrowsresizechanged:function(){return!0},_cellsbyrowreset:function(){this.cellsbyrow={index:0},this._getsegments(),this._getsegments(!0)},_cellsbyrowlayout:function(a){var c=this,d=this.cellsbyrow;a.each(function(){var a=b(this),e=d.index%d.cols,f=math.floor(d.index/d.cols),g=(e+.5)*d.columnwidth-a.outerwidth(!0)/2,h=(f+.5)*d.rowheight-a.outerheight(!0)/2;c._pushposition(a,g,h),d.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(a){var c=this;a.each(function(a){var d=b(this);c._pushposition(d,0,c.straightdown.y),c.straightdown.y+=d.outerheight(!0)})},_straightdowngetcontainersize:function(){return{height:this.straightdown.y}},_straightdownresizechanged:function(){return!0},_masonryhorizontalreset:function(){this.masonryhorizontal={},this._getsegments(!0);var a=this.masonryhorizontal.rows;this.masonryhorizontal.rowxs=[];while(a--)this.masonryhorizontal.rowxs.push(0)},_masonryhorizontallayout:function(a){var c=this,d=c.masonryhorizontal;a.each(function(){var a=b(this),e=math.ceil(a.outerheight(!0)/d.rowheight);e=math.min(e,d.rows);if(e===1)c._masonryhorizontalplacebrick(a,d.rowxs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushposition(a,e.x,e.y),e.width=math.max(e.x+f,e.width),e.y+=g})},_fitcolumnsgetcontainersize:function(){return{width:this.fitcolumns.width}},_fitcolumnsresizechanged:function(){return!0},_cellsbycolumnreset:function(){this.cellsbycolumn={index:0},this._getsegments(),this._getsegments(!0)},_cellsbycolumnlayout:function(a){var c=this,d=this.cellsbycolumn;a.each(function(){var a=b(this),e=math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnwidth-a.outerwidth(!0)/2,h=(f+.5)*d.rowheight-a.outerheight(!0)/2;c._pushposition(a,g,h),d.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(a){var c=this;a.each(function(a){var d=b(this);c._pushposition(d,c.straightacross.x,0),c.straightacross.x+=d.outerwidth(!0)})},_straightacrossgetcontainersize:function(){return{width:this.straightacross.x}},_straightacrossresizechanged:function(){return!0}},b.fn.imagesloaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inarray(c,g)===-1&&(g.push(c),--e<=0&&(settimeout(h),d.unbind(".imagesloaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,r0lgodlhaqabaiaaaaaaap///ywaaaaaaqabaaacauwaow==",g=[];return e||h(),d.bind("load.imagesloaded error.imagesloaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isfunction(c[a])||a.charat(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.isotope(a,this,c))});return this}})(window,jquery); /* * isotope custom layout mode that extends masonry in order to work with percentage-sized columns */ (function(window, $) { $.extend($.isotope.prototype, { _sloppymasonryreset : function() { // layout-specific props var containersize = this.element.width(), segmentsize = this.options.sloppymasonry && this.options.sloppymasonry.columnwidth || // or use the size of the first item, i.e. outerwidth this.$filteredatoms.outerwidth(true) || // if there's no items, use size of container containersize; this.sloppymasonry = { cols : math.round(containersize / segmentsize), columnwidth : segmentsize }; var i = this.sloppymasonry.cols; this.sloppymasonry.colys = []; while (i--) { this.sloppymasonry.colys.push(0); } }, _sloppymasonrylayout : function($elems) { var instance = this, props = instance.sloppymasonry; $elems.each(function() { var $this = $(this), // how many columns does this brick span colspan = math.round($this.outerwidth(true) / props.columnwidth); colspan = math.min(colspan, props.cols); if (colspan === 1) { // if brick spans only one column, // just like singlemode instance._sloppymasonryplacebrick($this, props.colys); } else { // brick spans more than one column // how many different places could // this brick fit horizontally var groupcount = props.cols + 1 - colspan, groupy = [], groupcoly, i; // for each group potential // horizontal position for (i = 0; i < groupcount; i++) { // make an array of coly values // for that one group groupcoly = props.colys.slice(i, i + colspan); // and get the max value of the // array groupy[i] = math.max.apply(math, groupcoly); } instance._sloppymasonryplacebrick($this, groupy); } }); }, _sloppymasonryplacebrick : function($brick, sety) { // get the minimum y value from the columns var minimumy = math.min.apply(math, sety), shortcol = 0; // find index of short column, the first from the left for ( var i = 0, len = sety.length; i < len; i++) { if (sety[i] === minimumy) { shortcol = i; break; } } // position the brick var x = this.sloppymasonry.columnwidth * shortcol, y = minimumy; this._pushposition($brick, x, y); // apply setheight to necessary columns var setheight = minimumy + $brick.outerheight(true), setspan = this.sloppymasonry.cols + 1 - len; for (i = 0; i < setspan; i++) { this.sloppymasonry.colys[shortcol + i] = setheight; } }, _sloppymasonrygetcontainersize : function() { var containerheight = math.max.apply(math, this.sloppymasonry.colys); return { height : containerheight }; }, _sloppymasonryresizechanged : function() { return true; } }); })(this, this.jquery);