diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/www/script/browse.js | 2 | ||||
-rw-r--r-- | share/www/script/couch.js | 4 | ||||
-rw-r--r-- | share/www/script/couch_tests.js | 16 | ||||
-rw-r--r-- | share/www/script/jquery.couch.js | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/share/www/script/browse.js b/share/www/script/browse.js index 4491246b..ec514f09 100644 --- a/share/www/script/browse.js +++ b/share/www/script/browse.js @@ -791,7 +791,7 @@ function CouchDocumentPage() { .attr("href", db.uri + encodeURIComponent(docId) + "/" + encodeURIComponent(name)) .wrapInner("<tt></tt>").appendTo(li); $("<span>()</span>").text("" + prettyPrintSize(attachment.length) + - ", " + attachment["content-type"]).addClass("info").appendTo(li); + ", " + attachment.content_type).addClass("info").appendTo(li); _initAttachmentItem(name, attachment, li); return li; } diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 847467d4..947a5137 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -33,7 +33,7 @@ function CouchDB(name) { if (req.status == 404) return false; var result = JSON.parse(req.responseText); - if (req.status != 202) + if (req.status != 200) throw result; return result; } @@ -73,7 +73,7 @@ function CouchDB(name) { this.deleteDoc = function(doc) { var req = request("DELETE", this.uri + encodeURIComponent(doc._id) + "?rev=" + doc._rev); var result = JSON.parse(req.responseText); - if (req.status != 202) + if (req.status != 200) throw result; doc._rev = result.rev; //record rev in input document doc._deleted = true; diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index ea31e140..8693d38c 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -388,11 +388,11 @@ var tests = { if (debug) debugger; var binAttDoc = { - _id:"bin_doc", + _id: "bin_doc", _attachments:{ "foo.txt": { - "content-type":"text/plain", - "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" + content_type:"text/plain", + data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" } } } @@ -401,7 +401,7 @@ var tests = { var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"); T(xhr.responseText == "This is a base64 encoded text") - T(xhr.getResponseHeader("content-type") == "text/plain") + T(xhr.getResponseHeader("Content-Type") == "text/plain") }, content_negotiation: function(debug) { @@ -954,11 +954,11 @@ var tests = { var binAttDoc = { - _id:"bin_doc", + _id: "bin_doc", _attachments:{ "foo.txt": { - "content-type":"text/plain", - "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" + content_type:"text/plain", + data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" } } } @@ -982,7 +982,7 @@ var tests = { var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"); T(xhr.responseText == "This is a base64 encoded text") - T(xhr.getResponseHeader("content-type") == "text/plain") + T(xhr.getResponseHeader("Content-Type") == "text/plain") var compactedsize = db.info().disk_size; diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 5dfb6025..1e3e623c 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -78,7 +78,7 @@ type: "DELETE", url: this.uri, dataType: "json", complete: function(req) { var resp = $.httpData(req, "json"); - if (req.status == 202) { + if (req.status == 200) { if (options.success) options.success(resp); } else if (options.error) { options.error(req.status, resp.error, resp.reason); @@ -176,7 +176,7 @@ dataType: "json", complete: function(req) { var resp = $.httpData(req, "json"); - if (req.status == 202) { + if (req.status == 200) { if (options.success) options.success(resp); } else if (options.error) { options.error(req.status, resp.error, resp.reason); |