From c6b3094ce1de1d7cfad87c3fef8045d8ab23b5e3 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 27 Feb 2012 09:25:52 -0500 Subject: [PATCH 1/3] specify JSHint options remove strict mode event.type === 'error' window.jQuery v2.0.1 --- jquery.imagesloaded.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery.imagesloaded.js b/jquery.imagesloaded.js index 2bdd88d..14375e8 100644 --- a/jquery.imagesloaded.js +++ b/jquery.imagesloaded.js @@ -1,11 +1,13 @@ /*! - * jQuery imagesLoaded plugin v2.0.0 + * jQuery imagesLoaded plugin v2.0.1 * http://github.com/desandro/imagesloaded * * MIT License. by Paul Irish et al. */ + +/*jshint curly: true, eqeqeq: true, noempty: true, undef: true, browser: true */ + ;(function($, undefined) { -'use strict'; // blank image data-uri bypasses webkit log warning (thx doug jones) var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='; @@ -73,7 +75,7 @@ $.fn.imagesLoaded = function( callback ) { } else { $images.bind( 'load.imagesLoaded error.imagesLoaded', function( event ){ // trigger imgLoaded - imgLoaded( event.target, event.type == 'error' ); + imgLoaded( event.target, event.type === 'error' ); }).each( function( i, el ) { var src = el.src; @@ -105,4 +107,4 @@ $.fn.imagesLoaded = function( callback ) { return deferred ? deferred.promise( $this ) : $this; }; -})(jQuery); \ No newline at end of file +})(window.jQuery); \ No newline at end of file From e9ebf7c6c51a76ec7e2a4a66cad40b653327e41f Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 27 Feb 2012 09:31:13 -0500 Subject: [PATCH 2/3] re-enable strict mode whoops, didn't realize that it _can_ be set in block-level https://developer.mozilla.org/en/JavaScript/Strict_mode#Strict_mode_for_functions --- jquery.imagesloaded.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.imagesloaded.js b/jquery.imagesloaded.js index 14375e8..cbb72e3 100644 --- a/jquery.imagesloaded.js +++ b/jquery.imagesloaded.js @@ -5,9 +5,10 @@ * MIT License. by Paul Irish et al. */ -/*jshint curly: true, eqeqeq: true, noempty: true, undef: true, browser: true */ +/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */ ;(function($, undefined) { +'use strict'; // blank image data-uri bypasses webkit log warning (thx doug jones) var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='; From 9e8766137f15116f64c614dc072a48dd757074e5 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 27 Feb 2012 23:07:58 -0500 Subject: [PATCH 3/3] jshint : jQuery gets global --- jquery.imagesloaded.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.imagesloaded.js b/jquery.imagesloaded.js index cbb72e3..a488974 100644 --- a/jquery.imagesloaded.js +++ b/jquery.imagesloaded.js @@ -6,6 +6,7 @@ */ /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */ +/*global jQuery: false */ ;(function($, undefined) { 'use strict'; @@ -108,4 +109,4 @@ $.fn.imagesLoaded = function( callback ) { return deferred ? deferred.promise( $this ) : $this; }; -})(window.jQuery); \ No newline at end of file +})(jQuery); \ No newline at end of file