Allow to set stub read buffer size for TextPassDumper
[lhc/web/wiklou.git] / resources / src / jquery / jquery.getAttrs.js
1 /**
2 * @class jQuery.plugin.getAttrs
3 */
4
5 function serializeControls( controls ) {
6 var i, data = {}, len = controls.length;
7
8 for ( i = 0; i < len; i++ ) {
9 data[ controls[i].name ] = controls[i].value;
10 }
11
12 return data;
13 }
14
15 /**
16 * Get the attributes of an element directy as a plain object.
17 *
18 * If there is more than one element in the collection, similar to most other jQuery getter methods,
19 * this will use the first element in the collection.
20 *
21 * @return {Object}
22 */
23 jQuery.fn.getAttrs = function () {
24 return serializeControls( this[0].attributes );
25 };
26
27 /**
28 * Get form data as a plain object mapping form control names to their values.
29 *
30 * @return {Object}
31 */
32 jQuery.fn.serializeObject = function () {
33 return serializeControls( this.serializeArray() );
34 };
35
36 /**
37 * @class jQuery
38 * @mixins jQuery.plugin.getAttrs
39 */