You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2014/03/11 12:18:42 UTC
[1/2] couchdb commit: updated refs/heads/master to 160f826
Repository: couchdb
Updated Branches:
refs/heads/master fffc5b73d -> 160f826e5
More deferred support to jquery.couch.js
COUCHDB-1180
Signed-off-by: Alexander Shorin <kx...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/160f826e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/160f826e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/160f826e
Branch: refs/heads/master
Commit: 160f826e5f61f52bd7830e47f45738bedde11137
Parents: e7548b2
Author: Dale Harvey <da...@arandomurl.com>
Authored: Tue Mar 11 15:16:13 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Mar 11 15:17:39 2014 +0400
----------------------------------------------------------------------
share/www/script/jquery.couch.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/160f826e/share/www/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index facaf9c..ffbad34 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -160,7 +160,7 @@
* @private
*/
userDb : function(callback) {
- $.couch.session({
+ return $.couch.session({
success : function(resp) {
var userDb = $.couch.db(resp.info.authentication_db);
callback(userDb);
@@ -187,7 +187,7 @@
var user_prefix = "org.couchdb.user:";
user_doc._id = user_doc._id || user_prefix + user_doc.name;
- $.couch.userDb(function(db) {
+ return $.couch.userDb(function(db) {
db.saveDoc(user_doc, options);
});
},
[2/2] couchdb commit: updated refs/heads/master to 160f826
Posted by kx...@apache.org.
Add deferred support to jquery.couch.js
COUCHDB-1036 COUCHDB-1180
This closes #169
Signed-off-by: Alexander Shorin <kx...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e7548b2e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e7548b2e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e7548b2e
Branch: refs/heads/master
Commit: e7548b2e51ffed71b8a770207a5dd33d7ed49049
Parents: fffc5b7
Author: telis94 <do...@hotmail.com>
Authored: Tue Mar 11 15:15:48 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Mar 11 15:17:39 2014 +0400
----------------------------------------------------------------------
share/www/script/jquery.couch.js | 57 ++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/e7548b2e/share/www/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index e78b67e..facaf9c 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -70,7 +70,7 @@
* /#jQuery-ajax-settings">jQuery ajax settings</a>
*/
activeTasks: function(options) {
- ajax(
+ return ajax(
{url: this.urlPrefix + "/_active_tasks"},
options,
"Active task status could not be retrieved"
@@ -85,7 +85,7 @@
* /#jQuery-ajax-settings">jQuery ajax settings</a>
*/
allDbs: function(options) {
- ajax(
+ return ajax(
{url: this.urlPrefix + "/_all_dbs"},
options,
"An error occurred retrieving the list of all databases"
@@ -123,7 +123,7 @@
req.processData = false
}
- ajax(req, options,
+ return ajax(req, options,
"An error occurred retrieving/updating the server configuration"
);
},
@@ -138,7 +138,7 @@
*/
session: function(options) {
options = options || {};
- ajax({
+ return ajax({
type: "GET", url: this.urlPrefix + "/_session",
beforeSend: function(xhr) {
xhr.setRequestHeader('Accept', 'application/json');
@@ -203,7 +203,7 @@
*/
login: function(options) {
options = options || {};
- $.ajax({
+ return $.ajax({
type: "POST", url: this.urlPrefix + "/_session", dataType: "json",
data: {name: options.name, password: options.password},
beforeSend: function(xhr) {
@@ -233,7 +233,7 @@
*/
logout: function(options) {
options = options || {};
- $.ajax({
+ return $.ajax({
type: "DELETE", url: this.urlPrefix + "/_session", dataType: "json",
username : "_", password : "_",
beforeSend: function(xhr) {
@@ -296,7 +296,7 @@
*/
compact: function(options) {
$.extend(options, {successStatus: 202});
- ajax({
+ return ajax({
type: "POST", url: this.uri + "_compact",
data: "", processData: false
},
@@ -314,7 +314,7 @@
*/
viewCleanup: function(options) {
$.extend(options, {successStatus: 202});
- ajax({
+ return ajax({
type: "POST", url: this.uri + "_view_cleanup",
data: "", processData: false
},
@@ -337,7 +337,7 @@
*/
compactView: function(groupname, options) {
$.extend(options, {successStatus: 202});
- ajax({
+ return ajax({
type: "POST", url: this.uri + "_compact/" + groupname,
data: "", processData: false
},
@@ -355,7 +355,7 @@
*/
create: function(options) {
$.extend(options, {successStatus: 201});
- ajax({
+ return ajax({
type: "PUT", url: this.uri, contentType: "application/json",
data: "", processData: false
},
@@ -373,7 +373,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
drop: function(options) {
- ajax(
+ return ajax(
{type: "DELETE", url: this.uri},
options,
"The database could not be deleted"
@@ -388,7 +388,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
info: function(options) {
- ajax(
+ return ajax(
{url: this.uri},
options,
"Database information could not be retrieved"
@@ -501,7 +501,7 @@
delete options["keys"];
data = toJSON({ "keys": keys });
}
- ajax({
+ return ajax({
type: type,
data: data,
url: this.uri + "_all_docs" + encodeOptions(options)
@@ -517,7 +517,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
allDesignDocs: function(options) {
- this.allDocs($.extend(
+ return this.allDocs($.extend(
{startkey:"_design", endkey:"_design0"}, options));
},
@@ -532,7 +532,7 @@
options = options || {};
var self = this;
if (options.eachApp) {
- this.allDesignDocs({
+ return this.allDesignDocs({
success: function(resp) {
$.each(resp.rows, function() {
self.openDoc(this.id, {
@@ -591,7 +591,8 @@
}
});
}
- ajax({url: this.uri + encodeDocId(docId) + encodeOptions(options)},
+ return ajax(
+ {url: this.uri + encodeDocId(docId) + encodeOptions(options)},
options,
"The document could not be retrieved",
ajaxOptions
@@ -622,7 +623,7 @@
var uri = this.uri + encodeDocId(doc._id);
}
var versioned = maybeApplyVersion(doc);
- $.ajax({
+ return $.ajax({
type: method, url: uri + encodeOptions(options),
contentType: "application/json",
dataType: "json", data: toJSON(doc),
@@ -663,7 +664,7 @@
bulkSave: function(docs, options) {
var beforeSend = fullCommit(options);
$.extend(options, {successStatus: 201, beforeSend : beforeSend});
- ajax({
+ return ajax({
type: "POST",
url: this.uri + "_bulk_docs" + encodeOptions(options),
contentType: "application/json", data: toJSON(docs)
@@ -684,7 +685,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
removeDoc: function(doc, options) {
- ajax({
+ return ajax({
type: "DELETE",
url: this.uri +
encodeDocId(doc._id) +
@@ -710,7 +711,7 @@
}
);
$.extend(options, {successStatus: 201});
- ajax({
+ return ajax({
type: "POST",
url: this.uri + "_bulk_docs" + encodeOptions(options),
data: toJSON(docs)
@@ -744,7 +745,7 @@
}
}
});
- ajax({
+ return ajax({
type: "COPY",
url: this.uri + encodeDocId(docId)
},
@@ -779,7 +780,7 @@
: "(" + reduceFun.toString() + ")";
body.reduce = reduceFun;
}
- ajax({
+ return ajax({
type: "POST",
url: this.uri + "_temp_view" + encodeOptions(options),
contentType: "application/json", data: toJSON(body)
@@ -814,7 +815,7 @@
delete options['keys'];
data = toJSON({'keys': keys });
}
- ajax({
+ return ajax({
type: type,
data: data,
url: this.uri + '_design/' + list[0] +
@@ -847,7 +848,7 @@
delete options["keys"];
data = toJSON({ "keys": keys });
}
- ajax({
+ return ajax({
type: type,
data: data,
url: this.uri + "_design/" + name[0] +
@@ -866,7 +867,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
getDbProperty: function(propName, options, ajaxOptions) {
- ajax({url: this.uri + propName + encodeOptions(options)},
+ return ajax({url: this.uri + propName + encodeOptions(options)},
options,
"The property could not be retrieved",
ajaxOptions
@@ -883,7 +884,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
setDbProperty: function(propName, propValue, options, ajaxOptions) {
- ajax({
+ return ajax({
type: "PUT",
url: this.uri + propName + encodeOptions(options),
data : JSON.stringify(propValue)
@@ -910,7 +911,7 @@
* jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
*/
info: function(options) {
- ajax(
+ return ajax(
{url: this.urlPrefix + "/"},
options,
"Server information could not be retrieved"
@@ -932,7 +933,7 @@
if (repOpts.continuous && !repOpts.cancel) {
ajaxOptions.successStatus = 202;
}
- ajax({
+ return ajax({
type: "POST", url: this.urlPrefix + "/_replicate",
data: JSON.stringify(repOpts),
contentType: "application/json"