You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/03/20 11:21:25 UTC

[01/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Repository: couchdb
Updated Branches:
  refs/heads/Query-Options-UI 5b8d8776d -> cf93bbfc3 (forced update)


Fauxton: Adding an info file for contributors


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a3559974
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a3559974
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a3559974

Branch: refs/heads/Query-Options-UI
Commit: a3559974f539ebf0ca44e849fc161c3f8fb7e3b0
Parents: d2a3c3c
Author: suelockwood <de...@apache.org>
Authored: Fri Mar 14 10:02:10 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Fri Mar 14 10:02:22 2014 -0400

----------------------------------------------------------------------
 src/fauxton/CONTRIBUTING.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a3559974/src/fauxton/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/src/fauxton/CONTRIBUTING.md b/src/fauxton/CONTRIBUTING.md
new file mode 100644
index 0000000..3b3b623
--- /dev/null
+++ b/src/fauxton/CONTRIBUTING.md
@@ -0,0 +1,22 @@
+Contributing to Fauxton
+=======================
+
+Couchdb is an apache project, which is why we keep all our issues in Jira.  You can find or submit issues for fauxton [here](https://issues.apache.org/jira/issues/?filter=12326543).
+
+We try to keep all tickets up to date with Skill level for you to have an idea of the level of effort or comfortability with the framework you'd need to complete the task.
+
+To fix an issue in Fauxton, fork the Couchdb project to your github account. The [Readme file](https://github.com/apache/couchdb/blob/master/src/fauxton/readme.md) has information about how to get the project running.  To start working on a specific ticket, create a branch with the Jira ID # followed by a traincase description of the issue. 
+
+> e.g.   1234-Added-support-for-list-functions
+
+If there is no Jira ticket for the issue you have, please create one. 
+
+When you're ready for a review, submit a Pull Request. We regularly check the PR list for fauxton and should get back to you with a code review.  If no one has responded to you yet, you can find us on IRC in #couchdb-dev.  Ping **Garren** or **Deathbear**, though anyone in the room should be able to help you.
+
+We appreciate constructive feedback from people who use couchdb, so don't be shy. We know there are bugs and we know there is room for improvement. 
+
+ʕ´•ᴥ•`ʔ Thanks! 
+
+-- Fauxton team
+
+PS - If you are new to contributing to open source, or using github reach out to us on irc (#couchdb-dev)! We will happily help you.


[17/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Cleaning up query options UI


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/b67b65ca
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b67b65ca
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b67b65ca

Branch: refs/heads/Query-Options-UI
Commit: b67b65caaee9fdfe7519980f06c9cda40e1aef15
Parents: 3508a90
Author: suelockwood <de...@apache.org>
Authored: Fri Feb 21 13:42:45 2014 -0500
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

----------------------------------------------------------------------
 .../addons/documents/assets/less/documents.less |   7 +
 .../documents/templates/advanced_options.html   | 156 +++++++++++--------
 src/fauxton/app/addons/documents/views.js       |  87 ++++++++++-
 3 files changed, 184 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b67b65ca/src/fauxton/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/assets/less/documents.less b/src/fauxton/app/addons/documents/assets/less/documents.less
index c30a9af..61d864b 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -23,6 +23,12 @@ button.beautify {
 	margin-top: 20px;
 }
 
+.toggle-btns {
+    label{
+        margin-right: 0;
+    }
+}
+
 #per-page {
   float: right;
 
@@ -32,6 +38,7 @@ button.beautify {
   
 }
 
+
 /** used in all_docs_list.html **/
 .view {
     table td div {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b67b65ca/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index e282c62..274c107 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -12,79 +12,113 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div class="errors-container"></div>
-<form class="js-view-query-update custom-inputs">
-  <div class="controls-group">
-    <div class="row-fluid">
+<form class="view-query-update custom-inputs">
+
+
+<!-- tabs for choosing Keys or Start & end -->
+
+
+
+
+  <div class="btn-group toggle-btns">
+    <label for="showKeys" class="drop-down btn active">
+     Specific Keys 
+    </label>
+    <label for="showStartEnd" class="drop-down btn">
+      Bounded Queries
+    </label>
+  </div>
+
+  <div class="controls-group well">
+    <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
-        <input name="key" class="span6" type="text" placeholder="Key">
-        <input name="keys" class="span6" type="text" placeholder="Keys">
+        <input name="keys" class="input-xxlarge" type="text" placeholder="Enter a key, or list of keys seperated by a comma.">
       </div>
     </div>
-    <div class="row-fluid">
+    <div class="row-fluid hide" id="js-showStartEnd">
       <div class="controls controls-row">
-        <input name="startkey" class="span6" type="text" placeholder="Start Key">
+        <input name="startkey" class="span6" type="text" placeholder="Start Key" disabled>
         <input name="endkey" class="span6" type="text" placeholder="End Key">
       </div>
+      <div class="controls controls-row checkbox inline">  
+        <input id="check5" name="inclusive_end" type="checkbox" value="false" disabled>
+        <label for="check5">Disable Inclusive End</label>
+      </div>
     </div>
   </div>
+
+
+
+<!-- Limit and Skip are conditional -->
+
   <div class="controls-group">
-    <div class="row-fluid">
-      <div class="controls controls-row">
-        <div class="checkbox inline">  
-          <input id="check1" type="checkbox" name="include_docs" value="true">  
-          <label name="include_docs" for="check1">Include Docs</label>  
-          <% if (hasReduce) { %>
-          <input id="check2" name="reduce" type="checkbox" value="true">
-          <label for="check2">Reduce</label>  
-        </div> 
-        <label id="select1" class="drop-down inline">
-          Group Level:
-          <select id="select1" disabled name="group_level" class="input-small">
-            <option value="0">None</option>
-            <option value="1">1</option>
-            <option value="2">2</option>
-            <option value="3">3</option>
-            <option value="4">4</option>
-            <option value="5">5</option>
-            <option value="6">6</option>
-            <option value="7">7</option>
-            <option value="8">8</option>
-            <option value="9">9</option>
-            <option value="999" selected="selected">exact</option>
-          </select>
-        </label>
-        <% } else{ %>
-        </div>
-        <% } %>
+      <label class="drop-down inline">
+        Limit:
+        <select name="limit" class="input-small" disabled>
+          <option>5</option>
+          <option>10</option>
+          <option selected="selected">20</option>
+          <option>30</option>
+          <option>50</option>
+          <option>100</option>
+		  <option>500</option>
+        </select>
+      </label>
+      <label for="skipRows" class="inline drop-down">
+        Skip
+        <input name="skip" class="input-large" type="text" id="skipRows" disabled placeholder="Number of rows to skip">
+      </label>
+      <span class="js-disabled-message"> Limit &amp; and Skip are disabled when using Keys.</span>
 
-        <div class="checkbox inline">  
-          <input id="check3" name="stale" type="checkbox" value="ok">
-          <label for="check3">Stale</label>
-          <input id="check4" name="descending" type="checkbox" value="true">  
-          <label for="check4">Descending</label>  
-        </div> 
-        <label class="drop-down inline">
-          Limit:
-          <select name="limit" class="input-small">
-            <option>5</option>
-            <option>10</option>
-            <option >20</option>
-            <option>30</option>
-            <option>50</option>
-            <option >100</option>
-            <option>500</option>
-            <option selected="selected">None</option>
-          </select>
-        </label>
-        <div class="checkbox inline">  
-          <input id="check5" name="inclusive_end" type="checkbox" value="false">
-          <label for="check5">Disable Inclusive End</label>
-          <input id="check6" name="update_seq" type="checkbox" value="true">  
-          <label for="check6">Update Sequence</label>  
-        </div>
+      <div class="checkbox inline"> 
+        <input id="check1" type="checkbox" name="include_docs" value="true">  
+        <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>  
+
+        <input id="check3" name="stale" type="checkbox" value="ok">
+        <label for="check3">Stale</label>
       </div>
-    </div>
+
+      <% if (hasReduce) { %>
+      <div class="checkbox inline">  
+        <input id="check2" name="reduce" type="checkbox" value="true">
+        <label for="check2">Reduce</label>  
+      </div> 
+      <label id="select1" class="drop-down inline">
+        Group Level:
+        <select id="select1" disabled name="group_level" class="input-small">
+          <option value="0">None</option>
+          <option value="1">1</option>
+          <option value="2">2</option>
+          <option value="3">3</option>
+          <option value="4">4</option>
+          <option value="5">5</option>
+          <option value="6">6</option>
+          <option value="7">7</option>
+          <option value="8">8</option>
+          <option value="9">9</option>
+          <option value="999" selected="selected">exact</option>
+        </select>
+      </label>
+      <% } %>
+
+      <label id="select2" class="drop-down inline">
+        Order: 
+        <select id="select2" name="descending" class="input-large">
+          <option value="false">Accending</option>
+          <option value="true">Descending</option>
+        </select>
+      </label>
+
+      <div class="checkbox inline">  
+        <input id="check6" name="update_seq" type="checkbox" value="true">  
+        <label for="check6">Update Sequence</label>  
+      </div>
+
   </div>
+
+
+
+
   <div class="controls-group">
     <div class="row-fluid">
       <div id="button-options" class="controls controls-row">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b67b65ca/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index f29ebaa..c595c6c 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1073,7 +1073,34 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       "change form.js-view-query-update input": "updateFilters",
       "change form.js-view-query-update select": "updateFilters",
       "submit form.js-view-query-update": "updateView",
-      "click button.preview": "previewView"
+      "click button.preview": "previewView",
+      "click .toggle-btns > label":  "toggleQuery"
+    },
+
+    toggleQuery: function(e){
+      e.preventDefault();
+      var showFunctionName =this.$(e.currentTarget).attr("for");
+      //highlight current
+      this.$(".toggle-btns > label").removeClass('active');
+      this.$(e.currentTarget).addClass("active");
+      
+      this.$("[id^='js-show']").hide();
+
+      //show section & disable what needs to be disabled
+      this[showFunctionName]();
+    },
+
+    showKeys: function(){
+      this.$("#js-showKeys, .js-disabled-message").show();
+      this.$('[name="skip"],[name="startkey"],[name="limit"],[name="endkey"],[name="inclusive_end"]').attr("disabled","true");
+      this.$('[name="keys"]').removeAttr("disabled");
+    },
+
+    showStartEnd: function(){
+      this.$("#js-showStartEnd").show();
+      this.$('[name="skip"],[name="startkey"],[name="limit"],[name="endkey"],[name="inclusive_end"]').removeAttr("disabled");
+      this.$('.js-disabled-message').hide();
+      this.$('[name="keys"]').attr("disabled","true");
     },
 
     beforeRender: function () {
@@ -1090,10 +1117,25 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.hasReduce = hasReduce;
       this.render();
     },
+    getKeys: function(val){
+      var keys = val.value.replace(/\s/g,"").split(',');
 
+      if (keys.length > 1){
+        return {
+          name: "keys",
+          value:  JSON.stringify(keys)
+        };
+      } else if (keys.length === 1) {
+        return {
+          name: "key",
+          value: keys[0]
+        };
+      }
+
+    },
     queryParams: function () {
-      var $form = this.$(".js-view-query-update");
-      // Ignore params without a value
+      var $form = this.$(".view-query-update"),
+          getKeys = this.getKeys;
       var params = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
@@ -1101,9 +1143,25 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         params.push(param);
         return params;
       }, []);
+      });
+      var filteredParams = _.filter(params, function(param) {
+        return param.value;
+      });
+        
+
+
+      var params = _.map(filteredParams, function(param) {
+        if (param.name === "keys"){
+          return getKeys(param);
+        }else{
+          return param;
+        }
+      });
+
+
 
       // Validate *key* params to ensure they're valid JSON
-      var keyParams = ["key","keys","startkey","endkey"];
+      var keyParams = ["keys","startkey","endkey"];
       var errorParams = _.filter(params, function(param) {
         if (_.contains(keyParams, param.name)) {
           try {
@@ -1118,6 +1176,24 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       });
 
       return {params: params, errorParams: errorParams};
+
+
+
+
+
+
+      // Ignore params without a value
+      _.map($form.serializeArray(), function(param) {
+        if (param.value){
+          if (param.name === "keys"){
+            var keys = getKeys(param.value);
+            data[keys.name] = keys.value;
+          }else{
+            data[param.name] = param.value;
+          }
+        }
+      });
+
     },
 
     updateFilters: function(event) {
@@ -1161,13 +1237,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         var $ele;
         switch (key) {
           case "limit":
+          case "descending":
           case "group_level":
             if (!val) { return; }
             $form.find("select[name='"+key+"']").val(val);
           break;
           case "include_docs":
             case "stale":
-            case "descending":
             case "inclusive_end":
             $form.find("input[name='"+key+"']").prop('checked', true);
           break;
@@ -1186,6 +1262,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     updateView: function (event) {
+      event.preventDefault();
       this.updateViewFn(event, this.queryParams());
     },
 


[11/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
update opening note


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/868e1711
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/868e1711
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/868e1711

Branch: refs/heads/Query-Options-UI
Commit: 868e17114cff46db38791c5abb382e465722ccbd
Parents: 1db70b8
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:51:15 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:51:15 2014 +0100

----------------------------------------------------------------------
 src/my-first-couchdb-plugin/README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/868e1711/src/my-first-couchdb-plugin/README.md
----------------------------------------------------------------------
diff --git a/src/my-first-couchdb-plugin/README.md b/src/my-first-couchdb-plugin/README.md
index 37c0a75..8bef13c 100644
--- a/src/my-first-couchdb-plugin/README.md
+++ b/src/my-first-couchdb-plugin/README.md
@@ -2,8 +2,7 @@
 
 A practical guide to developing CouchDB plugins.
 
-*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn something already :)*
-
+*NOTE: this feature is considered beta, possibly subject to change and expects that you understand some Erlang.
 
 ## Preparation
 


[12/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
update clone command to clone from github repo

since this already works on main couchdb.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/266020fe
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/266020fe
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/266020fe

Branch: refs/heads/Query-Options-UI
Commit: 266020fe541e46150f0fecd9df0ef3ab629be341
Parents: 868e171
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:52:14 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:52:14 2014 +0100

----------------------------------------------------------------------
 src/my-first-couchdb-plugin/README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/266020fe/src/my-first-couchdb-plugin/README.md
----------------------------------------------------------------------
diff --git a/src/my-first-couchdb-plugin/README.md b/src/my-first-couchdb-plugin/README.md
index 8bef13c..3c25eec 100644
--- a/src/my-first-couchdb-plugin/README.md
+++ b/src/my-first-couchdb-plugin/README.md
@@ -8,9 +8,8 @@ A practical guide to developing CouchDB plugins.
 
 To get started, you need to install CouchDB from source, grab the CouchDB sources:
 
-    git clone https://git-wip-us.apache.org/repos/asf/couchdb.git
+    git clone https://github.com/apache/couchdb.git
     cd couchdb
-    git checkout -b 1867-feature-plugin origin/1867-feature-plugins
 
 Follow the instructions in `couchdb/INSTALL.Unix` and `couchdb/DEVELOPERS` to get a development environment going.
 


[15/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
update copyright year for CouchDB to 2014


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/3508a90f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3508a90f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3508a90f

Branch: refs/heads/Query-Options-UI
Commit: 3508a90f8f1956d8084d23768610ab37569cfa91
Parents: 6f23ad4
Author: Robert Newson <rn...@apache.org>
Authored: Tue Mar 18 00:50:30 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Mar 18 00:50:50 2014 +0000

----------------------------------------------------------------------
 NOTICE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3508a90f/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index fda3caf..888acd2 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache CouchDB
-Copyright 2009-2013 The Apache Software Foundation
+Copyright 2009-2014 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).


[26/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Add keys validation


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cf93bbfc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cf93bbfc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cf93bbfc

Branch: refs/heads/Query-Options-UI
Commit: cf93bbfc3e8cbf2229af115a50c0c5efe2006345
Parents: f237411
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Mar 20 12:20:44 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 12:20:44 2014 +0200

----------------------------------------------------------------------
 .../addons/documents/assets/less/documents.less | 12 ++++++++
 .../documents/templates/advanced_options.html   |  3 +-
 src/fauxton/app/addons/documents/views.js       | 29 ++++++++++++++++----
 3 files changed, 38 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf93bbfc/src/fauxton/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/assets/less/documents.less b/src/fauxton/app/addons/documents/assets/less/documents.less
index 40a1d8c..36429ff 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -101,3 +101,15 @@ button.beautify {
     height: 688px;
     font-size: 16px;
 }
+
+#keys-input {
+  display: inline-block;
+  width: 35%;
+}
+
+#keys-error {
+  display: inline-block;
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf93bbfc/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index f823d1a..d8d57cd 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -28,7 +28,8 @@ the License.
   <div class="controls-group well">
     <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
-        <textarea name="keys" class="input-xxlarge" rows="5" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON."></textarea>
+        <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON."></textarea>
+        <div id="keys-error" class="inline-block js-keys-error"></div>
       </div>
     </div>
     <div class="row-fluid hide" id="js-showStartEnd">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf93bbfc/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index d3da5f1..90460e2 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1132,19 +1132,34 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.hasReduce = hasReduce;
       this.render();
     },
-    validateKeys:  function(val){
-      return JSON.parse(val);
+    validateKeys:  function(param){
+      var parsedValue = JSON.parse(param.value);
+      if (!_.isArray(parsedValue)) {
+        FauxtonAPI.addNotification({
+          type: "error",
+          msg: "Keys values must be in an array. E.g [1,2,3]",
+          clear:  false,
+          selector: '.js-keys-error'
+        });
+        return false;
+      }
+      return true; 
     },
     queryParams: function () {
-      var $form = this.$(".js-view-query-update");
+      var $form = this.$(".js-view-query-update"),
+          keysParam = false;
 
       var params = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
+        if (param.name === "keys") { keysParam = param; }
         params.push(param);
         return params;
       }, []);
 
+
+      if (keysParam && !this.validateKeys(keysParam)) { return false; }
+
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["keys","startkey","endkey"];
       var errorParams = _.filter(params, function(param) {
@@ -1235,11 +1250,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     updateView: function (event) {
       event.preventDefault();
-      this.updateViewFn(event, this.queryParams());
+      var params = this.queryParams();
+      if (!params) { return;}
+      this.updateViewFn(event, params);
     },
 
     previewView: function (event) {
-      this.previewFn(event, this.queryParams());
+      var params = this.queryParams();
+      if (!params) { return;}
+      this.previewFn(event, params);
     },
 
     serialize: function () {


[05/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fix missing file in Makefile.am

This closes #183

Signed-off-by: Alexander Shorin <kx...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/510070c0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/510070c0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/510070c0

Branch: refs/heads/Query-Options-UI
Commit: 510070c0979b72a111ba865a421a221250fc9350
Parents: b8accb4
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Mar 15 16:00:22 2014 +0100
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sat Mar 15 19:47:02 2014 +0400

----------------------------------------------------------------------
 src/Makefile.am | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/510070c0/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 89a6afd..43afcf5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -147,6 +147,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/databases/resources.js \
     fauxton/app/addons/databases/routes.js \
     fauxton/app/addons/databases/views.js \
+    fauxton/app/addons/databases/tests/resourcesSpec.js \
     fauxton/app/addons/documents/base.js \
     fauxton/app/addons/documents/resources.js \
     fauxton/app/addons/documents/routes.js \


[16/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Improved key support


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/789a55a2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/789a55a2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/789a55a2

Branch: refs/heads/Query-Options-UI
Commit: 789a55a2e3cea7d691de0fe5090a7592ff3d041c
Parents: c6e5ce6
Author: Garren Smith <ga...@gmail.com>
Authored: Fri Mar 14 12:05:55 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/views.js | 53 ++++++++++++++------------
 1 file changed, 29 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/789a55a2/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 0b62dce..4be76e6 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1118,12 +1118,21 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.render();
     },
     getKeys: function(val){
-      var keys = val.value.replace(/\s/g,"").split(',');
+      var keys = val.value.replace(/\s/g,"");
+      
+      var regKeys = keys.match(/(\[.*?\])/g); 
+      if (regKeys) {
+        keys = regKeys;
+      } else {
+        keys = keys.split(',');
+      }
+
+      keys = _.map(keys, function (key) { return JSON.parse(key); });
 
-      if (keys.length > 1){
+      if (_.isArray(keys)){
         return {
           name: "keys",
-          value:  JSON.stringify(keys)
+          value: JSON.stringify(keys)
         };
       } else if (keys.length === 1) {
         return {
@@ -1131,37 +1140,23 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           value: keys[0]
         };
       }
-
     },
     queryParams: function () {
       var $form = this.$(".js-view-query-update"),
           getKeys = this.getKeys;
 
-      var rawParams = _.reduce($form.serializeArray(), function(params, param) {
+      var params = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
+        
+        if (param.name === "keys"){
+          param = getKeys(param);
+        }
 
         params.push(param);
         return params;
       }, []);
 
-      var filteredParams = _.filter(rawParams, function(param) {
-        return param.value;
-      });
-
-      console.log('filtered', filteredParams);
-      var params = filteredParams;
-      /*var params = _.map(filteredParams, function(param) {
-        if (param.name === "keys"){
-          param.value = JSON.parse(param.value);
-          //param.value = JSON.stringify(b);
-          return param;
-          //return getKeys(param);
-        }else{
-          return param;
-        }
-      });*/
-
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["keys","startkey","endkey"];
       var errorParams = _.filter(params, function(param) {
@@ -1177,8 +1172,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         }
       });
 
-      console.log('params', params);
-      return {params: params, errorParams: {}}; //errorParams};
+      return {params: params, errorParams: errorParams};
     },
 
     updateFilters: function(event) {
@@ -1239,6 +1233,17 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           }
           this.updateFiltersFor(key, $ele);
           break;
+          case "keys":
+            val = JSON.parse(val);
+            var processVal = val;
+            if (_.isArray(val)) {
+              processVal = _.map(val, function (arr) {
+                return JSON.stringify(arr);
+              }).join(', ');
+            }
+
+            $form.find("input[name='keys']").val(processVal);
+            break;
           default:
             $form.find("input[name='"+key+"']").val(val);
           break;


[18/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
2183 (JIRA)  remove stale from query options


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/10ea3770
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/10ea3770
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/10ea3770

Branch: refs/heads/Query-Options-UI
Commit: 10ea377041fe7ce54cad68b8d560e3cf2533b329
Parents: b67b65c
Author: suelockwood <de...@apache.org>
Authored: Wed Mar 5 14:27:44 2014 -0500
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/templates/advanced_options.html | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/10ea3770/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index 274c107..2eaff2a 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -73,9 +73,6 @@ the License.
       <div class="checkbox inline"> 
         <input id="check1" type="checkbox" name="include_docs" value="true">  
         <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>  
-
-        <input id="check3" name="stale" type="checkbox" value="ok">
-        <label for="check3">Stale</label>
       </div>
 
       <% if (hasReduce) { %>


[14/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fauxton: fix navigating back to previous page

Fixes #COUCHDB-2169


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6f23ad40
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6f23ad40
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6f23ad40

Branch: refs/heads/Query-Options-UI
Commit: 6f23ad403d8669abedc5f090284450793b2a77e5
Parents: 304c144
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Mar 17 18:20:44 2014 +0100
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Mar 17 18:20:44 2014 +0100

----------------------------------------------------------------------
 src/Makefile.am                              |  1 +
 src/fauxton/app/addons/auth/base.js          |  2 +-
 src/fauxton/app/addons/auth/test/baseSpec.js | 34 +++++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6f23ad40/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index f610a31..e1007f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,6 +59,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/auth/templates/nav_dropdown.html \
     fauxton/app/addons/auth/templates/nav_link_title.html \
     fauxton/app/addons/auth/templates/noAccess.html \
+    fauxton/app/addons/auth/test/baseSpec.js \
     fauxton/app/addons/compaction/assets/less/compaction.less \
     fauxton/app/addons/compaction/templates/compact_view.html \
     fauxton/app/addons/compaction/templates/layout.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6f23ad40/src/fauxton/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/base.js b/src/fauxton/app/addons/auth/base.js
index 7f69a7f..3354f53 100644
--- a/src/fauxton/app/addons/auth/base.js
+++ b/src/fauxton/app/addons/auth/base.js
@@ -50,7 +50,7 @@ function(app, FauxtonAPI, Auth) {
     };
 
     var authDenied = function () {
-      FauxtonAPI.navigate('/noAccess');
+      FauxtonAPI.navigate('/noAccess', {replace: true});
     };
 
     FauxtonAPI.auth.registerAuth(auth);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6f23ad40/src/fauxton/app/addons/auth/test/baseSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/test/baseSpec.js b/src/fauxton/app/addons/auth/test/baseSpec.js
new file mode 100644
index 0000000..1525306
--- /dev/null
+++ b/src/fauxton/app/addons/auth/test/baseSpec.js
@@ -0,0 +1,34 @@
+// 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.
+define([
+      'api',
+      'addons/auth/base',
+      'core/auth',
+      'testUtils'
+], function (FauxtonAPI, Base, Auth, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox;
+
+  describe("Auth: Login", function () {
+
+    describe("failed login", function () {
+
+      it("redirects with replace: true set", function () {
+        var navigateSpy = sinon.spy(FauxtonAPI, 'navigate');
+        FauxtonAPI.auth = new Auth();
+        Base.initialize();
+        FauxtonAPI.auth.authDeniedCb();
+        assert.ok(navigateSpy.withArgs('/noAccess', {replace: true}).calledOnce);
+      });
+    });
+  });
+});


[23/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fix for when errors return for key queries in _all_docs


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f2374114
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f2374114
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f2374114

Branch: refs/heads/Query-Options-UI
Commit: f23741149511f6b799d6e35d690e78857fc051b9
Parents: 2f056a8
Author: suelockwood <de...@apache.org>
Authored: Wed Mar 19 11:46:23 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:47 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js | 23 ++++++++++++++--------
 src/fauxton/app/addons/documents/views.js     |  6 ++++++
 2 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f2374114/src/fauxton/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js
index 6f4323a..efd7f69 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -468,14 +468,21 @@ function(app, FauxtonAPI) {
       if (this.skipFirstItem) {
         rows = rows.splice(1);
       }
-      return _.map(rows, function(row) {
-        return {
-          _id: row.id,
-          _rev: row.value.rev,
-          value: row.value,
-          key: row.key,
-          doc: row.doc || undefined
-        };
+      
+      // remove any query errors that may return without doc info
+      // important for when querying keys on all docs
+      var noQueryErrors = _.filter(rows, function(row){
+        return row.value;
+      });
+
+      return _.map(noQueryErrors, function(row) {
+          return {
+            _id: row.id,
+            _rev: row.value.rev,
+            value: row.value,
+            key: row.key,
+            doc: row.doc || undefined
+          };
       });
     }
   }));

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f2374114/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 135ba31..d3da5f1 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1222,6 +1222,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           }
           this.updateFiltersFor(key, $ele);
           break;
+          case "key": 
+          case "keys": 
+            $form.find("textarea[name='"+key+"']").val(val);
+          break;
           default:
             $form.find("input[name='"+key+"']").val(val);
           break;
@@ -1615,6 +1619,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     toggleIndexNav: function (event) {
+      $('#dashboard-content').scrollTop(0); //scroll up
+      
       var $targetId = this.$(event.target).attr('id'),
           $previousTab = this.$(this.$('li.active a').attr('href')),
           $targetTab = this.$(this.$(event.target).attr('href'));


[10/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Merge branch 'my-first-couch-plugin-readme-typos' of https://github.com/marianoguerra/couchdb

* 'my-first-couch-plugin-readme-typos' of https://github.com/marianoguerra/couchdb:
  spell checking my-first-couchdb-plugin's README

This closes #185


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e07cc829
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e07cc829
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e07cc829

Branch: refs/heads/Query-Options-UI
Commit: e07cc8291bf5338ea7a86094ad43b2878e72b265
Parents: 585ddaf 1db70b8
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Mar 17 13:48:10 2014 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Mar 17 13:48:10 2014 +0100

----------------------------------------------------------------------
 src/my-first-couchdb-plugin/README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[13/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Merge branch 'my-first-couch-plugin-readme-typos'

'my-first-couch-plugin-readme-typos' of https://github.com/marianoguerra/couchdb

* update opening note 868e171
* update clone command to clone from github repo

This closes #186


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/304c1446
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/304c1446
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/304c1446

Branch: refs/heads/Query-Options-UI
Commit: 304c144606594d16b74bfac9e6d9c61fdfbc4264
Parents: e07cc82 266020f
Author: Andy Wenk <an...@apache.org>
Authored: Mon Mar 17 14:52:07 2014 +0100
Committer: Andy Wenk <an...@apache.org>
Committed: Mon Mar 17 14:54:47 2014 +0100

----------------------------------------------------------------------
 src/my-first-couchdb-plugin/README.md | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[25/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Remove Stale for all docs, but keep it for indexes


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5d3e3eae
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5d3e3eae
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5d3e3eae

Branch: refs/heads/Query-Options-UI
Commit: 5d3e3eaebed171d3fe361ac3a9057da12f20bb6a
Parents: 404afec
Author: suelockwood <de...@apache.org>
Authored: Tue Mar 18 16:27:45 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:47 2014 +0200

----------------------------------------------------------------------
 .../app/addons/documents/templates/advanced_options.html       | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d3e3eae/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index 4ca8f12..8acf30a 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -105,6 +105,12 @@ the License.
         <label for="check6">Update Sequence</label>  
       </div>
 
+      <% if (showPreview) { %>
+      <div class="checkbox inline">  
+        <input id="check7" name="stale" type="checkbox" value="true">  
+        <label for="check7">Stale</label>  
+      </div>
+      <% } %>
   </div>
 
 


[20/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fix linting issue


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1b005392
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1b005392
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1b005392

Branch: refs/heads/Query-Options-UI
Commit: 1b00539225e650209dda41d96c11c54f87047e8f
Parents: 10ea377
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Mar 6 12:21:20 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/views.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b005392/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index c595c6c..dfd0752 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1177,13 +1177,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
       return {params: params, errorParams: errorParams};
 
-
-
-
-
-
       // Ignore params without a value
-      _.map($form.serializeArray(), function(param) {
+      /*_.map($form.serializeArray(), function(param) {
         if (param.value){
           if (param.name === "keys"){
             var keys = getKeys(param.value);
@@ -1192,7 +1187,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
             data[param.name] = param.value;
           }
         }
-      });
+      });(*/
 
     },
 


[07/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fauxton: remove caching


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/13010ed2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/13010ed2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/13010ed2

Branch: refs/heads/Query-Options-UI
Commit: 13010ed264582f235825a26a1907952479156163
Parents: c81f2d4
Author: Garren Smith <ga...@gmail.com>
Authored: Fri Mar 14 15:54:27 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Mon Mar 17 08:23:56 2014 -0400

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                        |   2 +-
 src/fauxton/app/config.js                       |   3 +-
 src/fauxton/app/core/base.js                    |  45 +--
 src/fauxton/app/core/couchdbSession.js          |   1 -
 .../assets/js/plugins/backbone.fetch-cache.js   | 311 -------------------
 src/fauxton/tasks/couchserver.js                |   4 +-
 6 files changed, 18 insertions(+), 348 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 348fa45..49c082e 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -170,7 +170,7 @@ module.exports = function(grunt) {
     // override inside main.js needs to test for them so as to not accidentally
     // route. Settings expr true so we can do `migtBeNullObject && mightBeNullObject.coolFunction()`
     jshint: {
-      all: ['app/**/*.js', 'Gruntfile.js', "test/core/*.js"],
+      all: ['app/**/*.js', 'Gruntfile.js', "!app/**/assets/js/*.js"],
       options: {
         scripturl: true,
         evil: true,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/app/config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index a5d764f..98be9c6 100644
--- a/src/fauxton/app/config.js
+++ b/src/fauxton/app/config.js
@@ -30,8 +30,7 @@ require.config({
     spin: "../assets/js/libs/spin.min",
     d3: "../assets/js/libs/d3",
     "nv.d3": "../assets/js/libs/nv.d3",
-    "ace":"../assets/js/libs/ace",
-    "backbone.fetch-cache": "../assets/js/plugins/backbone.fetch-cache"
+    "ace":"../assets/js/libs/ace"
   },
 
   baseUrl: '/',

http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/app/core/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/base.js b/src/fauxton/app/core/base.js
index 7cacf39..15499b3 100644
--- a/src/fauxton/app/core/base.js
+++ b/src/fauxton/app/core/base.js
@@ -12,11 +12,10 @@
 
 define([
   "backbone",
-  "plugins/backbone.layoutmanager",
-  "backbone.fetch-cache"
+  "plugins/backbone.layoutmanager"
 ],
 
-function(Backbone, LayoutManager, BackboneCache) {
+function(Backbone, LayoutManager) {
   var FauxtonAPI = {
     //add default objects
     router: {
@@ -68,44 +67,26 @@ function(Backbone, LayoutManager, BackboneCache) {
     }
   });
 
-
-  FauxtonAPI.Model = Backbone.Model.extend({
-
-  });
-
-  FauxtonAPI.Collection = Backbone.Collection.extend({
-
-  });
-
   var caching = {
-    fetchOnce: function (opts) {
-      var options = _.defaults(opts || {}, this.cache, {cache: true});
+    fetchOnce: function (opt) {
+      var options = _.extend({}, opt);
 
-      if (opts && !opts.cache) {
-        delete options.cache;
+      if (!this._deferred || this._deferred.state() === "rejected" || options.forceFetch ) {
+        this._deferred = this.fetch();
       }
 
-      if (!options.prefill) {
-        return this.fetch(options);
-      }
-
-      //With Prefill, the Caching with resolve with whatever is in the cache for that model/collection
-      //and at the sametime it will fetch from the server the latest. 
-      var promise = FauxtonAPI.Deferred(),
-          fetchPromise = this.fetch(options);
-
-      fetchPromise.progress(promise.resolveWith); // Fires when the cache hit happens
-      fetchPromise.then(promise.resolveWith); // Fires after the AJAX call
-      promise.fail(fetchPromise.abort);
-
-      return promise;
+      return this._deferred;
     }
   };
 
-  _.each([FauxtonAPI.Collection, FauxtonAPI.Model], function (ctor) {
+  FauxtonAPI.Model = Backbone.Model.extend({ });
+
+  FauxtonAPI.Collection = Backbone.Collection.extend({ });
+
+  _.each([FauxtonAPI.Model, FauxtonAPI.Collection], function (ctor) {
     _.extend(ctor.prototype, caching);
   });
-
+  
   var extensions = _.extend({}, Backbone.Events);
   // Can look at a remove function later.
   FauxtonAPI.registerExtension = function (name, view) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/app/core/couchdbSession.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/couchdbSession.js b/src/fauxton/app/core/couchdbSession.js
index 747ef3e..7482db9 100644
--- a/src/fauxton/app/core/couchdbSession.js
+++ b/src/fauxton/app/core/couchdbSession.js
@@ -35,7 +35,6 @@ function (FauxtonAPI) {
 
         if (options.forceFetch) {
           fetch = _.bind(this.fetch, this);
-          Backbone.fetchCache.clearItem(_.result(this, 'url'));
         }
 
         return fetch(opt).then(function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/plugins/backbone.fetch-cache.js b/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
deleted file mode 100644
index 4aa7676..0000000
--- a/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
+++ /dev/null
@@ -1,311 +0,0 @@
-/*!
-  backbone.fetch-cache v1.3.0
-  by Andy Appleton - https://github.com/mrappleton/backbone-fetch-cache.git
- */
-
-// AMD wrapper from https://github.com/umdjs/umd/blob/master/amdWebGlobal.js
-
-(function (root, factory) {
-  if (typeof define === 'function' && define.amd) {
-    // AMD. Register as an anonymous module and set browser global
-    define(['underscore', 'backbone', 'jquery'], function (_, Backbone, $) {
-      return (root.Backbone = factory(_, Backbone, $));
-    });
-  } else {
-    // Browser globals
-    root.Backbone = factory(root._, root.Backbone, root.jQuery);
-  }
-}(this, function (_, Backbone, $) {
-
-  // Setup
-  var superMethods = {
-    modelFetch: Backbone.Model.prototype.fetch,
-    modelSync: Backbone.Model.prototype.sync,
-    collectionFetch: Backbone.Collection.prototype.fetch
-  },
-  supportLocalStorage = (function() {
-    var supported = typeof window.localStorage !== 'undefined';
-    if (supported) {
-      try {
-        // impossible to write on some platforms when private browsing is on and
-        // throws an exception = local storage not supported.
-        localStorage.setItem("test_support", "test_support");
-        localStorage.removeItem("test_support");
-      } catch (e) {
-        supported = false;
-      }
-    }
-    return supported;
-  })();
-
-  Backbone.fetchCache = (Backbone.fetchCache || {});
-  Backbone.fetchCache._cache = (Backbone.fetchCache._cache || {});
-
-  Backbone.fetchCache.priorityFn = function(a, b) {
-    if (!a || !a.expires || !b || !b.expires) {
-      return a;
-    }
-
-    return a.expires - b.expires;
-  };
-
-  Backbone.fetchCache._prioritize = function() {
-    var sorted = _.values(this._cache).sort(this.priorityFn);
-    var index = _.indexOf(_.values(this._cache), sorted[0]);
-    return _.keys(this._cache)[index];
-  };
-
-  Backbone.fetchCache._deleteCacheWithPriority = function() {
-    Backbone.fetchCache._cache[this._prioritize()] = null;
-    delete Backbone.fetchCache._cache[this._prioritize()];
-    Backbone.fetchCache.setLocalStorage();
-  };
-
-  Backbone.fetchCache.getLocalStorageKey = function() {
-    return 'backboneCache';
-  };
-
-  if (typeof Backbone.fetchCache.localStorage === 'undefined') {
-    Backbone.fetchCache.localStorage = true;
-  }
-
-  // Shared methods
-  function getCacheKey(instance, opts) {
-    var url;
-
-    if(opts && opts.url) {
-      url = opts.url;
-    } else {
-      url = _.isFunction(instance.url) ? instance.url() : instance.url;
-    }
-
-    // Need url to use as cache key so return if we can't get it
-    if(!url) { return; }
-
-    if(opts && opts.data) {
-      return url + "?" + $.param(opts.data);
-    }
-    return url;
-  }
-
-  function setCache(instance, opts, attrs) {
-    opts = (opts || {});
-    var key = Backbone.fetchCache.getCacheKey(instance, opts),
-        expires = false;
-
-    // Need url to use as cache key so return if we can't get it
-    if (!key) { return; }
-
-    // Never set the cache if user has explicitly said not to
-    if (opts.cache === false) { return; }
-
-    // Don't set the cache unless cache: true or prefill: true option is passed
-    if (!(opts.cache || opts.prefill)) { return; }
-
-    if (opts.expires !== false) {
-      expires = (new Date()).getTime() + ((opts.expires || 5 * 60) * 1000);
-    }
-
-    Backbone.fetchCache._cache[key] = {
-      expires: expires,
-      value: attrs
-    };
-
-    Backbone.fetchCache.setLocalStorage();
-  }
-
-  function clearItem(key) {
-    if (_.isFunction(key)) { key = key(); }
-    delete Backbone.fetchCache._cache[key];
-    Backbone.fetchCache.setLocalStorage();
-  }
-
-  function setLocalStorage() {
-    if (!supportLocalStorage || !Backbone.fetchCache.localStorage) { return; }
-    try {
-      localStorage.setItem(Backbone.fetchCache.getLocalStorageKey(), JSON.stringify(Backbone.fetchCache._cache));
-    } catch (err) {
-      var code = err.code || err.number || err.message;
-      if (code === 22) {
-        this._deleteCacheWithPriority();
-      } else {
-        throw(err);
-      }
-    }
-  }
-
-  function getLocalStorage() {
-    if (!supportLocalStorage || !Backbone.fetchCache.localStorage) { return; }
-    var json = localStorage.getItem(Backbone.fetchCache.getLocalStorageKey()) || '{}';
-    Backbone.fetchCache._cache = JSON.parse(json);
-  }
-
-  function nextTick(fn) {
-    return window.setTimeout(fn, 0);
-  }
-
-  // Instance methods
-  Backbone.Model.prototype.fetch = function(opts) {
-    opts = _.defaults(opts || {}, { parse: true });
-    var key = Backbone.fetchCache.getCacheKey(this, opts),
-        data = Backbone.fetchCache._cache[key],
-        expired = false,
-        attributes = false,
-        deferred = new $.Deferred(),
-        self = this;
-
-    function setData() {
-      if (opts.parse) {
-        attributes = self.parse(attributes, opts);
-      }
-
-      self.set(attributes, opts);
-      if (_.isFunction(opts.prefillSuccess)) { opts.prefillSuccess(self, attributes, opts); }
-
-      // Trigger sync events
-      self.trigger('cachesync', self, attributes, opts);
-      self.trigger('sync', self, attributes, opts);
-
-      // Notify progress if we're still waiting for an AJAX call to happen...
-      if (opts.prefill) { deferred.notify(self); }
-      // ...finish and return if we're not
-      else {
-        if (_.isFunction(opts.success)) { opts.success(self, attributes, opts); }
-        deferred.resolve(self);
-      }
-    }
-
-    if (data) {
-      expired = data.expires;
-      expired = expired && data.expires < (new Date()).getTime();
-      attributes = data.value;
-    }
-
-    if (!expired && (opts.cache || opts.prefill) && attributes) {
-      // Ensure that cache resolution adhers to async option, defaults to true.
-      if (opts.async == null) { opts.async = true; }
-
-      if (opts.async) {
-        nextTick(setData);
-      } else {
-        setData();
-      }
-
-      if (!opts.prefill) {
-        return deferred;
-      }
-    }
-
-    // Delegate to the actual fetch method and store the attributes in the cache
-    superMethods.modelFetch.apply(this, arguments)
-      // resolve the returned promise when the AJAX call completes
-      .done( _.bind(deferred.resolve, this, this) )
-      // Set the new data in the cache
-      .done( _.bind(Backbone.fetchCache.setCache, null, this, opts) )
-      // Reject the promise on fail
-      .fail( _.bind(deferred.reject, this, this) );
-
-    // return a promise which provides the same methods as a jqXHR object
-    return deferred;
-  };
-
-  // Override Model.prototype.sync and try to clear cache items if it looks
-  // like they are being updated.
-  Backbone.Model.prototype.sync = function(method, model, options) {
-    // Only empty the cache if we're doing a create, update, patch or delete.
-    if (method === 'read') {
-      return superMethods.modelSync.apply(this, arguments);
-    }
-
-    var collection = model.collection,
-        keys = [],
-        i, len;
-
-    // Build up a list of keys to delete from the cache, starting with this
-    keys.push(Backbone.fetchCache.getCacheKey(model, options));
-
-    // If this model has a collection, also try to delete the cache for that
-    if (!!collection) {
-      keys.push(Backbone.fetchCache.getCacheKey(collection));
-    }
-
-    // Empty cache for all found keys
-    for (i = 0, len = keys.length; i < len; i++) { clearItem(keys[i]); }
-
-    return superMethods.modelSync.apply(this, arguments);
-  };
-
-  Backbone.Collection.prototype.fetch = function(opts) {
-    opts = _.defaults(opts || {}, { parse: true });
-    var key = Backbone.fetchCache.getCacheKey(this, opts),
-        data = Backbone.fetchCache._cache[key],
-        expired = false,
-        attributes = false,
-        deferred = new $.Deferred(),
-        self = this;
-
-    function setData() {
-      self[opts.reset ? 'reset' : 'set'](attributes, opts);
-      if (_.isFunction(opts.prefillSuccess)) { opts.prefillSuccess(self); }
-
-      // Trigger sync events
-      self.trigger('cachesync', self, attributes, opts);
-      self.trigger('sync', self, attributes, opts);
-
-      // Notify progress if we're still waiting for an AJAX call to happen...
-      if (opts.prefill) { deferred.notify(self); }
-      // ...finish and return if we're not
-      else {
-        if (_.isFunction(opts.success)) { opts.success(self, attributes, opts); }
-        deferred.resolve(self);
-      }
-    }
-
-    if (data) {
-      expired = data.expires;
-      expired = expired && data.expires < (new Date()).getTime();
-      attributes = data.value;
-    }
-
-    if (!expired && (opts.cache || opts.prefill) && attributes) {
-      // Ensure that cache resolution adhers to async option, defaults to true.
-      if (opts.async == null) { opts.async = true; }
-
-      if (opts.async) {
-        nextTick(setData);
-      } else {
-        setData();
-      }
-
-      if (!opts.prefill) {
-        return deferred;
-      }
-    }
-
-    // Delegate to the actual fetch method and store the attributes in the cache
-    superMethods.collectionFetch.apply(this, arguments)
-      // resolve the returned promise when the AJAX call completes
-      .done( _.bind(deferred.resolve, this, this) )
-      // Set the new data in the cache
-      .done( _.bind(Backbone.fetchCache.setCache, null, this, opts) )
-      // Reject the promise on fail
-      .fail( _.bind(deferred.reject, this, this) );
-
-    // return a promise which provides the same methods as a jqXHR object
-    return deferred;
-  };
-
-  // Prime the cache from localStorage on initialization
-  getLocalStorage();
-
-  // Exports
-
-  Backbone.fetchCache._superMethods = superMethods;
-  Backbone.fetchCache.setCache = setCache;
-  Backbone.fetchCache.getCacheKey = getCacheKey;
-  Backbone.fetchCache.clearItem = clearItem;
-  Backbone.fetchCache.setLocalStorage = setLocalStorage;
-  Backbone.fetchCache.getLocalStorage = getLocalStorage;
-
-  return Backbone;
-}));

http://git-wip-us.apache.org/repos/asf/couchdb/blob/13010ed2/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 21c2fcb..95b05e8 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -47,7 +47,9 @@ module.exports = function (grunt) {
           accept = req.headers.accept.split(','),
           filePath;
 
-      if (!!url.match(/assets/)) {
+      if (!!url.match(/^\/addons\/.*\/assets\/js/)) {
+        filePath = path.join(app_dir, url.replace('/_utils/fauxton/',''));
+      } else if (!!url.match(/assets/)) {
         // serve any javascript or css files from here assets dir
         filePath = path.join('./',url);
       } else if (!!url.match(/mocha|\/test\/core\/|test\.config/)) {


[21/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Enable Limit and Skip again
Change the keys input to a textarea


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/2f056a81
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/2f056a81
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/2f056a81

Branch: refs/heads/Query-Options-UI
Commit: 2f056a8141bc0c4ce2de98ef8340e123ef86d4db
Parents: 5d3e3ea
Author: suelockwood <de...@apache.org>
Authored: Wed Mar 19 11:36:36 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:47 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/assets/less/documents.less | 4 ++++
 .../app/addons/documents/templates/advanced_options.html    | 9 ++++-----
 src/fauxton/app/addons/documents/views.js                   | 4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2f056a81/src/fauxton/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/assets/less/documents.less b/src/fauxton/app/addons/documents/assets/less/documents.less
index 61d864b..40a1d8c 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -39,6 +39,10 @@ button.beautify {
 }
 
 
+#query div.controls-group.well{
+    height: 150px;
+}
+
 /** used in all_docs_list.html **/
 .view {
     table td div {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2f056a81/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index 8acf30a..f823d1a 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -28,7 +28,7 @@ the License.
   <div class="controls-group well">
     <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
-        <input name="keys" class="input-xxlarge" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON.">
+        <textarea name="keys" class="input-xxlarge" rows="5" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON."></textarea>
       </div>
     </div>
     <div class="row-fluid hide" id="js-showStartEnd">
@@ -48,7 +48,7 @@ the License.
   <div class="controls-group">
       <label class="drop-down inline">
         Limit:
-        <select name="limit" class="input-small" disabled>
+        <select name="limit" class="input-small">
           <option>5</option>
           <option>10</option>
           <option selected="selected">20</option>
@@ -59,10 +59,9 @@ the License.
         </select>
       </label>
       <label for="skipRows" class="inline drop-down">
-        Skip
-        <input name="skip" class="input-large" type="text" id="skipRows" disabled placeholder="Number of rows to skip">
+        Skip: 
+        <input name="skip" class="input-large" type="text" id="skipRows" placeholder="Number of rows to skip">
       </label>
-      <span class="js-disabled-message"> Limit &amp; and Skip are disabled when using Keys.</span>
 
       <div class="checkbox inline"> 
         <input id="check1" type="checkbox" name="include_docs" value="true">  

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2f056a81/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 1e7addf..135ba31 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1107,13 +1107,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     showKeys: function(){
       this.$("#js-showKeys, .js-disabled-message").show();
-      this.$('[name="skip"],[name="startkey"],[name="limit"],[name="endkey"],[name="inclusive_end"]').attr("disabled","true");
+      this.$('[name="startkey"],[name="endkey"],[name="inclusive_end"]').attr("disabled","true");
       this.$('[name="keys"]').removeAttr("disabled");
     },
 
     showStartEnd: function(){
       this.$("#js-showStartEnd").show();
-      this.$('[name="skip"],[name="startkey"],[name="limit"],[name="endkey"],[name="inclusive_end"]').removeAttr("disabled");
+      this.$('[name="startkey"],[name="endkey"],[name="inclusive_end"]').removeAttr("disabled");
       this.$('.js-disabled-message').hide();
       this.$('[name="keys"]').attr("disabled","true");
     },


[02/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Added Autocomplete for config sections
Form Validation
Updating selectors with the js-prefix
Added modal to makefile.
Removed debugging alert.
Cleaned up error messaging to be consistent.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/33b6e350
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/33b6e350
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/33b6e350

Branch: refs/heads/Query-Options-UI
Commit: 33b6e3509880ac271be26d75e1094e2296c139f6
Parents: a355997
Author: suelockwood <de...@apache.org>
Authored: Fri Mar 14 11:04:26 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Fri Mar 14 11:08:50 2014 -0400

----------------------------------------------------------------------
 src/Makefile.am                                 |   2 +
 .../app/addons/config/assets/less/config.less   |   2 +-
 src/fauxton/app/addons/config/resources.js      |   4 +
 src/fauxton/app/addons/config/routes.js         |   1 -
 .../app/addons/config/templates/dashboard.html  |  29 +---
 .../app/addons/config/templates/modal.html      |  33 +++++
 src/fauxton/app/addons/config/views.js          | 136 +++++++++++++++----
 src/fauxton/app/addons/fauxton/components.js    |  53 ++++----
 8 files changed, 179 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index a5eea39..89a6afd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,6 +70,8 @@ FAUXTON_FILES = \
     fauxton/app/addons/config/resources.js \
     fauxton/app/addons/config/views.js \
     fauxton/app/addons/config/routes.js \
+    fauxton/app/addons/config/views.js \
+    fauxton/app/addons/config/templates/modal.html \
     fauxton/app/addons/config/templates/dashboard.html \
     fauxton/app/addons/config/templates/item.html \
     fauxton/app/addons/config/tests/resourcesSpec.js \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/assets/less/config.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/assets/less/config.less b/src/fauxton/app/addons/config/assets/less/config.less
index 44311de..2807708 100644
--- a/src/fauxton/app/addons/config/assets/less/config.less
+++ b/src/fauxton/app/addons/config/assets/less/config.less
@@ -27,7 +27,7 @@
   button {width: 7%;}
 }
 
-#add-section-modal {
+#add-section-modal .modal {
   width: 400px;
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/resources.js b/src/fauxton/app/addons/config/resources.js
index ec8cc98..317e355 100644
--- a/src/fauxton/app/addons/config/resources.js
+++ b/src/fauxton/app/addons/config/resources.js
@@ -13,12 +13,14 @@
 define([
   "app",
   "api"
+
 ],
 
 function (app, FauxtonAPI) {
 
   var Config = FauxtonAPI.addon();
 
+
   Config.Model = Backbone.Model.extend({});
   Config.OptionModel = Backbone.Model.extend({
     documentation: "config",
@@ -75,5 +77,7 @@ function (app, FauxtonAPI) {
     }
   });
 
+ 
+
   return Config;
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/routes.js b/src/fauxton/app/addons/config/routes.js
index 519e25f..affb453 100644
--- a/src/fauxton/app/addons/config/routes.js
+++ b/src/fauxton/app/addons/config/routes.js
@@ -12,7 +12,6 @@
 
 define([
        "app",
-
        "api",
 
        // Modules

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/templates/dashboard.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/templates/dashboard.html b/src/fauxton/app/addons/config/templates/dashboard.html
index c14402c..37ae634 100644
--- a/src/fauxton/app/addons/config/templates/dashboard.html
+++ b/src/fauxton/app/addons/config/templates/dashboard.html
@@ -13,10 +13,10 @@ the License.
 -->
 
 <div class="row">
-    <button id="add-section" href="#" class="btn btn-primary pull-right">
-      <i class="icon icon-plus icon-white"> </i>
-      Add Section
-    </button>
+  <button id="js-add-section" href="#" class="btn btn-primary pull-right">
+    <i class="icon icon-plus icon-white"> </i>
+    Add Section
+  </button>
 </div>
 <table class="config table table-striped table-bordered">
   <thead>
@@ -28,23 +28,4 @@ the License.
   <tbody>
   </tbody>
 </table>
-<div id="add-section-modal" class="modal hide fade">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3>Create Config Option</h3>
-  </div>
-  <div class="modal-body">
-    <form id="add-section-form" class="form well">
-      <label>Section</label>
-      <input type="text" name="section" placeholder="Section">
-      <span class="help-block">Enter an existing section name to add to it.</span>
-      <input type="text" name="name" placeholder="Name">
-      <br/>
-      <input type="text" name="value" placeholder="Value">
-      <div class="modal-footer">
-        <button type="button" class="btn" data-dismiss="modal">Cancel</button>
-        <button type="submit" class="btn btn-primary"> Save </button>
-      </div>
-    </form>
-  </div>
-</div>
+<div id="add-section-modal"></div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/templates/modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/templates/modal.html b/src/fauxton/app/addons/config/templates/modal.html
new file mode 100644
index 0000000..f32bd10
--- /dev/null
+++ b/src/fauxton/app/addons/config/templates/modal.html
@@ -0,0 +1,33 @@
+  <!--
+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.
+-->
+
+<div class="modal-header">
+  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+  <h3>Create Config Option</h3>
+</div>
+<div class="modal-body">
+  <div class="js-form-error-config"></div>
+  <form id="js-add-section-form" class="form well">
+    <label>Section</label>
+    <input type="text" name="section" placeholder="Section" >
+    <span class="help-block">Enter an existing section name to add to it.</span>
+    <input type="text" name="name" placeholder="Name">
+    <br/>
+    <input type="text" name="value" placeholder="Value">
+    <div class="modal-footer">
+      <button type="button" class="btn" data-dismiss="modal">Cancel</button>
+      <button type="submit" class="btn btn-primary"> Save </button>
+    </div>
+  </form>
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/config/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/views.js b/src/fauxton/app/addons/config/views.js
index bd05652..0468cd1 100644
--- a/src/fauxton/app/addons/config/views.js
+++ b/src/fauxton/app/addons/config/views.js
@@ -1,4 +1,4 @@
- // Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// 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
 //
@@ -14,11 +14,13 @@ define([
   "app",
   "api",
   "addons/config/resources",
+  "addons/fauxton/components"
 ],
+function(app, FauxtonAPI, Config, Components) {
+  var Views ={},
+      Events = {};
 
-function (app, FauxtonAPI, Config) {
-
-  var Views = {};
+  Views.Events = _.extend(Events, Backbone.Events);
 
   Views.TableRow = FauxtonAPI.View.extend({
     tagName: "tr",
@@ -59,7 +61,6 @@ function (app, FauxtonAPI, Config) {
       }
     },
 
-
     discardValue: function (event) {
       this.$(".js-edit-value-form").addClass("js-hidden");
       this.$(".js-show-value").removeClass("js-hidden");
@@ -84,12 +85,63 @@ function (app, FauxtonAPI, Config) {
     template: "addons/config/templates/dashboard",
 
     events: {
-      "click #add-section": "addSection",
-      "submit #add-section-form": "submitForm"
+      "click #js-add-section": "addSection"
     },
 
-    submitForm: function (event) {
+    initialize: function(){
+      this.listenTo(Views.Events, "newSection", this.render);
+    },
+
+    addSection: function (event) {
       event.preventDefault();
+      this.modal.show();
+    },
+
+    beforeRender: function() {
+      this.modal = this.insertView("#add-section-modal", new Views.Modal({
+                      collection: this.collection
+                    }));
+
+      this.modal.render();
+
+      this.collection.each(function(config) {
+        _.each(config.get("options"), function (option, index) {
+          this.insertView("table.config tbody", new Views.TableRow({
+            model: new Config.OptionModel({
+              section: config.get("section"),
+              name: option.name,
+              value: option.value,
+              index: index
+            })
+          }));
+        }, this);
+      }, this);
+    },
+
+    establish: function() {
+      return [this.collection.fetch()];
+    }
+  });
+
+  Views.Modal = FauxtonAPI.View.extend({
+    className: "modal hide fade",
+    template:  "addons/config/templates/modal",
+    events: {
+      "submit #js-add-section-form": "validate"
+    },
+    initialize: function(){
+      this.sourceArray = _.map(this.collection.toJSON(), function(item, key){ 
+        return item.section; 
+      });
+    },
+    afterRender: function(){
+      this.sectionTypeAhead = new Components.Typeahead({
+        source: this.sourceArray,
+        el: 'input[name="section"]'
+      });
+      this.sectionTypeAhead.render();
+    },
+    submitForm: function (event) {
       var option = new Config.OptionModel({
         section: this.$('input[name="section"]').val(),
         name: this.$('input[name="name"]').val(),
@@ -111,34 +163,58 @@ function (app, FauxtonAPI, Config) {
         });
       }
 
-      this.$("#add-section-modal").modal('hide');
-      this.render();
-    },
+      this.hide();
+      Views.Events.trigger("newSection");
 
-    addSection: function (event) {
+    },
+    isNew: function(collection){
+      var sectionName = this.$('input[name="section"]').val(),
+          name = this.$('input[name="name"]').val();
+          var section = _.findWhere(collection.toJSON(), {"section":sectionName});
+          var options = _.findWhere(section.options, {name: name});
+          
+          return options;
+    },
+    isSection: function(){
+      var section = this.$('input[name="section"]').val();
+      return _.find(this.sourceArray, function(item){ return item === section; });
+    },
+    validate: function (event){
       event.preventDefault();
-      this.$("#add-section-modal").modal({show:true});
+      var section = this.$('input[name="section"]').val(),
+          name = this.$('input[name="name"]').val(),
+          value = this.$('input[name="value"]').val(),
+          collection = this.collection;
+
+      if(!this.isSection()){
+         this.errorMessage("You need to use an existing section");
+      } else if (!name) {
+        this.errorMessage("Add a name");
+      } else if (!value) {
+        this.errorMessage("Add a value");
+      } else if (this.isNew(collection)){
+        this.errorMessage("Must have a unique name");
+      } else {
+        this.submitForm();
+      }
     },
-
-    beforeRender: function() {
-      this.collection.each(function(config) {
-        _.each(config.get("options"), function (option, index) {
-          this.insertView("table.config tbody", new Views.TableRow({
-            model: new Config.OptionModel({
-              section: config.get("section"),
-              name: option.name,
-              value: option.value,
-              index: index
-            })
-          }));
-        }, this);
-      }, this);
+    errorMessage: function(msg){
+      this.error = FauxtonAPI.addNotification({
+          msg: msg,
+          type: "error",
+          clear: true,
+          selector: ".js-form-error-config"
+      });
     },
-
-    establish: function() {
-      return [this.collection.fetch()];
+    show: function(){
+      this.$el.modal({show:true});
+    },
+    hide: function(){
+      this.$el.modal('hide');
     }
+
   });
 
   return Views;
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/33b6e350/src/fauxton/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/components.js b/src/fauxton/app/addons/fauxton/components.js
index 96af169..25f623c 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -210,32 +210,7 @@ function(app, FauxtonAPI, ace, spin) {
 
   });
 
-  //TODO allow more of the typeahead options.
-  //Current this just does what we need but we
-  //need to support the other typeahead options.
-  Components.Typeahead = FauxtonAPI.View.extend({
-
-    initialize: function (options) {
-      this.source = options.source;
-      _.bindAll(this);
-    },
 
-    afterRender: function () {
-      var onUpdate = this.onUpdate;
-
-      this.$el.typeahead({
-        source: this.source,
-        updater: function (item) {
-          if (onUpdate) {
-            onUpdate(item);
-          }
-
-          return item;
-        }
-      });
-    }
-
-  });
 
   Components.ModalView = FauxtonAPI.View.extend({
 
@@ -279,6 +254,34 @@ function(app, FauxtonAPI, ace, spin) {
     }
   });
 
+  //TODO allow more of the typeahead options.
+  //Current this just does what we need but we
+  //need to support the other typeahead options.
+  Components.Typeahead = FauxtonAPI.View.extend({
+
+    initialize: function (options) {
+      this.source = options.source;
+      this.onUpdate = options.onUpdate;
+      _.bindAll(this);
+    },
+
+    afterRender: function () {
+      var onUpdate = this.onUpdate;
+
+      this.$el.typeahead({
+        source: this.source,
+        updater: function (item) {
+          if (onUpdate) {
+            onUpdate(item);
+          }
+
+          return item;
+        }
+      });
+    }
+
+  });
+
   Components.DbSearchTypeahead = Components.Typeahead.extend({
     initialize: function (options) {
       this.dbLimit = options.dbLimit || 30;


[24/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Update Keys to be JSON instead of trying to configure that for the user


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/404afec3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/404afec3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/404afec3

Branch: refs/heads/Query-Options-UI
Commit: 404afec3dc9550500ec13fc9a79d85c3deeec906
Parents: 89e2f75
Author: suelockwood <de...@apache.org>
Authored: Tue Mar 18 12:36:32 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:47 2014 +0200

----------------------------------------------------------------------
 .../documents/templates/advanced_options.html   |  2 +-
 src/fauxton/app/addons/documents/views.js       | 44 ++------------------
 2 files changed, 4 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/404afec3/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index 8e78bcb..4ca8f12 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -28,7 +28,7 @@ the License.
   <div class="controls-group well">
     <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
-        <input name="keys" class="input-xxlarge" type="text" placeholder="Enter a key, or list of keys seperated by a comma.">
+        <input name="keys" class="input-xxlarge" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON.">
       </div>
     </div>
     <div class="row-fluid hide" id="js-showStartEnd">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/404afec3/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index a94a90c..1e7addf 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1132,42 +1132,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.hasReduce = hasReduce;
       this.render();
     },
-    getKeys: function(val){
-      var keys = val.value.replace(/\s/g,"");
-      
-      var regKeys = keys.match(/(\[.*?\])/g); 
-      if (regKeys) {
-        keys = regKeys;
-      } else {
-        keys = keys.split(',');
-      }
-
-      keys = _.map(keys, function (key) { return JSON.parse(key); });
-
-      if (_.isArray(keys)){
-        return {
-          name: "keys",
-          value: JSON.stringify(keys)
-        };
-      } else if (keys.length === 1) {
-        return {
-          name: "key",
-          value: keys[0]
-        };
-      }
+    validateKeys:  function(val){
+      return JSON.parse(val);
     },
     queryParams: function () {
-      var $form = this.$(".js-view-query-update"),
-          getKeys = this.getKeys;
+      var $form = this.$(".js-view-query-update");
 
       var params = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
-        
-        if (param.name === "keys"){
-          param = getKeys(param);
-        }
-
         params.push(param);
         return params;
       }, []);
@@ -1249,17 +1222,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           }
           this.updateFiltersFor(key, $ele);
           break;
-          case "keys":
-            val = JSON.parse(val);
-            var processVal = val;
-            if (_.isArray(val)) {
-              processVal = _.map(val, function (arr) {
-                return JSON.stringify(arr);
-              }).join(', ');
-            }
-
-            $form.find("input[name='keys']").val(processVal);
-            break;
           default:
             $form.find("input[name='"+key+"']").val(val);
           break;


[04/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
Fauxton: highlight databases with more deleted docs than existing

Fixes COUCHDB-2110


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/b8accb4e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b8accb4e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b8accb4e

Branch: refs/heads/Query-Options-UI
Commit: b8accb4eb7c46e3888416afc4aff407487f2f21c
Parents: a17bf86
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Mar 14 20:45:31 2014 +0100
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri Mar 14 20:45:43 2014 +0100

----------------------------------------------------------------------
 src/fauxton/app/addons/databases/resources.js   |  8 ++++
 .../app/addons/databases/templates/item.html    |  8 +++-
 .../app/addons/databases/tests/resourcesSpec.js | 39 ++++++++++++++++++++
 src/fauxton/app/addons/databases/views.js       |  1 +
 4 files changed, 55 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b8accb4e/src/fauxton/app/addons/databases/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/resources.js b/src/fauxton/app/addons/databases/resources.js
index 80cd533..f8aab96 100644
--- a/src/fauxton/app/addons/databases/resources.js
+++ b/src/fauxton/app/addons/databases/resources.js
@@ -123,6 +123,14 @@ function(app, FauxtonAPI, Documents) {
       return this.get("doc_count");
     },
 
+    numDeletedDocs: function() {
+      return this.get("doc_del_count");
+    },
+
+    isGraveYard: function() {
+      return this.numDeletedDocs() > this.numDocs();
+    },
+
     updateSeq: function(full) {
       var updateSeq = this.get("update_seq");
       if (full || (typeof(updateSeq) === 'number')) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b8accb4e/src/fauxton/app/addons/databases/templates/item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/templates/item.html b/src/fauxton/app/addons/databases/templates/item.html
index 549f421..304ab78 100644
--- a/src/fauxton/app/addons/databases/templates/item.html
+++ b/src/fauxton/app/addons/databases/templates/item.html
@@ -16,7 +16,13 @@ the License.
   <a href="#/database/<%=encoded%>/_all_docs"><%= database.get("name") %></a>
 </td>
 <td><%= database.status.humanSize() %></td>
-<td><%= database.status.numDocs() %></td>
+<td>
+  <%= database.status.numDocs() %>
+  <% if (database.status.isGraveYard()) { %>
+    <i class="js-db-graveyard icon icon-exclamation-sign" data-toggle="tooltip"
+      title="This database has just <%= database.status.numDocs() %> docs and <%= database.status.numDeletedDocs() %> deleted docs"></i>
+  <% } %>
+</td>
 <td><%= database.status.updateSeq() %></td>
 <td>
   <a class="db-actions btn fonticon-replicate set-replication-start" title="Replicate <%= database.get("name") %>" href="#/replication/new/<%=encoded%>"></a>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b8accb4e/src/fauxton/app/addons/databases/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/tests/resourcesSpec.js b/src/fauxton/app/addons/databases/tests/resourcesSpec.js
new file mode 100644
index 0000000..8e3fee4
--- /dev/null
+++ b/src/fauxton/app/addons/databases/tests/resourcesSpec.js
@@ -0,0 +1,39 @@
+// 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.
+define([
+      'api',
+      'addons/databases/resources',
+      'addons/databases/views',
+      'testUtils'
+], function (FauxtonAPI, Resources, Views, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox;
+
+  describe("Databases: List", function () {
+
+    describe("List items", function () {
+
+      it("detects graveyards", function () {
+        var modelWithGraveYard = new Resources.Status({
+          doc_count: 5,
+          doc_del_count: 6
+        });
+        var modelWithoutGraveYard = new Resources.Status({
+          doc_count: 6,
+          doc_del_count: 5
+        });
+        assert.ok(modelWithGraveYard.isGraveYard());
+        assert.ok(!modelWithoutGraveYard.isGraveYard());
+      });
+    });
+  });
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b8accb4e/src/fauxton/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/views.js b/src/fauxton/app/addons/databases/views.js
index ef52b2f..d632486 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -137,6 +137,7 @@ function(app, Components, FauxtonAPI, Databases) {
         }
       });
       this.dbSearchTypeahead.render();
+      this.$el.find(".js-db-graveyard").tooltip();
     },
 
     selectAll: function(evt){


[19/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
initial linking with paginate


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c6e5ce6e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c6e5ce6e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c6e5ce6e

Branch: refs/heads/Query-Options-UI
Commit: c6e5ce6ee8c52b6b42490fd9b041ec81038c0963
Parents: 1b00539
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Mar 11 11:48:50 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

----------------------------------------------------------------------
 .../documents/templates/advanced_options.html   |  8 +---
 src/fauxton/app/addons/documents/views.js       | 40 ++++++++------------
 2 files changed, 16 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c6e5ce6e/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index 2eaff2a..8e78bcb 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -12,14 +12,10 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div class="errors-container"></div>
-<form class="view-query-update custom-inputs">
-
+<form class="js-view-query-update custom-inputs">
 
 <!-- tabs for choosing Keys or Start & end -->
 
-
-
-
   <div class="btn-group toggle-btns">
     <label for="showKeys" class="drop-down btn active">
      Specific Keys 
@@ -47,8 +43,6 @@ the License.
     </div>
   </div>
 
-
-
 <!-- Limit and Skip are conditional -->
 
   <div class="controls-group">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c6e5ce6e/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index dfd0752..0b62dce 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1134,31 +1134,33 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     },
     queryParams: function () {
-      var $form = this.$(".view-query-update"),
+      var $form = this.$(".js-view-query-update"),
           getKeys = this.getKeys;
-      var params = _.reduce($form.serializeArray(), function(params, param) {
+
+      var rawParams = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
 
         params.push(param);
         return params;
       }, []);
-      });
-      var filteredParams = _.filter(params, function(param) {
+
+      var filteredParams = _.filter(rawParams, function(param) {
         return param.value;
       });
-        
 
-
-      var params = _.map(filteredParams, function(param) {
+      console.log('filtered', filteredParams);
+      var params = filteredParams;
+      /*var params = _.map(filteredParams, function(param) {
         if (param.name === "keys"){
-          return getKeys(param);
+          param.value = JSON.parse(param.value);
+          //param.value = JSON.stringify(b);
+          return param;
+          //return getKeys(param);
         }else{
           return param;
         }
-      });
-
-
+      });*/
 
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["keys","startkey","endkey"];
@@ -1175,20 +1177,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         }
       });
 
-      return {params: params, errorParams: errorParams};
-
-      // Ignore params without a value
-      /*_.map($form.serializeArray(), function(param) {
-        if (param.value){
-          if (param.name === "keys"){
-            var keys = getKeys(param.value);
-            data[keys.name] = keys.value;
-          }else{
-            data[param.name] = param.value;
-          }
-        }
-      });(*/
-
+      console.log('params', params);
+      return {params: params, errorParams: {}}; //errorParams};
     },
 
     updateFilters: function(event) {


[09/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
spell checking my-first-couchdb-plugin's README


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1db70b8c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1db70b8c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1db70b8c

Branch: refs/heads/Query-Options-UI
Commit: 1db70b8c8037deb3ab64a4e43e4a7c5f80f7038e
Parents: 13010ed
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:43:20 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:43:20 2014 +0100

----------------------------------------------------------------------
 src/my-first-couchdb-plugin/README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1db70b8c/src/my-first-couchdb-plugin/README.md
----------------------------------------------------------------------
diff --git a/src/my-first-couchdb-plugin/README.md b/src/my-first-couchdb-plugin/README.md
index 814ef3b..37c0a75 100644
--- a/src/my-first-couchdb-plugin/README.md
+++ b/src/my-first-couchdb-plugin/README.md
@@ -2,7 +2,7 @@
 
 A practical guide to developing CouchDB plugins.
 
-*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn someting already :)*
+*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn something already :)*
 
 
 ## Preparation
@@ -84,7 +84,7 @@ Note: from now on you can just type `make dev`, it will run `make` for you inter
 
 * * *
 
-That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, once that handle HTTP requests, others that operate on database changes, and yet others that provide a deamon that does useful things for us.
+That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, ones that handle HTTP requests, others that operate on database changes, and yet others that provide a daemon that does useful things for us.
 
 * * *
 
@@ -111,9 +111,9 @@ That’s the easy part. The hard part is publishing the plugin. And since this i
 
 Our module above is not very useful on its own. You can call it when you are in the Erlang command prompt for your local CouchDB, but CouchDB itself doesn’t know what to do with it and you can’t do anything with it from CouchDB’s HTTP API. Let’s fix that!
 
-CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straigtforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
+CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straightforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
 
-Before ge get goint, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
+Before we get going, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
 
     -module(my_first_couchdb_plugin_httpd).
 
@@ -142,11 +142,11 @@ Now we have a function that can handle HTTP requests, but we haven’t told Couc
 
 To do this, we need to take a little detour into the CouchDB configuration system, as CouchDB’s HTTP routing is fully dynamic and configurable at runtime.
 
-To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentialy an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
+To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentially an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
 
     _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
 
-This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additinal argument that is the document root for Futon.
+This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additional argument that is the document root for Futon.
 
 Another example:
 
@@ -154,7 +154,7 @@ Another example:
 
 This means that `/_all_dbs`, the API endpoint that allows you to list all databases in CouchDB is handled by, again, `couch_httpd_misc_handlers` but this time its function `handle_all_dbs_req`, which does not take an additional argument.
 
-Say we want to make our `handle_req` function answer under the enpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
+Say we want to make our `handle_req` function answer under the endpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
 
     _my_plugin = {my_first_couchdb_plugin, handle_req}
 


[06/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
fix build

add CONTRIBUTING.md to Makefile.am and license.skip
remove duplicate file from Makefile.am

This closes #184

Signed-off-by: Alexander Shorin <kx...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c81f2d47
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c81f2d47
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c81f2d47

Branch: refs/heads/Query-Options-UI
Commit: c81f2d470d73051617e0395f771c9f364e3f2e47
Parents: 510070c
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Mar 16 15:35:35 2014 +0100
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Mar 17 00:29:31 2014 +0400

----------------------------------------------------------------------
 license.skip    | 1 +
 src/Makefile.am | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c81f2d47/license.skip
----------------------------------------------------------------------
diff --git a/license.skip b/license.skip
index 984d869..56b48bd 100644
--- a/license.skip
+++ b/license.skip
@@ -140,6 +140,7 @@
 ^src/fauxton/readme.md
 ^src/fauxton/writing_addons.md
 ^src/fauxton/TODO.md
+^src/fauxton/CONTRIBUTING.md
 ^src/fauxton/settings.json.*
 ^src/fauxton/test/test.config.underscore
 ^src/fauxton/test/mocha/chai.js

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c81f2d47/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 43afcf5..f610a31 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,7 +70,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/config/resources.js \
     fauxton/app/addons/config/views.js \
     fauxton/app/addons/config/routes.js \
-    fauxton/app/addons/config/views.js \
     fauxton/app/addons/config/templates/modal.html \
     fauxton/app/addons/config/templates/dashboard.html \
     fauxton/app/addons/config/templates/item.html \
@@ -346,4 +345,5 @@ FAUXTON_FILES = \
     fauxton/test/runner.html \
     fauxton/test/test.config.underscore \
     fauxton/TODO.md \
+    fauxton/CONTRIBUTING.md \
     fauxton/writing_addons.md


[22/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
null object fix.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/89e2f752
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/89e2f752
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/89e2f752

Branch: refs/heads/Query-Options-UI
Commit: 89e2f752985d6eb5e09848d85b5e91ef4bf77ce9
Parents: 789a55a
Author: suelockwood <de...@apache.org>
Authored: Fri Mar 14 21:11:25 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 20 10:33:47 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/views.js | 50 +++++++++++++++++---------
 1 file changed, 33 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/89e2f752/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 4be76e6..a94a90c 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -335,7 +335,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
       this.model.destroy().then(function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Succesfully destroyed your doc"
+          msg: "Succesfully destroyed your doc",
+          clear:  true
         });
         that.$el.fadeOut(function () {
           that.remove();
@@ -348,7 +349,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       }, function(resp) {
         FauxtonAPI.addNotification({
           msg: "Failed to destroy your doc!",
-          type: "error"
+          type: "error",
+          clear:  true
         });
       });
     }
@@ -518,13 +520,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           return FauxtonAPI.addNotification({
             msg: "JSON Parse Error on field: "+param.name,
             type: "error",
-            selector: ".advanced-options .errors-container"
+            selector: ".advanced-options .errors-container",
+            clear:  true
           });
         });
         FauxtonAPI.addNotification({
           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
           type: "warning",
-          selector: ".advanced-options .errors-container"
+          selector: ".advanced-options .errors-container",
+          clear:  true
         });
 
         return false;
@@ -580,7 +584,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         this.ddocID = options.ddocInfo.id;
       }
       this.newView = options.newView || false;
-      this.docParams = options.docParams;
+      this.docParams = options.docParams || {};
       this.params = options.params || {};
       this.expandDocs = true;
       this.perPageDefault = this.docParams.limit || 20;
@@ -597,7 +601,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           // This should just throw a notification, not break the page
           FauxtonAPI.addNotification({
             msg: "Bad Request",
-            type: "error"
+            type: "error",
+            clear:  true
           });
 
           //now redirect back to alldocs
@@ -668,7 +673,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         }, function(resp) {
           FauxtonAPI.addNotification({
             msg: "Failed to destroy your doc!",
-            type: "error"
+            type: "error",
+            clear:  true
           });
         });
       }, this);
@@ -771,7 +777,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       if (this.model.isNewDoc()) {
         FauxtonAPI.addNotification({
           msg: 'This document has not been saved yet.',
-          type: 'warning'
+          type: 'warning',
+          clear:  true
         });
         return;
       }
@@ -784,13 +791,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
       this.model.destroy().then(function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Succesfully destroyed your doc"
+          msg: "Succesfully destroyed your doc",
+          clear:  true
         });
         FauxtonAPI.navigate(database.url("index"));
       }, function(resp) {
         FauxtonAPI.addNotification({
           msg: "Failed to destroy your doc!",
-          type: "error"
+          type: "error",
+          clear:  true
         });
       });
     },
@@ -808,7 +817,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       if (this.model.isNewDoc()) {
         FauxtonAPI.addNotification({
           msg: 'Please save the document before uploading an attachment.',
-          type: 'warning'
+          type: 'warning',
+          clear:  true
         });
         return;
       }
@@ -819,7 +829,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       if (this.model.isNewDoc()) {
         FauxtonAPI.addNotification({
           msg: 'Please save the document before duplicating it.',
-          type: 'warning'
+          type: 'warning',
+          clear:  true
         });
         return;
       }
@@ -891,14 +902,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           notification = FauxtonAPI.addNotification({
             msg: "Cannot save: " + 'Cannot change a documents _id, try Duplicate doc instead!',
             type: "error",
-            selector: "#doc .errors-container"
+            selector: "#doc .errors-container",
+            clear:  true
           });
         delete this.model.validationError;
       } else {
         notification = FauxtonAPI.addNotification({
           msg: "Please fix the JSON errors and try again.",
           type: "error",
-          selector: "#doc .errors-container"
+          selector: "#doc .errors-container",
+          clear:  true
         });
       }
     },
@@ -988,7 +1001,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         editor.setValue(JSON.stringify(changedDoc, null, "  "));
         FauxtonAPI.addNotification({
           type: "error",
-          msg: "Cannot remove a documents Id or Revision."
+          msg: "Cannot remove a documents Id or Revision.",
+          clear:  true
         });
       });
     },
@@ -1008,7 +1022,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     saveDoc: function(event) {
       FauxtonAPI.addNotification({
         type: "warning",
-        msg: "Save functionality coming soon."
+        msg: "Save functionality coming soon.",
+        clear:  true
       });
     },
 
@@ -1195,7 +1210,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
             var notification = FauxtonAPI.addNotification({
               msg: "include_docs has been disabled as you cannot include docs on a reduced view",
               type: "warn",
-              selector: ".view.show .all-docs-list.errors-container"
+              selector: ".view.show .all-docs-list.errors-container",
+              clear:  true
             });
           }
           $form.find("input[name=include_docs]").prop("disabled", true);


[08/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
encoded attachment name


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/585ddafb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/585ddafb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/585ddafb

Branch: refs/heads/Query-Options-UI
Commit: 585ddafb509da20966ceea41102e940643de7586
Parents: 13010ed
Author: suelockwood <de...@apache.org>
Authored: Thu Mar 13 23:26:33 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Mon Mar 17 08:27:32 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/views.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/585ddafb/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 56e9911..f29ebaa 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -940,7 +940,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           fileName: key,
           size: att.length,
           contentType: att.content_type,
-          url: this.model.url() + '/' + key
+          url: this.model.url() + '/' + app.utils.safeURLName(key)
         };
       }, this);
     },


[03/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf

Posted by ga...@apache.org.
COUCHDB-2166 Rename duplicate document to "copy ..." or "clone ..."


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a17bf86a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a17bf86a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a17bf86a

Branch: refs/heads/Query-Options-UI
Commit: a17bf86af27a2eb52e552360fecb5e74b6e5f582
Parents: 33b6e35
Author: suelockwood <de...@apache.org>
Authored: Fri Mar 14 11:17:26 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Fri Mar 14 11:17:26 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/templates/doc.html              | 2 +-
 .../app/addons/documents/templates/duplicate_doc_modal.html      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a17bf86a/src/fauxton/app/addons/documents/templates/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/doc.html b/src/fauxton/app/addons/documents/templates/doc.html
index 5ef70fe..9433868 100644
--- a/src/fauxton/app/addons/documents/templates/doc.html
+++ b/src/fauxton/app/addons/documents/templates/doc.html
@@ -40,7 +40,7 @@ the License.
     </div>
     <% } %> 
     <button class="btn upload"><i class="icon icon-circle-arrow-up"></i> Upload Attachment</button>
-    <button class="btn duplicate"><i class="icon icon-repeat"></i> Duplicate document</button>
+    <button class="btn duplicate"><i class="icon icon-repeat"></i> Clone document</button>
   </div>
 
   <button class="btn btn-danger delete"><i class="icon icon-trash"></i></button>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/a17bf86a/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html b/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
index 7616300..54be01f 100644
--- a/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
+++ b/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
@@ -15,7 +15,7 @@ the License.
 <div class="modal hide fade">
   <div class="modal-header">
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3>Duplicate Document</h3>
+    <h3>Clone Document</h3>
   </div>
   <div class="modal-body">
     <div id="modal-error" class="hide alert alert-error"/>
@@ -29,7 +29,7 @@ the License.
   </div>
   <div class="modal-footer">
     <button data-dismiss="modal" class="btn cancel-button"><i class="icon fonticon-circle-x"></i> Cancel</button>
-    <button id="duplicate-btn" class="btn btn-success save"><i class="fonticon-circle-check"></i> Duplicate</button>
+    <button id="duplicate-btn" class="btn btn-success save"><i class="fonticon-circle-check"></i> Clone</button>
   </div>
 </div>