couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [49/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf
Date Tue, 01 Apr 2014 08:52:54 GMT
Add deferred support to jquery.couch.js

COUCHDB-1036 COUCHDB-1180

This closes #169

Signed-off-by: Alexander Shorin <kxepal@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/commit/d0e44d2b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/tree/d0e44d2b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/diff/d0e44d2b

Branch: refs/heads/import-master
Commit: d0e44d2b02bc51a1076fc1473836637955a6f78c
Parents: 0ff661b
Author: telis94 <dossas07@hotmail.com>
Authored: Tue Mar 11 15:15:48 2014 +0400
Committer: Alexander Shorin <kxepal@gmail.com>
Committed: Tue Mar 11 15:15:48 2014 +0400

----------------------------------------------------------------------
 jquery.couch.js | 57 ++++++++++++++++++++++++++--------------------------
 1 file changed, 29 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/blob/d0e44d2b/jquery.couch.js
----------------------------------------------------------------------
diff --git a/jquery.couch.js b/jquery.couch.js
index e78b67e..facaf9c 100644
--- a/jquery.couch.js
+++ b/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"


Mime
View raw message