scratch

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 124  →  ?path2? @ 125
/bower_components/jquery/src/attributes/attr.js
@@ -1,73 +1,94 @@
define( [
define([
"../core",
"../var/rnotwhite",
"../var/strundefined",
"../core/access",
"./support",
"../var/rnothtmlwhite",
"../selector"
], function( jQuery, access, support, rnothtmlwhite ) {
], function( jQuery, rnotwhite, strundefined, access, support ) {
 
"use strict";
 
var boolHook,
var nodeHook, boolHook,
attrHandle = jQuery.expr.attrHandle;
 
jQuery.fn.extend( {
jQuery.fn.extend({
attr: function( name, value ) {
return access( this, jQuery.attr, name, value, arguments.length > 1 );
},
 
removeAttr: function( name ) {
return this.each( function() {
return this.each(function() {
jQuery.removeAttr( this, name );
} );
});
}
} );
});
 
jQuery.extend( {
jQuery.extend({
attr: function( elem, name, value ) {
var ret, hooks,
var hooks, ret,
nType = elem.nodeType;
 
// Don't get/set attributes on text, comment and attribute nodes
if ( nType === 3 || nType === 8 || nType === 2 ) {
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
 
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === "undefined" ) {
if ( typeof elem.getAttribute === strundefined ) {
return jQuery.prop( elem, name, value );
}
 
// Attribute hooks are determined by the lowercase version
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
}
 
if ( value !== undefined ) {
 
if ( value === null ) {
jQuery.removeAttr( elem, name );
return;
}
 
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 {
elem.setAttribute( name, value + "" );
return value;
}
 
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
 
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
return ret;
} else {
ret = jQuery.find.attr( elem, name );
 
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
}
},
 
ret = jQuery.find.attr( elem, name );
removeAttr: function( elem, value ) {
var name, propName,
i = 0,
attrNames = value && value.match( rnotwhite );
 
// Non-existent attributes return null, we normalize to undefined
return ret == null ? undefined : ret;
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
 
// Boolean attributes get special treatment (#10870)
if ( jQuery.expr.match.bool.test( name ) ) {
// Set corresponding property to false
elem[ propName ] = false;
}
 
elem.removeAttribute( name );
}
}
},
 
attrHooks: {
@@ -84,29 +105,13 @@
}
}
}
},
 
removeAttr: function( elem, value ) {
var name,
i = 0,
 
// Attribute names can contain non-HTML whitespace characters
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
attrNames = value && value.match( rnothtmlwhite );
 
if ( attrNames && elem.nodeType === 1 ) {
while ( ( name = attrNames[ i++ ] ) ) {
elem.removeAttribute( name );
}
}
}
} );
});
 
