From 7dd9f335d30e0676b6cfb618358063123da73bcf Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 09:17:17 -0400 Subject: [PATCH 1/6] demos : hash-history whitespace fix --- _posts/demos/2011-06-13-hash-history.html | 306 +++++++++++----------- 1 file changed, 148 insertions(+), 158 deletions(-) diff --git a/_posts/demos/2011-06-13-hash-history.html b/_posts/demos/2011-06-13-hash-history.html index 5d559f8..43ff8ec 100644 --- a/_posts/demos/2011-06-13-hash-history.html +++ b/_posts/demos/2011-06-13-hash-history.html @@ -4,187 +4,177 @@ layout: default category: demos --- -
-

jQuery BBQ by Ben Alman allows you to use hash history to save Isotope options. Try clicking a couple options then hitting the back button, or copying the URL and pasting it into a new window.

-
+
+

jQuery BBQ by Ben Alman allows you to use hash history to save Isotope options. Try clicking a couple options then hitting the back button, or copying the URL and pasting it into a new window.

+
-
+
-

Filters

+

Filters

- + -

Sort

+

Sort

- + -

Sort direction

+

Sort direction

- + -

Layout modes

+

Layout modes

- + -
+
-
- {% for elem_number in site.random_order | limit:60 %} - {% assign element = site.elements[elem_number] %} - {% include element-partial.html %} - {% endfor %} -
+
+ {% for elem_number in site.random_order | limit:60 %} + {% assign element = site.elements[elem_number] %} + {% include element-partial.html %} + {% endfor %} +
- - - - + + + + }); + From e26f17ed23f369afb18a9135541ec2e80601aa4a Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 09:22:18 -0400 Subject: [PATCH 2/6] demos : add change-sizes.js to relayout; whitespace fix to category rows --- _posts/demos/2010-12-31-relayout.html | 16 ++-------------- _posts/demos/2011-05-22-category-rows.html | 6 ------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/_posts/demos/2010-12-31-relayout.html b/_posts/demos/2010-12-31-relayout.html index f1aae6b..95b9c39 100644 --- a/_posts/demos/2010-12-31-relayout.html +++ b/_posts/demos/2010-12-31-relayout.html @@ -29,20 +29,6 @@ category: demos var $container = $('#container'); {% include random-sizes.js %} - - // toggle variable sizes of all elements - $('#toggle-sizes a').click(function(){ - $container - .toggleClass('variable-sizes') - .isotope('reLayout'); - return false; - }); - - // change size of clicked element - $container.find('.element').click(function(){ - $(this).toggleClass('large'); - $container.isotope('reLayout'); - }); $container.isotope({ itemSelector: '.element', @@ -51,6 +37,8 @@ category: demos } }); + {% include change-sizes.js %} + }); diff --git a/_posts/demos/2011-05-22-category-rows.html b/_posts/demos/2011-05-22-category-rows.html index 5e09fe3..8bb73c0 100644 --- a/_posts/demos/2011-05-22-category-rows.html +++ b/_posts/demos/2011-05-22-category-rows.html @@ -109,8 +109,6 @@ category: demos animationEngine : $.browser.opera ? 'jquery' : 'best-available' }); - - {% include option-set-buttons.js %} {% include add-buttons.js %} @@ -123,10 +121,6 @@ category: demos return false; }); - - - - }); From 7597e871ab9eba0d8893956bdafe92cb5421c81b Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 17 Jun 2011 09:26:36 -0400 Subject: [PATCH 3/6] test : position data : use change-sizes.js --- .../2011-04-26-item-position-data01.html | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/_posts/tests/2011-04-26-item-position-data01.html b/_posts/tests/2011-04-26-item-position-data01.html index eeec37b..9d1c86b 100644 --- a/_posts/tests/2011-04-26-item-position-data01.html +++ b/_posts/tests/2011-04-26-item-position-data01.html @@ -36,22 +36,6 @@ category: tests {% include random-sizes.js %} - {% include option-set-buttons.js %} - - // toggle variable sizes of all elements - $('#toggle-sizes').find('a').click(function(){ - $container - .toggleClass('variable-sizes') - .isotope('reLayout'); - return false; - }); - - // log item position - $container.find('.element').click(function(){ - var position = $(this).data('isotope-item-position'); - console.log( position.x + ', ' + position.y ); - }); - $container.isotope({ itemSelector: '.element', itemPositionDataEnabled: true, @@ -76,6 +60,10 @@ category: tests } } }); + + {% include option-set-buttons.js %} + + {% include change-sizes.js %} }); \ No newline at end of file From 60dba42f1fbfa680f4c5a478ab86ac662b4e8fb6 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 17:53:23 -0400 Subject: [PATCH 4/6] src : jsHinted; remove getStyleProperty from closure; jsHint comment; --- jquery.isotope.js | 60 ++++++++++++++++++++++--------------------- jquery.isotope.min.js | 5 ++-- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/jquery.isotope.js b/jquery.isotope.js index d2b2485..d98a7c6 100644 --- a/jquery.isotope.js +++ b/jquery.isotope.js @@ -1,5 +1,5 @@ /** - * Isotope v1.3.110604 + * Isotope v1.3.110620 * An exquisite jQuery plugin for magical layouts * http://isotope.metafizzy.co * @@ -9,39 +9,41 @@ * Copyright 2011 David DeSandro / Metafizzy */ +/*global Modernizr: true */ + (function( window, $, undefined ){ + // helper function + function capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + // ========================= getStyleProperty by kangax =============================== // http://perfectionkills.com/feature-testing-css-properties/ - var getStyleProperty = (function(){ + var prefixes = 'Moz Webkit Khtml O Ms'.split(' '); - var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms']; + function getStyleProperty( propName, element ) { + element = element || document.documentElement; + var style = element.style, + prefixed; - function getStyleProperty(propName, element) { - element = element || document.documentElement; - var style = element.style, - prefixed; - - // test standard property first - if (typeof style[propName] === 'string') { - return propName; - } + // test standard property first + if ( typeof style[propName] === 'string' ) { + return propName; + } - // capitalize - propName = propName.charAt(0).toUpperCase() + propName.slice(1); + // capitalize + propName = capitalize( propName ); - // test vendor specific properties - for (var i=0, l=prefixes.length; ig?1:fd&&(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=~~(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=~~(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){var b=this.find("img"),d=b.length,e=this;b.length||a.call(this),b.bind("load",function(){--d<=0&&a.call(e)}).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.src=a}});return this};var q=function(a){this.console&&console.error(a)};b.fn.isotope=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"isotope");if(!d)q("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){q("no such method '"+a+"' for isotope instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"isotope");c?(c.option(a),c._init()):b.data(this,"isotope",new b.Isotope(a,this))});return this}})(window,jQuery); +/*global Modernizr: true */ +(function(a,b,c){function f(a,b){b=b||document.documentElement;var c=b.style,f;if(typeof c[a]=="string")return a;a=d(a);for(var g=0,h=e.length;gg?1:fd&&(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=~~(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=~~(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){var b=this.find("img"),d=b.length,e=this;b.length||a.call(this),b.bind("load",function(){--d<=0&&a.call(e)}).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.src=a}});return this};var r=function(a){this.console&&console.error(a)};b.fn.isotope=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"isotope");if(!d)r("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){r("no such method '"+a+"' for isotope instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"isotope");c?(c.option(a),c._init()):b.data(this,"isotope",new b.Isotope(a,this))});return this}})(window,jQuery); From 902ea1a3b9c711de67fe4a1c89539d9ad30380c7 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 17:53:46 -0400 Subject: [PATCH 5/6] tests : index : don't have index show up in list --- _posts/tests/2010-01-01-index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/tests/2010-01-01-index.html b/_posts/tests/2010-01-01-index.html index 9e06779..58d2160 100644 --- a/_posts/tests/2010-01-01-index.html +++ b/_posts/tests/2010-01-01-index.html @@ -2,12 +2,12 @@ title: Tests Index layout: default category: tests -body_class: doc +is_index_page: true ---
    - {% for post in site.categories[page.category] reversed %} - {% if post.layout != 'index-page' %} + {% for post in site.categories.tests reversed %} + {% if post.is_index_page != true %}
  • {{ post.title }}
  • {% endif %} {% endfor %} From 12d7ee9ae165e1045b5b1ee34da9bbce0458842a Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 17:54:04 -0400 Subject: [PATCH 6/6] tests : jquery animation : add button --- _posts/tests/2011-05-13-jquery-animation01.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/_posts/tests/2011-05-13-jquery-animation01.html b/_posts/tests/2011-05-13-jquery-animation01.html index dc9f3a4..b9ec53d 100644 --- a/_posts/tests/2011-05-13-jquery-animation01.html +++ b/_posts/tests/2011-05-13-jquery-animation01.html @@ -14,7 +14,7 @@ category: tests
    -

    +

    Check that the option setter for animationEngine is properly triggered.

    @@ -28,11 +28,12 @@ category: tests
    -
    +
    {% for element in site.elements limit:40 %} {% include element-partial.html %} {% endfor %} @@ -76,6 +77,14 @@ category: tests {% include option-set-buttons.js %} {% include change-sizes.js %} + + var isAnimated = true; + $('#toggle-animation').click(function(){ + isAnimated = !isAnimated; + var aniEngine = isAnimated ? 'jquery' : 'css'; + $container.isotope( 'option', { animationEngine: aniEngine } ); + return false; + }); }); \ No newline at end of file