From 01ab079b194212b64f802d6a0f0557f5a04f4b80 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 10 Feb 2011 17:15:26 -0500 Subject: [PATCH] src : JSLint and var edits --- jquery.isotope.js | 12 ++++++------ jquery.isotope.min.js | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/jquery.isotope.js b/jquery.isotope.js index b1955f8..4d16a56 100644 --- a/jquery.isotope.js +++ b/jquery.isotope.js @@ -79,7 +79,7 @@ vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '), classes = [], docElement = document.documentElement, - i, l, + i, len, tests = [ { @@ -135,7 +135,7 @@ return miniModernizr; - }(this,this.document)); + })(this,this.document); @@ -903,7 +903,7 @@ }, _fitRowsResize : function() { - return this.reLayout() + return this.reLayout(); }, @@ -962,7 +962,7 @@ var $this = $(this), y = instance.straightDown.y + instance.posTop; instance._pushPosition( $this, instance.posLeft, y ); - instance.straightDown.y += $this.outerHeight(true) + instance.straightDown.y += $this.outerHeight(true); }); return this; }, @@ -1023,10 +1023,10 @@ // how many different places could this brick fit horizontally var groupCount = instance.masonryHorizontal.rows + 1 - rowSpan, groupX = [], - groupRowX; + groupRowX, i; // for each group potential horizontal position - for ( var i=0; i < groupCount; i++ ) { + for ( i=0; i < groupCount; i++ ) { // make an array of colY values for that one group groupRowX = instance.masonryHorizontal.rowXs.slice( i, i+rowSpan ); // and get the max value of the array diff --git a/jquery.isotope.min.js b/jquery.isotope.min.js index 599b54d..16ba2ef 100644 --- a/jquery.isotope.min.js +++ b/jquery.isotope.min.js @@ -8,13 +8,13 @@ * * Copyright 2011 David DeSandro / Metafizzy */ -(function(n,f,s){var o=function(){var a=["Moz","Webkit","Khtml","O","Ms"],b={};return function(c,d){d=d||document.documentElement;var e=d.style,g,h,i,j;if(arguments.length===1&&typeof b[c]==="string")return b[c];if(typeof e[c]==="string")return b[c]=c;h=c.charAt(0).toUpperCase()+c.slice(1);i=0;for(j=a.length;ib.height){b.fitColumns.x=b.fitColumns.width;b.fitColumns.y=0}b._pushPosition(c,b.fitColumns.x+b.posLeft,b.fitColumns.y+b.posTop);b.fitColumns.width=Math.max(b.fitColumns.x+d,b.fitColumns.width); b.fitColumns.y+=e})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResize:function(){return this.reLayout()},_cellsByColumnReset:function(){this.cellsByColumn={};this._getSegments("cellsByColumn",true);this.cellsByColumn.columnWidth=this.options.cellsByColumn.columnWidth||this.$allAtoms.outerHeight(true);return this},_cellsByColumnLayout:function(a){var b=this,c=this.cellsByColumn.rows;this.cellsByColumn.atomsLen=a.length;a.each(function(d){var e=f(this),g= (~~(d/c)+0.5)*b.cellsByColumn.columnWidth-e.outerWidth(true)/2+b.posLeft;d=(d%c+0.5)*b.cellsByColumn.rowHeight-e.outerHeight(true)/2+b.posTop;b._pushPosition(e,g,d)});return this},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.cellsByColumn.atomsLen/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth+this.posLeft}},_cellsByColumnResize:function(){var a=this.cellsByColumn.rows;this._getSegments("cellsByColumn",true);this.cellsByColumn.rows!==a&&this.reLayout();return this}}; -f.fn.imagesLoaded=function(a){var b=this.find("img"),c=b.length,d=this;b.bind("load",function(){--c<=0&&a.call(d)}).each(function(){if(this.complete||this.complete===s){var e=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";this.src=e}});return this};f.widget=f.widget||{};f.widget.bridge=f.widget.bridge||function(a,b){f.fn[a]=function(c){var d=typeof c==="string",e=Array.prototype.slice.call(arguments,1),g=this;c=!d&&e.length?f.extend.apply(null,[true,c].concat(e)): -c;if(d&&c.charAt(0)==="_")return g;d?this.each(function(){var h=f.data(this,a);if(!h)return f.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+c+"'");if(!f.isFunction(h[c]))return f.error("no such method '"+c+"' for "+a+" widget instance");var i=h[c].apply(h,e);if(i!==h&&i!==s){g=i;return false}}):this.each(function(){var h=f.data(this,a);h?h.option(c||{})._init():f.data(this,a,new b(c,this))});return g}};f.widget.bridge("isotope",f.Isotope)})(window,jQuery); +f.fn.imagesLoaded=function(a){var b=this.find("img"),c=b.length,d=this;b.bind("load",function(){--c<=0&&a.call(d)}).each(function(){if(this.complete||this.complete===t){var e=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";this.src=e}});return this};f.widget=f.widget||{};f.widget.bridge=f.widget.bridge||function(a,b){f.fn[a]=function(c){var d=typeof c==="string",e=Array.prototype.slice.call(arguments,1),g=this;c=!d&&e.length?f.extend.apply(null,[true,c].concat(e)): +c;if(d&&c.charAt(0)==="_")return g;d?this.each(function(){var h=f.data(this,a);if(!h)return f.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+c+"'");if(!f.isFunction(h[c]))return f.error("no such method '"+c+"' for "+a+" widget instance");var i=h[c].apply(h,e);if(i!==h&&i!==t){g=i;return false}}):this.each(function(){var h=f.data(this,a);h?h.option(c||{})._init():f.data(this,a,new b(c,this))});return g}};f.widget.bridge("isotope",f.Isotope)})(window,jQuery);