couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r831485 - in /couchdb/trunk: THANKS share/www/database.html share/www/dialog/_compact_database.html share/www/dialog/_compact_view.html share/www/script/futon.browse.js share/www/script/jquery.couch.js share/www/style/layout.css
Date Fri, 30 Oct 2009 23:08:43 GMT
Author: davisp
Date: Fri Oct 30 23:08:42 2009
New Revision: 831485

URL: http://svn.apache.org/viewvc?rev=831485&view=rev
Log:
Closes COUCHDB-547 - Adding a View Compaction Button

Thanks to Joshua Bronson for the patch.


Added:
    couchdb/trunk/share/www/dialog/_compact_view.html
Modified:
    couchdb/trunk/THANKS
    couchdb/trunk/share/www/database.html
    couchdb/trunk/share/www/dialog/_compact_database.html
    couchdb/trunk/share/www/script/futon.browse.js
    couchdb/trunk/share/www/script/jquery.couch.js
    couchdb/trunk/share/www/style/layout.css

Modified: couchdb/trunk/THANKS
URL: http://svn.apache.org/viewvc/couchdb/trunk/THANKS?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/THANKS (original)
+++ couchdb/trunk/THANKS Fri Oct 30 23:08:42 2009
@@ -37,5 +37,6 @@
  * Dan Walters <dan@danwalters.net>
  * Curt Arnold <carnold@apache.org>
  * Gustavo Niemeyer
+ * Joshua Bronson <jabronson@gmail.com>
 
 For a list of authors see the `AUTHORS` file.

Modified: couchdb/trunk/share/www/database.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/database.html?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/share/www/database.html [utf-8] (original)
+++ couchdb/trunk/share/www/database.html [utf-8] Fri Oct 30 23:08:42 2009
@@ -37,7 +37,7 @@
 
       $(function() {
         if (page.redirecting) return;
-        $("h1 strong").text(page.db.name);
+        $("h1 strong").html('<a href="?' + page.db.name + '">' + page.db.name + '</a>');
         var viewPath = page.viewName || "_all_docs";
         if (viewPath != "_temp_view" && viewPath != "_design_docs") {
           $("h1 a.raw").attr("href", "/" + encodeURIComponent(page.db.name) +
@@ -100,6 +100,7 @@
         $("#toolbar button.add").click(page.newDocument);
         $("#toolbar button.compact").click(page.compactDatabase);
         $("#toolbar button.delete").click(page.deleteDatabase);
+        $("#toolbar button.compactview").click(page.compactView);
 
         $('#jumpto input').addPlaceholder("Document ID").suggest(function(text, callback)
{
           page.db.allDocs({
@@ -146,6 +147,7 @@
         <li><button class="add">New Document</button></li>
         <li><button class="compact">Compact Database…</button></li>
         <li><button class="delete">Delete Database…</button></li>
+        <li><button class="compactview" style="display: none">Compact View…</button></li>
       </ul>
 
       <div id="viewcode" class="collapsed" style="display: none">

Modified: couchdb/trunk/share/www/dialog/_compact_database.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/dialog/_compact_database.html?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/share/www/dialog/_compact_database.html [utf-8] (original)
+++ couchdb/trunk/share/www/dialog/_compact_database.html [utf-8] Fri Oct 30 23:08:42 2009
@@ -17,7 +17,7 @@
   <fieldset>
     <p class="help">
       Compacting a database removes deleted documents and previous revisions.
-      It is an <strong>irreversible operation</strong> and my take
+      It is an <strong>irreversible operation</strong> and may take
       a while to complete for large databases.
     </p>
   </fieldset>

Added: couchdb/trunk/share/www/dialog/_compact_view.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/dialog/_compact_view.html?rev=831485&view=auto
==============================================================================
--- couchdb/trunk/share/www/dialog/_compact_view.html (added)
+++ couchdb/trunk/share/www/dialog/_compact_view.html Fri Oct 30 23:08:42 2009
@@ -0,0 +1,28 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+  <h2>Compact View</h2>
+  <fieldset>
+    <p class="help">
+      View compaction will affect all views in this design document. This
+      operation may take some time to complete. Your views will still operate
+      normally during compaction.
+    </p>
+  </fieldset>
+  <div class="buttons">
+    <button type="submit">Compact</button>
+    <button type="button" class="cancel">Cancel</button>
+  </div>
+</form>

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Fri Oct 30 23:08:42 2009
@@ -138,6 +138,20 @@
         });
       }
 
+      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();
+              }
+            });
+          }
+        });
+      }
+
       this.deleteDatabase = function() {
         $.showDialog("dialog/_delete_database.html", {
           submit: function(data, callback) {
@@ -638,6 +652,7 @@
             options.endkey = options.descending ? "_design" : "_design0";
             db.allDocs(options);
           } else {
+            $("button.compactview").show();
             $("#viewcode").show();
             var currentMapCode = $("#viewcode_map").val();
             var currentReduceCode = $.trim($("#viewcode_reduce").val()) || null;

Modified: couchdb/trunk/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Fri Oct 30 23:08:42 2009
@@ -111,6 +111,16 @@
             "The database could not be compacted"
           );
         },
+        compactView: function(groupname, options) {
+          $.extend(options, {successStatus: 202});
+          ajax({
+              type: "POST", url: this.uri + "_compact/" + groupname,
+              data: "", processData: false
+            },
+            options,
+            "The view could not be compacted"
+          );
+        },
         create: function(options) {
           $.extend(options, {successStatus: 201});
           ajax({

Modified: couchdb/trunk/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=831485&r1=831484&r2=831485&view=diff
==============================================================================
--- couchdb/trunk/share/www/style/layout.css (original)
+++ couchdb/trunk/share/www/style/layout.css Fri Oct 30 23:08:42 2009
@@ -230,6 +230,7 @@
 #toolbar button:active { background-position: 2px -62px; color: #000; }
 #toolbar button.add { background-image: url(../image/add.png); }
 #toolbar button.compact { background-image: url(../image/compact.png); }
+#toolbar button.compactview { background-image: url(../image/compact.png); }
 #toolbar button.delete { background-image: url(../image/delete.png); }
 #toolbar button.load { background-image: url(../image/load.png); }
 #toolbar button.run { background-image: url(../image/run.png); }



Mime
View raw message