Browse Source

src : white space for global closure

pull/14/head
David DeSandro 14 years ago
parent
commit
820216890e
  1. 208
      jquery.isotope.js

208
jquery.isotope.js

@ -13,131 +13,131 @@
(function( window, $, undefined ){ (function( window, $, undefined ){
// ========================= getStyleProperty by kangax =============================== // ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/ // http://perfectionkills.com/feature-testing-css-properties/
var getStyleProperty = (function(){ var getStyleProperty = (function(){
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms']; var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'];
var _cache = { }; var _cache = { };
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,
uPropName, uPropName,
i, l; i, l;
// check cache only when no element is given // check cache only when no element is given
if (arguments.length === 1 && typeof _cache[propName] === 'string') { if (arguments.length === 1 && typeof _cache[propName] === 'string') {
return _cache[propName]; return _cache[propName];
} }
// test standard property first // test standard property first
if (typeof style[propName] === 'string') { if (typeof style[propName] === 'string') {
return (_cache[propName] = propName); return (_cache[propName] = propName);
} }
// capitalize // capitalize
uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); uPropName = propName.charAt(0).toUpperCase() + propName.slice(1);
// test vendor specific properties // test vendor specific properties
for (i=0, l=prefixes.length; i<l; i++) { for (i=0, l=prefixes.length; i<l; i++) {
prefixed = prefixes[i] + uPropName; prefixed = prefixes[i] + uPropName;
if (typeof style[prefixed] === 'string') { if (typeof style[prefixed] === 'string') {
return (_cache[propName] = prefixed); return (_cache[propName] = prefixed);
}
} }
} }
}
return getStyleProperty;
}());
// ========================= miniModernizr =============================== return getStyleProperty;
// <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting }());
/*! // ========================= miniModernizr ===============================
* Modernizr v1.6ish: miniModernizr for Isotope // <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting
* http://www.modernizr.com
* /*!
* Developed by: * Modernizr v1.6ish: miniModernizr for Isotope
* - Faruk Ates http://farukat.es/ * http://www.modernizr.com
* - Paul Irish http://paulirish.com/ *
* * Developed by:
* Copyright (c) 2009-2010 * - Faruk Ates http://farukat.es/
* Dual-licensed under the BSD or MIT licenses. * - Paul Irish http://paulirish.com/
* http://www.modernizr.com/license/ *
*/ * Copyright (c) 2009-2010
* Dual-licensed under the BSD or MIT licenses.
* http://www.modernizr.com/license/
*/
/* /*
* This version whittles down the script just to check support for * This version whittles down the script just to check support for
* CSS transitions, transforms, and 3D transforms. * CSS transitions, transforms, and 3D transforms.
*/ */
window.Modernizr = window.Modernizr || (function(window,doc,undefined){ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
var version = '1.6ish: miniModernizr for Isotope', var version = '1.6ish: miniModernizr for Isotope',
miniModernizr = {}, miniModernizr = {},
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '), vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
classes = [], classes = [],
docElement = document.documentElement, docElement = document.documentElement,
i, l, i, l,
tests = [ tests = [
{ {
name : 'csstransforms', name : 'csstransforms',
result : function() { result : function() {
return !!getStyleProperty('transform'); return !!getStyleProperty('transform');
} }
}, },
{ {
name : 'csstransforms3d', name : 'csstransforms3d',
result : function() { result : function() {
var test = !!getStyleProperty('perspective'); var test = !!getStyleProperty('perspective');
// double check for Chrome's false positive // double check for Chrome's false positive
if ( test ){ if ( test ){
var st = document.createElement('style'), var st = document.createElement('style'),
div = document.createElement('div'), div = document.createElement('div'),
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}}';
(doc.head || doc.getElementsByTagName('head')[0]).appendChild(st); (doc.head || doc.getElementsByTagName('head')[0]).appendChild(st);
div.id = 'modernizr'; div.id = 'modernizr';
docElement.appendChild(div); docElement.appendChild(div);
test = div.offsetHeight === 3; test = div.offsetHeight === 3;
st.parentNode.removeChild(st); st.parentNode.removeChild(st);
div.parentNode.removeChild(div); div.parentNode.removeChild(div);
}
return !!test;
}
},
{
name : 'csstransitions',
result : function() {
return !!getStyleProperty('transitionProperty');
} }
return !!test;
}
},
{
name : 'csstransitions',
result : function() {
return !!getStyleProperty('transitionProperty');
} }
} ]
] ;
;
// Run through all tests and detect their support in the current UA. // Run through all tests and detect their support in the current UA.
for ( i = 0, len = tests.length; i < len; i++ ) { for ( i = 0, len = tests.length; i < len; i++ ) {
var test = tests[i], var test = tests[i],
result = test.result(); result = test.result();
miniModernizr[ test.name ] = result; miniModernizr[ test.name ] = result;
var className = ( result ? '' : 'no-' ) + test.name; var className = ( result ? '' : 'no-' ) + test.name;
classes.push( className ); classes.push( className );
} }
// Add the new classes to the <html> element. // Add the new classes to the <html> element.
docElement.className += ' ' + classes.join( ' ' ); docElement.className += ' ' + classes.join( ' ' );
return miniModernizr; return miniModernizr;
}(this,this.document)); }(this,this.document));

Loading…
Cancel
Save