diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-04-29 18:33:37 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-04-29 18:33:37 +0000 |
commit | 29fd68097060949adf1adc0292cb51458626cc85 (patch) | |
tree | 584b80b277d1313c9c435a90a97b9e7136263667 /share/www/script | |
parent | cbfb602d251557668146b2a28f8e58038c613318 (diff) |
list functionality for jquery.couch.js
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@939443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/jquery.couch.js | 20 |
1 files changed, 20 insertions, 0 deletions
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 || {}; |