You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2010/05/28 00:37:59 UTC
svn commit: r949028 - /couchdb/trunk/share/www/script/jquery.couch.js
Author: jasondavies
Date: Thu May 27 22:37:58 2010
New Revision: 949028
URL: http://svn.apache.org/viewvc?rev=949028&view=rev
Log:
Fix some bugs in jquery.couch.js.
Namely:
* openDoc() was inadvertently adding a ?beforeSuccess=... parameter to
the URL.
* bulkSave() wasn't sending a POST body.
Modified:
couchdb/trunk/share/www/script/jquery.couch.js
Modified: couchdb/trunk/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=949028&r1=949027&r2=949028&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Thu May 27 22:37:58 2010
@@ -271,7 +271,7 @@
openDoc: function(docId, options, ajaxOptions) {
options = options || {};
if (db_opts.attachPrevRev || options.attachPrevRev) {
- $.extend(options, {
+ $.extend(ajaxOptions, {
beforeSuccess : function(req, doc) {
rawDocs[doc._id] = {
rev : doc._rev,
@@ -280,7 +280,7 @@
}
});
} else {
- $.extend(options, {
+ $.extend(ajaxOptions, {
beforeSuccess : function(req, doc) {
if (doc["jquery.couch.attachPrevRev"]) {
rawDocs[doc._id] = {
@@ -344,7 +344,7 @@
ajax({
type: "POST",
url: this.uri + "_bulk_docs" + encodeOptions(options),
- data: toJSON(docs)
+ contentType: "application/json", data: toJSON(docs)
},
options,
"The documents could not be saved"