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/06/15 15:37:41 UTC

svn commit: r954878 - /couchdb/branches/0.11.x/share/www/script/jquery.couch.js

Author: jan
Date: Tue Jun 15 13:37:40 2010
New Revision: 954878

URL: http://svn.apache.org/viewvc?rev=954878&view=rev
Log:
Merge r939443 from trunk:

list functionality for jquery.couch.js

Modified:
    couchdb/branches/0.11.x/share/www/script/jquery.couch.js

Modified: couchdb/branches/0.11.x/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/share/www/script/jquery.couch.js?rev=954878&r1=954877&r2=954878&view=diff
==============================================================================
--- couchdb/branches/0.11.x/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/branches/0.11.x/share/www/script/jquery.couch.js [utf-8] Tue Jun 15 13:37:40 2010
@@ -364,6 +364,26 @@
             "An error occurred querying the database"
           );
         },
+        list: function(list, view, options) {
+          var list = list.split('/');
+          var options = options || {};
+          var type = 'GET';
+          var data = null;
+          if (options['keys']) {
+            type = 'POST';
+            var keys = options['keys'];
+            delete options['keys'];
+            data = toJSON({'keys': keys });
+          }
+          ajax({
+              type: type,
+              data: data,
+              url: this.uri + '_design/' + list[0] +
+                   '/_list/' + list[1] + '/' + view + encodeOptions(options)
+              },
+              options, 'An error occured accessing the list'
+          );
+        },
         view: function(name, options) {
           var name = name.split('/');
           var options = options || {};