diff options
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r-- | share/www/script/futon.browse.js | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 4d06d283..31e979bb 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -140,40 +140,22 @@ location.href = "document.html?" + encodeURIComponent(db.name); } - this.compactDatabase = function() { - $.showDialog("dialog/_compact_database.html", { + this.compactAndCleanup = function() { + $.showDialog("dialog/_compact_cleanup.html", { submit: function(data, callback) { - db.compact({ - success: function(resp) { - callback(); - } - }); - } - }); - } - - 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')); - $.showDialog("dialog/_compact_view.html", { - submit: function(data, callback) { - db.compactView(groupname, { - success: function(resp) { - callback(); - } - }); + switch (data.action) { + case "compact_database": + db.compact({success: function(resp) { callback() }}); + break; + case "compact_views": + var groupname = page.viewName.substring(8, + page.viewName.indexOf("/_view")); + db.compactView(groupname, {success: function(resp) { callback() }}); + break; + case "view_cleanup": + db.viewCleanup({success: function(resp) { callback() }}); + break; + } } }); } |