// Hooks for boolean attributes
boolHook = {
set: function( elem, value, name ) {
if ( value === false ) {
 
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
@@ -115,26 +120,22 @@
return name;
}
};
 
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
var getter = attrHandle[ name ] || jQuery.find.attr;
 
attrHandle[ name ] = function( elem, name, isXML ) {
var ret, handle,
lowercaseName = name.toLowerCase();
 
var ret, handle;
if ( !isXML ) {
 
// Avoid an infinite loop by temporarily removing this function from the getter
handle = attrHandle[ lowercaseName ];
attrHandle[ lowercaseName ] = ret;
handle = attrHandle[ name ];
attrHandle[ name ] = ret;
ret = getter( elem, name, isXML ) != null ?
lowercaseName :
name.toLowerCase() :
null;
attrHandle[ lowercaseName ] = handle;
attrHandle[ name ] = handle;
}
return ret;
};
} );
});
 
} );
});
/bower_components/jquery/src/attributes/classes.js
@@ -1,47 +1,49 @@
define( [
define([
"../core",
"../core/stripAndCollapse",
"../var/rnothtmlwhite",
"../data/var/dataPriv",
"../var/rnotwhite",
"../var/strundefined",
"../data/var/data_priv",
"../core/init"
], function( jQuery, stripAndCollapse, rnothtmlwhite, dataPriv ) {
], function( jQuery, rnotwhite, strundefined, data_priv ) {
 
"use strict";
var rclass = /[\t\r\n\f]/g;
 
function getClass( elem ) {
return elem.getAttribute && elem.getAttribute( "class" ) || "";
}
 
jQuery.fn.extend( {
jQuery.fn.extend({
addClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
var classes, elem, cur, clazz, j, finalValue,
proceed = typeof value === "string" && value,
i = 0,
len = this.length;
 
if ( jQuery.isFunction( value ) ) {
return this.each( function( j ) {
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
} );
return this.each(function( j ) {
jQuery( this ).addClass( value.call( this, j, this.className ) );
});
}
 
if ( typeof value === "string" && value ) {
classes = value.match( rnothtmlwhite ) || [];
if ( proceed ) {
// The disjunction here is for better compressibility (see removeClass)
classes = ( value || "" ).match( rnotwhite ) || [];
 
while ( ( elem = this[ i++ ] ) ) {
curValue = getClass( elem );
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
for ( ; i < len; i++ ) {
elem = this[ i ];
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
" "
);
 
if ( cur ) {
j = 0;
while ( ( clazz = classes[ j++ ] ) ) {
while ( (clazz = classes[j++]) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
 
// Only assign if different to avoid unneeded rendering.
finalValue = stripAndCollapse( cur );
if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue );
// only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur );
if ( elem.className !== finalValue ) {
elem.className = finalValue;
}
}
}
@@ -51,42 +53,40 @@
},
 
removeClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
var classes, elem, cur, clazz, j, finalValue,
proceed = arguments.length === 0 || typeof value === "string" && value,
i = 0,
len = this.length;
 
if ( jQuery.isFunction( value ) ) {
return this.each( function( j ) {
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
} );
return this.each(function( j ) {
jQuery( this ).removeClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
classes = ( value || "" ).match( rnotwhite ) || [];
 
if ( !arguments.length ) {
return this.attr( "class", "" );
}
 
if ( typeof value === "string" && value ) {
classes = value.match( rnothtmlwhite ) || [];
 
while ( ( elem = this[ i++ ] ) ) {
curValue = getClass( elem );
 
for ( ; i < len; i++ ) {
elem = this[ i ];
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
""
);
 
if ( cur ) {
j = 0;
while ( ( clazz = classes[ j++ ] ) ) {
 
while ( (clazz = classes[j++]) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
 
// Only assign if different to avoid unneeded rendering.
finalValue = stripAndCollapse( cur );
if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue );
finalValue = value ? jQuery.trim( cur ) : "";
if ( elem.className !== finalValue ) {
elem.className = finalValue;
}
}
}
@@ -103,26 +103,20 @@
}
 
if ( jQuery.isFunction( value ) ) {
return this.each( function( i ) {
jQuery( this ).toggleClass(
value.call( this, i, getClass( this ), stateVal ),
stateVal
);
} );
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
 
return this.each( function() {
var className, i, self, classNames;
 
return this.each(function() {
if ( type === "string" ) {
 
// Toggle individual class names
i = 0;
self = jQuery( this );
classNames = value.match( rnothtmlwhite ) || [];
var className,
i = 0,
self = jQuery( this ),
classNames = value.match( rnotwhite ) || [];
 
while ( ( className = classNames[ i++ ] ) ) {
 
while ( (className = classNames[ i++ ]) ) {
// Check each className given, space separated list
if ( self.hasClass( className ) ) {
self.removeClass( className );
@@ -132,12 +126,10 @@
}
 
// Toggle whole class name
} else if ( value === undefined || type === "boolean" ) {
className = getClass( this );
if ( className ) {
 
// Store className if set
dataPriv.set( this, "__className__", className );
} else if ( type === strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
data_priv.set( this, "__className__", this.className );
}
 
// If the element has a class name or if we're passed `false`,
@@ -144,31 +136,23 @@
// 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.
if ( this.setAttribute ) {
this.setAttribute( "class",
className || value === false ?
"" :
dataPriv.get( this, "__className__" ) || ""
);
}
this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
}
} );
});
},
 
hasClass: function( selector ) {
var className, elem,
i = 0;
 
className = " " + selector + " ";
while ( ( elem = this[ i++ ] ) ) {
if ( elem.nodeType === 1 &&
( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
return true;
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
 
return false;
}
} );
});
 
} );
});
/bower_components/jquery/src/attributes/prop.js
@@ -1,39 +1,41 @@
define( [
define([
"../core",
"../core/access",
"./support",
"../selector"
"./support"
], function( jQuery, access, support ) {
 
"use strict";
var rfocusable = /^(?:input|select|textarea|button)$/i;
 
var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i;
 
jQuery.fn.extend( {
jQuery.fn.extend({
prop: function( name, value ) {
return access( this, jQuery.prop, name, value, arguments.length > 1 );
},
 
removeProp: function( name ) {
return this.each( function() {
return this.each(function() {
delete this[ jQuery.propFix[ name ] || name ];
} );
});
}
} );
});
 
jQuery.extend( {
jQuery.extend({
propFix: {
"for": "htmlFor",
"class": "className"
},
 
prop: function( elem, name, value ) {
var ret, hooks,
var ret, hooks, notxml,
nType = elem.nodeType;
 
// Don't get/set properties on text, comment and attribute nodes
if ( nType === 3 || nType === 8 || nType === 2 ) {
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
 
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
 
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
@@ -40,92 +42,41 @@
}
 
if ( value !== undefined ) {
if ( hooks && "set" in hooks &&
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
return ret;
}
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
ret :
( elem[ name ] = value );
 
return ( elem[ name ] = value );
} else {
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
ret :
elem[ name ];
}
 
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
return ret;
}
 
return elem[ name ];
},
 
propHooks: {
tabIndex: {
get: function( elem ) {
 
// Support: IE <=9 - 11 only
// elem.tabIndex doesn't always return the
// correct value when it hasn't been explicitly set
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
// Use proper attribute retrieval(#12072)
var tabindex = jQuery.find.attr( elem, "tabindex" );
 
if ( tabindex ) {
return parseInt( tabindex, 10 );
}
 
if (
rfocusable.test( elem.nodeName ) ||
rclickable.test( elem.nodeName ) &&
elem.href
) {
return 0;
}
 
return -1;
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
elem.tabIndex :
-1;
}
}
},
 
propFix: {
"for": "htmlFor",
"class": "className"
}
} );
});
 
// Support: IE <=11 only
// Accessing the selectedIndex property
// forces the browser to respect setting selected
// on the option
// The getter ensures a default option is selected
// when in an optgroup
// eslint rule "no-unused-expressions" is disabled for this code
// since it considers such accessions noop
if ( !support.optSelected ) {
jQuery.propHooks.selected = {
get: function( elem ) {
 
/* eslint no-unused-expressions: "off" */
 
var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
parent.parentNode.selectedIndex;
}
return null;
},
set: function( elem ) {
 
/* eslint no-unused-expressions: "off" */
 
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
 
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
};
}
 
jQuery.each( [
jQuery.each([
"tabIndex",
"readOnly",
"maxLength",
@@ -138,6 +89,6 @@
"contentEditable"
], function() {
jQuery.propFix[ this.toLowerCase() ] = this;
} );
});
 
} );
});
/bower_components/jquery/src/attributes/support.js
@@ -1,11 +1,8 @@
define( [
"../var/document",
define([
"../var/support"
], function( document, support ) {
], function( support ) {
 
"use strict";
 
( function() {
(function() {
var input = document.createElement( "input" ),
select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) );
@@ -12,22 +9,27 @@
 
input.type = "checkbox";
 
// Support: Android <=4.3 only
// Support: iOS<=5.1, Android<=4.2+
// Default value for a checkbox should be "on"
support.checkOn = input.value !== "";
 
// Support: IE <=11 only
// Support: IE<=11+
// Must access selectedIndex to make default options select
support.optSelected = opt.selected;
 
// Support: IE <=11 only
// Support: Android<=2.3
// Options inside disabled selects are incorrectly marked as disabled
select.disabled = true;
support.optDisabled = !opt.disabled;
 
// Support: IE<=11+
// An input loses its value after becoming a radio
input = document.createElement( "input" );
input.value = "t";
input.type = "radio";
support.radioValue = input.value === "t";
} )();
})();
 
return support;
 
} );
});
/bower_components/jquery/src/attributes/val.js
@@ -1,40 +1,31 @@
define( [
define([
"../core",
"../core/stripAndCollapse",
"./support",
"../core/init"
], function( jQuery, stripAndCollapse, support ) {
], function( jQuery, support ) {
 
"use strict";
 
var rreturn = /\r/g;
 
jQuery.fn.extend( {
jQuery.fn.extend({
val: function( value ) {
var hooks, ret, isFunction,
elem = this[ 0 ];
elem = this[0];
 
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
) {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
 
ret = elem.value;
 
// Handle most common string cases
if ( typeof ret === "string" ) {
return ret.replace( rreturn, "" );
}
 
// Handle cases where value is null/undef or number
return ret == null ? "" : ret;
return typeof ret === "string" ?
// Handle most common string cases
ret.replace(rreturn, "") :
// Handle cases where value is null/undef or number
ret == null ? "" : ret;
}
 
return;
@@ -42,7 +33,7 @@
 
isFunction = jQuery.isFunction( value );
 
return this.each( function( i ) {
return this.each(function( i ) {
var val;
 
if ( this.nodeType !== 1 ) {
@@ -65,63 +56,52 @@
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map( val, function( value ) {
return value == null ? "" : value + "";
} );
});
}
 
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
 
// If set returns undefined, fall back to normal setting
if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
} );
});
}
} );
});
 
jQuery.extend( {
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
 
var val = jQuery.find.attr( elem, "value" );
return val != null ?
val :
 
// Support: IE <=10 - 11 only
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
// Strip and collapse whitespace
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
stripAndCollapse( jQuery.text( elem ) );
jQuery.trim( jQuery.text( elem ) );
}
},
select: {
get: function( elem ) {
var value, option, i,
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one",
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length;
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
 
if ( index < 0 ) {
i = max;
 
} else {
i = one ? index : 0;
}
 
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
 
// Support: IE <=9 only
// IE8-9 doesn't update selected after form reset (#2551)
// 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
!option.disabled &&
( !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();
@@ -147,16 +127,9 @@
 
while ( i-- ) {
option = options[ i ];
 
/* eslint-disable no-cond-assign */
 
if ( option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) {
if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
optionSet = true;
}
 
/* eslint-enable no-cond-assign */
}
 
// Force browsers to behave consistently when non-matching value is set
@@ -167,22 +140,22 @@
}
}
}
} );
});
 
// Radios and checkboxes getter/setter
jQuery.each( [ "radio", "checkbox" ], function() {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
};
if ( !support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) {
return elem.getAttribute( "value" ) === null ? "on" : elem.value;
return elem.getAttribute("value") === null ? "on" : elem.value;
};
}
} );
});
 
} );
});