Browse Source

Merge branch 'master' into gh-pages

v1
David DeSandro 13 years ago
parent
commit
d54c05d2f3
  1. 16
      _posts/demos/2010-12-31-relayout.html
  2. 6
      _posts/demos/2011-05-22-category-rows.html
  3. 38
      _posts/demos/2011-06-13-hash-history.html
  4. 6
      _posts/tests/2010-01-01-index.html
  5. 20
      _posts/tests/2011-04-26-item-position-data01.html
  6. 13
      _posts/tests/2011-05-13-jquery-animation01.html
  7. 34
      jquery.isotope.js
  8. 5
      jquery.isotope.min.js

16
_posts/demos/2010-12-31-relayout.html

@ -30,20 +30,6 @@ category: demos
{% include random-sizes.js %} {% 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({ $container.isotope({
itemSelector: '.element', itemSelector: '.element',
masonry : { masonry : {
@ -51,6 +37,8 @@ category: demos
} }
}); });
{% include change-sizes.js %}
}); });
</script> </script>

6
_posts/demos/2011-05-22-category-rows.html

@ -109,8 +109,6 @@ category: demos
animationEngine : $.browser.opera ? 'jquery' : 'best-available' animationEngine : $.browser.opera ? 'jquery' : 'best-available'
}); });
{% include option-set-buttons.js %} {% include option-set-buttons.js %}
{% include add-buttons.js %} {% include add-buttons.js %}
@ -123,10 +121,6 @@ category: demos
return false; return false;
}); });
}); });
</script> </script>

38
_posts/demos/2011-06-13-hash-history.html

@ -4,11 +4,11 @@ layout: default
category: demos category: demos
--- ---
<section id="copy"> <section id="copy">
<p><a href="http://benalman.com/projects/jquery-bbq-plugin/">jQuery BBQ</a> 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.</p> <p><a href="http://benalman.com/projects/jquery-bbq-plugin/">jQuery BBQ</a> 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.</p>
</section> </section>
<section id="options" class="clearfix"> <section id="options" class="clearfix">
<h3>Filters</h3> <h3>Filters</h3>
@ -51,20 +51,20 @@ category: demos
<li><a href="#layoutMode=straightDown">straightDown</a></li> <li><a href="#layoutMode=straightDown">straightDown</a></li>
</ul> </ul>
</section> <!-- #options --> </section> <!-- #options -->
<div id="container" class="variable-sizes clearfix"> <div id="container" class="variable-sizes clearfix">
{% for elem_number in site.random_order | limit:60 %} {% for elem_number in site.random_order | limit:60 %}
{% assign element = site.elements[elem_number] %} {% assign element = site.elements[elem_number] %}
{% include element-partial.html %} {% include element-partial.html %}
{% endfor %} {% endfor %}
</div> <!-- #container --> </div> <!-- #container -->
<script src="../{{ site.jquery_js }}"></script> <script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script> <script src="../{{ site.isotope_js }}"></script>
<script src="../js/jquery.ba-bbq.min.js"></script> <script src="../js/jquery.ba-bbq.min.js"></script>
<script> <script>
$(function(){ $(function(){
var $container = $('#container'), var $container = $('#container'),
// object that will keep track of options // object that will keep track of options
@ -77,16 +77,7 @@ $(function(){
layoutMode: 'masonry' layoutMode: 'masonry'
}; };
{% include random-sizes.js %}
// hacky way of adding random size classes
$container.find('.element').each(function(){
if ( Math.random() > 0.6 ) {
$(this).addClass('width2');
}
if ( Math.random() > 0.6 ) {
$(this).addClass('height2');
}
});
var setupOptions = $.extend( defaultOptions, { var setupOptions = $.extend( defaultOptions, {
itemSelector : '.element', itemSelector : '.element',
@ -184,7 +175,6 @@ $(function(){
// trigger hashchange to capture any hash data on init // trigger hashchange to capture any hash data on init
.trigger('hashchange'); .trigger('hashchange');
});
}); </script>
</script>

6
_posts/tests/2010-01-01-index.html

@ -2,12 +2,12 @@
title: Tests Index title: Tests Index
layout: default layout: default
category: tests category: tests
body_class: doc is_index_page: true
--- ---
<ul> <ul>
{% for post in site.categories[page.category] reversed %} {% for post in site.categories.tests reversed %}
{% if post.layout != 'index-page' %} {% if post.is_index_page != true %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li> <li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

20
_posts/tests/2011-04-26-item-position-data01.html

@ -36,22 +36,6 @@ category: tests
{% include random-sizes.js %} {% 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({ $container.isotope({
itemSelector: '.element', itemSelector: '.element',
itemPositionDataEnabled: true, itemPositionDataEnabled: true,
@ -77,5 +61,9 @@ category: tests
} }
}); });
{% include option-set-buttons.js %}
{% include change-sizes.js %}
}); });
</script> </script>

13
_posts/tests/2011-05-13-jquery-animation01.html

@ -14,7 +14,7 @@ category: tests
</style> </style>
<section id="copy"> <section id="copy">
<p></p> <p>Check that the option setter for animationEngine is properly triggered.</p>
</section> </section>
<section id="options" class="clearfix"> <section id="options" class="clearfix">
@ -28,11 +28,12 @@ category: tests
<ul id="etc" class="clearfix"> <ul id="etc" class="clearfix">
<li id="toggle-animation"><a href="#toggle-animation">Toggle jQuery animation</a></li>
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li> <li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
</ul> </ul>
</section> <!-- #options --> </section> <!-- #options -->
<div id="container"> <div id="container" class="clickable clearfix">
{% for element in site.elements limit:40 %} {% for element in site.elements limit:40 %}
{% include element-partial.html %} {% include element-partial.html %}
{% endfor %} {% endfor %}
@ -77,5 +78,13 @@ category: tests
{% include change-sizes.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;
});
}); });
</script> </script>

