Sha256: 8d147510f30f51516ea6ff146fde09765870c2466dd87ec5a604eabeed32331b

Contents?: true

Size: 1.06 KB

Versions: 24

Compression:

Stored size: 1.06 KB

Contents

//>>excludeStart("exclude", pragmas.exclude);
define([ "shoestring" ], function(){
//>>excludeEnd("exclude");

	shoestring.inputTypes = [
		"text",
		"hidden",
		"password",
		"color",
		"date",
		"datetime",
		// "datetime\-local" matched by datetime
		"email",
		"month",
		"number",
		"range",
		"search",
		"tel",
		"time",
		"url",
		"week"
	];

	shoestring.inputTypeTest = new RegExp( shoestring.inputTypes.join( "|" ) );


	/**
	 * Serialize child input element values into an object.
	 *
	 * @return shoestring
	 * @this shoestring
	 */
	shoestring.fn.serialize = function(){
		var data = {};

		shoestring( "input, select", this ).each(function(){
			var type = this.type, name = this.name,	value = this.value;

			if( shoestring.inputTypeTest.test( type ) ||
					( type === "checkbox" || type === "radio" ) &&
					this.checked ){

				data[ name ] = value;
			}	else if( this.nodeName === "SELECT" ){
				data[ name ] = this.options[ this.selectedIndex ].nodeValue;
			}
		});

		return data;
	};

//>>excludeStart("exclude", pragmas.exclude);
});
//>>excludeEnd("exclude");

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.7 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.6 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.5 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.4 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.3 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.2 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.1 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3.5 node_modules/shoestring/src/dom/serialize.js
trusty-cms-5.0.0 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3.4 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3.3 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3.2 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3.1 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.3 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.2.3 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.2.2 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.2.1 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.2 node_modules/shoestring/src/dom/serialize.js
trusty-cms-4.1.9 node_modules/shoestring/src/dom/serialize.js