couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r1036486 - /couchdb/trunk/share/www/script/futon.browse.js
Date Thu, 18 Nov 2010 15:20:08 GMT
Author: rnewson
Date: Thu Nov 18 15:20:08 2010
New Revision: 1036486

URL: http://svn.apache.org/viewvc?rev=1036486&view=rev
Log:
COUCHDB-957 - Show an error message if trying 'Compact View' without selecting a view, rather
than compacting the associated database by mistake.

Modified:
    couchdb/trunk/share/www/script/futon.browse.js

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=1036486&r1=1036485&r2=1036486&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Thu Nov 18 15:20:08 2010
@@ -153,9 +153,13 @@
                 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() }});
+                var idx = page.viewName.indexOf("/_view");
+                if (idx == -1) {
+                    alert("Compact Views requires focus on a view!");
+                } else {
+                    var groupname = page.viewName.substring(8, idx);
+                    db.compactView(groupname, {success: function(resp) { callback() }});
+                }
                 break;
               case "view_cleanup":
                 db.viewCleanup({success: function(resp) { callback() }});



Mime
View raw message