Build: update grunt-jscs-checker and pass with the new rules

This commit is contained in:
Timmy Willison
2014-07-17 10:25:59 -07:00
parent 8e3a0ceafa
commit c869a1ef8a
39 changed files with 352 additions and 187 deletions

View File

@@ -50,7 +50,9 @@ jQuery.extend({
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
} else if ( hooks && "set" in hooks &&
(ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {

View File

@@ -2,9 +2,9 @@ define([
"../core",
"../var/rnotwhite",
"../var/strundefined",
"../data/var/data_priv",
"../data/var/dataPriv",
"../core/init"
], function( jQuery, rnotwhite, strundefined, data_priv ) {
], function( jQuery, rnotwhite, strundefined, dataPriv ) {
var rclass = /[\t\r\n\f]/g;
@@ -104,7 +104,9 @@ jQuery.fn.extend({
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
jQuery( this ).toggleClass(
value.call(this, i, this.className, stateVal), stateVal
);
});
}
@@ -129,14 +131,16 @@ jQuery.fn.extend({
} else if ( type === strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
data_priv.set( this, "__className__", this.className );
dataPriv.set( this, "__className__", this.className );
}
// If the element has a class name or if we're passed `false`,
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
this.className = this.className || value === false ?
"" :
dataPriv.get( this, "__className__" ) || "";
}
});
},
@@ -146,7 +150,9 @@ jQuery.fn.extend({
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
if ( this[i].nodeType === 1 &&
(" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}

View File

@@ -56,9 +56,10 @@ jQuery.extend({
propHooks: {
tabIndex: {
get: function( elem ) {
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
elem.tabIndex :
-1;
return elem.hasAttribute( "tabindex" ) ||
rfocusable.test( elem.nodeName ) || elem.href ?
elem.tabIndex :
-1;
}
}
}

View File

@@ -13,7 +13,8 @@ jQuery.fn.extend({
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
hooks = jQuery.valHooks[ elem.type ] ||
jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
@@ -100,8 +101,10 @@ jQuery.extend({
// IE6-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
( support.optDisabled ?
!option.disabled : option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();