summaryrefslogtreecommitdiffstatshomepage
path: root/src/wp-includes/js/jquery/jquery.serialize-object.js
diff options
context:
space:
mode:
authorAndrew Nacin <nacin@git.wordpress.org>2013-08-07 05:25:25 +0000
committerAndrew Nacin <nacin@git.wordpress.org>2013-08-07 05:25:25 +0000
commitb43712e0f79a9f5bea52217e06155e2f471c490c (patch)
tree23d331e7b2f29689571f03cfa5f9b7b3b6cafab8 /src/wp-includes/js/jquery/jquery.serialize-object.js
parent5bbd08e1d17079a2e852517351f7405884a156b3 (diff)
downloadwordpress-b43712e0f79a9f5bea52217e06155e2f471c490c.tar.gz
wordpress-b43712e0f79a9f5bea52217e06155e2f471c490c.zip
New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory. * New task runner (Grunt), configured to copy a built WordPress to build/. * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js. * Remove Akismet external from develop.svn. Still exists in core.svn. * Drop minified files from src/. The build process will now generate these. props koop. see #24976. and see http://wp.me/p2AvED-1AI. git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-includes/js/jquery/jquery.serialize-object.js')
-rw-r--r--src/wp-includes/js/jquery/jquery.serialize-object.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/wp-includes/js/jquery/jquery.serialize-object.js b/src/wp-includes/js/jquery/jquery.serialize-object.js
new file mode 100644
index 0000000000..03b905bf5b
--- /dev/null
+++ b/src/wp-includes/js/jquery/jquery.serialize-object.js
@@ -0,0 +1,31 @@
+/*!
+ * jQuery serializeObject - v0.2 - 1/20/2010
+ * http://benalman.com/projects/jquery-misc-plugins/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+
+// Whereas .serializeArray() serializes a form into an array, .serializeObject()
+// serializes a form into an (arguably more useful) object.
+
+(function($,undefined){
+ '$:nomunge'; // Used by YUI compressor.
+
+ $.fn.serializeObject = function(){
+ var obj = {};
+
+ $.each( this.serializeArray(), function(i,o){
+ var n = o.name,
+ v = o.value;
+
+ obj[n] = obj[n] === undefined ? v
+ : $.isArray( obj[n] ) ? obj[n].concat( v )
+ : [ obj[n], v ];
+ });
+
+ return obj;
+ };
+
+})(jQuery);