MCPcopy Index your code
hub / github.com/apache/caldera / access

Function access

static/jquery/jquery.js:4375–4429  ·  view source on GitHub ↗
( elems, fn, key, value, chainable, emptyGet, raw )

Source from the content-addressed store, hash-verified

4373// Multifunctional method to get and set values of a collection
4374// The value/s can optionally be executed if it's a function
4375var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4376 var i = 0,
4377 length = elems.length,
4378 bulk = key == null;
4379
4380 // Sets many values
4381 if ( jQuery.type( key ) === "object" ) {
4382 chainable = true;
4383 for ( i in key ) {
4384 access( elems, fn, i, key[ i ], true, emptyGet, raw );
4385 }
4386
4387 // Sets one value
4388 } else if ( value !== undefined ) {
4389 chainable = true;
4390
4391 if ( !jQuery.isFunction( value ) ) {
4392 raw = true;
4393 }
4394
4395 if ( bulk ) {
4396
4397 // Bulk operations run against the entire set
4398 if ( raw ) {
4399 fn.call( elems, value );
4400 fn = null;
4401
4402 // ...except when executing function values
4403 } else {
4404 bulk = fn;
4405 fn = function( elem, key, value ) {
4406 return bulk.call( jQuery( elem ), value );
4407 };
4408 }
4409 }
4410
4411 if ( fn ) {
4412 for ( ; i < length; i++ ) {
4413 fn(
4414 elems[ i ],
4415 key,
4416 raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
4417 );
4418 }
4419 }
4420 }
4421
4422 return chainable ?
4423 elems :
4424
4425 // Gets
4426 bulk ?
4427 fn.call( elems ) :
4428 length ? fn( elems[ 0 ], key ) : emptyGet;
4429};
4430var rcheckableType = ( /^(?:checkbox|radio)$/i );
4431
4432var rtagName = ( /<([\w:-]+)/ );

Callers 1

jquery.jsFile · 0.85

Calls 1

jQueryFunction · 0.85

Tested by

no test coverage detected