//     Zepto.js
//     (c) 2010, 2011 Thomas Fuchs
//     Zepto.js may be freely distributed under the MIT license.

(function ($) {

  // ### $.fn.serializeArray
  //
  // Encode a set of form elements as an array of names and values
  //
  // *Example:*
  //
  //     $('#login_form').serializeArray();
  //
  //  returns
  //
  //     [
  //         {
  //             name: 'email',
  //             value: 'koss@nocorp.me'
  //         },
  //         {
  //             name: 'password',
  //             value: '123456'
  //         }
  //     ]
  //
  $.fn.serializeArray = function () {
    var result = [];
    $( Array.prototype.slice.call(this.get(0).elements) ).each(function () {
      if ( $(this).attr('type') !== 'radio' || $(this).is(':checked') ) {
        result.push({
          name: $(this).attr('name'),
          value: $(this).val()
        });
      }
    });
    return result;
  };

  // ### $.fn.serialize
  //
  //
  // Encode a set of form elements as a string for submission
  //
  // *Example:*
  //
  //     $('#login_form').serialize();
  //
  //  returns
  //
  //     "email=koss%40nocorp.me&password=123456"
  //
  $.fn.serialize = function () {
    var result = [];
    this.serializeArray().forEach(function (elm) {
      result.push( encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value) );
    });
    return result.join('&');
  };

  // ### $.fn.submit
  //
  // Trigger submit event for form
  //
  // *Example:*
  //
  //     $('#login_form').submit();
  //
  $.fn.submit = function () {
    return this.each(function () {
      try {
        this.submit();
        return;
      } catch(e) {};
    });
  }

})(Zepto);

@@ -1442,16 +1442,37 @@
 for form
+ or bind submit event
 %0A  //%0A  
@@ -1478,32 +1478,33 @@
  // *Example
+s
 :*%0A  //%0A
   //     $('
@@ -1483,32 +1483,67 @@
 Examples:*%0A  //%0A
+  // To trigger submit event:%0A  //%0A
   //     $('#log
@@ -1563,24 +1563,198 @@
 mit();%0A  //%0A
+  // To bind submit event:%0A  //%0A  //     $('#login_form').submit(function (e) %7B%0A  //         alert('Form was submitted!');%0A  //         e.preventDefault();%0A  //     %7D);%0A  //%0A
   $.fn.submi
@@ -1767,24 +1767,26 @@
 nction (
+fn
 ) %7B%0A    
 return t
@@ -1781,39 +1781,145 @@
     
-return this.each(function () %7B%0A
+var isBind = typeof fn === 'function';%0A    return this.each(function () %7B%0A      if (isBind) %7B%0A        this.submit = fn;%0A      %7D else %7B%0A  
     
@@ -1926,16 +1926,18 @@
   try %7B%0A
+  
         
@@ -1963,16 +1963,18 @@
     
+ 
+ 
 return;%0A
     
@@ -1969,16 +1969,18 @@
 return;%0A
+  
       %7D 
@@ -1992,16 +1992,24 @@
 (e) %7B%7D;%0A
+      %7D%0A
     %7D);%0A

Allow to bind submit event via $.fn.submit (closes #150)