From 91e06e9aebecf67a5c4997408bf0a28fffd03f9d Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Thu, 17 Jul 2014 10:25:59 -0700 Subject: Build: update grunt-jscs-checker and pass with the new rules Conflicts: build/tasks/build.js src/ajax/xhr.js src/attributes/classes.js src/attributes/prop.js src/attributes/val.js src/core/init.js src/core/ready.js src/css.js src/css/curCSS.js src/css/defaultDisplay.js src/data.js src/data/var/dataPriv.js src/data/var/dataUser.js src/dimensions.js src/effects.js src/event.js src/manipulation.js src/offset.js src/queue.js src/selector-native.js test/data/testrunner.js --- src/core/init.js | 5 ++++- src/core/parseHTML.js | 3 ++- src/core/ready.js | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/init.js b/src/core/init.js index f2db547a9..340e378b8 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -26,7 +26,10 @@ var rootjQuery, // Handle HTML strings if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + if ( selector.charAt(0) === "<" && + selector.charAt( selector.length - 1 ) === ">" && + selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; diff --git a/src/core/parseHTML.js b/src/core/parseHTML.js index 64cf2a18a..808d60e3d 100644 --- a/src/core/parseHTML.js +++ b/src/core/parseHTML.js @@ -5,7 +5,8 @@ define([ ], function( jQuery, rsingleTag ) { // data: string of html -// context (optional): If specified, the fragment will be created in this context, defaults to document +// context (optional): If specified, the fragment will be created in this context, +// defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { diff --git a/src/core/ready.js b/src/core/ready.js index 392c4849f..095e6daeb 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -82,7 +82,10 @@ function detach() { */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + if ( document.addEventListener || + event.type === "load" || + document.readyState === "complete" ) { + detach(); jQuery.ready(); } @@ -93,9 +96,12 @@ jQuery.ready.promise = function( obj ) { readyList = jQuery.Deferred(); - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // we once tried to use readyState "interactive" here, + // but it caused issues like the one + // discovered by ChrisS here: + // http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); @@ -122,7 +128,7 @@ jQuery.ready.promise = function( obj ) { try { top = window.frameElement == null && document.documentElement; - } catch(e) {} + } catch ( e ) {} if ( top && top.doScroll ) { (function doScrollCheck() { @@ -132,7 +138,7 @@ jQuery.ready.promise = function( obj ) { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); - } catch(e) { + } catch ( e ) { return setTimeout( doScrollCheck, 50 ); } -- cgit v1.2.3