// Generated by CoffeeScript 1.9.1
(function() {
  var $;

  $ = jQuery;

  $.fn.extend({
    serializeForm: function(options) {
      var data, field, form, i, len, ref, settings;
      settings = {
        include_disabled: true
      };
      settings = $.extend(settings, options);
      data = {};
      form = $(this);
      ref = form.find('input, select, textarea');
      for (i = 0, len = ref.length; i < len; i++) {
        field = ref[i];
        if ((!field.disabled || settings['include_disabled']) && (field.type !== "radio" || field.checked)) {
          data[field.name] = (function() {
            switch (field.type) {
              case 'checkbox':
                return $(field).prop("checked");
              case 'select-multiple':
                return $(field).val().join(':');
              default:
                return $(field).val();
            }
          })();
        }
      }
      return data;
    }
  });

}).call(this);