34
jquery.isotope.js

@ -1,5 +1,5 @@
/** /**
* Isotope v1.3.110604 * Isotope v1.3.110620
* An exquisite jQuery plugin for magical layouts * An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co * http://isotope.metafizzy.co
* *
@ -9,40 +9,42 @@
* Copyright 2011 David DeSandro / Metafizzy * Copyright 2011 David DeSandro / Metafizzy
*/ */
/*global Modernizr: true */
(function( window, $, undefined ){ (function( window, $, undefined ){
// helper function
function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
// ========================= getStyleProperty by kangax =============================== // ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/ // 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) { function getStyleProperty( propName, element ) {
element = element || document.documentElement; element = element || document.documentElement;
var style = element.style, var style = element.style,
prefixed; prefixed;
// test standard property first // test standard property first
if (typeof style[propName] === 'string') { if ( typeof style[propName] === 'string' ) {
return propName; return propName;
} }
// capitalize // capitalize
propName = propName.charAt(0).toUpperCase() + propName.slice(1); propName = capitalize( propName );
// test vendor specific properties // test vendor specific properties
for (var i=0, l=prefixes.length; i<l; i++) { for ( var i=0, len = prefixes.length; i < len; i++ ) {
prefixed = prefixes[i] + propName; prefixed = prefixes[i] + propName;
if (typeof style[prefixed] === 'string') { if ( typeof style[ prefixed ] === 'string' ) {
return prefixed; return prefixed;
} }
} }
} }
return getStyleProperty;
})();
var transformProp = getStyleProperty('transform'); var transformProp = getStyleProperty('transform');
// ========================= miniModernizr =============================== // ========================= miniModernizr ===============================
@ -68,7 +70,6 @@
*/ */
var docElement = document.documentElement, var docElement = document.documentElement,
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
tests = [ tests = [
{ {
name : 'csstransforms', name : 'csstransforms',
@ -84,6 +85,7 @@
if ( test ){ if ( test ){
var st = document.createElement('style'), var st = document.createElement('style'),
div = document.createElement('div'), div = document.createElement('div'),
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
mq = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)'; mq = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)';
st.textContent = mq + '{#modernizr{height:3px}}'; st.textContent = mq + '{#modernizr{height:3px}}';
@ -452,7 +454,7 @@
// trigger _updateOptionName if it exists // trigger _updateOptionName if it exists
_updateOption : function( optionName ) { _updateOption : function( optionName ) {
var updateOptionFn = '_update' + optionName.charAt(0).toUpperCase() + optionName.slice(1); var updateOptionFn = '_update' + capitalize( optionName );
if ( this[ updateOptionFn ] ) { if ( this[ updateOptionFn ] ) {
this[ updateOptionFn ](); this[ updateOptionFn ]();
} }
@ -856,7 +858,7 @@
} }
// position the brick // position the brick
x = this.masonry.columnWidth * shortCol; var x = this.masonry.columnWidth * shortCol,
y = minimumY; y = minimumY;
this._pushPosition( $brick, x, y ); this._pushPosition( $brick, x, y );
@ -1042,7 +1044,7 @@
} }
// position the brick // position the brick
x = minimumX; var x = minimumX,
y = this.masonryHorizontal.rowHeight * smallRow; y = this.masonryHorizontal.rowHeight * smallRow;
this._pushPosition( $brick, x, y ); this._pushPosition( $brick, x, y );

5
jquery.isotope.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save