Browse Source

Merge branch 'master' into gh-pages

v1
David DeSandro 13 years ago
parent
commit
adf4aecd6c
  1. 2
      _posts/docs/2010-12-04-methods.mdown
  2. 56
      jquery.isotope.js
  3. 8
      jquery.isotope.min.js
  4. 16
      minify.sh

2
_posts/docs/2010-12-04-methods.mdown

@ -130,7 +130,7 @@ Re-collects all item elements in their current order in the DOM. Useful for pre
{% highlight javascript %} {% highlight javascript %}
.isotope( 'remove', $items ) .isotope( 'remove', $items, callback )
{% endhighlight %} {% endhighlight %}

56
jquery.isotope.js

@ -1,20 +1,22 @@
/** /**
* Isotope v1.5.10 * Isotope v1.5.11
* An exquisite jQuery plugin for magical layouts * An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co * http://isotope.metafizzy.co
* *
* Commercial use requires one-time license fee * Commercial use requires one-time license fee
* http://metafizzy.co/#licenses * http://metafizzy.co/#licenses
* *
* Copyright 2011 David DeSandro / Metafizzy * Copyright 2012 David DeSandro / Metafizzy
*/ */
/*jshint curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, undef: true */ /*jshint curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, undef: true */
/*global Modernizr: true, jQuery: true */ /*global window: true, jQuery: true */
(function( window, $, undefined ){ (function( window, $, undefined ){
'use strict'; // get global vars
var document = window.document;
var Modernizr = window.Modernizr;
// helper function // helper function
var capitalize = function( str ) { var capitalize = function( str ) {
@ -100,9 +102,11 @@
} }
}; };
if ( window.Modernizr ) { var testName;
if ( Modernizr ) {
// if there's a previous Modernzir, check if there are necessary tests // if there's a previous Modernzir, check if there are necessary tests
for ( var testName in tests) { for ( testName in tests) {
if ( !Modernizr.hasOwnProperty( testName ) ) { if ( !Modernizr.hasOwnProperty( testName ) ) {
// if test hasn't been run, use addTest to run it // if test hasn't been run, use addTest to run it
Modernizr.addTest( testName, tests[ testName ] ); Modernizr.addTest( testName, tests[ testName ] );
@ -110,28 +114,23 @@
} }
} else { } else {
// or create new mini Modernizr that just has the 3 tests // or create new mini Modernizr that just has the 3 tests
window.Modernizr = (function(){ Modernizr = window.Modernizr = {
_version : '1.6ish: miniModernizr for Isotope'
var miniModernizr = { };
_version : '1.6ish: miniModernizr for Isotope'
},
classes = ' ',
result, testName;
// Run through tests
for ( testName in tests) {
result = tests[ testName ]();
miniModernizr[ testName ] = result;
classes += ' ' + ( result ? '' : 'no-' ) + testName;
}
// Add the new classes to the <html> element. var classes = ' ';
$('html').addClass( classes ); var result;
return miniModernizr; // Run through tests
})(); for ( testName in tests) {
} result = tests[ testName ]();
Modernizr[ testName ] = result;
classes += ' ' + ( result ? '' : 'no-' ) + testName;
}
// Add the new classes to the <html> element.
$('html').addClass( classes );
}
// ========================= isoTransform =============================== // ========================= isoTransform ===============================
@ -795,7 +794,7 @@
}, },
// removes elements from Isotope widget // removes elements from Isotope widget
remove: function( $content ) { remove: function( $content, callback ) {
// remove elements from Isotope instance in callback // remove elements from Isotope instance in callback
var instance = this; var instance = this;
var removeContent = function() { var removeContent = function() {
@ -808,10 +807,13 @@
this.styleQueue.push({ $el: $content, style: this.options.hiddenStyle }); this.styleQueue.push({ $el: $content, style: this.options.hiddenStyle });
this.$filteredAtoms = this.$filteredAtoms.not( $content ); this.$filteredAtoms = this.$filteredAtoms.not( $content );
this._sort(); this._sort();
this.reLayout( removeContent ); this.reLayout( removeContent, callback );
} else { } else {
// remove it now // remove it now
removeContent(); removeContent();
if ( callback ) {
callback.call( this.element );
}
} }
}, },

8
jquery.isotope.min.js vendored

File diff suppressed because one or more lines are too long

16
minify.sh

@ -3,13 +3,15 @@
# minifies jquery.isotope.js # minifies jquery.isotope.js
# requires nodejs & uglifyjs # requires nodejs & uglifyjs
JS=jquery.isotope.js IN=jquery.isotope.js
JS_MIN=jquery.isotope.min.js OUT=jquery.isotope.min.js
# minify with UglifyJS # remove any lines that begin with /*jshint or /*global
# then, minify with Uglify JS
# then, add newline characters after `*/`, but not last newline character # then, add newline characters after `*/`, but not last newline character
uglifyjs $JS \ awk '!/^\/\*[jshint|global]/' $IN \
| awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $JS_MIN | uglifyjs \
| awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $OUT
# add trailing semicolon # add trailing semicolon
echo ';' >> $JS_MIN echo ';' >> $OUT
echo "Minified" $JS "as" $JS_MIN echo "Minified" $IN "as" $OUT

Loading…
Cancel
Save