summaryrefslogtreecommitdiff
path: root/share/www/script/couch.js
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-02-22 07:31:26 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-02-22 07:31:26 +0000
commit1ebc2117452516f6ac6f4f458d7372bc710b79d2 (patch)
treee6dc0c62e64e29247e5c2cf18343690d01e1bc0c /share/www/script/couch.js
parent4838c35db5f4d49181b22d72f4cb5697b89c8870 (diff)
Link to design docs that have ddoc.couchapp.index or index.html, from Futon database index.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@746644 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch.js')
-rw-r--r--share/www/script/couch.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js
index 21382dd0..3f4db334 100644
--- a/share/www/script/couch.js
+++ b/share/www/script/couch.js
@@ -177,6 +177,10 @@ function CouchDB(name, httpHeaders) {
CouchDB.maybeThrowError(this.last_req);
return JSON.parse(this.last_req.responseText);
}
+
+ this.designDocs = function() {
+ return this.allDocs({startkey:"_design", endkey:"_design0"});
+ };
this.allDocsBySeq = function(options,keys) {
var req = null;
@@ -263,6 +267,15 @@ CouchDB.allDbs = function() {
return JSON.parse(CouchDB.last_req.responseText);
}
+CouchDB.allDesignDocs = function() {
+ var ddocs = {}, dbs = CouchDB.allDbs();
+ for (var i=0; i < dbs.length; i++) {
+ var db = new CouchDB(dbs[i]);
+ ddocs[dbs[i]] = db.designDocs();
+ };
+ return ddocs;
+};
+
CouchDB.getVersion = function() {
CouchDB.last_req = CouchDB.request("GET", "/");
CouchDB.maybeThrowError(CouchDB.last_req);