<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>share/www/dialog/_compact_view.html</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -37,5 +37,6 @@ suggesting improvements or submitting changes. Some of these people are:
  * Dan Walters &lt;dan@danwalters.net&gt;
  * Curt Arnold &lt;carnold@apache.org&gt;
  * Gustavo Niemeyer
+ * Joshua Bronson &lt;jabronson@gmail.com&gt;
 
 For a list of authors see the `AUTHORS` file.</diff>
      <filename>THANKS</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ specific language governing permissions and limitations under the License.
 
       $(function() {
         if (page.redirecting) return;
-        $(&quot;h1 strong&quot;).text(page.db.name);
+        $(&quot;h1 strong&quot;).html('&lt;a href=&quot;?' + page.db.name + '&quot;&gt;' + page.db.name + '&lt;/a&gt;');
         var viewPath = page.viewName || &quot;_all_docs&quot;;
         if (viewPath != &quot;_temp_view&quot; &amp;&amp; viewPath != &quot;_design_docs&quot;) {
           $(&quot;h1 a.raw&quot;).attr(&quot;href&quot;, &quot;/&quot; + encodeURIComponent(page.db.name) +
@@ -100,6 +100,7 @@ specific language governing permissions and limitations under the License.
         $(&quot;#toolbar button.add&quot;).click(page.newDocument);
         $(&quot;#toolbar button.compact&quot;).click(page.compactDatabase);
         $(&quot;#toolbar button.delete&quot;).click(page.deleteDatabase);
+        $(&quot;#toolbar button.compactview&quot;).click(page.compactView);
 
         $('#jumpto input').addPlaceholder(&quot;Document ID&quot;).suggest(function(text, callback) {
           page.db.allDocs({
@@ -146,6 +147,7 @@ specific language governing permissions and limitations under the License.
         &lt;li&gt;&lt;button class=&quot;add&quot;&gt;New Document&lt;/button&gt;&lt;/li&gt;
         &lt;li&gt;&lt;button class=&quot;compact&quot;&gt;Compact Database&#8230;&lt;/button&gt;&lt;/li&gt;
         &lt;li&gt;&lt;button class=&quot;delete&quot;&gt;Delete Database&#8230;&lt;/button&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;button class=&quot;compactview&quot; style=&quot;display: none&quot;&gt;Compact View&#8230;&lt;/button&gt;&lt;/li&gt;
       &lt;/ul&gt;
 
       &lt;div id=&quot;viewcode&quot; class=&quot;collapsed&quot; style=&quot;display: none&quot;&gt;</diff>
      <filename>share/www/database.html</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License.
   &lt;fieldset&gt;
     &lt;p class=&quot;help&quot;&gt;
       Compacting a database removes deleted documents and previous revisions.
-      It is an &lt;strong&gt;irreversible operation&lt;/strong&gt; and my take
+      It is an &lt;strong&gt;irreversible operation&lt;/strong&gt; and may take
       a while to complete for large databases.
     &lt;/p&gt;
   &lt;/fieldset&gt;</diff>
      <filename>share/www/dialog/_compact_database.html</filename>
    </modified>
    <modified>
      <diff>@@ -138,6 +138,20 @@
         });
       }
 
+      this.compactView = function() {
+        var groupname = page.viewName.substring(8,
+            page.viewName.indexOf('/_view'));
+        $.showDialog(&quot;dialog/_compact_view.html&quot;, {
+          submit: function(data, callback) {
+            db.compactView(groupname, {
+              success: function(resp) {
+                callback();
+              }
+            });
+          }
+        });
+      }
+
       this.deleteDatabase = function() {
         $.showDialog(&quot;dialog/_delete_database.html&quot;, {
           submit: function(data, callback) {
@@ -638,6 +652,7 @@
             options.endkey = options.descending ? &quot;_design&quot; : &quot;_design0&quot;;
             db.allDocs(options);
           } else {
+            $(&quot;button.compactview&quot;).show();
             $(&quot;#viewcode&quot;).show();
             var currentMapCode = $(&quot;#viewcode_map&quot;).val();
             var currentReduceCode = $.trim($(&quot;#viewcode_reduce&quot;).val()) || null;</diff>
      <filename>share/www/script/futon.browse.js</filename>
    </modified>
    <modified>
      <diff>@@ -111,6 +111,16 @@
             &quot;The database could not be compacted&quot;
           );
         },
+        compactView: function(groupname, options) {
+          $.extend(options, {successStatus: 202});
+          ajax({
+              type: &quot;POST&quot;, url: this.uri + &quot;_compact/&quot; + groupname,
+              data: &quot;&quot;, processData: false
+            },
+            options,
+            &quot;The view could not be compacted&quot;
+          );
+        },
         create: function(options) {
           $.extend(options, {successStatus: 201});
           ajax({</diff>
      <filename>share/www/script/jquery.couch.js</filename>
    </modified>
    <modified>
      <diff>@@ -230,6 +230,7 @@ body.fullwidth #wrap { margin-right: 0; }
 #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); }</diff>
      <filename>share/www/style/layout.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1e2a54d1848b4da2270c5d89c9105a501218cb42</id>
    </parent>
  </parents>
  <author>
    <name>davisp</name>
    <email>davisp@13f79535-47bb-0310-9956-ffa450edef68</email>
  </author>
  <url>http://github.com/halorgium/couchdb/commit/aeddd29b28056c8761d00a9d39a7df1eef57ca6e</url>
  <id>aeddd29b28056c8761d00a9d39a7df1eef57ca6e</id>
  <committed-date>2009-10-30T16:08:42-07:00</committed-date>
  <authored-date>2009-10-30T16:08:42-07:00</authored-date>
  <message>Closes COUCHDB-547 - Adding a View Compaction Button

Thanks to Joshua Bronson for the patch.



git-svn-id: http://svn.apache.org/repos/asf/couchdb/trunk@831485 13f79535-47bb-0310-9956-ffa450edef68</message>
  <tree>c3dcbdb77dda6fbd166c602d0323ab196176f8a2</tree>
  <committer>
    <name>davisp</name>
    <email>davisp@13f79535-47bb-0310-9956-ffa450edef68</email>
  </committer>
</commit>
