From 29fd68097060949adf1adc0292cb51458626cc85 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 29 Apr 2010 18:33:37 +0000 Subject: list functionality for jquery.couch.js git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@939443 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/jquery.couch.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'share') diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 2b680d9c..71560181 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -352,6 +352,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 || {}; -- cgit v1.2.3