Sha256: 2510e1edcafb33cc3271aaab27190d283d46453b851430c7393ff733c122584c

Contents?: true

Size: 877 Bytes

Versions: 4

Compression:

Stored size: 877 Bytes

Contents

$.extend({
  modules: function(object) {
    var array = [];
    $.each(object, function(property, names_only) {
      if (property.match(/^[ABCDEFGHIJKLMNOPQRSTUVWXYZ][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]+$/)) {
        array.push(names_only === true ? property : object[property]);
      }
    });
    return array;
  }
});

$.fn.extend({
  serializeHash: function() {
    var hash = {};
    $.each(this.serializeArray(), function() {
      if(hash[this.name] === undefined) {
        hash[this.name] = this.value;
      }
      else {
        if ($.isArray(hash[this.name])) {
          hash[this.name].push(this.value);
        }
        else if (this.name.match(/\[\]$/)) {
          hash[this.name] = [hash[this.name], this.value];
        }
        else {
          hash[this.name] = this.value;
        }
      }
    });
    
    return hash;
  }
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jzip-1.0.10 test/javascripts/assets/jzip/shared/jquery/extensions/core.js
jzip-1.0.9 test/javascripts/assets/jzip/shared/jquery/extensions/core.js
jzip-1.0.8 test/javascripts/assets/jzip/shared/jquery/extensions/core.js
jzip-1.0.7 test/javascripts/assets/jzip/shared/jquery/extensions/core.js