diff options
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/couch.js | 6 | ||||
-rw-r--r-- | share/www/script/futon.browse.js | 12 | ||||
-rw-r--r-- | share/www/script/jquery.couch.js | 10 |
3 files changed, 28 insertions, 0 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js index f7d7d43d..19b98edb 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -243,6 +243,12 @@ function CouchDB(name, httpHeaders) { return JSON.parse(this.last_req.responseText); } + this.viewCleanup = function() { + this.last_req = this.request("POST", this.uri + "_view_cleanup"); + CouchDB.maybeThrowError(this.last_req); + return JSON.parse(this.last_req.responseText); + } + this.setDbProperty = function(propId, propValue) { this.last_req = this.request("PUT", this.uri + propId,{ body:JSON.stringify(propValue) diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 172c7b62..437c30c2 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -152,6 +152,18 @@ }); } + this.viewCleanup = function() { + $.showDialog("dialog/_view_cleanup.html", { + submit: function(data, callback) { + db.viewCleanup({ + success: function(resp) { + callback(); + } + }); + } + }); + } + this.compactView = function() { var groupname = page.viewName.substring(8, page.viewName.indexOf('/_view')); diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 05b3af79..6812ed9a 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -111,6 +111,16 @@ "The database could not be compacted" ); }, + viewCleanup: function(options) { + $.extend(options, {successStatus: 202}); + ajax({ + type: "POST", url: this.uri + "_view_cleanup", + data: "", processData: false + }, + options, + "The views could not be cleaned up" + ); + }, compactView: function(groupname, options) { $.extend(options, {successStatus: 202}); ajax({ |