You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by dc...@apache.org on 2014/03/07 01:17:44 UTC

[01/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Repository: couchdb
Updated Branches:
  refs/heads/2041-update-ibrowse fbb4491dd -> 948e7d9a6 (forced update)


Merge branch 'added-documentation-fixes' of https://github.com/andywenk/couchdb


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

Branch: refs/heads/2041-update-ibrowse
Commit: 918563154d5f93a7f979b0b344c031be761a89b2
Parents: b68eb17 be483fd
Author: Andy Wenk <an...@apache.org>
Authored: Mon Feb 3 13:08:46 2014 +0100
Committer: Andy Wenk <an...@apache.org>
Committed: Mon Feb 3 13:08:46 2014 +0100

----------------------------------------------------------------------
 share/doc/src/api/document/common.rst | 19 ++++---
 share/doc/src/json-structure.rst      | 84 +++++++++++++++---------------
 2 files changed, 54 insertions(+), 49 deletions(-)
----------------------------------------------------------------------



[22/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
fix handle_req

handle-req/2 was useless. Instead we wanted handle_req/1 to tell to
others which method is allowed.


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

Branch: refs/heads/2041-update-ibrowse
Commit: aed283fd79f7d3e90b1c7339aa2bba30da296864
Parents: e389a8b
Author: Benoit Chesneau <bc...@gmail.com>
Authored: Sun Feb 16 13:26:06 2014 +0100
Committer: Benoit Chesneau <bc...@gmail.com>
Committed: Sun Feb 16 13:37:24 2014 +0100

----------------------------------------------------------------------
 src/couch_dbupdates/src/couch_dbupdates_httpd.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/aed283fd/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_dbupdates/src/couch_dbupdates_httpd.erl b/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
index 96058d3..afd99a5 100644
--- a/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
+++ b/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
@@ -37,9 +37,9 @@ handle_req(#httpd{method='GET'}=Req) ->
 
     State = #state{resp=Resp, feed=Feed},
     couch_dbupdates:handle_dbupdates(fun handle_update/2,
-                                     State, Options).
+                                     State, Options);
 
-handle_req(Req, _Db) ->
+handle_req(_Req) ->
     couch_httpd:send_method_not_allowed(Req, "GET").
 
 handle_update(stop, #state{resp=Resp}) ->


[17/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Allow runtime configuration of maximum url length in replication

COUCHDB-2059


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

Branch: refs/heads/2041-update-ibrowse
Commit: e1453abf7d8075906abaf240d8f31465a94b6b25
Parents: 72adab9
Author: Robert Newson <ro...@cloudant.com>
Authored: Thu Feb 13 10:20:17 2014 +0000
Committer: Robert Newson <ro...@cloudant.com>
Committed: Thu Feb 13 10:20:17 2014 +0000

----------------------------------------------------------------------
 src/couch_replicator/src/couch_replicator_api_wrap.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e1453abf/src/couch_replicator/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index 52e15b7..5a42bb3 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -536,11 +536,11 @@ options_to_query_args([{open_revs, Revs} | Rest], Acc) ->
     options_to_query_args(Rest, [{"open_revs", JsonRevs} | Acc]).
 
 
--define(MAX_URL_LEN, 7000).
-
 atts_since_arg(_UrlLen, [], Acc) ->
     lists:reverse(Acc);
 atts_since_arg(UrlLen, [PA | Rest], Acc) ->
+    MaxUrlLen = list_to_integer(
+        couch_config:get("replicator", "max_url_len", "7000")),
     RevStr = couch_doc:rev_to_str(PA),
     NewUrlLen = case Rest of
     [] ->
@@ -550,7 +550,7 @@ atts_since_arg(UrlLen, [PA | Rest], Acc) ->
         % plus 2 double quotes and a comma (% encoded)
         UrlLen + size(RevStr) + 9
     end,
-    case NewUrlLen >= ?MAX_URL_LEN of
+    case NewUrlLen >= MaxUrlLen of
     true ->
         lists:reverse(Acc);
     false ->


[43/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Added comparitor to the configuration collection for alphabetical sorting


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

Branch: refs/heads/2041-update-ibrowse
Commit: 929b3a08776674742353aab20d5f4adb331dd2a7
Parents: 0df722e
Author: suelockwood <de...@apache.org>
Authored: Thu Feb 27 16:15:51 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Fri Feb 28 12:42:49 2014 -0500

----------------------------------------------------------------------
 src/fauxton/app/addons/config/resources.js | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/929b3a08/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 14d2474..227e80d 100644
--- a/src/fauxton/app/addons/config/resources.js
+++ b/src/fauxton/app/addons/config/resources.js
@@ -51,6 +51,11 @@ function (app, FauxtonAPI) {
   Config.Collection = Backbone.Collection.extend({
     model: Config.Model,
     documentation: "config",
+    comparator: function (OptionModel) {
+      if (OptionModel.get("section")) {
+        return OptionModel.get("section");
+      }
+    },
     url: function () {
       return app.host + '/_config';
     },


[40/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Remove caching from design docs, so that edit revisions are updated


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

Branch: refs/heads/2041-update-ibrowse
Commit: 055219f106b271dc17f0e469fb967489f4ef962e
Parents: 5989bb3
Author: suelockwood <de...@apache.org>
Authored: Wed Feb 26 17:00:07 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Wed Feb 26 17:00:07 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/055219f1/src/fauxton/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/routes.js b/src/fauxton/app/addons/documents/routes.js
index be9ce2f..1510485 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -182,7 +182,7 @@ function(app, FauxtonAPI, Documents, Databases) {
     },
 
     establish: function () {
-      return this.data.designDocs.fetchOnce();
+      return this.data.designDocs.fetch();
     },
 
     allDocs: function(databaseName, options) {


[20/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Revert "Allow runtime configuration of maximum url length in replication"

This reverts commit e1453abf7d8075906abaf240d8f31465a94b6b25.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 90a989ad89db8efbbbfc667086f977ff0a736668
Parents: c6c3794
Author: Robert Newson <rn...@apache.org>
Authored: Thu Feb 13 17:09:00 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Feb 13 17:09:00 2014 +0000

----------------------------------------------------------------------
 src/couch_replicator/src/couch_replicator_api_wrap.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/90a989ad/src/couch_replicator/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index 5a42bb3..52e15b7 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -536,11 +536,11 @@ options_to_query_args([{open_revs, Revs} | Rest], Acc) ->
     options_to_query_args(Rest, [{"open_revs", JsonRevs} | Acc]).
 
 
+-define(MAX_URL_LEN, 7000).
+
 atts_since_arg(_UrlLen, [], Acc) ->
     lists:reverse(Acc);
 atts_since_arg(UrlLen, [PA | Rest], Acc) ->
-    MaxUrlLen = list_to_integer(
-        couch_config:get("replicator", "max_url_len", "7000")),
     RevStr = couch_doc:rev_to_str(PA),
     NewUrlLen = case Rest of
     [] ->
@@ -550,7 +550,7 @@ atts_since_arg(UrlLen, [PA | Rest], Acc) ->
         % plus 2 double quotes and a comma (% encoded)
         UrlLen + size(RevStr) + 9
     end,
-    case NewUrlLen >= MaxUrlLen of
+    case NewUrlLen >= ?MAX_URL_LEN of
     true ->
         lists:reverse(Acc);
     false ->


[16/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fauxton: Fix login issue


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

Branch: refs/heads/2041-update-ibrowse
Commit: e54d1d8fc0f36ea737d2693364ee83324a98cddf
Parents: 72adab9
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Feb 13 10:59:45 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Feb 13 10:59:45 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/auth/resources.js | 2 ++
 src/fauxton/app/core/couchdbSession.js   | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e54d1d8f/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index 0c9b1f5..ed06175 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -53,6 +53,8 @@ function (app, FauxtonAPI, CouchdbSession) {
     initialize: function (options) {
       if (!options) { options = {}; }
 
+      _.bindAll(this);
+
       this.messages = _.extend({},  { 
           missingCredentials: 'Username or password cannot be blank.',
           passwordsNotMatch:  'Passwords do not match.',

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


[28/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
added overflow:auto to one-pane styles
fixed styletests template license comment...again
fixed Delete DB modal button styles
took graphs out of span5 + inline styles

They are now properly sized with no cutoffs
changed .row to .row-fluid in .container-fluid
reordered imports in databases; consolidated .well
removed unused styles
more Bootstrap overrides moved higher up
conslidated prettyprint stuff
moved document specific CSS to documents
no more CodeMirror anymore; gone be the related CSS
moved the input tag overrides up

Keeping like with like, so we can find the
like.
working on grouping Bootstrap overrides together

Also fixed some space around in-tab icons and
did some whitespace cleanup...I know...I know...
reordering & reducing the customness some more

Still finding heavy/dangerous Bootstrap 2.x overrides
(margin settings for .row & .tab-content--broadly).

Changing colors and such is generally fine, but
changing positioning breaks the grid. :frowning:


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

Branch: refs/heads/2041-update-ibrowse
Commit: 5d17c204dbcefc389420fef79810a58be91cde71
Parents: 3ad1f6a
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Mon Feb 17 21:55:40 2014 +0000
Committer: suelockwood <de...@apache.org>
Committed: Wed Feb 19 14:55:44 2014 -0500

----------------------------------------------------------------------
 .../app/addons/compaction/templates/layout.html |   4 +-
 .../addons/databases/assets/less/databases.less |   5 +-
 .../addons/documents/assets/less/documents.less |  30 +-
 .../templates/delete_database_modal.html        |   6 +-
 .../addons/documents/templates/view_editor.html |   3 -
 src/fauxton/app/addons/documents/views.js       |   3 +-
 .../addons/permissions/templates/section.html   |   2 +-
 .../app/addons/stats/templates/pie_table.html   |   6 +-
 .../app/addons/styletests/templates/theme.html  |   3 +-
 .../assets/less/bootstrap/bootstrap.less        |   1 -
 src/fauxton/assets/less/fauxton.less            | 571 ++++++++-----------
 src/fauxton/assets/less/prettyprint.less        |  21 +-
 12 files changed, 282 insertions(+), 373 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/compaction/templates/layout.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/compaction/templates/layout.html b/src/fauxton/app/addons/compaction/templates/layout.html
index 5125892..f63b7de 100644
--- a/src/fauxton/app/addons/compaction/templates/layout.html
+++ b/src/fauxton/app/addons/compaction/templates/layout.html
@@ -11,7 +11,7 @@ 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="row">
+<div class="row-fluid">
   <div class="span12 compaction-option">
     <h3> Compact Database </h3>
     <p>Compacting a database removes deleted documents and previous revisions. It is an irreversible operation and may take a while to complete for large databases.</p>
@@ -19,7 +19,7 @@ the License.
   </div>
 </div>
 
-<div class="row">
+<div class="row-fluid">
   <div class="span12 compaction-option">
     <h3> Cleanup Views </h3>
     <p>Cleaning up views in a database removes old view files still stored on the filesystem. It is an irreversible operation.</p>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/databases/assets/less/databases.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/assets/less/databases.less b/src/fauxton/app/addons/databases/assets/less/databases.less
index 7b7cf6a..b401e7d 100644
--- a/src/fauxton/app/addons/databases/assets/less/databases.less
+++ b/src/fauxton/app/addons/databases/assets/less/databases.less
@@ -13,8 +13,9 @@
 
 /* =database
    ---------------------------------------------------------------------- */
-@import "../../../../../assets/less/bootstrap/variables.less";  
-@import "../../../../../assets/less/bootstrap/mixins.less";   
+@import "../../../../../assets/less/bootstrap/variables.less";
+@import "../../../../../assets/less/variables.less";
+@import "../../../../../assets/less/bootstrap/mixins.less";
 
 .tools .nav {
     margin-bottom: 10px;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/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 6f462ef..9dee85e 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -48,25 +48,6 @@ button.beautify {
     }
 }
 
-/** used in ddocs_info.html **/
-.well {
-    .row-fluid {
-        margin: 0;
-    }
-    .row-fluid .row-fluid:last-child .well-item {
-        border: none;
-    }
-    .well-item {
-        color: #666;
-        font-size: 12px;
-        border-bottom: 1px solid #e5e5e5;
-        padding: 8px 4px;
-        strong {
-            font-size: 16px;
-        }
-    }
-}
-
 /** used in view_editor.html **/
 .design-doc-group{
     .span3 { margin: 0;}
@@ -90,3 +71,14 @@ button.beautify {
     width: 5%;
   }
 }
+
+#map-function, #reduce-function{
+    width: 100%;
+    font-size: 16px;
+}
+
+#editor-container {
+    width: 1316px;
+    height: 688px;
+    font-size: 16px;
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/documents/templates/delete_database_modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/delete_database_modal.html b/src/fauxton/app/addons/documents/templates/delete_database_modal.html
index 024f7c9..7ea3bc4 100644
--- a/src/fauxton/app/addons/documents/templates/delete_database_modal.html
+++ b/src/fauxton/app/addons/documents/templates/delete_database_modal.html
@@ -30,8 +30,10 @@ the License.
     </form>
   </div>
   <div class="modal-footer">
-    <a href="#" data-dismiss="modal" data-bypass="true" class="btn button cancel-button outlineGray fonticon-circle-x">Cancel</a>
-    <a href="#" id="delete-db-btn" data-bypass="true" class="btn btn-primary button red save fonticon-circle-check">Delete</a>
+    <button data-dismiss="modal" data-bypass="true" class="btn cancel-button">
+      <i class="icon fonticon-circle-x"></i> Cancel</button>
+    <button id="delete-db-btn" data-bypass="true" class="btn btn-danger save">
+      <i class="icon fonticon-circle-check"></i> Delete</button>
   </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/view_editor.html b/src/fauxton/app/addons/documents/templates/view_editor.html
index b4addad..6a20849 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -11,7 +11,6 @@ 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="row">
   <ul class="nav nav-tabs" id="db-views-tabs-nav">
     <li class="active"> <a data-bypass="true" id="index-nav" data-toggle="tab" href="#index">
       <i class="fonticon-wrench fonticon"></i>
@@ -88,5 +87,3 @@ the License.
     <div class="tab-pane" id="query">
     </div>
   </div>
-</div>
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/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 13cbacb..62d8761 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -117,7 +117,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     template: "addons/documents/templates/delete_database_modal",
 
     events: {
-      "click a#delete-db-btn": "deleteDatabase",
+      "click #delete-db-btn": "deleteDatabase",
       "submit #delete-db-check": "deleteDatabase"
     },
 
@@ -456,7 +456,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
   Views.AllDocsLayout = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_layout",
-    className: "row",
 
     initialize: function (options) {
       this.database = options.database;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/permissions/templates/section.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/templates/section.html b/src/fauxton/app/addons/permissions/templates/section.html
index 8f4d552..0459562 100644
--- a/src/fauxton/app/addons/permissions/templates/section.html
+++ b/src/fauxton/app/addons/permissions/templates/section.html
@@ -16,7 +16,7 @@ the License.
 <p class="help"> <%= help %> <a href="<%=getDocUrl('database_permission')%>" target="_blank"><i class="icon-question-sign"> </i> </a></p>
 </header>
 
-<div class="row">
+<div class="row-fluid">
   <div class="span6">
     <header>
       <h4> Users </h4>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/stats/templates/pie_table.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/stats/templates/pie_table.html b/src/fauxton/app/addons/stats/templates/pie_table.html
index c8e89cd..1fa781a 100644
--- a/src/fauxton/app/addons/stats/templates/pie_table.html
+++ b/src/fauxton/app/addons/stats/templates/pie_table.html
@@ -46,9 +46,5 @@ the License.
     </table>
   </div>
 
-  <div class="span5" style="height:430px;min-width: 430px">
-    <center>
-      <svg id="<%= datatype %>_graph"></svg>
-    </center>
-  </div>
+  <svg id="<%= datatype %>_graph"></svg>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/app/addons/styletests/templates/theme.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/styletests/templates/theme.html b/src/fauxton/app/addons/styletests/templates/theme.html
index f05bad1..3d93e5f 100644
--- a/src/fauxton/app/addons/styletests/templates/theme.html
+++ b/src/fauxton/app/addons/styletests/templates/theme.html
@@ -1,3 +1,4 @@
+<!--
 // 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
@@ -9,7 +10,7 @@
 // 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="container theme-showcase">
 
   <!-- Main jumbotron for a primary marketing message or call to action -->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/assets/less/bootstrap/bootstrap.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/bootstrap.less b/src/fauxton/assets/less/bootstrap/bootstrap.less
index 6f1abd7..3331980 100644
--- a/src/fauxton/assets/less/bootstrap/bootstrap.less
+++ b/src/fauxton/assets/less/bootstrap/bootstrap.less
@@ -9,7 +9,6 @@
  */
 
 // Core variables and mixins
-@import "variables.less"; // Modify this for custom colors, font-sizes, etc
 @import "mixins.less";
 
 // CSS Reset

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 43e623c..4ec502a 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -16,66 +16,33 @@
  * Fauxton less style files
  *
  */
+@import "bootstrap/variables.less";
+@import "variables.less";
 @import "bootstrap/bootstrap.less";
 @import "bootstrap/mixins.less";
-@import "variables.less";
 @import "prettyprint.less";
 @import "icons.less";
 
+/**
+ * HTML-wide overrides
+ **/
 
-body {
-  background-color: #F2F2F2;
-}
-#main > footer {
-  position: fixed;
-  bottom: 0;
-  font-size: 10px;
-  margin-left: @navWidth;
-  padding: 5px 10px;
-  background-color: #F2F2F2;
-  width: 100%;
-  .closeMenu & {
-    margin-left: @collapsedNavWidth;
-  }
-}
-
-.hide-text {
-  font: 0/0 a;
-  color: transparent;
-  text-shadow: none;
-  background-color: transparent;
-  border: 0;
-}
-
-.row {
-  margin-left: 0;
+*, *:before, *:after {
+  .box-sizing(border-box);
 }
 
-// globals
 body {
   font-size: 16px;
   line-height:1.3;
   padding-bottom: 0px;
   color: #333;
-  padding-top: 92px;
-  &#home{
-    padding-top: 90px;
-  }
+  padding-top: 90px;
   background-color: @sidebarBG;
-  /* OVERRIDE BOOTSTRAP BTN STYLES */
-  .btn{
-    .box-shadow(none);
-    .border-radius(@baseBorderRadius);
-    background-image: none;
-    text-shadow: none;
-    background-repeat: no-repeat;
-  }
 }
 
 h2,h3,h4 {font-weight: 600;}
 
-
-a, .btn{
+a {
   .transition(all .25s linear);
 }
 
@@ -85,10 +52,245 @@ a:active {
   color: @linkColor;
 }
 
-a:hover{
+a:hover {
   color: @red;
 }
 
+input[type=text],
+input[type=password] {
+  .border-radius(0);
+  padding: 12px;
+  border: 1px solid #ccc;
+  height: auto;
+  font-size: 16px;
+  margin-top: 0;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+  box-sizing: border-box;
+  padding: 0;
+}
+
+input[type="file"],
+input[type="checkbox"],
+input[type="radio"],
+select {
+  margin: 0 0 1em 0;
+}
+
+
+/* bootstrap overrides */
+.page-header {
+  border-bottom: 1px solid #E3E3E3;
+  margin-bottom: 10px;
+  h3 {
+    text-transform: capitalize;
+    margin-bottom: 0;
+  }
+}
+
+.nav-tabs > li {
+  margin-right: 2px;
+  > a {
+    cursor: pointer;
+    color: #333;
+    border-color: #eeeeee #eeeeee #dddddd;
+    text-decoration: none;
+    background-color: #eeeeee;
+    border-radius: 0;
+    border-left: none;
+    border-right: none;
+    &:hover,
+    &:focus {
+      background-color: @linkRed;
+      border-top: 1px solid @red;
+      color: white;
+    }
+  }
+}
+
+.well {
+  select {
+    margin: 0;
+  }
+  .controls-group {
+    &:first-child,
+    &:last-child {
+      margin-top: 24px;
+    }
+    margin-bottom: 8px;
+  }
+  .controls-row {
+    margin-bottom: 8px;
+  }
+  .row-fluid {
+    margin: 0;
+  }
+  .row-fluid .row-fluid:last-child .well-item {
+    border: none;
+  }
+  .well-item {
+    color: #666;
+    font-size: 12px;
+    border-bottom: 1px solid #e5e5e5;
+    padding: 8px 4px;
+    strong {
+        font-size: 16px;
+    }
+  }
+}
+
+/*TABLE STYLES*/
+table.table {
+  table-layout: fixed;
+}
+table tr td{
+  word-wrap: break-word;
+  &.select {
+    width: 20px;
+  }
+}
+thead {
+  border-bottom: 2px solid @redButton;
+}
+tbody {
+  padding-top: 10px;
+}
+.table-condensed td {
+  padding: 18px 5px;
+}
+.table-striped tbody > tr:nth-child(odd) > td,
+.table-striped tbody > tr:nth-child(odd) > th
+{
+  background-color: #F7F7F7;
+}
+
+/*form elements and buttons*/
+.btn-group {
+  > .btn + .dropdown-toggle,
+  > .btn:first-child,
+  > .btn:last-child,
+  > .dropdown-toggle {
+    .border-radius(0);
+    background-image: none;
+    text-shadow: none;
+  }
+}
+
+.btn {
+  .box-shadow(none);
+  .border-radius(@baseBorderRadius);
+  background-image: none;
+  text-shadow: none;
+  background-repeat: no-repeat;
+  padding: 10px;
+  margin-top: 0px;
+  .icon {
+    margin-right: 0.2em;
+  }
+  &.btn-small {
+    padding: 5px 10px;
+    .icon {
+      margin-right: 0;
+      font-size: inherit;
+    }
+  }
+  &.btn-mini {
+    padding: 3px 8px;
+    .icon {
+      margin-right: 0;
+      font-size: inherit;
+    }
+  }
+}
+.btn-primary {
+  background: @redButton;
+}
+
+.btn-primary a:visited {
+  color: #fff;
+}
+
+.form-actions {
+  background: none;
+  border: none;
+}
+
+.input-append,
+.input-prepend {
+  .add-on {
+    font-size: 18px;
+    padding: 14px 5px 30px;
+  }
+  .btn .icon {
+    font-size: 21.5px;
+    margin-right: 0;
+  }
+}
+
+.row-fluid .input-append [class*="span"],
+.input-prepend input[class*="span"] {
+  width: auto;
+}
+
+.form-inline {
+  input[type=password],
+  input[type=text] {
+    width: auto;
+  }
+}
+.checkbox {
+  label {
+    display: inline-block;
+    padding-left:25px;
+  }
+}
+
+label {
+  margin-right: 15px;
+  padding-left:0;
+  display: block;
+  cursor: pointer;
+  position: relative;
+  font-size: 14px;
+  &.inline {
+    display: inline-block;
+  }
+}
+.help-block {
+  font-size: 12px;
+}
+
+input[type=text].error {
+  border: red 1px solid;
+}
+
+/**
+ * Fauxton-specific Bootstrap additions
+ **/
+table.databases {
+  clear: both;
+}
+.nav-tabs > li > a .fonticon:before {
+  margin-right: 6px;
+  font-size: 16px;
+}
+
+/* application specific stuff */
+#main > footer {
+  position: fixed;
+  bottom: 0;
+  font-size: 10px;
+  margin-left: @navWidth;
+  padding: 5px 10px;
+  background-color: #F2F2F2;
+  width: 100%;
+  .closeMenu & {
+    margin-left: @collapsedNavWidth;
+  }
+}
+
 /* ajax loader */
 .loader {
   background: url('../img/loader.gif') center center no-repeat;
@@ -125,20 +327,6 @@ a:hover{
   }
 }
 
-/* bootstrap overrides */
-.container-fluid {
-  padding-right: 0px;
-  padding-left: 0px;
-}
-.page-header {
-  border-bottom: 1px solid #E3E3E3;
-  margin-bottom: 10px;
-  h3 {
-    text-transform: capitalize;
-    margin-bottom: 0;
-  }
-}
-
 /* Fixed side navigation */
 #primary-navbar {
   height: 100%;
@@ -306,6 +494,8 @@ a:hover{
   left: @navWidth;
   right: 0;
   margin-left: 0;
+  padding-left: 0;
+  padding-right: 0;
   background-color: @sidebarBG;
   min-width: 600px;
   height: 100%;
@@ -315,6 +505,7 @@ a:hover{
   &.one-pane{
     min-width: 800px;
     margin-top: 0;
+    overflow: auto;
   }
 }
 
@@ -413,11 +604,6 @@ a:hover{
 }
 
 
-footer#mainFooter{
-  position: fixed;
-  bottom: 0;
-}
-
 /*SIDEBAR TEMPLATE STYLES*/
 .topmenu-defaults {
   height: 70px;
@@ -439,6 +625,9 @@ footer#mainFooter{
 }
 
 #dashboard-upper-content{
+  .tab-content {
+    padding-top: 70px;
+  }
   .well{
     padding: 20px;
     .border-radius(0);
@@ -526,107 +715,7 @@ footer#mainFooter{
   max-width: 500px;
 }
 
-.nav-tabs > li{
-  margin-right: 2px;
-  > a {
-  cursor: pointer;
-  color: #333;
-  border-color: #eeeeee #eeeeee #dddddd;
-  text-decoration: none;
-  background-color: #eeeeee;
-  border-radius: 0;
-  border-left: none;
-  border-right: none;
-    &.fonticon:before{
-      margin-right: 6px;
-      font-size: 16px;
-    }
-  }
-}
-
-.nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
-  background-color: @linkRed;
-  border-top: 1px solid @red;
-  color: white;
-}
-
-
-.tab-content {
-  margin-top: 70px;
-}
-
-.well { 
-  .controls-group {
-  &:first-child, &:last-child{
-    margin-top: 24px;
-  }
-  margin-bottom: 8px;
-  }
-  .controls-row {
-    margin-bottom: 8px;
-  }
-}
-
-/*TABLE STYLES*/
-table.table {
-  table-layout: fixed;
-}
-table {
-  tr{
-    td{
-      word-wrap: break-word;
-      &.select {
-        width: 20px;
-      }
-    }
-  }
-}
-table.databases {clear: both;}
-thead {border-bottom: 2px solid @redButton;}
-tbody {padding-top: 10px;}
-.table-condensed td {padding: 18px 5px;}
-.table-striped tbody > tr:nth-child(odd) > td, 
-.table-striped tbody > tr:nth-child(odd) > th
-{
-  background-color: #F7F7F7;
-}
-
-
-/*form elements and buttons*/
-.btn-group {
-  > .btn + .dropdown-toggle,
-  > .btn:first-child,
-  > .btn:last-child,
-  > .dropdown-toggle
-  {
-    .border-radius(0);
-    background-image: none;
-    text-shadow: none;
-  }
-}
-
-.btn {
-  padding: 10px;
-  margin-top: 0px;
-  .icon {
-    margin-right: 0.2em;
-  }
-  &.btn-small {
-    padding: 5px 10px;
-    .icon {
-      margin-right: 0;
-      font-size: inherit;
-    }
-  }
-  &.btn-mini {
-    padding: 3px 8px;
-    .icon {
-      margin-right: 0;
-      font-size: inherit;
-    }
-  }
-}
-
+/** table row selector thing **/
 .select{
   > a{
     display: block;
@@ -657,98 +746,6 @@ tbody {padding-top: 10px;}
   }
 }
 
-input[type=text], input[type=password],
-.navbar-form input{
-  .border-radius(0);
-  padding: 12px;
-  border: 1px solid #ccc;
-  height: auto;
-  font-size: 16px;
-  margin-top: 0;
-}
-
-
-
-label.fonticon-search {
-  .box-sizing(content-box);
-  position: relative;
-  &:before {
-    .transition(all .25s linear);
-    font-size: 16px;
-    position: absolute;
-    right: -47px;
-    background-color: #E1E1E1;
-    height: 46px;
-    width: 48px;
-    border: 1px solid #cccccc;
-    padding: 14px;
-    top: -4px;
-  }
-  &:hover{
-    color:white;
-    &:before {
-      background-color: @red;
-    }
-  }
-}
-
-
-.form-inline {
-  input[type=password],
-  input[type=text]{
-    width: auto;
-  }
-}
-*, *:before, *:after {
-  .box-sizing(border-box);
-}
-
-input[type="checkbox"], input[type="radio"] {
-  box-sizing: border-box;
-  padding: 0;
-}
-
-input[type="file"], input[type="checkbox"], input[type="radio"], select {
-  margin: 0 0 1em 0;
-}
-
-.well select {
-  margin: 0;
-}
-
-form.custom .hidden-field {
-  margin-left: -99999px;
-  position: absolute;
-  visibility: hidden;
-}
-
-
-.checkbox {
-  label{
-    display: inline-block;
-    padding-left:25px;
-  }
-}
-
-label{ 
-  margin-right: 15px; 
-  padding-left:0;
-  display: block;  
-  cursor: pointer;  
-  position: relative;  
-  font-size: 14px; 
-  &.inline{
-    display: inline-block;
-  } 
-}
-.help-block{
-  font-size: 12px;
-}
-
-input[type=text].error{
-  border: red 1px solid;
-}
-
 .custom-inputs{
 
   input[type=radio], 
@@ -820,45 +817,6 @@ form.view-query-update, form.view-query-save {
   max-width: 100%;
 }
 
-
-.form-actions {
-  background: none;
-  border: none;
-}
-
-.input-append,
-.input-prepend {
-  .add-on {
-    font-size: 18px;
-    padding: 14px 5px 30px;
-  }
-  .btn .icon{
-    font-size: 21.5px;
-    margin-right: 0;
-  }
-}
-
-.row-fluid .input-append [class*="span"],
-.input-prepend input[class*="span"]{
-  width: auto;
-}
-
-/*pretty print*/
-pre.prettyprint {
-  background: #E5E0DD;
-  border: none;
-}
-
-.prettyprint .str, .prettyprint .lit {
-  color: @red;
-}
-
-.prettyprint .pln, .prettyprint .pun, .prettyprint .typ{
-  color: #333333;
-}
-
-
-
 /*logs*/
 #log-sidebar{
   padding: 20px;
@@ -876,20 +834,6 @@ div.spinner {
   top: 50%;
 }
 
-/* Code mirror overrides */
-.CodeMirror-scroll {
-  .border-radius(2px);
-  border: solid 1px #ddd;
-}
-
-.btn-primary {
-  background: @redButton;
-}
-
-.btn-primary a:visited {
-  color: #fff;
-}
-
 #api-navbar{
   position: relative;
 }
@@ -924,14 +868,3 @@ div.spinner {
     }
   }
 }
-
-#map-function, #reduce-function{
-    width: 100%;
-    font-size: 16px;
-}
-
-#editor-container {
-    width: 1316px;
-    height: 688px;
-    font-size: 16px;
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5d17c204/src/fauxton/assets/less/prettyprint.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/prettyprint.less b/src/fauxton/assets/less/prettyprint.less
index 7925fa7..4367b32 100644
--- a/src/fauxton/assets/less/prettyprint.less
+++ b/src/fauxton/assets/less/prettyprint.less
@@ -12,8 +12,8 @@
  */
 
 pre.prettyprint {
-  background: #000;
-  border-radius: 0;
+  background: #E5E0DD;
+  border: none;
   font-size: 83%;
   line-height: 1.4;
   margin: 0;
@@ -21,26 +21,15 @@ pre.prettyprint {
 }
 .prettyprint {
   .pln, .pun,  .typ {
-    color: #f8f8f8;
+    color: #333;
   }
   .kwd {
     color: #ff8300;
   }
-  .str {
-    color: #ff8300;
-  }
-  .lit {
-    color: #00ff00;
+  .str, .lit {
+    color: @red;
   }
   .com {
     color: #666;
   }
 }
-.CodeMirror-wrap pre{
-  &.view-code-error{
-    color: @darkRed;
-  }
-  .tooltip{
-    z-index: 100000000;
-  }
-}


[27/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Merge branch '2059-feature-uri-len-negotiation'


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

Branch: refs/heads/2041-update-ibrowse
Commit: 3ad1f6a76e10ccf4f9608fd6d8de06da7491c548
Parents: ea9bc69 f7ca266
Author: Robert Newson <rn...@apache.org>
Authored: Mon Feb 17 21:55:40 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 17 21:55:40 2014 +0000

----------------------------------------------------------------------
 etc/couchdb/default.ini.tpl.in                  |  2 +
 .../src/couch_replicator_api_wrap.erl           | 40 ++++++++++++++------
 src/couchdb/couch_httpd.erl                     | 18 +++++++++
 3 files changed, 49 insertions(+), 11 deletions(-)
----------------------------------------------------------------------



[02/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
fixed .css concat ordering in index.css

This change removes the loading of .css files
from /addons/**/assets/css/*.css. Putting those
back is an option, but since unused at present
I saw it as a separate case for adding back
if/when desired.


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

Branch: refs/heads/2041-update-ibrowse
Commit: b8fe3cb10299cbabf4274d6071368734c3880511
Parents: 8462b9d
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Mon Feb 3 11:28:09 2014 -0500
Committer: BigBlueHat <by...@bigbluehat.com>
Committed: Mon Feb 3 11:29:00 2014 -0500

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b8fe3cb1/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 2c5a249..554eccb 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -64,7 +64,10 @@ module.exports = function(grunt) {
           "dist/debug/css/fauxton.css": "assets/less/fauxton.less"
         }
       },
-      img: ["assets/img/**"]
+      img: ["assets/img/**"],
+      // used in concat:index_css to keep file ordering intact
+      // fauxton.css should load first
+      css: ["dist/debug/css/fauxton.css"]
     };
     helper.processAddons(function(addon){
       // Less files from addons
@@ -75,6 +78,7 @@ module.exports = function(grunt) {
         theAssets.less.paths.push(lessPath);
         theAssets.less.files["dist/debug/css/" + addon.name + ".css"] =
           lessPath + "/" + addon.name + ".less";
+        theAssets.css.push("dist/debug/css/" + addon.name + ".css");
       }
       // Images
       root = addon.path || "app/addons/" + addon.name;
@@ -210,7 +214,7 @@ module.exports = function(grunt) {
       },
 
       index_css: {
-        src: ["dist/debug/css/*.css", '!dist/debug/css/index.css', 'assets/css/*.css'],
+        src: assets.css,
         dest: 'dist/debug/css/index.css'
       },
 


[05/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Add backbone.fetch-cache


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

Branch: refs/heads/2041-update-ibrowse
Commit: ed89f34020a10259344ded418785a4492159c23f
Parents: 34aabbf
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Feb 4 16:47:54 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Feb 4 16:47:54 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/databases/resources.js   |   8 +-
 src/fauxton/app/addons/documents/resources.js   |  14 +-
 src/fauxton/app/addons/documents/routes.js      |   2 +-
 src/fauxton/app/addons/documents/views.js       |  22 +-
 src/fauxton/app/config.js                       |   3 +-
 src/fauxton/app/core/base.js                    |  27 +-
 .../assets/js/plugins/backbone.fetch-cache.js   | 311 +++++++++++++++++++
 7 files changed, 365 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/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 1b55f88..5fa931b 100644
--- a/src/fauxton/app/addons/databases/resources.js
+++ b/src/fauxton/app/addons/databases/resources.js
@@ -24,7 +24,7 @@ function(app, FauxtonAPI, Documents) {
 
   Databases.DocLimit = 20;
 
-  Databases.Model = Backbone.Model.extend({
+  Databases.Model = FauxtonAPI.Model.extend({
     initialize: function(options) {
       this.status = new Databases.Status({
         database: this
@@ -82,7 +82,7 @@ function(app, FauxtonAPI, Documents) {
     }
   });
 
-  Databases.Changes = Backbone.Collection.extend({
+  Databases.Changes = FauxtonAPI.Collection.extend({
 
     initialize: function(options) {
       this.database = options.database;
@@ -110,7 +110,7 @@ function(app, FauxtonAPI, Documents) {
     }
   });
 
-  Databases.Status = Backbone.Model.extend({
+  Databases.Status = FauxtonAPI.Model.extend({
     url: function() {
       return app.host + "/" + this.database.safeID();
     },
@@ -166,7 +166,7 @@ function(app, FauxtonAPI, Documents) {
   });
 
   // TODO: shared databases - read from the user doc
-  Databases.List = Backbone.Collection.extend({
+  Databases.List = FauxtonAPI.Collection.extend({
     model: Databases.Model,
     documentation: function(){
       return "all_dbs";

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/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 831d5e3..adfee1f 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -18,7 +18,7 @@ define([
 function(app, FauxtonAPI) {
   var Documents = FauxtonAPI.addon();
 
-  Documents.Doc = Backbone.Model.extend({
+  Documents.Doc = FauxtonAPI.Model.extend({
     idAttribute: "_id",
     documentation: function(){
       return "docs";
@@ -194,7 +194,7 @@ function(app, FauxtonAPI) {
     }
   });
 
-  Documents.DdocInfo = Backbone.Model.extend({
+  Documents.DdocInfo = FauxtonAPI.Model.extend({
     idAttribute: "_id",
     documentation: function(){
       return "docs";
@@ -224,7 +224,7 @@ function(app, FauxtonAPI) {
 
   });
 
-  Documents.ViewRow = Backbone.Model.extend({
+  Documents.ViewRow = FauxtonAPI.Model.extend({
     // this is a hack so that backbone.collections doesn't group 
     // these by id and reduce the number of items returned.
     idAttribute: "_id",
@@ -272,7 +272,7 @@ function(app, FauxtonAPI) {
 
   });
 
-  Documents.AllDocs = Backbone.Collection.extend({
+  Documents.AllDocs = FauxtonAPI.Collection.extend({
     model: Documents.Doc,
     documentation: function(){
       return "docs";
@@ -397,7 +397,7 @@ function(app, FauxtonAPI) {
     }
   });
 
-  Documents.IndexCollection = Backbone.Collection.extend({
+  Documents.IndexCollection = FauxtonAPI.Collection.extend({
     model: Documents.ViewRow,
     documentation: function(){
       return "docs";
@@ -527,7 +527,7 @@ function(app, FauxtonAPI) {
     // we can get the request duration
     fetch: function () {
       this.startTime = new Date().getTime();
-      return Backbone.Collection.prototype.fetch.call(this);
+      return FauxtonAPI.Collection.prototype.fetch.call(this);
     },
 
     allDocs: function(){
@@ -568,7 +568,7 @@ function(app, FauxtonAPI) {
   });
 
   
-  Documents.PouchIndexCollection = Backbone.Collection.extend({
+  Documents.PouchIndexCollection = FauxtonAPI.Collection.extend({
     model: Documents.ViewRow,
     documentation: function(){
       return "docs";

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/src/fauxton/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/routes.js b/src/fauxton/app/addons/documents/routes.js
index 1510485..be9ce2f 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -182,7 +182,7 @@ function(app, FauxtonAPI, Documents, Databases) {
     },
 
     establish: function () {
-      return this.data.designDocs.fetch();
+      return this.data.designDocs.fetchOnce();
     },
 
     allDocs: function(databaseName, options) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/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 298cfb4..5476203 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1803,11 +1803,31 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
   Views.Changes = FauxtonAPI.View.extend({
     template: "addons/documents/templates/changes",
 
+    initialize: function () {
+      var that = this;
+      this.listenTo( this.model.changes, 'change', function () {
+        console.log('render on change'); 
+        that.render();
+      });
+      this.listenTo( this.model.changes, 'cachesync', function () {
+        console.log('render on cachesync'); 
+        that.render();
+      });
+    },
+
     establish: function() {
-      return [ this.model.changes.fetch()];
+      return [ this.model.changes.fetchOnce({prefill: true,
+        success: function () {
+          console.log('hi ajax success');
+        },
+        prefillSuccess: function () {
+          console.log('hi prefill success');
+        }
+      })];
     },
 
     serialize: function () {
+      console.log('ss');
       return {
         changes: this.model.changes.toJSON(),
         database: this.model

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/src/fauxton/app/config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index 98be9c6..a5d764f 100644
--- a/src/fauxton/app/config.js
+++ b/src/fauxton/app/config.js
@@ -30,7 +30,8 @@ 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"
+    "ace":"../assets/js/libs/ace",
+    "backbone.fetch-cache": "../assets/js/plugins/backbone.fetch-cache"
   },
 
   baseUrl: '/',

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/src/fauxton/app/core/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/base.js b/src/fauxton/app/core/base.js
index 53316bc..6fe3261 100644
--- a/src/fauxton/app/core/base.js
+++ b/src/fauxton/app/core/base.js
@@ -12,10 +12,12 @@
 
 define([
   "backbone",
-  "plugins/backbone.layoutmanager"
+  "plugins/backbone.layoutmanager",
+  "backbone.fetch-cache"
 ],
 
-function(Backbone) {
+function(Backbone, LayoutManager, BackboneCache) {
+  console.log(BackboneCache);
   var FauxtonAPI = {
     //add default objects
     router: {
@@ -67,16 +69,25 @@ function(Backbone) {
     }
   });
 
+
   FauxtonAPI.Model = Backbone.Model.extend({
-    fetchOnce: function (opt) {
-      var options = _.extend({}, opt);
 
-      if (!this._deferred || this._deferred.state() === "rejected" || options.forceFetch ) {
-        this._deferred = this.fetch();
-      }
+  });
+
+  FauxtonAPI.Collection = Backbone.Collection.extend({
 
-      return this._deferred;
+  });
+
+  var caching = {
+    fetchOnce: function (opts) {
+      var options = _.defaults(opts || {}, this.cache, {cache: true});
+      console.log('opts', options);
+      return this.fetch(options);
     }
+  };
+
+  _.each([FauxtonAPI.Collection, FauxtonAPI.Model], function (ctor) {
+    _.extend(ctor.prototype, caching);
   });
 
   var extensions = _.extend({}, Backbone.Events);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed89f340/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
new file mode 100644
index 0000000..c86a8b9
--- /dev/null
+++ b/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
@@ -0,0 +1,311 @@
+/*!
+  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.promise();
+      }
+    }
+
+    // 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.promise();
+  };
+
+  // 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.promise();
+      }
+    }
+
+    // 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.promise();
+  };
+
+  // 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;
+}));


[18/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Merge branch '2059-feature-url-len'


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

Branch: refs/heads/2041-update-ibrowse
Commit: c6c37945920983d0c2dec01e1cf85398bad58a52
Parents: e54d1d8 e1453ab
Author: Robert Newson <ro...@cloudant.com>
Authored: Thu Feb 13 11:36:12 2014 +0000
Committer: Robert Newson <ro...@cloudant.com>
Committed: Thu Feb 13 11:36:12 2014 +0000

----------------------------------------------------------------------
 src/couch_replicator/src/couch_replicator_api_wrap.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[49/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fauxton: Improved pagination

This is an improvement and fix on the current pagination. This fixes
pagination so that it works with all query options.

Pagination in Couchdb is quite complex
and there are plenty of situations to cater for. This new pagination
works quite differently to the previous way we had it working for a
user.

A user can set the number of documents they want to view on a page. This
is not related to limit options in the query options - the limit option
is an overall cap of how many documents to paginate too. A limit of none
is possible and is the default. If the limit option is set to 50 and a
user wants 10 docs per page, the would then be able to paginate 3 pages
before hitting the end.

Another change is that the api url and browser url does not change when
we paginate. That happens internally and hence the new addition of
urlParams and docParams. This allows Fauxton to keep track of the
parameters that the user sees and the parameters that the document needs
to paginate.

Fixes COUCHDB-2067


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

Branch: refs/heads/2041-update-ibrowse
Commit: 4e60f0b7a7b26662dde0ebc0a73c70df54e0f309
Parents: 0782a44
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jan 28 16:30:38 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Mar 6 11:48:09 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/databases/resources.js   |   2 +-
 .../app/addons/databases/templates/item.html    |   2 +-
 src/fauxton/app/addons/databases/views.js       |   3 +-
 .../addons/documents/assets/less/documents.less |   8 +
 src/fauxton/app/addons/documents/resources.js   | 211 +++--
 src/fauxton/app/addons/documents/routes.js      | 192 +++--
 .../documents/templates/advanced_options.html   |   8 +-
 .../documents/templates/all_docs_list.html      |  15 +-
 .../documents/templates/all_docs_number.html    |  24 +-
 .../app/addons/documents/templates/sidebar.html |   4 +-
 .../addons/documents/templates/view_editor.html |   4 +-
 .../app/addons/documents/tests/resourcesSpec.js |  27 -
 src/fauxton/app/addons/documents/views.js       | 241 +++---
 src/fauxton/app/addons/fauxton/base.js          |  14 +-
 src/fauxton/app/addons/fauxton/components.js    | 127 ++-
 .../app/addons/fauxton/tests/paginateSpec.js    |  18 -
 src/fauxton/test/mocha/chai.js                  | 804 ++++++++++++++-----
 src/fauxton/test/test.config.underscore         |   4 +
 18 files changed, 1153 insertions(+), 555 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 ea1aed2..80cd533 100644
--- a/src/fauxton/app/addons/databases/resources.js
+++ b/src/fauxton/app/addons/databases/resources.js
@@ -22,7 +22,7 @@ define([
 function(app, FauxtonAPI, Documents) {
   var Databases = FauxtonAPI.addon();
 
-  Databases.DocLimit = 20;
+  Databases.DocLimit = 100;
 
   Databases.Model = FauxtonAPI.Model.extend({
     initialize: function(options) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 e2f8071..549f421 100644
--- a/src/fauxton/app/addons/databases/templates/item.html
+++ b/src/fauxton/app/addons/databases/templates/item.html
@@ -13,7 +13,7 @@ the License.
 -->
 
 <td>
-  <a href="#/database/<%=encoded%>/_all_docs?limit=<%=docLimit%>"><%= database.get("name") %></a>
+  <a href="#/database/<%=encoded%>/_all_docs"><%= database.get("name") %></a>
 </td>
 <td><%= database.status.humanSize() %></td>
 <td><%= database.status.numDocs() %></td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 7f23d65..a56267f 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -31,8 +31,7 @@ function(app, Components, FauxtonAPI, Databases) {
       
       return {
         encoded: app.utils.safeURLName(this.model.get("name")),
-        database: this.model,
-        docLimit: Databases.DocLimit
+        database: this.model
       };
     }
   });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 9dee85e..c30a9af 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -23,6 +23,14 @@ button.beautify {
 	margin-top: 20px;
 }
 
+#per-page {
+  float: right;
+
+  #select-per-page {
+    margin-top: 10px;
+  }
+  
+}
 
 /** used in all_docs_list.html **/
 .view {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 adfee1f..c0b736f 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -18,6 +18,92 @@ define([
 function(app, FauxtonAPI) {
   var Documents = FauxtonAPI.addon();
 
+  Documents.QueryParams = (function () {
+    var _eachParams = function (params, action) {
+      _.each(['startkey', 'endkey', 'key'], function (key) {
+        if (_.has(params, key)) {
+          params[key] = action(params[key]);
+        }
+      });
+
+      return params;
+    };
+
+    return {
+      parse: function (params) {
+        return _eachParams(params, JSON.parse);
+      },
+
+      stringify: function (params) {
+        return _eachParams(params, JSON.stringify);
+      }
+    };
+  })();
+
+  Documents.paginate = {
+    history: [],
+    calculate: function (doc, defaultParams, currentParams, _isAllDocs) {
+      var docId = '',
+          lastId = '',
+          isView = !!!_isAllDocs,
+          key;
+
+      if (currentParams.keys) {
+        throw "Cannot paginate when keys is specfied";
+      }
+
+      if (_.isUndefined(doc)) {
+        throw "Require docs to paginate";
+      }
+
+      // defaultParams should always override the user-specified parameters
+      _.extend(currentParams, defaultParams);
+
+      lastId = doc.id || doc._id;
+
+      // If we are paginating on a view, we need to set a ``key`` and a ``docId``
+      // and expect that they are different values.
+      if (isView) {
+        key = doc.key;
+        docId = lastId;
+      } else {
+        docId = key = lastId;
+      }
+
+      // Set parameters to paginate
+      if (isView) {
+        currentParams.startkey_docid = docId;
+        currentParams.startkey = key;
+      } else if (currentParams.startkey) {
+        currentParams.startkey = key;
+      } else {
+        currentParams.startkey_docid = docId;
+      }
+
+      return currentParams;
+    },
+
+    next: function (docs, currentParams, perPage, _isAllDocs) {
+      var params = {limit: perPage, skip: 1},
+          doc = _.last(docs);
+          
+      this.history.push(_.clone(currentParams));
+      return this.calculate(doc, params, currentParams, _isAllDocs);
+    },
+
+    previous: function (docs, currentParams, perPage, _isAllDocs) {
+      var params = this.history.pop(),
+          doc = _.first(docs);
+
+      params.limit = perPage;
+      return params;
+    },
+
+    reset: function () {
+      this.history = [];
+    } 
+  };
+
   Documents.Doc = FauxtonAPI.Model.extend({
     idAttribute: "_id",
     documentation: function(){
@@ -274,20 +360,31 @@ function(app, FauxtonAPI) {
 
   Documents.AllDocs = FauxtonAPI.Collection.extend({
     model: Documents.Doc,
+    isAllDocs: true,
     documentation: function(){
       return "docs";
     },
     initialize: function(_models, options) {
       this.database = options.database;
-      this.params = options.params;
-      this.skipFirstItem = false;
-
+      this.params = _.clone(options.params);
       this.on("remove",this.decrementTotalRows , this);
+      this.perPageLimit = options.perPageLimit || 20;
+
+      if (!this.params.limit) {
+        this.params.limit = this.perPageLimit; 
+      }
     },
 
-    url: function(context) {
+    url: function(context, params) {
       var query = "";
-      if (this.params) {
+
+      if (params) {
+        if (!_.isEmpty(params)) {
+          query = "?" + $.param(params);
+        } else {
+          query = '';
+        }
+      } else if (this.params) {
         query = "?" + $.param(this.params);
       }
 
@@ -314,34 +411,13 @@ function(app, FauxtonAPI) {
       });
     },
 
-    urlNextPage: function (num, lastId) {
-      if (!lastId) {
-        var doc = this.last();
-
-        if (doc) {
-          lastId = doc.id;
-        } else {
-          lastId = '';
-        }
-      }
-
-      this.params.startkey_docid = '"' + lastId + '"';
-      this.params.startkey = '"' + lastId + '"';
-      // when paginating forward, fetch 21 and don't show
-      // the first item as it was the last item in the previous list
-      this.params.limit = num + 1;
-      return this.url('app');
+    updateLimit: function (limit) {
+      this.perPageLimit = limit;
+      this.params.limit = limit;
     },
 
-    urlPreviousPage: function (num, params) {
-      if (params) { 
-        this.params = params;
-      } else {
-        this.params = {reduce: false};
-      }
-
-      this.params.limit = num;
-      return this.url('app'); 
+    updateParams: function (params) {
+      this.params = params;
     },
 
     totalRows: function() {
@@ -359,18 +435,6 @@ function(app, FauxtonAPI) {
       return this.viewMeta.update_seq || false;
     },
 
-    recordStart: function () {
-      if (this.viewMeta.offset === 0) {
-        return 1;
-      }
-
-      if (this.skipFirstItem) {
-        return this.viewMeta.offset + 2;
-      }
-
-      return this.viewMeta.offset + 1;
-    },
-
     parse: function(resp) {
       var rows = resp.rows;
 
@@ -409,11 +473,23 @@ function(app, FauxtonAPI) {
       this.view = options.view;
       this.design = options.design.replace('_design/','');
       this.skipFirstItem = false;
+      this.perPageLimit = options.perPageLimit || 20;
+
+      if (!this.params.limit) {
+        this.params.limit = this.perPageLimit; 
+      }
+
     },
 
-    url: function(context) {
+    url: function(context, params) {
       var query = "";
-      if (this.params) {
+      if (params) {
+        if (!_.isEmpty(params)) {
+          query = "?" + $.param(params);
+        } else {
+          query = '';
+        }
+      } else if (this.params) {
         query = "?" + $.param(this.params);
       }
       
@@ -430,42 +506,18 @@ function(app, FauxtonAPI) {
       return url.join("/") + query;
     },
 
-    urlNextPage: function (num, lastId) {
-      if (!lastId) {
-        lastDoc = this.last();
-      }
-
-      var id = lastDoc.get("id");
-      if (id) {
-        this.params.startkey_docid = id;
-      }
-
-      this.params.startkey =  JSON.stringify(lastDoc.get('key'));
-      this.params.limit = num + 1;
-      return this.url('app');
+    updateParams: function (params) {
+      this.params = params;
     },
 
-     urlPreviousPage: function (num, params) {
-      if (params) { 
-        this.params = params;
-      } else {
-        this.params = {reduce: false};
+    updateLimit: function (limit) {
+      if (this.params.startkey_docid && this.params.startkey) {
+        //we are paginating so set limit + 1
+        this.params.limit = limit + 1;
+        return;
       }
 
-      this.params.limit = num;
-      return this.url('app');
-    },
-
-    recordStart: function () {
-      if (this.viewMeta.offset === 0) {
-        return 1;
-      }
-
-      if (this.skipFirstItem) {
-        return this.viewMeta.offset + 2;
-      }
-
-      return this.viewMeta.offset + 1;
+      this.params.limit = limit;
     },
 
     totalRows: function() {
@@ -565,6 +617,7 @@ function(app, FauxtonAPI) {
 
       return timeString;
     }
+
   });
 
   
@@ -619,10 +672,6 @@ function(app, FauxtonAPI) {
       return deferred;
     },
 
-    recordStart: function () {
-      return 1;
-    },
-
     totalRows: function() {
       return this.viewMeta.total_rows || "unknown";
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/routes.js b/src/fauxton/app/addons/documents/routes.js
index 1510485..f340195 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -155,13 +155,11 @@ function(app, FauxtonAPI, Documents, Databases) {
       "route:updateAllDocs": "updateAllDocsFromView",
       "route:updatePreviewDocs": "updateAllDocsFromPreview",
       "route:reloadDesignDocs": "reloadDesignDocs",
-      "route:paginate": "paginate"
+      "route:paginate": "paginate",
+      "route:perPageChange": "perPageChange"
     },
 
     initialize: function (route, masterLayout, options) {
-      var docOptions = app.getParams();
-      docOptions.include_docs = true;
-
       this.databaseName = options[0];
 
       this.data = {
@@ -170,9 +168,11 @@ function(app, FauxtonAPI, Documents, Databases) {
 
       this.data.designDocs = new Documents.AllDocs(null, {
         database: this.data.database,
-        params: {startkey: '"_design"',
+        params: {
+          startkey: '"_design"',
           endkey: '"_design1"',
-          include_docs: true}
+          include_docs: true
+        }
       });
 
       this.sidebar = this.setView("#sidebar-content", new Documents.Views.Sidebar({
@@ -185,12 +185,32 @@ function(app, FauxtonAPI, Documents, Databases) {
       return this.data.designDocs.fetch();
     },
 
+    createParams: function (options) {
+      var urlParams = app.getParams(options);
+      return {
+        urlParams: urlParams,
+        docParams: _.extend(_.clone(urlParams), {limit: this.getDocPerPageLimit(urlParams, 20)})
+      };
+    },
+
+    /*
+    * docParams are the options collection uses to fetch from the server 
+    * urlParams are what are shown in the url and to the user
+    * They are not the same when paginating
+    */
     allDocs: function(databaseName, options) {
-      var docOptions = app.getParams(options);
+      var params = this.createParams(options),
+          urlParams = params.urlParams,
+          docParams = params.docParams;
+
+      if (this.eventAllDocs) {
+        this.eventAllDocs = false;
+        return;
+      }
 
-      this.data.database.buildAllDocs(docOptions);
+      this.data.database.buildAllDocs(docParams);
 
-      if (docOptions.startkey && docOptions.startkey.indexOf('_design') > -1) {
+      if (docParams.startkey && docParams.startkey.indexOf('_design') > -1) {
         this.sidebar.setSelectedTab('design-docs');
       } else {
         this.sidebar.setSelectedTab('all-docs');
@@ -206,22 +226,29 @@ function(app, FauxtonAPI, Documents, Databases) {
       this.setView("#dashboard-upper-content", new Documents.Views.AllDocsLayout({
         database: this.data.database,
         collection: this.data.database.allDocs,
-        params: docOptions
+        params: urlParams,
+        docParams: docParams
       }));
 
       this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-        collection: this.data.database.allDocs
+        collection: this.data.database.allDocs,
+        docParams: docParams,
+        params: urlParams
       }));
 
       this.crumbs = [
         {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
       ];
 
-      this.apiUrl = [this.data.database.allDocs.url("apiurl"), this.data.database.allDocs.documentation() ];
+      this.apiUrl = [this.data.database.allDocs.url("apiurl", urlParams), this.data.database.allDocs.documentation() ];
+      //reset the pagination history - the history is used for pagination.previous
+      Documents.paginate.reset();
     },
 
     viewFn: function (databaseName, ddoc, view) {
-      var params = app.getParams(),
+      var params = this.createParams(),
+          urlParams = params.urlParams,
+          docParams = params.docParams;
           decodeDdoc = decodeURIComponent(ddoc);
 
       view = view.replace(/\?.*$/,'');
@@ -230,7 +257,7 @@ function(app, FauxtonAPI, Documents, Databases) {
         database: this.data.database,
         design: decodeDdoc,
         view: view,
-        params: params
+        params: docParams
       });
 
       var ddocInfo = {
@@ -243,7 +270,7 @@ function(app, FauxtonAPI, Documents, Databases) {
         model: this.data.database,
         ddocs: this.data.designDocs,
         viewName: view,
-        params: params,
+        params: urlParams,
         newView: false,
         database: this.data.database,
         ddocInfo: ddocInfo
@@ -256,7 +283,9 @@ function(app, FauxtonAPI, Documents, Databases) {
         collection: this.data.indexedDocs,
         nestedView: Documents.Views.Row,
         viewList: true,
-        ddocInfo: ddocInfo
+        ddocInfo: ddocInfo,
+        docParams: docParams,
+        params: urlParams
       }));
 
       this.sidebar.setSelectedTab(app.utils.removeSpecialCharacters(ddoc) + '_' + app.utils.removeSpecialCharacters(view));
@@ -267,15 +296,15 @@ function(app, FauxtonAPI, Documents, Databases) {
         ];
       };
 
-      this.apiUrl = [this.data.indexedDocs.url("apiurl"), "docs"];
+      this.apiUrl = [this.data.indexedDocs.url("apiurl", urlParams), "docs"];
+      Documents.paginate.reset();
     },
 
     newViewEditor: function () {
       var params = app.getParams();
 
-      if (this.toolsView) {
-        this.toolsView.remove();
-      }
+      this.toolsView && this.toolsView.remove();
+      this.documentsView && this.documentsView.remove();
 
       this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.ViewEditor({
         ddocs: this.data.designDocs,
@@ -290,39 +319,41 @@ function(app, FauxtonAPI, Documents, Databases) {
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
         ];
       };
+
+      Documents.paginate.reset();
     },
 
     updateAllDocsFromView: function (event) {
       var view = event.view,
-          docOptions = app.getParams(),
-          ddoc = event.ddoc;
+          params = this.createParams(),
+          urlParams = params.urlParams,
+          docParams = params.docParams,
+          ddoc = event.ddoc,
+          collection;
 
-      this.documentsView && this.documentsView.remove();
+      docParams.limit = this.getDocPerPageLimit(urlParams, this.documentsView.perPage());
+      this.documentsView.forceRender();
 
       if (event.allDocs) {
-        this.data.database.buildAllDocs(docOptions);
-        this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-          collection: this.data.database.allDocs
-        }));
-        //this.apiUrl = [this.data.database.allDocs.url("apiurl"), this.data.database.allDocs.documentation() ];
-        return;
-      }
+        this.eventAllDocs = true; // this is horrible. But I cannot get the trigger not to fire the route!
+        this.data.database.buildAllDocs(docParams);
+        collection = this.data.database.allDocs;
 
-      this.data.indexedDocs = new Documents.IndexCollection(null, {
-        database: this.data.database,
-        design: ddoc,
-        view: view,
-        params: app.getParams()
-      });
+      } else {
+        collection = this.data.indexedDocs = new Documents.IndexCollection(null, {
+          database: this.data.database,
+          design: ddoc,
+          view: view,
+          params: docParams
+        });
 
-      this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-        database: this.data.database,
-        collection: this.data.indexedDocs,
-        nestedView: Documents.Views.Row,
-        viewList: true
-      }));
+      }
+
+      this.documentsView.setCollection(collection);
+      this.documentsView.setParams(docParams, urlParams);
 
-      this.apiUrl = [this.data.indexedDocs.url("apiurl"), "docs"];
+      this.apiUrl = [collection.url("apiurl", urlParams), "docs"];
+      Documents.paginate.reset();
     },
 
     updateAllDocsFromPreview: function (event) {
@@ -345,14 +376,49 @@ function(app, FauxtonAPI, Documents, Databases) {
       }));
     },
 
-    paginate: function (direction) {
-      _.extend(this.documentsView.collection.params, app.getParams());
+    perPageChange: function (perPage) {
+      var params = app.getParams();
+      this.perPage = perPage;
+      this.documentsView.updatePerPage(perPage);
+      this.documentsView.forceRender();
+      params.limit = perPage;
+      this.documentsView.collection.params = params;
+      this.setDocPerPageLimit(perPage);
+    },
+
+    paginate: function (options) {
+      var params = {},
+          urlParams = app.getParams(),
+          collection = this.documentsView.collection;
+
       this.documentsView.forceRender();
-      if (direction === 'next') {
-        this.documentsView.collection.skipFirstItem = true;
+
+      // this is really ugly. But we basically need to make sure that
+      // all parameters are in the correct state and have been parsed before we
+      // calculate how to paginate the collection
+      collection.params = Documents.QueryParams.parse(collection.params);
+      urlParams = Documents.QueryParams.parse(urlParams);
+
+      if (options.direction === 'next') {
+          params = Documents.paginate.next(collection.toJSON(), 
+                                           collection.params,
+                                           options.perPage, 
+                                           !!collection.isAllDocs);
       } else {
-        this.documentsView.collection.skipFirstItem = false;
+          params = Documents.paginate.previous(collection.toJSON(), 
+                                               collection.params, 
+                                               options.perPage, 
+                                               !!collection.isAllDocs);
       }
+
+      // use the perPage sent from IndexPagination as it calculates how many
+      // docs to fetch for next page
+      params.limit = options.perPage;
+
+      // again not pretty but need to make sure all the parameters can be correctly
+      // built into a query
+      params = Documents.QueryParams.stringify(params);
+      collection.updateParams(params);
     },
 
     reloadDesignDocs: function (event) {
@@ -361,6 +427,32 @@ function(app, FauxtonAPI, Documents, Databases) {
       if (event && event.selectedTab) {
         this.sidebar.setSelectedTab(event.selectedTab);
       }
+    },
+
+    setDocPerPageLimit: function (perPage) {
+      window.localStorage.setItem('fauxton:perpage', perPage);
+    },
+
+
+    getDocPerPageLimit: function (urlParams, perPage) {
+      var storedPerPage = perPage;
+
+      if (window.localStorage) {
+        storedPerPage = window.localStorage.getItem('fauxton:perpage');
+
+        if (!storedPerPage) {
+          this.setDocPerPageLimit(perPage);
+          storedPerPage = perPage;
+        } else {
+          storedPerPage = parseInt(storedPerPage, 10);
+        }
+      } 
+
+      if (!urlParams.limit || urlParams.limit > storedPerPage) {
+        return storedPerPage;
+      } else {
+        return urlParams.limit;
+      }
     }
 
   });
@@ -383,9 +475,9 @@ function(app, FauxtonAPI, Documents, Databases) {
       this.databaseName = options[0];
       this.database = new Databases.Model({id: this.databaseName});
 
-      var docOptions = app.getParams();
+      var docParams = app.getParams();
 
-      this.database.buildChanges(docOptions);
+      this.database.buildChanges(docParams);
 
       this.setView("#tabs", new Documents.Views.Tabs({
         collection: this.designDocs,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 bea256a..e282c62 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -12,7 +12,7 @@ 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">
   <div class="controls-group">
     <div class="row-fluid">
       <div class="controls controls-row">
@@ -68,10 +68,12 @@ the License.
           <select name="limit" class="input-small">
             <option>5</option>
             <option>10</option>
-            <option selected="selected">20</option>
+            <option >20</option>
             <option>30</option>
             <option>50</option>
-            <option>100</option>
+            <option >100</option>
+            <option>500</option>
+            <option selected="selected">None</option>
           </select>
         </label>
         <div class="checkbox inline">  

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_list.html b/src/fauxton/app/addons/documents/templates/all_docs_list.html
index cdec81e..a521ff9 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_list.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_list.html
@@ -29,15 +29,16 @@ the License.
   <p>
 
   <div id="item-numbers"> </div>
-
-  <% if (requestDuration) { %>
-    <span class="view-request-duration pull-right">
-    View request duration: <strong> <%= requestDuration %> </strong> 
-    </span>
-  <% } %>
-  </p>
   <table class="all-docs table table-striped table-condensed">
     <tbody></tbody>
   </table>
+  
+  <% if (endOfResults) { %>  
+  <div class="text-center well">
+    <p class="muted">
+      End of results - <a id="js-end-results" href="#query" data-bypass="true" data-toggle="tab">edit query</a>
+    </p>
+    </div>
+  <% } %>
   <div id="documents-pagination"></div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/templates/all_docs_number.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_number.html b/src/fauxton/app/addons/documents/templates/all_docs_number.html
index df8fe07..0461a4b 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_number.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_number.html
@@ -11,13 +11,25 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<% if (totalRows === "unknown"){ %>
-  Showing 0 documents. <a href="#/database/<%=database%>/new"> Create your first document.</a>
-<% } else if (showNumbers) { %>
-  Showing <%=offset%> - <%= numModels %> of <%= totalRows %> rows
+<% if (totalRows === "unknown" || totalRows === 0){ %>
+Showing 0 documents. <a href="#/database/<%=database%>/new"> Create your first document.</a>
 <% } else { %>
-  Showing <%=pageStart%> - <%= pageEnd %>
+Showing <%=pageStart%> - <%= pageEnd %>
 <%}%>
 <% if (updateSeq) { %>
-  -- Update Sequence: <%= updateSeq %>
+-- Update Sequence: <%= updateSeq %>
 <% } %>
+
+<div id="per-page">
+  <label id="per-page" class="drop-down inline">
+    Per page:
+    <select id="select-per-page" name="per-page" class="input-small">
+      <option value="5">5</option>
+      <option value="10">10</option>
+      <option value="20">20</option>
+      <option value="30">30</option>
+      <option value="50">50</option>
+      <option value="100">100</option>
+    </select>
+  </label>
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/sidebar.html b/src/fauxton/app/addons/documents/templates/sidebar.html
index 7358960..750cd30 100644
--- a/src/fauxton/app/addons/documents/templates/sidebar.html
+++ b/src/fauxton/app/addons/documents/templates/sidebar.html
@@ -55,8 +55,8 @@ the License.
 
   <nav>
     <ul class="nav nav-list">
-      <li class="active"><a id="all-docs" href="#<%= database.url('index') %>?limit=<%= docLimit %>" class="toggle-view"> All documents</a></li>
-      <li><a id="design-docs" href='#<%= database.url("index") %>?limit=<%= docLimit %>&startkey="_design"&endkey="_e"'  class="toggle-view"> All design docs</a></li>
+      <li class="active"><a id="all-docs" href="#<%= database.url('index') %>" class="toggle-view"> All documents</a></li>
+      <li><a id="design-docs" href='#<%= database.url("index") %>?startkey="_design"&endkey="_e"'  class="toggle-view"> All design docs</a></li>
     </ul>
     <ul class="nav nav-list views">
       <li class="nav-header">Secondary Indexes</li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/view_editor.html b/src/fauxton/app/addons/documents/templates/view_editor.html
index 6a20849..e08e36e 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -17,12 +17,14 @@ the License.
       <% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li>
     <% if (!newView) { %>
     <li><a data-bypass="true" id="query-nav" href="#query" data-toggle="tab">
-      <i class="fonticon-plus fonticon"></i> Query Options</a></li>
+      <i class="fonticon-plus fonticon"></i> Query Options</a>
+    </li>
     <li><a data-bypass="true" id="meta-nav" href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>
     <% } %>
   </ul>
   <div class="all-docs-list errors-container"></div>
   <div class="tab-content">
+	 <div id="query-options-wrapper"></div>
     <div class="tab-pane active" id="index">
       <div id="define-view" class="ddoc-alert well">
         <div class="errors-container"></div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/documents/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/tests/resourcesSpec.js b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
index 380a4e4..62506e6 100644
--- a/src/fauxton/app/addons/documents/tests/resourcesSpec.js
+++ b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
@@ -32,20 +32,6 @@ define([
 
     });
 
-    it('Should return urlNext', function () {
-      var url = collection.urlNextPage(20);
-
-      assert.equal(url, 'database/databaseId/_design/myDoc/_view/?limit=21&reduce=false&startkey_docid=myId2&startkey=');
-
-    });
-
-    it('Should return urlPrevious', function () {
-      var url = collection.urlPreviousPage(20, {limit: 21, reduce: false,  startkey_docid: "myId1",startkey:"myId1"} );
-
-      assert.equal(url, 'database/databaseId/_design/myDoc/_view/?limit=20&reduce=false&startkey_docid=myId1&startkey=myId1');
-
-    });
-
   });
 
   describe('AllDocs', function () {
@@ -65,19 +51,6 @@ define([
 
     });
 
-    it('Should return urlNext', function () {
-      var url = collection.urlNextPage(20);
-
-      assert.equal(url, 'database/databaseId/_all_docs?limit=21&startkey_docid=%22myId2%22&startkey=%22myId2%22');
-
-    });
-
-     it('Should return urlPrevious', function () {
-      var url = collection.urlPreviousPage(20, {limit: 21, startkey_docid: "myId1",startkey:"myId1"} );
-      assert.equal(url, 'database/databaseId/_all_docs?limit=20&startkey_docid=myId1&startkey=myId1');
-    });
-
-
   });
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 7282ed7..54ec261 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -26,8 +26,6 @@ define([
        // Plugins
        "plugins/beautify",
        "plugins/prettify",
-
-
 ],
 
 function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns, beautify) {
@@ -416,25 +414,38 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     initialize: function (options) {
       this.newView = options.newView || false;
-      this.showNumbers = options.showNumbers;
       this.pagination = options.pagination;
-
+      _.bindAll(this);
+      
+      this._perPage = options.perPageDefault || 20;
       this.listenTo(this.collection, 'totalRows:decrement', this.render);
     },
 
+    events: {
+      'change #select-per-page': 'updatePerPage'
+    },
+
+    updatePerPage: function (event) {
+      this._perPage = parseInt(this.$('#select-per-page :selected').val(), 10);
+      this.pagination.updatePerPage(this.perPage());
+      FauxtonAPI.triggerRouteEvent('perPageChange', this.pagination.documentsLeftToFetch());
+    },
+
+    afterRender: function () {
+      this.$('option[value="' + this.perPage() + '"]').attr('selected', "selected");
+    },
+
     serialize: function () {
        var totalRows = 0,
-          recordStart = 0,
           updateSeq = false,
           pageStart = 0,
           pageEnd = 20;
 
       if (!this.newView) {
-        totalRows = this.collection.totalRows();
+        totalRows = this.collection.length;
         updateSeq = this.collection.updateSeq();
       }
 
-      recordStart = this.collection.recordStart();
       if (this.pagination) {
         pageStart = this.pagination.pageStart();
         pageEnd =  this.pagination.pageEnd();
@@ -443,13 +454,18 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       return {
         database: app.utils.safeURLName(this.collection.database.id),
         updateSeq: updateSeq,
-        offset: recordStart,
         totalRows: totalRows,
-        showNumbers: this.showNumbers,
-        numModels: this.collection.models.length + recordStart - 1,
         pageStart: pageStart,
         pageEnd: pageEnd
       };
+    },
+
+    perPage: function () {
+      return this._perPage;
+    },
+
+    setCollection: function (collection) {
+      this.collection = collection;
     }
 
   });
@@ -468,7 +484,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     toggleQuery: function (event) {
       $('#dashboard-content').scrollTop(0);
-      this.$('#query').toggle('fast');
+      this.$('#query').toggle('slow');
     },
 
     beforeRender: function () {
@@ -477,17 +493,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         previewFn: this.previewView,
         hasReduce: false,
         showPreview: false,
-        database: this.database
+        database: this.database,
       }));
-
-      this.$('#query').hide();
     },
 
     afterRender: function () {
       if (this.params) {
         this.advancedOptions.updateFromParams(this.params);
       }
-
     },
 
     updateAllDocs: function (event, paramInfo) {
@@ -518,9 +531,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       }
 
       var fragment = window.location.hash.replace(/\?.*$/, '');
-      fragment = fragment + '?' + $.param(params);
-      FauxtonAPI.navigate(fragment, {trigger: false});
 
+      if (!_.isEmpty(params)) {
+        fragment = fragment + '?' + $.param(params);
+      }
+
+      FauxtonAPI.navigate(fragment, {trigger: false});
       FauxtonAPI.triggerRouteEvent('updateAllDocs', {allDocs: true});
     },
 
@@ -537,7 +553,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       "click button.all": "selectAll",
       "click button.bulk-delete": "bulkDelete",
       "click #collapse": "collapse",
-      "change .row-select":"toggleTrash"
+      "change .row-select":"toggleTrash",
+      "click #js-end-results": "scrollToQuery"
     },
 
     toggleTrash: function () {
@@ -548,26 +565,45 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       }
     },
 
+    scrollToQuery: function () {
+      $('#dashboard-content').animate({ scrollTop: 0 }, 'slow');
+    },
+
     initialize: function(options){
       this.nestedView = options.nestedView || Views.Document;
       this.rows = {};
       this.viewList = !! options.viewList;
       this.database = options.database;
+
       if (options.ddocInfo) {
         this.designDocs = options.ddocInfo.designDocs;
         this.ddocID = options.ddocInfo.id;
       }
       this.newView = options.newView || false;
+      this.docParams = options.docParams;
+      this.params = options.params || {};
       this.expandDocs = true;
+      this.perPageDefault = this.docParams.limit || 20;
     },
 
     establish: function() {
       if (this.newView) { return null; }
 
-      return this.collection.fetch({reset: true}).fail(function() {
-        // TODO: handle error requests that slip through
-        // This should just throw a notification, not break the page
-        console.log("ERROR: ", arguments);
+      return this.collection.fetch({
+        reset: true,
+        success:  function() { },
+        error: function(model, xhr, options){
+          // TODO: handle error requests that slip through
+          // This should just throw a notification, not break the page
+          FauxtonAPI.addNotification({
+            msg: "Bad Request",
+            type: "error"
+          });
+
+          //now redirect back to alldocs
+          FauxtonAPI.navigate(model.database.url("index") + "?limit=100");
+          console.log("ERROR: ", arguments);
+        }
       });
     },
 
@@ -576,16 +612,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     serialize: function() {
-      var requestDuration = false;
-
-      if (this.collection.requestDurationInString) {
-        requestDuration = this.collection.requestDurationInString();
-      }
-
       return {
         viewList: this.viewList,
-        requestDuration: requestDuration,
-        expandDocs: this.expandDocs
+        expandDocs: this.expandDocs,
+        endOfResults: !this.pagination.canShowNextfn()
       };
     },
 
@@ -646,70 +676,41 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     addPagination: function () {
       var collection = this.collection;
-      var perPage = function () {
-        if (collection.params.limit && collection.skipFirstItem) {
-          return parseInt(collection.params.limit, 10) - 1;
-        } else if (collection.params.limit) {
-          return parseInt(collection.params.limit, 10);
-        }
-
-        return 20;
-      };
 
       this.pagination = new Components.IndexPagination({
         collection: this.collection,
         scrollToSelector: '#dashboard-content',
-        previousUrlfn: function () {
-          return collection.urlPreviousPage(perPage(), this.previousParams.pop());
-        },
-        canShowPreviousfn: function () {
-          if (this.previousParams.length === 0) {
-            return false;
-          }
-
-          return true;
-        },
-        canShowNextfn: function () {
-          if (collection.length < (perPage() -1)) {
-            return false;
-          }
-
-          return true;
-        },
-
-        nextUrlfn: function () {
-          return collection.urlNextPage(perPage());
-        }
+        docLimit: this.params.limit,
+        perPage: this.perPageDefault
       });
     },
 
     cleanup: function () {
-      this.allDocsNumber.remove();
+      this.pagination && this.pagination.remove();
+      this.allDocsNumber && this.allDocsNumber.remove();
       _.each(this.rows, function (row) {row.remove();});
-
-      if (!this.pagination) { return; }
-      this.pagination.remove();
     },
 
     beforeRender: function() {
-      var showNumbers = true;
 
       if (!this.pagination) {
         this.addPagination();
       }
 
-      this.insertView('#documents-pagination', this.pagination);
+      if (!this.params.keys) { //cannot paginate with keys
+        this.insertView('#documents-pagination', this.pagination);
+      }
 
-      if (this.designDocs || this.collection.idxType === '_view' || this.collection.params.startkey === '"_design"') {
-        showNumbers = false;
+      if (!this.allDocsNumber) {
+        this.allDocsNumber = new Views.AllDocsNumber({
+          collection: this.collection,
+          newView: this.newView,
+          pagination: this.pagination,
+          perPageDefault: this.perPageDefault
+        });
       }
 
-      this.allDocsNumber = this.setView('#item-numbers', new Views.AllDocsNumber({
-        collection: this.collection,
-        newView: this.newView,
-        showNumbers: showNumbers,
-        pagination: this.pagination
-      }));
+      this.setView('#item-numbers', this.allDocsNumber);
 
       var docs = this.expandDocs ? this.collection : this.collection.simple();
 
@@ -720,8 +721,32 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       }, this);
     },
 
+    setCollection: function (collection) {
+      this.collection = collection;
+      this.pagination.setCollection(collection);
+      this.allDocsNumber.setCollection(collection);
+    },
+
+    setParams: function (docParams, urlParams) {
+      this.docParams = docParams;
+      this.params = urlParams;
+      this.perPageDefault = this.docParams.limit;
+
+      if (this.params.limit) {
+        this.pagination.docLimit = this.params.limit;
+      }
+    },
+
     afterRender: function(){
       prettyPrint();
+    },
+
+    perPage: function () {
+      return this.allDocsNumber.perPage();
+    },
+
+    updatePerPage: function (newPerPage) {
+      this.collection.updateLimit(newPerPage);
     }
   });
 
@@ -942,9 +967,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           model = this.model;
 
       editor.editor.on("change", function (event) {
-        //if (event.data.action !== 'removeText') { return; }
-        //if (!event.data.text.match(/_id/) && !event.data.text.match(/_rev/)) { return; }
-
         var changedDoc;
         try {
           changedDoc = JSON.parse(editor.getValue());
@@ -1033,7 +1055,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.viewName = options.viewName;
       this.updateViewFn = options.updateViewFn;
       this.previewFn = options.previewFn;
-      //this.hadReduce = options.hasReduce || true;
 
       if (typeof(options.hasReduce) === 'undefined') {
         this.hasReduce = true;
@@ -1049,9 +1070,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     events: {
-      "change form.view-query-update input": "updateFilters",
-      "change form.view-query-update select": "updateFilters",
-      "submit form.view-query-update": "updateView",
+      "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"
     },
 
@@ -1071,11 +1092,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     queryParams: function () {
-      var $form = this.$(".view-query-update");
+      var $form = this.$(".js-view-query-update");
       // Ignore params without a value
-      var params = _.filter($form.serializeArray(), function(param) {
-        return param.value;
-      });
+      var params = _.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;
+      }, []);
 
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["key","keys","startkey","endkey"];
@@ -1103,7 +1128,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     updateFiltersFor: function(name, $ele) {
-      var $form = $ele.parents("form.view-query-update:first");
+      var $form = $ele.parents("form.js-view-query-update:first");
       switch (name) {
         // Reduce constraints
         //   - Can't include_docs for reduce=true
@@ -1131,12 +1156,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     updateFromParams: function (params) {
-      var $form = this.$el.find("form.view-query-update");
+      var $form = this.$el.find("form.js-view-query-update");
       _.each(params, function(val, key) {
         var $ele;
         switch (key) {
           case "limit":
-            case "group_level":
+          case "group_level":
+            if (!val) { return; }
             $form.find("select[name='"+key+"']").val(val);
           break;
           case "include_docs":
@@ -1247,7 +1273,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       "click button.preview": "previewView",
       "click #db-views-tabs-nav": 'toggleIndexNav',
       "click .beautify_map":  "beautifyCode",
-      "click .beautify_reduce":  "beautifyCode"
+      "click .beautify_reduce":  "beautifyCode",
+      "click #query-options-wrapper": 'toggleIndexNav'
     },
 
     langTemplates: {
@@ -1368,6 +1395,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           that.mapEditor.editSaved();
           that.reduceEditor && that.reduceEditor.editSaved();
 
+
           FauxtonAPI.addNotification({
             msg: "View has been saved.",
             type: "success",
@@ -1448,9 +1476,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       }
 
        var fragment = window.location.hash.replace(/\?.*$/, '');
-       fragment = fragment + '?' + $.param(params);
-       FauxtonAPI.navigate(fragment, {trigger: false});
+       if (!_.isEmpty(params)) {
+        fragment = fragment + '?' + $.param(params);
+       }
 
+       FauxtonAPI.navigate(fragment, {trigger: false});
        FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
     },
 
@@ -1622,18 +1652,25 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         database: this.database
       }));
 
-      this.advancedOptions = this.insertView('#query', new Views.AdvancedOptions({
-        updateViewFn: this.updateView,
-        previewFn: this.previewView,
-        database: this.database,
-        viewName: this.viewName,
-        ddocName: this.model.id,
-        hasReduce: this.hasReduce()
-      }));
+
+      if (!this.newView) {
+        this.eventer = _.extend({}, Backbone.Events);
+
+        this.advancedOptions = this.insertView('#query', new Views.AdvancedOptions({
+          updateViewFn: this.updateView,
+          previewFn: this.previewView,
+          database: this.database,
+          viewName: this.viewName,
+          ddocName: this.model.id,
+          hasReduce: this.hasReduce(),
+          eventer: this.eventer
+        }));
+      }
+
     },
 
     afterRender: function() {
-      if (this.params) {
+      if (this.params && !this.newView) {
         this.advancedOptions.updateFromParams(this.params);
       }
 
@@ -1646,7 +1683,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         this.$('#index-nav').parent().removeClass('active');
       }
 
-
     },
 
     showEditors: function () {
@@ -1737,11 +1773,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       return {
         changes_url: '#' + this.database.url('changes'),
         permissions_url: '#' + this.database.url('app') + '/permissions',
-        db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
+        db_url: '#' + this.database.url('index'),
         database: this.collection.database,
         database_url: '#' + this.database.url('app'),
         docLinks: docLinks,
-        docLimit: Databases.DocLimit,
         addLinks: addLinks,
         newLinks: newLinks,
         extensionList: extensionList > 0

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/base.js b/src/fauxton/app/addons/fauxton/base.js
index 35babb5..a6e462a 100644
--- a/src/fauxton/app/addons/fauxton/base.js
+++ b/src/fauxton/app/addons/fauxton/base.js
@@ -45,7 +45,6 @@ function(app, FauxtonAPI, resizeColumns) {
     }
   });
 
-
   Fauxton.initialize = function () {
     app.footer = new Fauxton.Footer({el: "#footer-content"}),
     app.navBar = new Fauxton.NavBar();
@@ -93,7 +92,7 @@ function(app, FauxtonAPI, resizeColumns) {
     });
   };
 
-  Fauxton.Breadcrumbs = Backbone.View.extend({
+  Fauxton.Breadcrumbs = FauxtonAPI.View.extend({
     template: "templates/fauxton/breadcrumbs",
 
     serialize: function() {
@@ -114,10 +113,7 @@ function(app, FauxtonAPI, resizeColumns) {
     }
   });
 
-  // TODO: this View should extend from FauxtonApi.View.
-  // Chicken and egg problem, api.js extends fauxton/base.js.
-  // Need to sort the loading order.
-  Fauxton.Footer = Backbone.View.extend({
+  Fauxton.Footer = FauxtonAPI.View.extend({
     template: "templates/fauxton/footer",
 
     initialize: function() {
@@ -135,7 +131,7 @@ function(app, FauxtonAPI, resizeColumns) {
     }
   });
 
-  Fauxton.NavBar = Backbone.View.extend({
+  Fauxton.NavBar = FauxtonAPI.View.extend({
     className:"navbar",
     template: "templates/fauxton/nav_bar",
     // TODO: can we generate this list from the router?
@@ -260,7 +256,7 @@ function(app, FauxtonAPI, resizeColumns) {
     // TODO: ADD ACTIVE CLASS
   });
 
-  Fauxton.ApiBar = Backbone.View.extend({
+  Fauxton.ApiBar = FauxtonAPI.View.extend({
     template: "templates/fauxton/api_bar",
     endpoint: '_all_docs',
 
@@ -304,7 +300,7 @@ function(app, FauxtonAPI, resizeColumns) {
 
   });
 
-  Fauxton.Notification = Backbone.View.extend({
+  Fauxton.Notification = FauxtonAPI.View.extend({
     fadeTimer: 5000,
 
     initialize: function(options) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/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 0422b5a..7dcf2d7 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -69,19 +69,68 @@ function(app, FauxtonAPI, ace, spin) {
     initialize: function (options) {
       this.previousUrlfn = options.previousUrlfn;
       this.nextUrlfn = options.nextUrlfn;
-      this.canShowPreviousfn = options.canShowPreviousfn;
-      this.canShowNextfn = options.canShowNextfn;
       this.scrollToSelector = options.scrollToSelector;
       _.bindAll(this);
-      this.previousParams = [];
+      this.docLimit = options.docLimit || 1000000;
+      this.perPage = options.perPage || 20;
+      this.setDefaults();
+    },
+
+    setDefaults: function () {
+      this._pageNumber = [];
+      this._pageStart = 1;
+      this.enabled = true;
+      this.currentPage = 1;
+    },
+
+    canShowPreviousfn: function () {
+      if (this._pageStart === 1 || !this.enabled) {
+        return false;
+      }
+      return true;
+    },
+
+    canShowNextfn: function () {
+      if (!this.enabled) { return this.enabled; }
+
+      if (this.collection.length < (this.perPage -1)) {
+        return false;
+      }
+
+      if ((this.pageStart() + this.perPage) >= this.docLimit) {
+        return false;
+      }
+
+      if (this.collection.viewMeta && this.collection.viewMeta.total_rows <= this.pageStart() + this.perPage) {
+        return false;
+      }
+
+      return true;
     },
 
     previousClicked: function (event) {
       event.preventDefault();
       event.stopPropagation();
       if (!this.canShowPreviousfn()) { return; }
-      FauxtonAPI.navigate(this.previousUrlfn(), {trigger: false});
-      FauxtonAPI.triggerRouteEvent('paginate', 'previous');
+
+      this.decPageNumber();
+
+      FauxtonAPI.triggerRouteEvent('paginate', {
+       direction: 'previous',
+       perPage: this.perPage,
+       currentPage: this.currentPage
+      });
+    },
+
+    documentsLeftToFetch: function () {
+      var documentsLeftToFetch = this.docLimit - this.totalDocsViewed(),
+          limit = this.perPage;
+
+      if (documentsLeftToFetch < this.perPage ) {
+        limit = documentsLeftToFetch;
+      }
+
+      return limit;
     },
 
     nextClicked: function (event) {
@@ -89,14 +138,14 @@ function(app, FauxtonAPI, ace, spin) {
       event.stopPropagation();
       if (!this.canShowNextfn()) { return; }
 
-      var params = _.clone(this.collection.params);
+      this.incPageNumber();
 
-      if (params) {
-        this.previousParams.push(params);
-      }
+      FauxtonAPI.triggerRouteEvent('paginate', {
+       direction: 'next',
+       perPage: this.documentsLeftToFetch(),
+       currentPage: this.currentPage
+      });
 
-      FauxtonAPI.navigate(this.nextUrlfn(), {trigger: false});
-      FauxtonAPI.triggerRouteEvent('paginate', 'next');
     },
 
     serialize: function () {
@@ -106,30 +155,58 @@ function(app, FauxtonAPI, ace, spin) {
       };
     },
 
-    pageLimit: function () {
-      var limit = 20;
+    updatePerPage: function (newPerPage) {
+      this.setDefaults();
+      this.perPage = newPerPage;
+    },
+
+    page: function () {
+      return this._pageStart - 1;
+    },
+
+    incPageNumber: function () {
+      this.currentPage = this.currentPage + 1;
+      this._pageNumber.push({perPage: this.perPage});
+      this._pageStart = this._pageStart + this.perPage;
+    },
+
+    totalDocsViewed: function () {
+      return _.reduce(this._pageNumber, function (total, value) {
+        return total + value.perPage;
+      }, 0);
+    },
 
-      if (this.collection.params.limit && this.collection.skipFirstItem) {
-        limit = parseInt(this.collection.params.limit, 10) - 1;
-      } else if (this.collection.params.limit) {
-        limit = parseInt(this.collection.params.limit, 10);
+    decPageNumber: function () {
+      this.currentPage = this.currentPage - 1;
+      this._pageNumber.pop();
+      var val = this._pageStart - this.perPage;
+      if (val < 1) {
+        val = 1;
       }
 
-      return limit;
+      this._pageStart = val;
     },
 
     pageStart: function () {
-      return (this.previousParams.length * this.pageLimit()) + 1;
-
+      return this._pageStart;
     },
 
     pageEnd: function () {
-      if (this.collection.length < this.pageLimit()) {
-        return (this.previousParams.length * this.pageLimit()) + this.collection.length;
-      }
+      return this.page() + this.collection.length;
+    },
 
-      return (this.previousParams.length * this.pageLimit()) + this.pageLimit();
-    }
+    disable: function () {
+      this.enabled = false;
+    },
+
+    enable: function () {
+      this.enabled = true;
+    },
+
+    setCollection: function (collection) {
+      this.collection = collection;
+      this.setDefaults();
+    },
 
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/tests/paginateSpec.js b/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
index 535e26f..8fc409a 100644
--- a/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
+++ b/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
@@ -58,15 +58,6 @@ define([
         //FauxtonAPI.navigate.restore && FauxtonAPI.navigate.restore(); 
       });
 
-      it('Should navigate', function () {
-        var navigateMock = sinon.spy(FauxtonAPI, 'navigate');
-
-        paginate.$('a#next').click();
-
-        assert.ok(navigateMock.calledOnce);
-        FauxtonAPI.navigate.restore();
-      });
-
       it('Should trigger routeEvent', function () {
         var navigateMock = sinon.spy(FauxtonAPI, 'triggerRouteEvent');
 
@@ -81,15 +72,6 @@ define([
 
     describe('#previous', function () {
 
-      it('Should navigate', function () {
-        var navigateMock = sinon.spy(FauxtonAPI, 'navigate');
-
-        paginate.$('a#previous').click();
-
-        assert.ok(navigateMock.calledOnce);
-        FauxtonAPI.navigate.restore();
-      });
-
       it('Should trigger routeEvent', function () {
         var navigateMock = sinon.spy(FauxtonAPI, 'triggerRouteEvent');
 


[09/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Send better error if user specifies key and keys

closes COUCHDB-2053


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

Branch: refs/heads/2041-update-ibrowse
Commit: 2bc0784030847cbbdd8998d3f135f91992768f6a
Parents: e7fdc16
Author: Robert Newson <rn...@apache.org>
Authored: Fri Feb 7 11:00:24 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Feb 7 14:40:40 2014 +0000

----------------------------------------------------------------------
 src/couch_mrview/src/couch_mrview_util.erl | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2bc07840/src/couch_mrview/src/couch_mrview_util.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl
index c4272f8..95f7be4 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -359,11 +359,13 @@ validate_args(Args) ->
         _ -> mrverror(<<"`keys` must be an array of strings.">>)
     end,
 
-    case {Args#mrargs.keys, Args#mrargs.start_key} of
-        {undefined, _} -> ok;
-        {[], _} -> ok;
-        {[_|_], undefined} -> ok;
-        _ -> mrverror(<<"`start_key` is incompatible with `keys`">>)
+    case {Args#mrargs.keys, Args#mrargs.start_key,
+          Args#mrargs.end_key} of
+        {undefined, _, _} -> ok;
+        {[], _, _} -> ok;
+        {[_|_], undefined, undefined} -> ok;
+        _ -> mrverror(<<"`keys` is incompatible with `key`"
+                        ", `start_key` and `end_key`">>)
     end,
 
     case Args#mrargs.start_key_docid of
@@ -372,13 +374,6 @@ validate_args(Args) ->
         _ -> mrverror(<<"`start_key_docid` must be a string.">>)
     end,
 
-    case {Args#mrargs.keys, Args#mrargs.end_key} of
-        {undefined, _} -> ok;
-        {[], _} -> ok;
-        {[_|_], undefined} -> ok;
-        _ -> mrverror(<<"`end_key` is incompatible with `keys`">>)
-    end,
-
     case Args#mrargs.end_key_docid of
         undefined -> ok;
         EKDocId0 when is_binary(EKDocId0) -> ok;


[32/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Upgrade password hashes on authentication

We now upgrade user docs to the new PBKDF2 password scheme on successful
authentication if the password hash is still from the old days where we
only used plain SHA-1 for hashing salted passwords.

Closes COUCHDB-1780.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 348889380c3b98d7f1a6c8963fc2eb4ee08c1db7
Parents: 45e17e5
Author: Klaus Trainer <kl...@posteo.de>
Authored: Wed Feb 19 23:17:02 2014 +0100
Committer: Klaus Trainer <kl...@apache.org>
Committed: Sun Feb 23 18:59:22 2014 +0100

----------------------------------------------------------------------
 share/www/script/test/users_db_security.js | 61 ++++++++++++++++++++++++-
 src/couchdb/couch_httpd_auth.erl           | 35 ++++++++++----
 2 files changed, 86 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/34888938/share/www/script/test/users_db_security.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/users_db_security.js b/share/www/script/test/users_db_security.js
index 9bf9b8a..2a2bb9d 100644
--- a/share/www/script/test/users_db_security.js
+++ b/share/www/script/test/users_db_security.js
@@ -151,6 +151,63 @@ couchTests.users_db_security = function(debug) {
       TEquals(true, userDoc.derived_key != jchrisDoc.derived_key,
         "should have new derived_key");
 
+      // SHA-1 password hashes are upgraded to PBKDF2 on successful
+      // authentication
+      var rnewsonDoc = {
+        _id: "org.couchdb.user:rnewson",
+        type: "user",
+        name: "rnewson",
+        // password: "plaintext_password",
+        password_sha: "e29dc3aeed5abf43185c33e479f8998558c59474",
+        salt: "24f1e0a87c2e374212bda1073107e8ae",
+        roles: []
+      };
+
+      var password_sha = rnewsonDoc.password_sha,
+        salt = rnewsonDoc.salt,
+        derived_key,
+        iterations;
+
+      usersDb.save(rnewsonDoc);
+      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
+      T(!rnewsonDoc.password_scheme);
+      T(!rnewsonDoc.derived_key);
+      T(!rnewsonDoc.iterations);
+
+      // check that we don't upgrade when the password is wrong
+      TEquals("unauthorized", CouchDB.login("rnewson", "wrong_password").error);
+      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
+      TEquals(salt, rnewsonDoc.salt);
+      TEquals(password_sha, rnewsonDoc.password_sha);
+      T(!rnewsonDoc.password_scheme);
+      T(!rnewsonDoc.derived_key);
+      T(!rnewsonDoc.iterations);
+
+      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
+      rnewsonDoc = usersDb.open(rnewsonDoc._id);
+      TEquals("pbkdf2", rnewsonDoc.password_scheme);
+      T(rnewsonDoc.salt != salt);
+      T(!rnewsonDoc.password_sha);
+      T(rnewsonDoc.derived_key);
+      T(rnewsonDoc.iterations);
+
+      salt = rnewsonDoc.salt,
+      derived_key = rnewsonDoc.derived_key,
+      iterations = rnewsonDoc.iterations;
+
+      // check that authentication is still working
+      // and everything is staying the same now
+      CouchDB.logout();
+      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
+      rnewsonDoc = usersDb.open(rnewsonDoc._id);
+      TEquals("pbkdf2", rnewsonDoc.password_scheme);
+      TEquals(salt, rnewsonDoc.salt);
+      T(!rnewsonDoc.password_sha);
+      TEquals(derived_key, rnewsonDoc.derived_key);
+      TEquals(iterations, rnewsonDoc.iterations);
+
+      CouchDB.logout();
+
       // user should not be able to read another user's user document
       var fdmananaDoc = {
         _id: "org.couchdb.user:fdmanana",
@@ -209,11 +266,11 @@ couchTests.users_db_security = function(debug) {
 
       // admin should be able to read from any view
       var result = view_as(usersDb, "user_db_auth/test", "jan");
-      TEquals(3, result.total_rows, "should allow access and list two users to admin");
+      TEquals(4, result.total_rows, "should allow access and list four users to admin");
 
       // db admin should be able to read from any view
       var result = view_as(usersDb, "user_db_auth/test", "benoitc");
-      TEquals(3, result.total_rows, "should allow access and list two users to db admin");
+      TEquals(4, result.total_rows, "should allow access and list four users to db admin");
 
 
       // non-admins can't read design docs

http://git-wip-us.apache.org/repos/asf/couchdb/blob/34888938/src/couchdb/couch_httpd_auth.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_auth.erl b/src/couchdb/couch_httpd_auth.erl
index b8c4e26..08841fb 100644
--- a/src/couchdb/couch_httpd_auth.erl
+++ b/src/couchdb/couch_httpd_auth.erl
@@ -68,11 +68,14 @@ default_authentication_handler(Req) ->
             nil ->
                 throw({unauthorized, <<"Name or password is incorrect.">>});
             UserProps ->
-                case authenticate(?l2b(Pass), UserProps) of
+                UserName = ?l2b(User),
+                Password = ?l2b(Pass),
+                case authenticate(Password, UserProps) of
                     true ->
+                        UserProps2 = maybe_upgrade_password_hash(UserName, Password, UserProps),
                         Req#httpd{user_ctx=#user_ctx{
-                            name=?l2b(User),
-                            roles=couch_util:get_value(<<"roles">>, UserProps, [])
+                            name=UserName,
+                            roles=couch_util:get_value(<<"roles">>, UserProps2, [])
                         }};
                     _Else ->
                         throw({unauthorized, <<"Name or password is incorrect.">>})
@@ -263,15 +266,16 @@ handle_session_req(#httpd{method='POST', mochi_req=MochiReq}=Req) ->
     UserName = ?l2b(couch_util:get_value("name", Form, "")),
     Password = ?l2b(couch_util:get_value("password", Form, "")),
     ?LOG_DEBUG("Attempt Login: ~s",[UserName]),
-    User = case couch_auth_cache:get_user_creds(UserName) of
+    UserProps = case couch_auth_cache:get_user_creds(UserName) of
         nil -> [];
         Result -> Result
     end,
-    UserSalt = couch_util:get_value(<<"salt">>, User, <<>>),
-    case authenticate(Password, User) of
+    case authenticate(Password, UserProps) of
         true ->
+            UserProps2 = maybe_upgrade_password_hash(UserName, Password, UserProps),
             % setup the session cookie
             Secret = ?l2b(ensure_cookie_auth_secret()),
+            UserSalt = couch_util:get_value(<<"salt">>, UserProps2),
             CurrentTime = make_cookie_time(),
             Cookie = cookie_auth_cookie(Req, ?b2l(UserName), <<Secret/binary, UserSalt/binary>>, CurrentTime),
             % TODO document the "next" feature in Futon
@@ -284,8 +288,8 @@ handle_session_req(#httpd{method='POST', mochi_req=MochiReq}=Req) ->
             send_json(Req#httpd{req_body=ReqBody}, Code, Headers,
                 {[
                     {ok, true},
-                    {name, couch_util:get_value(<<"name">>, User, null)},
-                    {roles, couch_util:get_value(<<"roles">>, User, [])}
+                    {name, couch_util:get_value(<<"name">>, UserProps2, null)},
+                    {roles, couch_util:get_value(<<"roles">>, UserProps2, [])}
                 ]});
         _Else ->
             % clear the session
@@ -340,6 +344,21 @@ maybe_value(_Key, undefined, _Fun) -> [];
 maybe_value(Key, Else, Fun) ->
     [{Key, Fun(Else)}].
 
+maybe_upgrade_password_hash(UserName, Password, UserProps) ->
+    case couch_util:get_value(<<"password_scheme">>, UserProps, <<"simple">>) of
+    <<"simple">> ->
+        DbName = ?l2b(couch_config:get("couch_httpd_auth", "authentication_db", "_users")),
+        couch_util:with_db(DbName, fun(UserDb) ->
+            UserProps2 = proplists:delete(<<"password_sha">>, UserProps),
+            UserProps3 = [{<<"password">>, Password} | UserProps2],
+            NewUserDoc = couch_doc:from_json_obj({UserProps3}),
+            {ok, _NewRev} = couch_db:update_doc(UserDb, NewUserDoc, []),
+            couch_auth_cache:get_user_creds(UserName)
+        end);
+    _ ->
+        UserProps
+    end.
+
 authenticate(Pass, UserProps) ->
     UserSalt = couch_util:get_value(<<"salt">>, UserProps, <<>>),
     {PasswordHash, ExpectedHash} =


[14/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fauxton: Improve spinners


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

Branch: refs/heads/2041-update-ibrowse
Commit: 46edca25a875096374097c6e01e746eaa0e5d31c
Parents: d2a0c46
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Feb 11 10:12:21 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Feb 11 10:12:21 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/fauxton/components.js | 22 +++++++++++++++-------
 src/fauxton/app/core/routeObject.js          |  1 -
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/46edca25/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 1f5e4ad..8b21916 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -415,6 +415,8 @@ function(app, FauxtonAPI, ace, spin) {
         shadow: false // Whether to render a shadow
      };
 
+     if (routeObjectSpinner) { return; }
+
      if (!$('.spinner').length) {
        $('<div class="spinner"></div>')
         .appendTo('#app-container');
@@ -428,18 +430,22 @@ function(app, FauxtonAPI, ace, spin) {
   var removeRouteObjectSpinner = function () {
     if (routeObjectSpinner) {
       routeObjectSpinner.stop();
+      routeObjectSpinner = null;
       $('.spinner').remove();
     }
   };
 
-  var removeViewSpinner = function () {
+  var removeViewSpinner = function (selector) {
+    var viewSpinner = viewSpinners[selector];
+
     if (viewSpinner){
       viewSpinner.stop();
-      $('.spinner').remove();
+      $(selector).find('.spinner').remove();
+      delete viewSpinners[selector];
     }
   };
 
-  var viewSpinner;
+  var viewSpinners = {};
   FauxtonAPI.RouteObject.on('beforeRender', function (routeObject, view, selector) {
     removeRouteObjectSpinner();
 
@@ -455,19 +461,21 @@ function(app, FauxtonAPI, ace, spin) {
         shadow: false // Whether to render a shadow
       };
 
-      viewSpinner = new Spinner(opts).spin();
+      var viewSpinner = new Spinner(opts).spin();
       $('<div class="spinner"></div>')
         .appendTo(selector)
         .append(viewSpinner.el);
+
+      viewSpinners[selector] = viewSpinner;
     }
   });
 
   FauxtonAPI.RouteObject.on('afterRender', function (routeObject, view, selector) {
-    removeViewSpinner();
+    removeViewSpinner(selector);
   });
 
-  FauxtonAPI.RouteObject.on('viewHasRendered', function () {
-    removeViewSpinner();
+  FauxtonAPI.RouteObject.on('viewHasRendered', function (view, selector) {
+    removeViewSpinner(selector);
     removeRouteObjectSpinner();
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/46edca25/src/fauxton/app/core/routeObject.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/routeObject.js b/src/fauxton/app/core/routeObject.js
index 9f1067f..f8a238f 100644
--- a/src/fauxton/app/core/routeObject.js
+++ b/src/fauxton/app/core/routeObject.js
@@ -231,7 +231,6 @@ function(FauxtonAPI, Backbone) {
       if (_.isEmpty(promise)) { return; }
 
       if (!_.isArray(promise)) {
-        if (!promise.abort && !promise.reject) {
         return this._promises.push(promise);
       }
 


[26/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Allow optional max_uri_length server setting


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

Branch: refs/heads/2041-update-ibrowse
Commit: f7ca266b41a6fb8dd8e8167b8c8d44df00a1907f
Parents: 3ce13c5
Author: Robert Newson <rn...@apache.org>
Authored: Mon Feb 17 13:30:52 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 17 21:53:27 2014 +0000

----------------------------------------------------------------------
 etc/couchdb/default.ini.tpl.in |  2 ++
 src/couchdb/couch_httpd.erl    | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7ca266b/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 3267001..fd953c2 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -52,6 +52,8 @@ allow_jsonp = false
 ;socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
 log_max_chunk_size = 1000000
 enable_cors = false
+; CouchDB can optionally enforce a maximum uri length;
+; max_uri_length = 8000
 
 [ssl]
 port = 6984

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7ca266b/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index f00fdd0..7ee3e3a 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -310,6 +310,7 @@ handle_request_int(MochiReq, DefaultFun,
 
     {ok, Resp} =
     try
+        check_request_uri_length(RawUri),
         case couch_httpd_cors:is_preflight_request(HttpReq) of
         #httpd{} ->
             case authenticate_request(HttpReq, AuthHandlers) of
@@ -343,6 +344,8 @@ handle_request_int(MochiReq, DefaultFun,
             send_error(HttpReq, {bad_otp_release, ErrorReason});
         exit:{body_too_large, _} ->
             send_error(HttpReq, request_entity_too_large);
+        exit:{uri_too_long, _} ->
+            send_error(HttpReq, request_uri_too_long);
         throw:Error ->
             Stack = erlang:get_stacktrace(),
             ?LOG_DEBUG("Minor error in HTTP request: ~p",[Error]),
@@ -369,6 +372,19 @@ handle_request_int(MochiReq, DefaultFun,
     couch_stats_collector:increment({httpd, requests}),
     {ok, Resp}.
 
+check_request_uri_length(Uri) ->
+    check_request_uri_length(Uri, couch_config:get("httpd", "max_uri_length")).
+
+check_request_uri_length(_Uri, undefined) ->
+    ok;
+check_request_uri_length(Uri, MaxUriLen) when is_list(MaxUriLen) ->
+    case length(Uri) > list_to_integer(MaxUriLen) of
+        true ->
+            throw(request_uri_too_long);
+        false ->
+            ok
+    end.
+
 % Try authentication handlers in order until one sets a user_ctx
 % the auth funs also have the option of returning a response
 % move this to couch_httpd_auth?
@@ -826,6 +842,8 @@ error_info(file_exists) ->
         "created, the file already exists.">>};
 error_info(request_entity_too_large) ->
     {413, <<"too_large">>, <<"the request entity is too large">>};
+error_info(request_uri_too_long) ->
+    {414, <<"too_long">>, <<"the request entity is too long">>};
 error_info({bad_ctype, Reason}) ->
     {415, <<"bad_content_type">>, Reason};
 error_info(requested_range_not_satisfiable) ->


[29/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fix Fauxton's define paths to match mixedCase style

As bonus trailing spaces were striped.


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

Branch: refs/heads/2041-update-ibrowse
Commit: dea6cef58b4074d8b82270fe23928231bf1863f7
Parents: 5d17c20
Author: Alexander Shorin <kx...@apache.org>
Authored: Thu Feb 20 03:09:32 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Thu Feb 20 03:09:32 2014 +0400

----------------------------------------------------------------------
 src/fauxton/app/addons/auth/resources.js  | 20 ++++++++++----------
 src/fauxton/app/addons/documents/views.js |  4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dea6cef5/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index ed06175..2e359c9 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -13,7 +13,7 @@
 define([
        "app",
        "api",
-       "core/CouchdbSession"
+       "core/couchdbSession"
 ],
 
 function (app, FauxtonAPI, CouchdbSession) {
@@ -55,7 +55,7 @@ function (app, FauxtonAPI, CouchdbSession) {
 
       _.bindAll(this);
 
-      this.messages = _.extend({},  { 
+      this.messages = _.extend({},  {
           missingCredentials: 'Username or password cannot be blank.',
           passwordsNotMatch:  'Passwords do not match.',
           incorrectCredentials: 'Incorrect username or password.',
@@ -88,7 +88,7 @@ function (app, FauxtonAPI, CouchdbSession) {
     userRoles: function () {
       var user = this.user();
 
-      if (user && user.roles) { 
+      if (user && user.roles) {
         return user.roles;
       }
 
@@ -157,8 +157,8 @@ function (app, FauxtonAPI, CouchdbSession) {
 
       return $.ajax({
         cache: false,
-        type: "POST", 
-        url: app.host + "/_session", 
+        type: "POST",
+        url: app.host + "/_session",
         dataType: "json",
         data: {name: username, password: password}
       }).then(function () {
@@ -170,10 +170,10 @@ function (app, FauxtonAPI, CouchdbSession) {
       var that = this;
 
       return $.ajax({
-        type: "DELETE", 
-        url: app.host + "/_session", 
+        type: "DELETE",
+        url: app.host + "/_session",
         dataType: "json",
-        username : "_", 
+        username : "_",
         password : "_"
       }).then(function () {
        return that.fetchUser({forceFetch: true });
@@ -315,7 +315,7 @@ function (app, FauxtonAPI, CouchdbSession) {
     }
   });
 
-  Auth.NavLink = FauxtonAPI.View.extend({ 
+  Auth.NavLink = FauxtonAPI.View.extend({
     template: 'addons/auth/templates/nav_link_title',
     tagName: 'li',
 
@@ -331,7 +331,7 @@ function (app, FauxtonAPI, CouchdbSession) {
     }
   });
 
-  Auth.NavDropDown = FauxtonAPI.View.extend({ 
+  Auth.NavDropDown = FauxtonAPI.View.extend({
     template: 'addons/auth/templates/nav_dropdown',
 
     beforeRender: function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dea6cef5/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 62d8761..7282ed7 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -21,7 +21,7 @@ define([
        "addons/pouchdb/base",
 
        // Libs
-       "addons/Fauxton/resizeColumns",
+       "addons/fauxton/resizeColumns",
 
        // Plugins
        "plugins/beautify",
@@ -952,7 +952,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           //not complete doc. Cannot work with it
           return;
         }
-        
+
         var keyChecked = ["_id"];
         if (model.get("_rev")) { keyChecked.push("_rev");}
 


[30/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fix documentation wording

The warning regarding the Response Object was unclear.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 08cf09fc0ae828e05c3ab01b11d561b4e717e0c4
Parents: dea6cef
Author: Andy Wenk <an...@apache.org>
Authored: Thu Feb 20 20:57:11 2014 +0100
Committer: Andy Wenk <an...@apache.org>
Committed: Thu Feb 20 20:57:11 2014 +0100

----------------------------------------------------------------------
 share/doc/src/json-structure.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/08cf09fc/share/doc/src/json-structure.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/json-structure.rst b/share/doc/src/json-structure.rst
index 4ab2f65..8eae7df 100644
--- a/share/doc/src/json-structure.rst
+++ b/share/doc/src/json-structure.rst
@@ -481,10 +481,10 @@ Response object
 +--------------------------------+---------------------------------------------+
 
 .. warning::
-   The ``body``, ``base64`` and ``json`` object keys are overlapping each other
-   where the last one wins. Since most realizations of key-value objects do
-   not preserve the key order or if they are mixed, confusing situations can
-   occure. Try to use only one of them.
+   The ``body``, ``base64`` and ``json`` object keys overlapp each other
+   where in the last one wins. Since most implementations of key-value objects do
+   not preserve the key order, confusing situations can emerge. The same applies,
+   when they are mixed. Try to use only one of them.
 
 .. note::
    Any custom property makes CouchDB raise an internal exception.


[39/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Revert "fix right hand side scrolling over navigation"

This reverts commit e389a8ba2a79da2669b536ca242b5dfdee4faba3.

This is the commit that broke modals.

Reverting it fixes COUCHDB-2086

Fixing the right hand content overlapping the left
hand navigation will require a bigger fix...
This sadly was not it...


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

Branch: refs/heads/2041-update-ibrowse
Commit: 5989bb324a7998f931050b542f7e526309bdcc32
Parents: b4b6fe1
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Mon Feb 24 15:39:26 2014 -0500
Committer: BigBlueHat <by...@bigbluehat.com>
Committed: Wed Feb 26 08:49:43 2014 -0500

----------------------------------------------------------------------
 src/fauxton/assets/less/fauxton.less | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5989bb32/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 4ec502a..82c65bd 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -490,9 +490,8 @@ table.databases {
   max-width: 1500px;
   .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
   border-left: 1px solid #999;
-  position: fixed;
+  position: absolute;
   left: @navWidth;
-  right: 0;
   margin-left: 0;
   padding-left: 0;
   padding-right: 0;


[41/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Added the "everyone is an admin" & "fix this" note  and move the text around on the page.
Got rid of the extra header


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

Branch: refs/heads/2041-update-ibrowse
Commit: 48f586f850a4cc92e938d84bfc98ba33f125861e
Parents: 055219f
Author: suelockwood <de...@apache.org>
Authored: Thu Feb 27 15:33:48 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Thu Feb 27 15:33:48 2014 -0500

----------------------------------------------------------------------
 .../app/addons/auth/templates/create_admin.html | 21 ++++++++++----------
 .../addons/auth/templates/nav_link_title.html   |  3 ++-
 src/fauxton/assets/less/fauxton.less            |  4 +++-
 3 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/48f586f8/src/fauxton/app/addons/auth/templates/create_admin.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/templates/create_admin.html b/src/fauxton/app/addons/auth/templates/create_admin.html
index 4715be5..8f4ed2c 100644
--- a/src/fauxton/app/addons/auth/templates/create_admin.html
+++ b/src/fauxton/app/addons/auth/templates/create_admin.html
@@ -13,21 +13,20 @@ the License.
 -->
 
 <div class="span12">
-  <h2> Add Admin </h2>
+  <p class="help-block">
+  Before a server admin is configured, all clients have admin privileges.
+  This is fine when HTTP access is restricted 
+  to trusted users. <strong>If end-users will be accessing this CouchDB, you must
+    create an admin account to prevent accidental (or malicious) data loss.</strong>
+  </p>
+  <p class="help-block">Server admins can create and destroy databases, install 
+    and update _design documents, run the test suite, and edit all aspects of CouchDB 
+    configuration.
+  </p>
   <form id="create-admin-form">
     <input id="username" type="text" name="name" placeholder= "Username:" size="24">
     <br/>
     <input id="password" type="password" name="password" placeholder= "Password" size="24">
-    <p class="help-block">
-    Before a server admin is configured, all clients have admin privileges.
-    This is fine when HTTP access is restricted 
-    to trusted users. <strong>If end-users will be accessing this CouchDB, you must
-      create an admin account to prevent accidental (or malicious) data loss.</strong>
-    </p>
-    <p class="help-block">Server admins can create and destroy databases, install 
-    and update _design documents, run the test suite, and edit all aspects of CouchDB 
-    configuration.
-    </p>
     <p class="help-block">Non-admin users have read and write access to all databases, which
     are controlled by validation functions. CouchDB can be configured to block all
     access to anonymous users.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/48f586f8/src/fauxton/app/addons/auth/templates/nav_link_title.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/templates/nav_link_title.html b/src/fauxton/app/addons/auth/templates/nav_link_title.html
index b23157e..699ea80 100644
--- a/src/fauxton/app/addons/auth/templates/nav_link_title.html
+++ b/src/fauxton/app/addons/auth/templates/nav_link_title.html
@@ -14,7 +14,8 @@ the License.
 <% if (admin_party) { %>
   <a id="user-create-admin" href="#createAdmin"> 
   	<span class="fonticon-user fonticon"></span>
-  	Admin Party! 
+  	Admin Party! [FIX THIS] 
+    <small>Everyone is an admin.</small>
   </a>
 <% } else if (user) { %>
   <a  href="#changePassword" >

http://git-wip-us.apache.org/repos/asf/couchdb/blob/48f586f8/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 82c65bd..229075b 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -340,7 +340,9 @@ table.databases {
     bottom: 0;
     width: 100%;
   }
-
+  #user-create-admin{
+    font-size: 12px
+  }
   .navbar {
     .brand {
       .box-sizing(content-box);


[48/50] [abbrv] Fauxton: Improved pagination

Posted by dc...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/test/mocha/chai.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/mocha/chai.js b/src/fauxton/test/mocha/chai.js
index 2a67f98..9dd7b0a 100644
--- a/src/fauxton/test/mocha/chai.js
+++ b/src/fauxton/test/mocha/chai.js
@@ -27,10 +27,14 @@ function require(path, parent, orig) {
   // perform real require()
   // by invoking the module's
   // registered function
-  if (!module.exports) {
-    module.exports = {};
-    module.client = module.component = true;
-    module.call(this, module.exports, require.relative(resolved), module);
+  if (!module._resolving && !module.exports) {
+    var mod = {};
+    mod.exports = {};
+    mod.client = mod.component = true;
+    module._resolving = true;
+    module.call(this, mod.exports, require.relative(resolved), mod);
+    delete module._resolving;
+    module.exports = mod.exports;
   }
 
   return module.exports;
@@ -309,6 +313,411 @@ AssertionError.prototype.toJSON = function (stack) {
 };
 
 });
+require.register("chaijs-type-detect/lib/type.js", function(exports, require, module){
+/*!
+ * type-detect
+ * Copyright(c) 2013 jake luer <ja...@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+/*!
+ * Primary Exports
+ */
+
+var exports = module.exports = getType;
+
+/*!
+ * Detectable javascript natives
+ */
+
+var natives = {
+    '[object Array]': 'array'
+  , '[object RegExp]': 'regexp'
+  , '[object Function]': 'function'
+  , '[object Arguments]': 'arguments'
+  , '[object Date]': 'date'
+};
+
+/**
+ * ### typeOf (obj)
+ *
+ * Use several different techniques to determine
+ * the type of object being tested.
+ *
+ *
+ * @param {Mixed} object
+ * @return {String} object type
+ * @api public
+ */
+
+function getType (obj) {
+  var str = Object.prototype.toString.call(obj);
+  if (natives[str]) return natives[str];
+  if (obj === null) return 'null';
+  if (obj === undefined) return 'undefined';
+  if (obj === Object(obj)) return 'object';
+  return typeof obj;
+}
+
+exports.Library = Library;
+
+/**
+ * ### Library
+ *
+ * Create a repository for custom type detection.
+ *
+ * ```js
+ * var lib = new type.Library;
+ * ```
+ *
+ */
+
+function Library () {
+  this.tests = {};
+}
+
+/**
+ * #### .of (obj)
+ *
+ * Expose replacement `typeof` detection to the library.
+ *
+ * ```js
+ * if ('string' === lib.of('hello world')) {
+ *   // ...
+ * }
+ * ```
+ *
+ * @param {Mixed} object to test
+ * @return {String} type
+ */
+
+Library.prototype.of = getType;
+
+/**
+ * #### .define (type, test)
+ *
+ * Add a test to for the `.test()` assertion.
+ *
+ * Can be defined as a regular expression:
+ *
+ * ```js
+ * lib.define('int', /^[0-9]+$/);
+ * ```
+ *
+ * ... or as a function:
+ *
+ * ```js
+ * lib.define('bln', function (obj) {
+ *   if ('boolean' === lib.of(obj)) return true;
+ *   var blns = [ 'yes', 'no', 'true', 'false', 1, 0 ];
+ *   if ('string' === lib.of(obj)) obj = obj.toLowerCase();
+ *   return !! ~blns.indexOf(obj);
+ * });
+ * ```
+ *
+ * @param {String} type
+ * @param {RegExp|Function} test
+ * @api public
+ */
+
+Library.prototype.define = function (type, test) {
+  if (arguments.length === 1) return this.tests[type];
+  this.tests[type] = test;
+  return this;
+};
+
+/**
+ * #### .test (obj, test)
+ *
+ * Assert that an object is of type. Will first
+ * check natives, and if that does not pass it will
+ * use the user defined custom tests.
+ *
+ * ```js
+ * assert(lib.test('1', 'int'));
+ * assert(lib.test('yes', 'bln'));
+ * ```
+ *
+ * @param {Mixed} object
+ * @param {String} type
+ * @return {Boolean} result
+ * @api public
+ */
+
+Library.prototype.test = function (obj, type) {
+  if (type === getType(obj)) return true;
+  var test = this.tests[type];
+
+  if (test && 'regexp' === getType(test)) {
+    return test.test(obj);
+  } else if (test && 'function' === getType(test)) {
+    return test(obj);
+  } else {
+    throw new ReferenceError('Type test "' + type + '" not defined or invalid.');
+  }
+};
+
+});
+require.register("chaijs-deep-eql/lib/eql.js", function(exports, require, module){
+/*!
+ * deep-eql
+ * Copyright(c) 2013 Jake Luer <ja...@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+/*!
+ * Module dependencies
+ */
+
+var type = require('type-detect');
+
+/*!
+ * Buffer.isBuffer browser shim
+ */
+
+var Buffer;
+try { Buffer = require('buffer').Buffer; }
+catch(ex) {
+  Buffer = {};
+  Buffer.isBuffer = function() { return false; }
+}
+
+/*!
+ * Primary Export
+ */
+
+module.exports = deepEqual;
+
+/**
+ * Assert super-strict (egal) equality between
+ * two objects of any type.
+ *
+ * @param {Mixed} a
+ * @param {Mixed} b
+ * @param {Array} memoised (optional)
+ * @return {Boolean} equal match
+ */
+
+function deepEqual(a, b, m) {
+  if (sameValue(a, b)) {
+    return true;
+  } else if ('date' === type(a)) {
+    return dateEqual(a, b);
+  } else if ('regexp' === type(a)) {
+    return regexpEqual(a, b);
+  } else if (Buffer.isBuffer(a)) {
+    return bufferEqual(a, b);
+  } else if ('arguments' === type(a)) {
+    return argumentsEqual(a, b, m);
+  } else if (!typeEqual(a, b)) {
+    return false;
+  } else if (('object' !== type(a) && 'object' !== type(b))
+  && ('array' !== type(a) && 'array' !== type(b))) {
+    return sameValue(a, b);
+  } else {
+    return objectEqual(a, b, m);
+  }
+}
+
+/*!
+ * Strict (egal) equality test. Ensures that NaN always
+ * equals NaN and `-0` does not equal `+0`.
+ *
+ * @param {Mixed} a
+ * @param {Mixed} b
+ * @return {Boolean} equal match
+ */
+
+function sameValue(a, b) {
+  if (a === b) return a !== 0 || 1 / a === 1 / b;
+  return a !== a && b !== b;
+}
+
+/*!
+ * Compare the types of two given objects and
+ * return if they are equal. Note that an Array
+ * has a type of `array` (not `object`) and arguments
+ * have a type of `arguments` (not `array`/`object`).
+ *
+ * @param {Mixed} a
+ * @param {Mixed} b
+ * @return {Boolean} result
+ */
+
+function typeEqual(a, b) {
+  return type(a) === type(b);
+}
+
+/*!
+ * Compare two Date objects by asserting that
+ * the time values are equal using `saveValue`.
+ *
+ * @param {Date} a
+ * @param {Date} b
+ * @return {Boolean} result
+ */
+
+function dateEqual(a, b) {
+  if ('date' !== type(b)) return false;
+  return sameValue(a.getTime(), b.getTime());
+}
+
+/*!
+ * Compare two regular expressions by converting them
+ * to string and checking for `sameValue`.
+ *
+ * @param {RegExp} a
+ * @param {RegExp} b
+ * @return {Boolean} result
+ */
+
+function regexpEqual(a, b) {
+  if ('regexp' !== type(b)) return false;
+  return sameValue(a.toString(), b.toString());
+}
+
+/*!
+ * Assert deep equality of two `arguments` objects.
+ * Unfortunately, these must be sliced to arrays
+ * prior to test to ensure no bad behavior.
+ *
+ * @param {Arguments} a
+ * @param {Arguments} b
+ * @param {Array} memoize (optional)
+ * @return {Boolean} result
+ */
+
+function argumentsEqual(a, b, m) {
+  if ('arguments' !== type(b)) return false;
+  a = [].slice.call(a);
+  b = [].slice.call(b);
+  return deepEqual(a, b, m);
+}
+
+/*!
+ * Get enumerable properties of a given object.
+ *
+ * @param {Object} a
+ * @return {Array} property names
+ */
+
+function enumerable(a) {
+  var res = [];
+  for (var key in a) res.push(key);
+  return res;
+}
+
+/*!
+ * Simple equality for flat iterable objects
+ * such as Arrays or Node.js buffers.
+ *
+ * @param {Iterable} a
+ * @param {Iterable} b
+ * @return {Boolean} result
+ */
+
+function iterableEqual(a, b) {
+  if (a.length !==  b.length) return false;
+
+  var i = 0;
+  var match = true;
+
+  for (; i < a.length; i++) {
+    if (a[i] !== b[i]) {
+      match = false;
+      break;
+    }
+  }
+
+  return match;
+}
+
+/*!
+ * Extension to `iterableEqual` specifically
+ * for Node.js Buffers.
+ *
+ * @param {Buffer} a
+ * @param {Mixed} b
+ * @return {Boolean} result
+ */
+
+function bufferEqual(a, b) {
+  if (!Buffer.isBuffer(b)) return false;
+  return iterableEqual(a, b);
+}
+
+/*!
+ * Block for `objectEqual` ensuring non-existing
+ * values don't get in.
+ *
+ * @param {Mixed} object
+ * @return {Boolean} result
+ */
+
+function isValue(a) {
+  return a !== null && a !== undefined;
+}
+
+/*!
+ * Recursively check the equality of two objects.
+ * Once basic sameness has been established it will
+ * defer to `deepEqual` for each enumerable key
+ * in the object.
+ *
+ * @param {Mixed} a
+ * @param {Mixed} b
+ * @return {Boolean} result
+ */
+
+function objectEqual(a, b, m) {
+  if (!isValue(a) || !isValue(b)) {
+    return false;
+  }
+
+  if (a.prototype !== b.prototype) {
+    return false;
+  }
+
+  var i;
+  if (m) {
+    for (i = 0; i < m.length; i++) {
+      if ((m[i][0] === a && m[i][1] === b)
+      ||  (m[i][0] === b && m[i][1] === a)) {
+        return true;
+      }
+    }
+  } else {
+    m = [];
+  }
+
+  try {
+    var ka = enumerable(a);
+    var kb = enumerable(b);
+  } catch (ex) {
+    return false;
+  }
+
+  ka.sort();
+  kb.sort();
+
+  if (!iterableEqual(ka, kb)) {
+    return false;
+  }
+
+  m.push([ a, b ]);
+
+  var key;
+  for (i = ka.length - 1; i >= 0; i--) {
+    key = ka[i];
+    if (!deepEqual(a[key], b[key], m)) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+});
 require.register("chai/index.js", function(exports, require, module){
 module.exports = require('./lib/chai');
 
@@ -316,7 +725,7 @@ module.exports = require('./lib/chai');
 require.register("chai/lib/chai.js", function(exports, require, module){
 /*!
  * chai
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -327,7 +736,7 @@ var used = []
  * Chai version
  */
 
-exports.version = '1.7.2';
+exports.version = '1.8.1';
 
 /*!
  * Assertion Error
@@ -400,7 +809,7 @@ require.register("chai/lib/chai/assertion.js", function(exports, require, module
 /*!
  * chai
  * http://chaijs.com
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -480,6 +889,10 @@ module.exports = function (_chai, util) {
     util.overwriteMethod(this.prototype, name, fn);
   };
 
+  Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
+    util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
+  };
+
   /*!
    * ### .assert(expression, message, negateMessage, expected, actual)
    *
@@ -533,7 +946,7 @@ require.register("chai/lib/chai/core/assertions.js", function(exports, require,
 /*!
  * chai
  * http://chaijs.com
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -545,7 +958,7 @@ module.exports = function (chai, _) {
   /**
    * ### Language Chains
    *
-   * The following are provide as chainable getters to
+   * The following are provided as chainable getters to
    * improve the readability of your assertions. They
    * do not provide an testing capability unless they
    * have been overwritten by a plugin.
@@ -558,6 +971,7 @@ module.exports = function (chai, _) {
    * - is
    * - that
    * - and
+   * - has
    * - have
    * - with
    * - at
@@ -569,7 +983,7 @@ module.exports = function (chai, _) {
    */
 
   [ 'to', 'be', 'been'
-  , 'is', 'and', 'have'
+  , 'is', 'and', 'has', 'have'
   , 'with', 'that', 'at'
   , 'of', 'same' ].forEach(function (chain) {
     Assertion.addProperty(chain, function () {
@@ -677,9 +1091,21 @@ module.exports = function (chai, _) {
 
   function include (val, msg) {
     if (msg) flag(this, 'message', msg);
-    var obj = flag(this, 'object')
+    var obj = flag(this, 'object');
+
+    if (_.type(val) === 'object') {
+      if (!flag(this, 'negate')) {
+        for (var k in val) new Assertion(obj).property(k, val[k]);
+        return;
+      }
+      var subset = {}
+      for (var k in val) subset[k] = obj[k]
+      var expected = _.eql(subset, val);
+    } else {
+      var expected = obj && ~obj.indexOf(val)
+    }
     this.assert(
-        ~obj.indexOf(val)
+        expected
       , 'expected #{this} to include ' + _.inspect(val)
       , 'expected #{this} to not include ' + _.inspect(val));
   }
@@ -776,8 +1202,8 @@ module.exports = function (chai, _) {
    *
    * Asserts that the target is `undefined`.
    *
-   *      expect(undefined).to.be.undefined;
-   *      expect(null).to.not.be.undefined;
+   *     expect(undefined).to.be.undefined;
+   *     expect(null).to.not.be.undefined;
    *
    * @name undefined
    * @api public
@@ -1534,6 +1960,7 @@ module.exports = function (chai, _) {
    * @param {String|RegExp} expected error message
    * @param {String} message _optional_
    * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
+   * @returns error for chaining (null if no error)
    * @api public
    */
 
@@ -1558,7 +1985,10 @@ module.exports = function (chai, _) {
       constructor = null;
       errMsg = null;
     } else if (typeof constructor === 'function') {
-      name = (new constructor()).name;
+      name = constructor.prototype.name || constructor.name;
+      if (name === 'Error' && constructor !== Error) {
+        name = (new constructor()).name;
+      }
     } else {
       constructor = null;
     }
@@ -1572,12 +2002,14 @@ module.exports = function (chai, _) {
             err === desiredError
           , 'expected #{this} to throw #{exp} but #{act} was thrown'
           , 'expected #{this} to not throw #{exp}'
-          , desiredError
-          , err
+          , (desiredError instanceof Error ? desiredError.toString() : desiredError)
+          , (err instanceof Error ? err.toString() : err)
         );
 
+        flag(this, 'object', err);
         return this;
       }
+
       // next, check constructor
       if (constructor) {
         this.assert(
@@ -1585,11 +2017,15 @@ module.exports = function (chai, _) {
           , 'expected #{this} to throw #{exp} but #{act} was thrown'
           , 'expected #{this} to not throw #{exp} but #{act} was thrown'
           , name
-          , err
+          , (err instanceof Error ? err.toString() : err)
         );
 
-        if (!errMsg) return this;
+        if (!errMsg) {
+          flag(this, 'object', err);
+          return this;
+        }
       }
+
       // next, check message
       var message = 'object' === _.type(err) && "message" in err
         ? err.message
@@ -1604,6 +2040,7 @@ module.exports = function (chai, _) {
           , message
         );
 
+        flag(this, 'object', err);
         return this;
       } else if ((message != null) && errMsg && 'string' === typeof errMsg) {
         this.assert(
@@ -1614,6 +2051,7 @@ module.exports = function (chai, _) {
           , message
         );
 
+        flag(this, 'object', err);
         return this;
       } else {
         thrown = true;
@@ -1636,9 +2074,11 @@ module.exports = function (chai, _) {
         thrown === true
       , 'expected #{this} to throw ' + expectedThrown + actuallyGot
       , 'expected #{this} to not throw ' + expectedThrown + actuallyGot
-      , desiredError
-      , thrownError
+      , (desiredError instanceof Error ? desiredError.toString() : desiredError)
+      , (thrownError instanceof Error ? thrownError.toString() : thrownError)
     );
+
+    flag(this, 'object', thrownError);
   };
 
   Assertion.addMethod('throw', assertThrows);
@@ -1657,8 +2097,8 @@ module.exports = function (chai, _) {
    * To check if a constructor will respond to a static function,
    * set the `itself` flag.
    *
-   *    Klass.baz = function(){};
-   *    expect(Klass).itself.to.respondTo('baz');
+   *     Klass.baz = function(){};
+   *     expect(Klass).itself.to.respondTo('baz');
    *
    * @name respondTo
    * @param {String} method
@@ -1686,12 +2126,12 @@ module.exports = function (chai, _) {
    *
    * Sets the `itself` flag, later used by the `respondTo` assertion.
    *
-   *    function Foo() {}
-   *    Foo.bar = function() {}
-   *    Foo.prototype.baz = function() {}
+   *     function Foo() {}
+   *     Foo.bar = function() {}
+   *     Foo.prototype.baz = function() {}
    *
-   *    expect(Foo).itself.to.respondTo('bar');
-   *    expect(Foo).itself.not.to.respondTo('baz');
+   *     expect(Foo).itself.to.respondTo('bar');
+   *     expect(Foo).itself.not.to.respondTo('baz');
    *
    * @name itself
    * @api public
@@ -1805,7 +2245,7 @@ module.exports = function (chai, _) {
 require.register("chai/lib/chai/interface/assert.js", function(exports, require, module){
 /*!
  * chai
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -1860,13 +2300,12 @@ module.exports = function (chai, util) {
    */
 
   assert.fail = function (actual, expected, message, operator) {
-    throw new chai.AssertionError({
+    message = message || 'assert.fail()';
+    throw new chai.AssertionError(message, {
         actual: actual
       , expected: expected
-      , message: message
       , operator: operator
-      , stackStartFunction: assert.fail
-    });
+    }, assert.fail);
   };
 
   /**
@@ -2462,19 +2901,7 @@ module.exports = function (chai, util) {
    */
 
   assert.include = function (exp, inc, msg) {
-    var obj = new Assertion(exp, msg);
-
-    if (Array.isArray(exp)) {
-      obj.to.include(inc);
-    } else if ('string' === typeof exp) {
-      obj.to.contain.string(inc);
-    } else {
-      throw new chai.AssertionError(
-          'expected an array or string'
-        , null
-        , assert.include
-      );
-    }
+    new Assertion(exp, msg).include(inc);
   };
 
   /**
@@ -2494,19 +2921,7 @@ module.exports = function (chai, util) {
    */
 
   assert.notInclude = function (exp, inc, msg) {
-    var obj = new Assertion(exp, msg);
-
-    if (Array.isArray(exp)) {
-      obj.to.not.include(inc);
-    } else if ('string' === typeof exp) {
-      obj.to.not.contain.string(inc);
-    } else {
-      throw new chai.AssertionError(
-          'expected an array or string'
-        , null
-        , assert.notInclude
-      );
-    }
+    new Assertion(exp, msg).not.include(inc);
   };
 
   /**
@@ -2750,7 +3165,8 @@ module.exports = function (chai, util) {
       errt = null;
     }
 
-    new Assertion(fn, msg).to.Throw(errt, errs);
+    var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
+    return flag(assertErr, 'object');
   };
 
   /**
@@ -2888,7 +3304,7 @@ module.exports = function (chai, util) {
 require.register("chai/lib/chai/interface/expect.js", function(exports, require, module){
 /*!
  * chai
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -2903,7 +3319,7 @@ module.exports = function (chai, util) {
 require.register("chai/lib/chai/interface/should.js", function(exports, require, module){
 /*!
  * chai
- * Copyright(c) 2011-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2011-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -2982,7 +3398,7 @@ module.exports = function (chai, util) {
 require.register("chai/lib/chai/utils/addChainableMethod.js", function(exports, require, module){
 /*!
  * Chai - addChainingMethod utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3037,15 +3453,27 @@ var call  = Function.prototype.call,
  */
 
 module.exports = function (ctx, name, method, chainingBehavior) {
-  if (typeof chainingBehavior !== 'function')
+  if (typeof chainingBehavior !== 'function') {
     chainingBehavior = function () { };
+  }
+
+  var chainableBehavior = {
+      method: method
+    , chainingBehavior: chainingBehavior
+  };
+
+  // save the methods so we can overwrite them later, if we need to.
+  if (!ctx.__methods) {
+    ctx.__methods = {};
+  }
+  ctx.__methods[name] = chainableBehavior;
 
   Object.defineProperty(ctx, name,
     { get: function () {
-        chainingBehavior.call(this);
+        chainableBehavior.chainingBehavior.call(this);
 
         var assert = function () {
-          var result = method.apply(this, arguments);
+          var result = chainableBehavior.method.apply(this, arguments);
           return result === undefined ? this : result;
         };
 
@@ -3079,7 +3507,7 @@ module.exports = function (ctx, name, method, chainingBehavior) {
 require.register("chai/lib/chai/utils/addMethod.js", function(exports, require, module){
 /*!
  * Chai - addMethod utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3119,7 +3547,7 @@ module.exports = function (ctx, name, method) {
 require.register("chai/lib/chai/utils/addProperty.js", function(exports, require, module){
 /*!
  * Chai - addProperty utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3159,142 +3587,10 @@ module.exports = function (ctx, name, getter) {
 };
 
 });
-require.register("chai/lib/chai/utils/eql.js", function(exports, require, module){
-// This is (almost) directly from Node.js assert
-// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/assert.js
-
-module.exports = _deepEqual;
-
-var getEnumerableProperties = require('./getEnumerableProperties');
-
-// for the browser
-var Buffer;
-try {
-  Buffer = require('buffer').Buffer;
-} catch (ex) {
-  Buffer = {
-    isBuffer: function () { return false; }
-  };
-}
-
-function _deepEqual(actual, expected, memos) {
-
-  // 7.1. All identical values are equivalent, as determined by ===.
-  if (actual === expected) {
-    return true;
-
-  } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
-    if (actual.length != expected.length) return false;
-
-    for (var i = 0; i < actual.length; i++) {
-      if (actual[i] !== expected[i]) return false;
-    }
-
-    return true;
-
-  // 7.2. If the expected value is a Date object, the actual value is
-  // equivalent if it is also a Date object that refers to the same time.
-  } else if (expected instanceof Date) {
-    if (!(actual instanceof Date)) return false;
-    return actual.getTime() === expected.getTime();
-
-  // 7.3. Other pairs that do not both pass typeof value == 'object',
-  // equivalence is determined by ==.
-  } else if (typeof actual != 'object' && typeof expected != 'object') {
-    return actual === expected;
-
-  } else if (expected instanceof RegExp) {
-    if (!(actual instanceof RegExp)) return false;
-    return actual.toString() === expected.toString();
-
-  // 7.4. For all other Object pairs, including Array objects, equivalence is
-  // determined by having the same number of owned properties (as verified
-  // with Object.prototype.hasOwnProperty.call), the same set of keys
-  // (although not necessarily the same order), equivalent values for every
-  // corresponding key, and an identical 'prototype' property. Note: this
-  // accounts for both named and indexed properties on Arrays.
-  } else {
-    return objEquiv(actual, expected, memos);
-  }
-}
-
-function isUndefinedOrNull(value) {
-  return value === null || value === undefined;
-}
-
-function isArguments(object) {
-  return Object.prototype.toString.call(object) == '[object Arguments]';
-}
-
-function objEquiv(a, b, memos) {
-  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
-    return false;
-
-  // an identical 'prototype' property.
-  if (a.prototype !== b.prototype) return false;
-
-  // check if we have already compared a and b
-  var i;
-  if (memos) {
-    for(i = 0; i < memos.length; i++) {
-      if ((memos[i][0] === a && memos[i][1] === b) ||
-          (memos[i][0] === b && memos[i][1] === a))
-        return true;
-    }
-  } else {
-    memos = [];
-  }
-
-  //~~~I've managed to break Object.keys through screwy arguments passing.
-  //   Converting to array solves the problem.
-  if (isArguments(a)) {
-    if (!isArguments(b)) {
-      return false;
-    }
-    a = pSlice.call(a);
-    b = pSlice.call(b);
-    return _deepEqual(a, b, memos);
-  }
-  try {
-    var ka = getEnumerableProperties(a),
-        kb = getEnumerableProperties(b),
-        key;
-  } catch (e) {//happens when one is a string literal and the other isn't
-    return false;
-  }
-
-  // having the same number of owned properties (keys incorporates
-  // hasOwnProperty)
-  if (ka.length != kb.length)
-    return false;
-
-  //the same set of keys (although not necessarily the same order),
-  ka.sort();
-  kb.sort();
-  //~~~cheap key test
-  for (i = ka.length - 1; i >= 0; i--) {
-    if (ka[i] != kb[i])
-      return false;
-  }
-
-  // remember objects we have compared to guard against circular references
-  memos.push([ a, b ]);
-
-  //equivalent values for every corresponding key, and
-  //~~~possibly expensive deep test
-  for (i = ka.length - 1; i >= 0; i--) {
-    key = ka[i];
-    if (!_deepEqual(a[key], b[key], memos)) return false;
-  }
-
-  return true;
-}
-
-});
 require.register("chai/lib/chai/utils/flag.js", function(exports, require, module){
 /*!
  * Chai - flag utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3329,7 +3625,7 @@ module.exports = function (obj, key, value) {
 require.register("chai/lib/chai/utils/getActual.js", function(exports, require, module){
 /*!
  * Chai - getActual utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3351,7 +3647,7 @@ module.exports = function (obj, args) {
 require.register("chai/lib/chai/utils/getEnumerableProperties.js", function(exports, require, module){
 /*!
  * Chai - getEnumerableProperties utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3379,7 +3675,7 @@ module.exports = function getEnumerableProperties(object) {
 require.register("chai/lib/chai/utils/getMessage.js", function(exports, require, module){
 /*!
  * Chai - message composition utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3431,7 +3727,7 @@ module.exports = function (obj, args) {
 require.register("chai/lib/chai/utils/getName.js", function(exports, require, module){
 /*!
  * Chai - getName utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3454,7 +3750,7 @@ module.exports = function (func) {
 require.register("chai/lib/chai/utils/getPathValue.js", function(exports, require, module){
 /*!
  * Chai - getPathValue utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * @see https://github.com/logicalparadox/filtr
  * MIT Licensed
  */
@@ -3559,7 +3855,7 @@ function _getPathValue (parsed, obj) {
 require.register("chai/lib/chai/utils/getProperties.js", function(exports, require, module){
 /*!
  * Chai - getProperties utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -3659,7 +3955,7 @@ exports.transferFlags = require('./transferFlags');
  * Deep equal utility
  */
 
-exports.eql = require('./eql');
+exports.eql = require('deep-eql');
 
 /*!
  * Deep path value
@@ -3703,6 +3999,12 @@ exports.overwriteMethod = require('./overwriteMethod');
 
 exports.addChainableMethod = require('./addChainableMethod');
 
+/*!
+ * Overwrite chainable method
+ */
+
+exports.overwriteChainableMethod = require('./overwriteChainableMethod');
+
 
 });
 require.register("chai/lib/chai/utils/inspect.js", function(exports, require, module){
@@ -4031,7 +4333,7 @@ function objectToString(o) {
 require.register("chai/lib/chai/utils/objDisplay.js", function(exports, require, module){
 /*!
  * Chai - flag utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4082,7 +4384,7 @@ module.exports = function (obj) {
 require.register("chai/lib/chai/utils/overwriteMethod.js", function(exports, require, module){
 /*!
  * Chai - overwriteMethod utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4136,7 +4438,7 @@ module.exports = function (ctx, name, method) {
 require.register("chai/lib/chai/utils/overwriteProperty.js", function(exports, require, module){
 /*!
  * Chai - overwriteProperty utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4190,10 +4492,66 @@ module.exports = function (ctx, name, getter) {
 };
 
 });
+require.register("chai/lib/chai/utils/overwriteChainableMethod.js", function(exports, require, module){
+/*!
+ * Chai - overwriteChainableMethod utility
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+/**
+ * ### overwriteChainableMethod (ctx, name, fn)
+ *
+ * Overwites an already existing chainable method
+ * and provides access to the previous function or
+ * property.  Must return functions to be used for
+ * name.
+ *
+ *     utils.overwriteChainableMethod(chai.Assertion.prototype, 'length',
+ *       function (_super) {
+ *       }
+ *     , function (_super) {
+ *       }
+ *     );
+ *
+ * Can also be accessed directly from `chai.Assertion`.
+ *
+ *     chai.Assertion.overwriteChainableMethod('foo', fn, fn);
+ *
+ * Then can be used as any other assertion.
+ *
+ *     expect(myFoo).to.have.length(3);
+ *     expect(myFoo).to.have.length.above(3);
+ *
+ * @param {Object} ctx object whose method / property is to be overwritten
+ * @param {String} name of method / property to overwrite
+ * @param {Function} method function that returns a function to be used for name
+ * @param {Function} chainingBehavior function that returns a function to be used for property
+ * @name overwriteChainableMethod
+ * @api public
+ */
+
+module.exports = function (ctx, name, method, chainingBehavior) {
+  var chainableBehavior = ctx.__methods[name];
+
+  var _chainingBehavior = chainableBehavior.chainingBehavior;
+  chainableBehavior.chainingBehavior = function () {
+    var result = chainingBehavior(_chainingBehavior).call(this);
+    return result === undefined ? this : result;
+  };
+
+  var _method = chainableBehavior.method;
+  chainableBehavior.method = function () {
+    var result = method(_method).apply(this, arguments);
+    return result === undefined ? this : result;
+  };
+};
+
+});
 require.register("chai/lib/chai/utils/test.js", function(exports, require, module){
 /*!
  * Chai - test utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4222,7 +4580,7 @@ module.exports = function (obj, args) {
 require.register("chai/lib/chai/utils/transferFlags.js", function(exports, require, module){
 /*!
  * Chai - transferFlags utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4269,7 +4627,7 @@ module.exports = function (assertion, object, includeAll) {
 require.register("chai/lib/chai/utils/type.js", function(exports, require, module){
 /*!
  * Chai - type utility
- * Copyright(c) 2012-2013 Jake Luer <ja...@alogicalparadox.com>
+ * Copyright(c) 2012-2014 Jake Luer <ja...@alogicalparadox.com>
  * MIT Licensed
  */
 
@@ -4314,17 +4672,25 @@ module.exports = function (obj) {
 };
 
 });
+
+
+
+
 require.alias("chaijs-assertion-error/index.js", "chai/deps/assertion-error/index.js");
 require.alias("chaijs-assertion-error/index.js", "chai/deps/assertion-error/index.js");
 require.alias("chaijs-assertion-error/index.js", "assertion-error/index.js");
 require.alias("chaijs-assertion-error/index.js", "chaijs-assertion-error/index.js");
-
-require.alias("chai/index.js", "chai/index.js");
-
-if (typeof exports == "object") {
+require.alias("chaijs-deep-eql/lib/eql.js", "chai/deps/deep-eql/lib/eql.js");
+require.alias("chaijs-deep-eql/lib/eql.js", "chai/deps/deep-eql/index.js");
+require.alias("chaijs-deep-eql/lib/eql.js", "deep-eql/index.js");
+require.alias("chaijs-type-detect/lib/type.js", "chaijs-deep-eql/deps/type-detect/lib/type.js");
+require.alias("chaijs-type-detect/lib/type.js", "chaijs-deep-eql/deps/type-detect/index.js");
+require.alias("chaijs-type-detect/lib/type.js", "chaijs-type-detect/index.js");
+require.alias("chaijs-deep-eql/lib/eql.js", "chaijs-deep-eql/index.js");
+require.alias("chai/index.js", "chai/index.js");if (typeof exports == "object") {
   module.exports = require("chai");
 } else if (typeof define == "function" && define.amd) {
-  define(function(){ return require("chai"); });
+  define([], function(){ return require("chai"); });
 } else {
   this["chai"] = require("chai");
 }})();

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e60f0b7/src/fauxton/test/test.config.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/test/test.config.underscore b/src/fauxton/test/test.config.underscore
index 5cebe78..95494a4 100644
--- a/src/fauxton/test/test.config.underscore
+++ b/src/fauxton/test/test.config.underscore
@@ -7,7 +7,11 @@ require.config(
 require([
         "app",
         <% _.each(testFiles, function (test) {%>
+           <% if (test[0] === '.') { %>
            '../<%= test %>',
+           <% } else { %>
+           '<%= test %>',
+           <% }  %>
         <% }) %>
 ], function() {
   if (window.mochaPhantomJS) { mochaPhantomJS.run(); }


[35/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
```validate_doc_update``` moved from views to root

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/8de6b6e1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8de6b6e1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8de6b6e1

Branch: refs/heads/2041-update-ibrowse
Commit: 8de6b6e1c36212dd6615633cd1fddae430da9775
Parents: 358901a
Author: Anthony Ananich <an...@inpun.com>
Authored: Tue Feb 25 18:17:44 2014 +0200
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Feb 25 20:22:20 2014 +0400

----------------------------------------------------------------------
 share/doc/src/query-server/javascript.rst | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8de6b6e1/share/doc/src/query-server/javascript.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/query-server/javascript.rst b/share/doc/src/query-server/javascript.rst
index 16590d6..386f9c5 100644
--- a/share/doc/src/query-server/javascript.rst
+++ b/share/doc/src/query-server/javascript.rst
@@ -273,12 +273,12 @@ The CommonJS module can be added to a design document, like so:
        "views": {
           "lib": {
              "security": "function user_context(userctx, secobj) { ... }"
-          },
-          "validate_doc_update": "function(newdoc, olddoc, userctx, secobj) {
-            user = require('lib/security').user(userctx, secobj);
-            return user.is_admin();
-          }"
+          }
        },
+       "validate_doc_update": "function(newdoc, olddoc, userctx, secobj) {
+          user = require('lib/security').user(userctx, secobj);
+          return user.is_admin();
+       }"
        "_id": "_design/test"
     }
 


[04/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
nv.d3.css is the one CSS used in Fauxton

And now it is loaded before the fauxton.less
file. Other options would include moving/renaming
it (to a .less file) and making it an @import.
Not necessary this time, but may be for other
needed CSS.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 34aabbfb58ca4f0ed60a20c466b6bf544b7dc28f
Parents: b8fe3cb
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Mon Feb 3 15:20:26 2014 -0500
Committer: BigBlueHat <by...@bigbluehat.com>
Committed: Mon Feb 3 15:20:26 2014 -0500

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/34aabbfb/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 554eccb..9507a60 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -67,7 +67,7 @@ module.exports = function(grunt) {
       img: ["assets/img/**"],
       // used in concat:index_css to keep file ordering intact
       // fauxton.css should load first
-      css: ["dist/debug/css/fauxton.css"]
+      css: ["assets/css/*.css", "dist/debug/css/fauxton.css"]
     };
     helper.processAddons(function(addon){
       // Less files from addons


[11/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fix Beautify button css


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

Branch: refs/heads/2041-update-ibrowse
Commit: f7801e669e522ca3bd92cfc4fdf2a65879369be1
Parents: 14a38b7
Author: suelockwood <de...@apache.org>
Authored: Fri Feb 7 14:46:43 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Fri Feb 7 14:47:05 2014 -0500

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/templates/view_editor.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7801e66/src/fauxton/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/view_editor.html b/src/fauxton/app/addons/documents/templates/view_editor.html
index be60090..b4addad 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -44,7 +44,7 @@ the License.
             <div class="js-editor" id="map-function"><%= langTemplates.map %></div>
             <% } else { %>
             <div class="js-editor" id="map-function"><%- ddoc.get('views')[viewName].map %></div>
-            <button class="beautify beautify_map button hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+            <button class="beautify beautify_map btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
             <% } %>
           </div>
 
@@ -67,7 +67,7 @@ the License.
             <div class="js-editor" id="reduce-function"><%= langTemplates.reduce %></div>
             <% } else { %>
             <div class="js-editor" id="reduce-function"><%- ddoc.get('views')[viewName].reduce %></div>
-            <button class="beautify beautify_reduce button hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+            <button class="beautify beautify_reduce btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
             <% } %>
           </div>
 


[13/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fauxton: Improvements to xhr cancellations


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

Branch: refs/heads/2041-update-ibrowse
Commit: d2a0c46e9475b14c85067e0139b3ecb166fa475a
Parents: 4d89338
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Feb 10 15:53:10 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Feb 10 15:53:10 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/core/base.js                          | 1 +
 src/fauxton/app/core/couchdbSession.js                | 6 +++---
 src/fauxton/app/core/routeObject.js                   | 4 +++-
 src/fauxton/app/core/router.js                        | 6 +++---
 src/fauxton/assets/js/plugins/backbone.fetch-cache.js | 8 ++++----
 5 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d2a0c46e/src/fauxton/app/core/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/base.js b/src/fauxton/app/core/base.js
index 24b89cf..7cacf39 100644
--- a/src/fauxton/app/core/base.js
+++ b/src/fauxton/app/core/base.js
@@ -96,6 +96,7 @@ function(Backbone, LayoutManager, BackboneCache) {
 
       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;
     }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d2a0c46e/src/fauxton/app/core/couchdbSession.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/couchdbSession.js b/src/fauxton/app/core/couchdbSession.js
index b70ddf3..c59a8fc 100644
--- a/src/fauxton/app/core/couchdbSession.js
+++ b/src/fauxton/app/core/couchdbSession.js
@@ -30,15 +30,15 @@ function (FauxtonAPI) {
       fetchUser: function (opt) {
         var that = this,
             options = opt || {},
-        currentUser = this.user(),
-        fetch = this.fetchOnce;
+            currentUser = this.user(),
+            fetch = _.bind(this.fetchOnce, this);
 
         if (options.forceFetch) {
           fetch = this.fetch;
           Backbone.fetchCache.clearItem(_.result(this.url));
         }
 
-        return this.fetch(opt).then(function () {
+        return fetch(opt).then(function () {
           var user = that.user();
 
           // Notify anyone listening on these events that either a user has changed

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d2a0c46e/src/fauxton/app/core/routeObject.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/routeObject.js b/src/fauxton/app/core/routeObject.js
index f3b8672..9f1067f 100644
--- a/src/fauxton/app/core/routeObject.js
+++ b/src/fauxton/app/core/routeObject.js
@@ -223,6 +223,7 @@ function(FauxtonAPI, Backbone) {
       _.each(this.views, function (view, selector) {
         view.remove();
         delete this.views[selector];
+        view = null;
       }, this);
     },
 
@@ -230,6 +231,7 @@ function(FauxtonAPI, Backbone) {
       if (_.isEmpty(promise)) { return; }
 
       if (!_.isArray(promise)) {
+        if (!promise.abort && !promise.reject) {
         return this._promises.push(promise);
       }
 
@@ -250,7 +252,7 @@ function(FauxtonAPI, Backbone) {
           return promise.abort("Route change");
         } 
 
-        promise.reject();
+        promise.reject && promise.reject();
       }, this);
 
       this._promises = [];

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d2a0c46e/src/fauxton/app/core/router.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/router.js b/src/fauxton/app/core/router.js
index cc1ca4f..bef4ced 100644
--- a/src/fauxton/app/core/router.js
+++ b/src/fauxton/app/core/router.js
@@ -59,13 +59,13 @@ function(FauxtonAPI, Auth, Backbone) {
 
           authPromise.then(function () {
             if (!that.activeRouteObject || !that.activeRouteObject.hasRoute(route)) {
-              if (that.activeRouteObject) {
-                that.activeRouteObject.cleanup();
-              }
+              that.activeRouteObject && that.activeRouteObject.cleanup();
+
               that.activeRouteObject = new RouteObject(route, masterLayout, args);
             }
 
             var routeObject = that.activeRouteObject;
+            routeObject.rejectPromises();
             routeObject.routeCallback(route, args);
             routeObject.renderWith(route, masterLayout, args);
           }, function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d2a0c46e/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
index c86a8b9..4aa7676 100644
--- a/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
+++ b/src/fauxton/assets/js/plugins/backbone.fetch-cache.js
@@ -192,7 +192,7 @@
       }
 
       if (!opts.prefill) {
-        return deferred.promise();
+        return deferred;
       }
     }
 
@@ -206,7 +206,7 @@
       .fail( _.bind(deferred.reject, this, this) );
 
     // return a promise which provides the same methods as a jqXHR object
-    return deferred.promise();
+    return deferred;
   };
 
   // Override Model.prototype.sync and try to clear cache items if it looks
@@ -278,7 +278,7 @@
       }
 
       if (!opts.prefill) {
-        return deferred.promise();
+        return deferred;
       }
     }
 
@@ -292,7 +292,7 @@
       .fail( _.bind(deferred.reject, this, this) );
 
     // return a promise which provides the same methods as a jqXHR object
-    return deferred.promise();
+    return deferred;
   };
 
   // Prime the cache from localStorage on initialization


[45/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Cancel event propagation on replication swap.

Previous implementation called e.preventDefault() but did not stop upwards
propagation - the click event would therefore trigger navigation to the main
database panel. jQuery calls preventDefault and stopPropagation
when false is returned from an event handler so just do that here.


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

Branch: refs/heads/2041-update-ibrowse
Commit: b22f2a48c48f3cfa9b4c082cfee87b76e8d44c37
Parents: 72d6134
Author: Will Holley <wi...@gmail.com>
Authored: Fri Feb 28 15:07:13 2014 +0000
Committer: Will Holley <wi...@gmail.com>
Committed: Mon Mar 3 08:06:09 2014 +0000

----------------------------------------------------------------------
 src/fauxton/app/addons/replication/views.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b22f2a48/src/fauxton/app/addons/replication/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/views.js b/src/fauxton/app/addons/replication/views.js
index 1b31a9d..a19e609 100644
--- a/src/fauxton/app/addons/replication/views.js
+++ b/src/fauxton/app/addons/replication/views.js
@@ -175,7 +175,6 @@ function(app, FauxtonAPI, Components, replication) {
       this.startReplication(formJSON);
     },	
     swapFields: function(e){
-      e.preventDefault();
       //WALL O' VARIABLES
       var $fromSelect = this.$('#from_name'),
           $toSelect = this.$('#to_name'),
@@ -191,6 +190,9 @@ function(app, FauxtonAPI, Components, replication) {
 
       $fromInput.val(toInputVal);
       $toInput.val(fromInputVal);
+
+      // prevent other click handlers from running
+      return false;
     }
   });
 


[06/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Add more caching locations


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

Branch: refs/heads/2041-update-ibrowse
Commit: 8ec4cbc11e337555dd82e27e19c802bda3bcb817
Parents: ed89f34
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Feb 5 19:23:12 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Feb 5 19:23:12 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/databases/resources.js |  5 +++++
 src/fauxton/app/addons/databases/routes.js    |  2 +-
 src/fauxton/app/addons/databases/views.js     |  2 +-
 src/fauxton/app/addons/documents/views.js     | 21 +++------------------
 src/fauxton/app/core/base.js                  | 21 ++++++++++++++++++---
 src/fauxton/app/core/couchdbSession.js        | 11 +++++++++--
 6 files changed, 37 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/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 5fa931b..ea1aed2 100644
--- a/src/fauxton/app/addons/databases/resources.js
+++ b/src/fauxton/app/addons/databases/resources.js
@@ -171,6 +171,11 @@ function(app, FauxtonAPI, Documents) {
     documentation: function(){
       return "all_dbs";
     },
+
+    cache: {
+      expires: 60
+    },
+
     url: function(context) {
       if (context === "apiurl") { 
         return window.location.origin + "/_all_dbs";

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/src/fauxton/app/addons/databases/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/routes.js b/src/fauxton/app/addons/databases/routes.js
index c413018..131abf9 100644
--- a/src/fauxton/app/addons/databases/routes.js
+++ b/src/fauxton/app/addons/databases/routes.js
@@ -59,7 +59,7 @@ function(app, FauxtonAPI, Databases, Views) {
     },
 
     establish: function() {
-     return [this.databases.fetch()];
+     return [this.databases.fetchOnce()];
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/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 afe2d1c..7f23d65 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -61,7 +61,7 @@ function(app, Components, FauxtonAPI, Databases) {
       var deferred = FauxtonAPI.Deferred();
 
       FauxtonAPI.when(currentDBs.map(function(database) {
-        return database.status.fetch();
+        return database.status.fetchOnce();
       })).always(function(resp) {
         //make this always so that even if a user is not allowed access to a database
         //they will still see a list of all databases

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/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 5476203..13cbacb 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1804,30 +1804,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     template: "addons/documents/templates/changes",
 
     initialize: function () {
-      var that = this;
-      this.listenTo( this.model.changes, 'change', function () {
-        console.log('render on change'); 
-        that.render();
-      });
-      this.listenTo( this.model.changes, 'cachesync', function () {
-        console.log('render on cachesync'); 
-        that.render();
-      });
+      this.listenTo( this.model.changes, 'sync', this.render);
+      this.listenTo( this.model.changes, 'cachesync', this.render);
     },
 
     establish: function() {
-      return [ this.model.changes.fetchOnce({prefill: true,
-        success: function () {
-          console.log('hi ajax success');
-        },
-        prefillSuccess: function () {
-          console.log('hi prefill success');
-        }
-      })];
+      return [ this.model.changes.fetchOnce({prefill: true})];
     },
 
     serialize: function () {
-      console.log('ss');
       return {
         changes: this.model.changes.toJSON(),
         database: this.model

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/src/fauxton/app/core/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/base.js b/src/fauxton/app/core/base.js
index 6fe3261..24b89cf 100644
--- a/src/fauxton/app/core/base.js
+++ b/src/fauxton/app/core/base.js
@@ -17,7 +17,6 @@ define([
 ],
 
 function(Backbone, LayoutManager, BackboneCache) {
-  console.log(BackboneCache);
   var FauxtonAPI = {
     //add default objects
     router: {
@@ -81,8 +80,24 @@ function(Backbone, LayoutManager, BackboneCache) {
   var caching = {
     fetchOnce: function (opts) {
       var options = _.defaults(opts || {}, this.cache, {cache: true});
-      console.log('opts', options);
-      return this.fetch(options);
+
+      if (opts && !opts.cache) {
+        delete options.cache;
+      }
+
+      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
+
+      return promise;
     }
   };
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ec4cbc1/src/fauxton/app/core/couchdbSession.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/couchdbSession.js b/src/fauxton/app/core/couchdbSession.js
index 93bfd8a..b70ddf3 100644
--- a/src/fauxton/app/core/couchdbSession.js
+++ b/src/fauxton/app/core/couchdbSession.js
@@ -29,9 +29,16 @@ function (FauxtonAPI) {
 
       fetchUser: function (opt) {
         var that = this,
-        currentUser = this.user();
+            options = opt || {},
+        currentUser = this.user(),
+        fetch = this.fetchOnce;
 
-        return this.fetchOnce(opt).then(function () {
+        if (options.forceFetch) {
+          fetch = this.fetch;
+          Backbone.fetchCache.clearItem(_.result(this.url));
+        }
+
+        return this.fetch(opt).then(function () {
           var user = that.user();
 
           // Notify anyone listening on these events that either a user has changed


[50/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
ibrowse: update to 4.0.3

- for COUCHDB-2041
- should be re-pushed with amended VSN when upstream tags a release
-  ibrowse sha#108c131d at 20140306


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

Branch: refs/heads/2041-update-ibrowse
Commit: 948e7d9a66741b8178b154f3445620ee59ad28c1
Parents: 4e60f0b
Author: Dave Cottlehuber <dc...@apache.org>
Authored: Wed Jan 29 11:05:23 2014 +0100
Committer: Dave Cottlehuber <dc...@apache.org>
Committed: Fri Mar 7 00:16:38 2014 +0000

----------------------------------------------------------------------
 src/ibrowse/ibrowse.app.in          |   2 +-
 src/ibrowse/ibrowse.erl             |  51 +++++----
 src/ibrowse/ibrowse_http_client.erl | 190 ++++++++++++++++---------------
 src/ibrowse/ibrowse_lb.erl          |  28 +++--
 src/ibrowse/ibrowse_lib.erl         |   7 +-
 src/ibrowse/ibrowse_socks5.erl      | 143 ++++++++---------------
 6 files changed, 198 insertions(+), 223 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse.app.in
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse.app.in b/src/ibrowse/ibrowse.app.in
index 1d88084..813192b 100644
--- a/src/ibrowse/ibrowse.app.in
+++ b/src/ibrowse/ibrowse.app.in
@@ -1,6 +1,6 @@
 {application, ibrowse,
         [{description, "Erlang HTTP client application"},
-         {vsn, "4.0.1"},
+         {vsn, "4.0.3pre"},
          {registered, [ibrowse_sup, ibrowse]},
          {applications, [kernel,stdlib]},
 	 {env, []},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse.erl b/src/ibrowse/ibrowse.erl
index 80a4282..42030af 100644
--- a/src/ibrowse/ibrowse.erl
+++ b/src/ibrowse/ibrowse.erl
@@ -175,9 +175,11 @@ send_req(Url, Headers, Method) ->
 send_req(Url, Headers, Method, Body) ->
     send_req(Url, Headers, Method, Body, []).
 
-%% @doc Same as send_req/4. 
-%% For a description of SSL Options, look in the <a href="http://www.erlang.org/doc/apps/ssl/index.html">ssl</a> manpage. If the
-%% HTTP Version to use is not specified, the default is 1.1.
+%% @doc Same as send_req/4.
+
+%% For a description of SSL Options, look in the <a href="http://www.erlang.org/doc/apps/ssl/index.html">ssl</a> manpage.
+%% For a description of Process Options, look in the <a href="http://www.erlang.org/doc/man/gen_server.html">gen_server</a> manpage.
+%% If the HTTP Version to use is not specified, the default is 1.1.
 %% <br/>
 %% <ul>
 %% <li>The <code>host_header</code> option is useful in the case where ibrowse is
@@ -286,7 +288,8 @@ send_req(Url, Headers, Method, Body) ->
 %%          {headers_as_is, boolean()}         |
 %%          {give_raw_headers, boolean()}      |
 %%          {preserve_chunked_encoding,boolean()}     |
-%%          {workaround, head_response_with_body}
+%%          {workaround, head_response_with_body}     |
+%%          {worker_process_options, list()}
 %%
 %% stream_to() = process() | {process(), once}
 %% process() = pid() | atom()
@@ -340,10 +343,12 @@ try_routing_request(Lb_pid, Parsed_url,
                     Max_pipeline_size,
                     {SSLOptions, IsSSL}, 
                     Headers, Method, Body, Options_1, Timeout, Try_count) when Try_count < 3 ->
+    ProcessOptions = get_value(worker_process_options, Options_1, []),
     case ibrowse_lb:spawn_connection(Lb_pid, Parsed_url,
                                              Max_sessions, 
                                              Max_pipeline_size,
-                                             {SSLOptions, IsSSL}) of
+                                             {SSLOptions, IsSSL},
+                                             ProcessOptions) of
         {ok, Conn_Pid} ->
             case do_send_req(Conn_Pid, Parsed_url, Headers,
                              Method, Body, Options_1, Timeout) of
@@ -438,6 +443,8 @@ do_send_req(Conn_Pid, Parsed_url, Headers, Method, Body, Options, Timeout) ->
             {error, sel_conn_closed};
         {'EXIT', {normal, _}} ->
             {error, req_timedout};
+        {'EXIT', {connection_closed, _}} ->
+            {error, sel_conn_closed};
         {error, connection_closed} ->
             {error, sel_conn_closed};
         {'EXIT', Reason} ->
@@ -470,28 +477,32 @@ ensure_bin({Fun, _} = Body) when is_function(Fun) -> Body.
 %% request is sent via any of the send_req_direct/4,5,6,7 functions.<br/>
 %% <b>Note:</b> It is the responsibility of the calling process to control
 %% pipeline size on such connections.
-%%
-%% @spec spawn_worker_process(Url::string()) -> {ok, pid()}
-spawn_worker_process(Url) ->
-    ibrowse_http_client:start(Url).
 
-%% @doc Same as spawn_worker_process/1 but takes as input a Host and Port
-%% instead of a URL.
+%% @spec spawn_worker_process(Url::string() | {Host::string(), Port::integer()}) -> {ok, pid()}
+spawn_worker_process(Args) ->
+    spawn_worker_process(Args, []).
+
+%% @doc Same as spawn_worker_process/1 except with Erlang process options.
 %% @spec spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
-spawn_worker_process(Host, Port) ->
-    ibrowse_http_client:start({Host, Port}).
+spawn_worker_process(Host, Port) when is_list(Host), is_integer(Port) ->
+    %% Convert old API calls to new API format.
+    spawn_worker_process({Host, Port}, []);
+spawn_worker_process(Args, Options) ->
+    ibrowse_http_client:start(Args, Options).
 
 %% @doc Same as spawn_worker_process/1 except the the calling process
 %% is linked to the worker process which is spawned.
-%% @spec spawn_link_worker_process(Url::string()) -> {ok, pid()}
-spawn_link_worker_process(Url) ->
-    ibrowse_http_client:start_link(Url).
+%% @spec spawn_link_worker_process(Url::string() | {Host::string(), Port::integer()}) -> {ok, pid()}
+spawn_link_worker_process(Args) ->
+    spawn_link_worker_process(Args, []).
 
-%% @doc Same as spawn_worker_process/2 except the the calling process
-%% is linked to the worker process which is spawned.
+%% @doc Same as spawn_link_worker_process/1 except with Erlang process options.
 %% @spec spawn_link_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
-spawn_link_worker_process(Host, Port) ->
-    ibrowse_http_client:start_link({Host, Port}).
+spawn_link_worker_process(Host, Port) when is_list(Host), is_integer(Port) ->
+    %% Convert old API calls to new API format.
+    spawn_link_worker_process({Host, Port}, []);
+spawn_link_worker_process(Args, Options) ->
+    ibrowse_http_client:start_link(Args, Options).
 
 %% @doc Terminate a worker process spawned using
 %% spawn_worker_process/2 or spawn_link_worker_process/2. Requests in

http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse_http_client.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse_http_client.erl b/src/ibrowse/ibrowse_http_client.erl
index a1cf6eb..0410c08 100644
--- a/src/ibrowse/ibrowse_http_client.erl
+++ b/src/ibrowse/ibrowse_http_client.erl
@@ -15,7 +15,9 @@
 %% External exports
 -export([
          start_link/1,
+         start_link/2,
          start/1,
+         start/2,
          stop/1,
          send_req/7
         ]).
@@ -39,8 +41,7 @@
 
 -record(state, {host, port, connect_timeout,
                 inactivity_timer_ref,
-                use_http_proxy = false, http_proxy_auth_digest,
-                socks5_host, socks5_port, socks5_user, socks5_password,
+                use_proxy = false, proxy_auth_digest,
                 ssl_options = [], is_ssl = false, socket,
                 proxy_tunnel_setup = false,
                 tunnel_setup_queue = [],
@@ -80,10 +81,16 @@
 %% Description: Starts the server
 %%--------------------------------------------------------------------
 start(Args) ->
-    gen_server:start(?MODULE, Args, []).
+    start(Args, []).
+
+start(Args, Options) ->
+    gen_server:start(?MODULE, Args, Options).
 
 start_link(Args) ->
-    gen_server:start_link(?MODULE, Args, []).
+    start_link(Args, []).
+
+start_link(Args, Options) ->
+    gen_server:start_link(?MODULE, Args, Options).
 
 stop(Conn_pid) ->
     case catch gen_server:call(Conn_pid, stop) of
@@ -187,7 +194,7 @@ handle_info({ssl, _Sock, Data}, State) ->
 
 handle_info({stream_next, Req_id}, #state{socket = Socket,
                                           cur_req = #request{req_id = Req_id}} = State) ->
-    do_setopts(Socket, [{active, once}], State),
+    _ = do_setopts(Socket, [{active, once}], State),
     {noreply, set_inac_timer(State)};
 
 handle_info({stream_next, _Req_id}, State) ->
@@ -208,11 +215,11 @@ handle_info({stream_close, _Req_id}, State) ->
 handle_info({tcp_closed, _Sock}, State) ->
     do_trace("TCP connection closed by peer!~n", []),
     handle_sock_closed(State),
-    {stop, normal, State};
+    {stop, connection_closed, State};
 handle_info({ssl_closed, _Sock}, State) ->
     do_trace("SSL connection closed by peer!~n", []),
     handle_sock_closed(State),
-    {stop, normal, State};
+    {stop, connection_closed, State};
 
 handle_info({tcp_error, _Sock, Reason}, State) ->
     do_trace("Error on connection to ~1000.p:~1000.p -> ~1000.p~n",
@@ -226,12 +233,12 @@ handle_info({ssl_error, _Sock, Reason}, State) ->
     {stop, normal, State};
 
 handle_info({req_timedout, From}, State) ->
-    case lists:keymember(From, #request.from, queue:to_list(State#state.reqs)) of
+    case lists:keysearch(From, #request.from, queue:to_list(State#state.reqs)) of
         false ->
             {noreply, State};
-        true ->
+        {value, #request{stream_to = StreamTo, req_id = ReqId}} ->
+            catch StreamTo ! {ibrowse_async_response_timeout, ReqId},
             shutting_down(State),
-%%            do_error_reply(State, req_timedout),
             {stop, normal, State}
     end;
 
@@ -288,12 +295,12 @@ handle_sock_data(Data, #state{status = get_header}=State) ->
             shutting_down(State),
             {stop, normal, State};
         #state{socket = Socket, status = Status, cur_req = CurReq} = State_1 ->
-            case {Status, CurReq} of
-                {get_header, #request{caller_controls_socket = true}} ->
-                    do_setopts(Socket, [{active, once}], State_1);
-                _ ->
-                    active_once(State_1)
-            end,
+            _ = case {Status, CurReq} of
+		    {get_header, #request{caller_controls_socket = true}} ->
+			do_setopts(Socket, [{active, once}], State_1);
+		    _ ->
+			active_once(State_1)
+		end,
             {noreply, set_inac_timer(State_1)}
     end;
 
@@ -312,7 +319,7 @@ handle_sock_data(Data, #state{status           = get_body,
                                             {error, {Reason, {stat_code, StatCode}, Headers}}),
                     {stop, normal, State};
                 State_1 ->
-                    active_once(State_1),
+                    _ = active_once(State_1),
                     State_2 = set_inac_timer(State_1),
                     {noreply, State_2}
             end;
@@ -325,14 +332,14 @@ handle_sock_data(Data, #state{status           = get_body,
                     {stop, normal, State};
                 #state{cur_req = #request{caller_controls_socket = Ccs},
                        interim_reply_sent = Irs} = State_1 ->
-                    case Irs of
-                        true ->
-                            active_once(State_1);
-                        false when Ccs == true ->
-                            do_setopts(Socket, [{active, once}], State);
-                        false ->
-                            active_once(State_1)
-                    end,
+                    _ = case Irs of
+			    true ->
+				active_once(State_1);
+			    false when Ccs == true ->
+				do_setopts(Socket, [{active, once}], State);
+			    false ->
+				active_once(State_1)
+			end,
                     State_2 = State_1#state{interim_reply_sent = false},
                     case Ccs of
                     true ->
@@ -342,7 +349,7 @@ handle_sock_data(Data, #state{status           = get_body,
                         {noreply, set_inac_timer(State_2)}
                     end;
                 State_1 ->
-                    active_once(State_1),
+                    _ = active_once(State_1),
                     State_2 = set_inac_timer(State_1),
                     {noreply, State_2}
             end
@@ -489,25 +496,19 @@ handle_sock_closed(#state{reply_buffer = Buf, reqs = Reqs, http_status_code = SC
             State
     end.
 
-do_connect(Host, Port, Options, #state{socks5_host = SocksHost}=State, Timeout)
-  when SocksHost /= undefined ->
-    ProxyOptions = [
-        {user,     State#state.socks5_user},
-        {password, State#state.socks5_password},
-        {host,     SocksHost},
-        {port,     State#state.socks5_port},
-        {is_ssl,   State#state.is_ssl},
-        {ssl_opts, State#state.ssl_options}],
-    ibrowse_socks5:connect(Host, Port, ProxyOptions,
-                           get_sock_options(SocksHost, Options, []),
-                           Timeout);
-do_connect(Host, Port, Options, #state{is_ssl         = true,
-                                       use_http_proxy = false,
-                                       ssl_options    = SSLOptions},
+do_connect(Host, Port, Options, #state{is_ssl      = true,
+                                       use_proxy   = false,
+                                       ssl_options = SSLOptions},
            Timeout) ->
     ssl:connect(Host, Port, get_sock_options(Host, Options, SSLOptions), Timeout);
 do_connect(Host, Port, Options, _State, Timeout) ->
-    gen_tcp:connect(Host, Port, get_sock_options(Host, Options, []), Timeout).
+    Socks5Host = get_value(socks5_host, Options, undefined),
+    case Socks5Host of
+      undefined ->
+        gen_tcp:connect(Host, Port, get_sock_options(Host, Options, []), Timeout);
+      _ ->
+        catch ibrowse_socks5:connect(Host, Port, Options)
+    end.
 
 get_sock_options(Host, Options, SSLOptions) ->
     Caller_socket_options = get_value(socket_options, Options, []),
@@ -554,7 +555,7 @@ filter_sock_options(Opts) ->
 
 do_send(Req, #state{socket = Sock,
                     is_ssl = true,
-                    use_http_proxy = true,
+                    use_proxy = true,
                     proxy_tunnel_setup = Pts}) when Pts /= done ->  gen_tcp:send(Sock, Req);
 do_send(Req, #state{socket = Sock, is_ssl = true})  ->  ssl:send(Sock, Req);
 do_send(Req, #state{socket = Sock, is_ssl = false}) ->  gen_tcp:send(Sock, Req).
@@ -578,16 +579,16 @@ do_send_body1(Source, Resp, State, TE) ->
                 {ok, Data} when Data == []; Data == <<>> ->
                         do_send_body({Source}, State, TE);
         {ok, Data} ->
-            do_send(maybe_chunked_encode(Data, TE), State),
+            _ = do_send(maybe_chunked_encode(Data, TE), State),
             do_send_body({Source}, State, TE);
                 {ok, Data, New_source_state} when Data == []; Data == <<>> ->
                         do_send_body({Source, New_source_state}, State, TE);
         {ok, Data, New_source_state} ->
-            do_send(maybe_chunked_encode(Data, TE), State),
+            _ = do_send(maybe_chunked_encode(Data, TE), State),
             do_send_body({Source, New_source_state}, State, TE);
         eof when TE == true ->
-            do_send(<<"0\r\n\r\n">>, State),
-            ok;
+            _ = do_send(<<"0\r\n\r\n">>, State),
+	    ok;
         eof ->
             ok;
         Err ->
@@ -602,7 +603,7 @@ maybe_chunked_encode(Data, true) ->
 do_close(#state{socket = undefined})            ->  ok;
 do_close(#state{socket = Sock,
                 is_ssl = true,
-                use_http_proxy = true,
+                use_proxy = true,
                 proxy_tunnel_setup = Pts
                }) when Pts /= done ->  catch gen_tcp:close(Sock);
 do_close(#state{socket = Sock, is_ssl = true})  ->  catch ssl:close(Sock);
@@ -611,11 +612,11 @@ do_close(#state{socket = Sock, is_ssl = false}) ->  catch gen_tcp:close(Sock).
 active_once(#state{cur_req = #request{caller_controls_socket = true}}) ->
     ok;
 active_once(#state{socket = Socket} = State) ->
-    do_setopts(Socket, [{active, once}], State).
+    _ = do_setopts(Socket, [{active, once}], State).
 
 do_setopts(_Sock, [],   _)    ->  ok;
 do_setopts(Sock, Opts, #state{is_ssl = true,
-                              use_http_proxy = true,
+                              use_proxy = true,
                               proxy_tunnel_setup = Pts}
                              ) when Pts /= done ->  inet:setopts(Sock, Opts);
 do_setopts(Sock, Opts, #state{is_ssl = true}) -> ssl:setopts(Sock, Opts);
@@ -634,28 +635,17 @@ send_req_1(From,
                 port = Port} = Url,
            Headers, Method, Body, Options, Timeout,
            #state{socket = undefined} = State) ->
-    ProxyHost = get_value(proxy_host, Options, false),
-    ProxyProtocol = get_value(proxy_protocol, Options, http),
     {Host_1, Port_1, State_1} =
-        case {ProxyHost, ProxyProtocol} of
-            {false, _} ->
+        case get_value(proxy_host, Options, false) of
+            false ->
                 {Host, Port, State};
-            {_, http} ->
+            PHost ->
                 ProxyUser     = get_value(proxy_user, Options, []),
                 ProxyPassword = get_value(proxy_password, Options, []),
                 Digest        = http_auth_digest(ProxyUser, ProxyPassword),
-                {ProxyHost, get_value(proxy_port, Options, 80),
-                 State#state{use_http_proxy = true,
-                             http_proxy_auth_digest = Digest}};
-            {_, socks5} ->
-                ProxyUser     = list_to_binary(get_value(proxy_user, Options, [])),
-                ProxyPassword = list_to_binary(get_value(proxy_password, Options, [])),
-                ProxyPort = get_value(proxy_port, Options, 1080),
-                {Host, Port,
-                 State#state{socks5_host = ProxyHost,
-                             socks5_port = ProxyPort,
-                             socks5_user = ProxyUser,
-                             socks5_password = ProxyPassword}}
+                {PHost, get_value(proxy_port, Options, 80),
+                 State#state{use_proxy = true,
+                             proxy_auth_digest = Digest}}
         end,
     State_2 = check_ssl_options(Options, State_1),
     do_trace("Connecting...~n", []),
@@ -686,7 +676,7 @@ send_req_1(From,
            Headers, Method, Body, Options, Timeout,
            #state{
                   proxy_tunnel_setup = false,
-                  use_http_proxy = true,
+                  use_proxy = true,
                   is_ssl    = true} = State) ->
     Ref = case Timeout of
               infinity ->
@@ -713,7 +703,7 @@ send_req_1(From,
             case do_send_body(Body_1, State_1, TE) of
                 ok ->
                     trace_request_body(Body_1),
-                    active_once(State_1),
+                    _ = active_once(State_1),
                     State_1_1 = inc_pipeline_counter(State_1),
                     State_2 = State_1_1#state{status     = get_header,
                                               cur_req    = NewReq,
@@ -796,7 +786,7 @@ send_req_1(From,
                                  AbsPath, RelPath, Body, Options, State_1,
                                  ReqId),
     trace_request(Req),
-    do_setopts(Socket, Caller_socket_options, State_1),
+    _ = do_setopts(Socket, Caller_socket_options, State_1),
     TE = is_chunked_encoding_specified(Options),
     case do_send(Req, State_1) of
         ok ->
@@ -804,7 +794,7 @@ send_req_1(From,
                 ok ->
                     trace_request_body(Body_1),
                     State_2 = inc_pipeline_counter(State_1),
-                    active_once(State_2),
+                    _ = active_once(State_2),
                     State_3 = case Status of
                                   idle ->
                                       State_2#state{status     = get_header,
@@ -874,11 +864,11 @@ add_auth_headers(#url{username = User,
                 end,
     add_proxy_auth_headers(State, Headers_1).
 
-add_proxy_auth_headers(#state{use_http_proxy = false}, Headers) ->
+add_proxy_auth_headers(#state{use_proxy = false}, Headers) ->
     Headers;
-add_proxy_auth_headers(#state{http_proxy_auth_digest = []}, Headers) ->
+add_proxy_auth_headers(#state{proxy_auth_digest = []}, Headers) ->
     Headers;
-add_proxy_auth_headers(#state{http_proxy_auth_digest = Auth_digest}, Headers) ->
+add_proxy_auth_headers(#state{proxy_auth_digest = Auth_digest}, Headers) ->
     [{"Proxy-Authorization", ["Basic ", Auth_digest]} | Headers].
 
 http_auth_digest([], []) ->
@@ -887,7 +877,7 @@ http_auth_digest(Username, Password) ->
     ibrowse_lib:encode_base64(Username ++ [$: | Password]).
 
 make_request(Method, Headers, AbsPath, RelPath, Body, Options,
-             #state{use_http_proxy = UseHttpProxy, is_ssl = Is_ssl}, ReqId) ->
+             #state{use_proxy = UseProxy, is_ssl = Is_ssl}, ReqId) ->
     HttpVsn = http_vsn_string(get_value(http_vsn, Options, {1,1})),
     Fun1 = fun({X, Y}) when is_atom(X) ->
                    {to_lower(atom_to_list(X)), X, Y};
@@ -930,7 +920,7 @@ make_request(Method, Headers, AbsPath, RelPath, Body, Options,
                         Headers_2
                 end,
     Headers_4 = cons_headers(Headers_3),
-    Uri = case get_value(use_absolute_uri, Options, false) or UseHttpProxy of
+    Uri = case get_value(use_absolute_uri, Options, false) or UseProxy of
               true ->
                   case Is_ssl of
                       true ->
@@ -1061,7 +1051,9 @@ parse_response(Data, #state{reply_buffer = Acc, reqs = Reqs,
                                             http_status_code=StatCode}
                       end,
             put(conn_close, ConnClose),
-            TransferEncoding = to_lower(get_value("transfer-encoding", LCHeaders, "false")),
+            TransferEncodings = to_lower(get_value("transfer-encoding", LCHeaders, "false")),
+            IsChunked = lists:any(fun(Enc) -> string:strip(Enc) =:= "chunked" end,
+                                  string:tokens(TransferEncodings, ",")),
             Head_response_with_body = lists:member({workaround, head_response_with_body}, Options),
             case get_value("content-length", LCHeaders, undefined) of
                 _ when Method == connect,
@@ -1112,7 +1104,7 @@ parse_response(Data, #state{reply_buffer = Acc, reqs = Reqs,
                     State_2 = reset_state(State_1_1),
                     State_3 = set_cur_request(State_2#state{reqs = Reqs_1}),
                     parse_response(Data_1, State_3);
-                _ when TransferEncoding =:= "chunked" ->
+                _ when IsChunked ->
                     do_trace("Chunked encoding detected...~n",[]),
                     send_async_headers(ReqId, StreamTo, Give_raw_headers, State_1),
                     case parse_11_response(Data_1, State_1#state{transfer_encoding=chunked,
@@ -1130,6 +1122,25 @@ parse_response(Data, #state{reply_buffer = Acc, reqs = Reqs,
                                ConnClose =:= "close" ->
                     send_async_headers(ReqId, StreamTo, Give_raw_headers, State_1),
                     State_1#state{reply_buffer = Data_1};
+                undefined when StatCode =:= "303" ->
+                    %% Some servers send 303 requests without a body.
+                    %% RFC2616 says that they SHOULD, but they dont.
+                    case ibrowse:get_config_value(allow_303_with_no_body, false) of
+                      false -> 
+                        fail_pipelined_requests(State_1,
+                                            {error, {content_length_undefined,
+                                                     {stat_code, StatCode}, Headers}}),
+                       {error, content_length_undefined};
+                      true -> 
+                        {_, Reqs_1} = queue:out(Reqs),
+                        send_async_headers(ReqId, StreamTo, Give_raw_headers, State_1),
+                        State_1_1 = do_reply(State_1, From, StreamTo, ReqId, Resp_format,
+                                             {ok, StatCode, Headers_1, []}),
+                        cancel_timer(T_ref, {eat_message, {req_timedout, From}}),
+                        State_2 = reset_state(State_1_1),
+                        State_3 = set_cur_request(State_2#state{reqs = Reqs_1}),
+                        parse_response(Data_1, State_3)
+                    end;
                 undefined ->
                     fail_pipelined_requests(State_1,
                                             {error, {content_length_undefined,
@@ -1407,12 +1418,8 @@ set_cur_request(#state{reqs = Reqs, socket = Socket} = State) ->
         empty ->
             State#state{cur_req = undefined};
         {value, #request{caller_controls_socket = Ccs} = NextReq} ->
-            case Ccs of
-                true ->
-                    do_setopts(Socket, [{active, once}], State);
-                _ ->
-                    ok
-            end,
+            _ = Ccs =:= true
+		andalso do_setopts(Socket, [{active, once}], State),
             State#state{cur_req = NextReq}
     end.
 
@@ -1586,6 +1593,7 @@ get_crlf_pos(<<>>, _)                     -> no.
 fmt_val(L) when is_list(L)    -> L;
 fmt_val(I) when is_integer(I) -> integer_to_list(I);
 fmt_val(A) when is_atom(A)    -> atom_to_list(A);
+fmt_val(B) when is_binary(B)    -> B;
 fmt_val(Term)                 -> io_lib:format("~p", [Term]).
 
 crnl() -> "\r\n".
@@ -1863,13 +1871,13 @@ dec_pipeline_counter(#state{lb_ets_tid = undefined} = State) ->
     State;
 dec_pipeline_counter(#state{cur_pipeline_size = Pipe_sz,
                             lb_ets_tid = Tid} = State) ->
-    try
-        update_counter(Tid, self(), {2,-1,0,0}),
-        update_counter(Tid, self(), {3,-1,0,0})
-    catch
-        _:_ ->
-            ok
-    end,
+    _ = try
+	    update_counter(Tid, self(), {2,-1,0,0}),
+	    update_counter(Tid, self(), {3,-1,0,0})
+	catch
+	    _:_ ->
+		ok
+	end,
     State#state{cur_pipeline_size = Pipe_sz - 1}.
 
 flatten([H | _] = L) when is_integer(H) ->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse_lb.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse_lb.erl b/src/ibrowse/ibrowse_lb.erl
index d98cf32..f5a9aef 100644
--- a/src/ibrowse/ibrowse_lb.erl
+++ b/src/ibrowse/ibrowse_lb.erl
@@ -16,7 +16,7 @@
 %% External exports
 -export([
 	 start_link/1,
-	 spawn_connection/5,
+	 spawn_connection/6,
          stop/1
 	]).
 
@@ -81,13 +81,14 @@ init([Host, Port]) ->
 spawn_connection(Lb_pid, Url,
 		 Max_sessions,
 		 Max_pipeline_size,
-		 SSL_options)
+		 SSL_options,
+		 Process_options)
   when is_pid(Lb_pid),
        is_record(Url, url),
        is_integer(Max_pipeline_size),
        is_integer(Max_sessions) ->
     gen_server:call(Lb_pid,
-		    {spawn_connection, Url, Max_sessions, Max_pipeline_size, SSL_options}).
+		    {spawn_connection, Url, Max_sessions, Max_pipeline_size, SSL_options, Process_options}).
 
 stop(Lb_pid) ->
     case catch gen_server:call(Lb_pid, stop) of
@@ -123,19 +124,19 @@ handle_call(_, _From, #state{proc_state = shutting_down} = State) ->
     {reply, {error, shutting_down}, State};
 
 %% Update max_sessions in #state with supplied value
-handle_call({spawn_connection, _Url, Max_sess, Max_pipe, _}, _From,
-	    #state{num_cur_sessions = Num} = State) 
+handle_call({spawn_connection, _Url, Max_sess, Max_pipe, _, _}, _From,
+	    #state{num_cur_sessions = Num} = State)
     when Num >= Max_sess ->
     State_1 = maybe_create_ets(State),
     Reply = find_best_connection(State_1#state.ets_tid, Max_pipe),
     {reply, Reply, State_1#state{max_sessions = Max_sess,
                                  max_pipeline_size = Max_pipe}};
 
-handle_call({spawn_connection, Url, Max_sess, Max_pipe, SSL_options}, _From,
+handle_call({spawn_connection, Url, Max_sess, Max_pipe, SSL_options, Process_options}, _From,
 	    #state{num_cur_sessions = Cur} = State) ->
     State_1 = maybe_create_ets(State),
     Tid = State_1#state.ets_tid,
-    {ok, Pid} = ibrowse_http_client:start_link({Tid, Url, SSL_options}),
+    {ok, Pid} = ibrowse_http_client:start_link({Tid, Url, SSL_options}, Process_options),
     ets:insert(Tid, {Pid, 0, 0}),
     {reply, {ok, Pid}, State_1#state{num_cur_sessions = Cur + 1,
                                      max_sessions = Max_sess,
@@ -230,7 +231,9 @@ code_change(_OldVsn, State, _Extra) ->
 %%% Internal functions
 %%--------------------------------------------------------------------
 find_best_connection(Tid, Max_pipe) ->
+    ets:safe_fixtable(Tid, true),
     Res = find_best_connection(ets:first(Tid), Tid, Max_pipe),
+    ets:safe_fixtable(Tid, false),
     Res.
 
 find_best_connection('$end_of_table', _, _) ->
@@ -239,9 +242,14 @@ find_best_connection(Pid, Tid, Max_pipe) ->
     case ets:lookup(Tid, Pid) of
         [{Pid, Cur_sz, Speculative_sz}] when Cur_sz < Max_pipe,
                                              Speculative_sz < Max_pipe ->
-            ets:update_counter(Tid, Pid, {3, 1, 9999999, 9999999}),
-            {ok, Pid};
-        _ ->
+            case catch ets:update_counter(Tid, Pid, {3, 1, 9999999, 9999999}) of
+                {'EXIT', _} ->
+                    %% The selected process has shutdown
+                    find_best_connection(ets:next(Tid, Pid), Tid, Max_pipe);
+                _ ->
+                    {ok, Pid}
+            end;
+         _ ->
             find_best_connection(ets:next(Tid, Pid), Tid, Max_pipe)
     end.
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse_lib.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse_lib.erl b/src/ibrowse/ibrowse_lib.erl
index 7b12cb3..1ce6bd4 100644
--- a/src/ibrowse/ibrowse_lib.erl
+++ b/src/ibrowse/ibrowse_lib.erl
@@ -362,10 +362,9 @@ parse_url([], get_password, Url, TmpAcc) ->
 parse_url([], State, Url, TmpAcc) ->
     {invalid_uri_2, State, Url, TmpAcc}.
 
-default_port(socks5) -> 1080;
-default_port(http)   -> 80;
-default_port(https)  -> 443;
-default_port(ftp)    -> 21.
+default_port(http)  -> 80;
+default_port(https) -> 443;
+default_port(ftp)   -> 21.
 
 printable_date() ->
     {{Y,Mo,D},{H, M, S}} = calendar:local_time(),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/948e7d9a/src/ibrowse/ibrowse_socks5.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse/ibrowse_socks5.erl b/src/ibrowse/ibrowse_socks5.erl
index d00df44..e6d8913 100644
--- a/src/ibrowse/ibrowse_socks5.erl
+++ b/src/ibrowse/ibrowse_socks5.erl
@@ -1,109 +1,58 @@
-% 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.
-
 -module(ibrowse_socks5).
 
--define(VERSION, 5).
--define(CONNECT, 1).
+-include_lib("kernel/src/inet_dns.hrl").
 
--define(NO_AUTH, 0).
--define(USERPASS, 2).
--define(UNACCEPTABLE, 16#FF).
--define(RESERVED, 0).
+-export([connect/3]).
 
--define(ATYP_IPV4, 1).
--define(ATYP_DOMAINNAME, 3).
--define(ATYP_IPV6, 4).
+-define(TIMEOUT, 2000).
 
--define(SUCCEEDED, 0).
+-define(SOCKS5, 5).
+-define(AUTH_METHOD_NO, 0).
+-define(AUTH_METHOD_USERPASS, 2).
+-define(ADDRESS_TYPE_IP4, 1).
+-define(COMMAND_TYPE_TCPIP_STREAM, 1).
+-define(RESERVER, 0).
+-define(STATUS_GRANTED, 0).
 
--export([connect/5]).
+-define(DNS_IP, {8,8,8,8}).
 
--import(ibrowse_lib, [get_value/2, get_value/3]).
+connect(Host, Port, Options) ->
+    Socks5Host = proplists:get_value(socks5_host, Options),
+    Socks5Port = proplists:get_value(socks5_port, Options),
 
-connect(TargetHost, TargetPort, ProxyOptions, Options, Timeout) ->
-    case gen_tcp:connect(get_value(host, ProxyOptions),
-                         get_value(port, ProxyOptions),
-                         Options, Timeout) of
-        {ok, Socket} ->
-            case handshake(Socket, Options) of
-                ok ->
-                    case connect(TargetHost, TargetPort, Socket) of
-                        ok ->
-                            maybe_ssl(Socket, ProxyOptions, Timeout);
-                        Else ->
-                            gen_tcp:close(Socket),
-                            Else
-                    end;
-                Else ->
-                    gen_tcp:close(Socket),
-                    Else
-            end;
-        Else ->
-            Else
-    end.
+    {ok, Socket} = gen_tcp:connect(Socks5Host, Socks5Port, [binary, {packet, 0}, {keepalive, true}, {active, false}]),
 
-handshake(Socket, ProxyOptions) when is_port(Socket) ->
-    {Handshake, Success} = case get_value(user, ProxyOptions, <<>>) of
-        <<>> ->
-            {<<?VERSION, 1, ?NO_AUTH>>, ?NO_AUTH};
-        User ->
-            Password = get_value(password, ProxyOptions, <<>>),
-            {<<?VERSION, 1, ?USERPASS, (byte_size(User)), User,
-               (byte_size(Password)), Password>>, ?USERPASS}
-    end,
-    ok = gen_tcp:send(Socket, Handshake),
-    case gen_tcp:recv(Socket, 0) of
-        {ok, <<?VERSION, Success>>} ->
-            ok;
-        {ok, <<?VERSION, ?UNACCEPTABLE>>} ->
-            {error, unacceptable};
-        {error, Reason} ->
-            {error, Reason}
-    end.
+    {ok, _Bin} =
+    case proplists:get_value(socks5_user, Options, undefined) of
+        undefined ->
+            ok = gen_tcp:send(Socket, <<?SOCKS5, 1, ?AUTH_METHOD_NO>>),
+            {ok, <<?SOCKS5, ?AUTH_METHOD_NO>>} = gen_tcp:recv(Socket, 2, ?TIMEOUT);
+        _Else ->
+            Socks5User = list_to_binary(proplists:get_value(socks5_user, Options)),
+            Socks5Pass = list_to_binary(proplists:get_value(socks5_pass, Options)),
+
+            ok = gen_tcp:send(Socket, <<?SOCKS5, 1, ?AUTH_METHOD_USERPASS>>),
+            {ok, <<?SOCKS5, ?AUTH_METHOD_USERPASS>>} = gen_tcp:recv(Socket, 2, ?TIMEOUT),
 
-connect(Host, Port, Via) when is_list(Host) ->
-    connect(list_to_binary(Host), Port, Via);
-connect(Host, Port, Via) when is_binary(Host), is_integer(Port),
-                              is_port(Via) ->
-    ok = gen_tcp:send(Via,
-        <<?VERSION, ?CONNECT, ?RESERVED, ?ATYP_DOMAINNAME,
-          (byte_size(Host)), Host/binary,
-          (Port):16>>),
-    case gen_tcp:recv(Via, 0) of
-        {ok, <<?VERSION, ?SUCCEEDED, ?RESERVED, _/binary>>} ->
-            ok;
-        {ok, <<?VERSION, Rep, ?RESERVED, _/binary>>} ->
-            {error, rep(Rep)};
-        {error, Reason} ->
-            {error, Reason}
-    end.
+            UserLength = byte_size(Socks5User),
 
-maybe_ssl(Socket, ProxyOptions, Timeout) ->
-    IsSsl = get_value(is_ssl, ProxyOptions, false),
-    SslOpts = get_value(ssl_opts, ProxyOptions, []),
-    case IsSsl of
-        false ->
-            {ok, Socket};
-        true ->
-            ssl:connect(Socket, SslOpts, Timeout)
-    end.
+            ok = gen_tcp:send(Socket, << 1, UserLength >>),
+            ok = gen_tcp:send(Socket, Socks5User),
+            PassLength = byte_size(Socks5Pass),
+            ok = gen_tcp:send(Socket, << PassLength >>),
+            ok = gen_tcp:send(Socket, Socks5Pass),
+            {ok, <<1, 0>>} = gen_tcp:recv(Socket, 2, ?TIMEOUT)
+    end,
+
+    {IP1,IP2,IP3,IP4} = case inet_parse:address(Host) of
+        {ok, IP} ->
+            IP;
+        _Other ->
+            {ok, NsData} = inet_res:nslookup(Host, in, a, [{?DNS_IP, 53}]),
+            [Addr | _NewAnList] = [D || #dns_rr{data=D, type=a} <- NsData#dns_rec.anlist],
+            Addr
+    end,
 
-rep(0) -> succeeded;
-rep(1) -> server_fail;
-rep(2) -> disallowed_by_ruleset;
-rep(3) -> network_unreachable;
-rep(4) -> host_unreachable;
-rep(5) -> connection_refused;
-rep(6) -> ttl_expired;
-rep(7) -> command_not_supported;
-rep(8) -> address_type_not_supported.
+    ok = gen_tcp:send(Socket, <<?SOCKS5, ?COMMAND_TYPE_TCPIP_STREAM, ?RESERVER, ?ADDRESS_TYPE_IP4, IP1, IP2, IP3, IP4, Port:16>>),
+    {ok, << ?SOCKS5, ?STATUS_GRANTED, ?RESERVER, ?ADDRESS_TYPE_IP4, IP1, IP2, IP3, IP4, Port:16 >>} = gen_tcp:recv(Socket, 10, ?TIMEOUT),
+    {ok, Socket}.


[47/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
remove warning when running `grunt dev`

This removes the warning 'path.existsSync is now called
fs.existsSync'. Now having one require at the top of the file,
as module.require caches requires anyway.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 0782a44ce6f54aa553e014acfa3bb11448c0682e
Parents: 77724c9
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Mar 5 20:34:02 2014 +0100
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Mar 5 20:38:43 2014 +0100

----------------------------------------------------------------------
 src/fauxton/tasks/fauxton.js | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0782a44c/src/fauxton/tasks/fauxton.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/fauxton.js b/src/fauxton/tasks/fauxton.js
index e54bab8..e06e7dc 100644
--- a/src/fauxton/tasks/fauxton.js
+++ b/src/fauxton/tasks/fauxton.js
@@ -11,7 +11,8 @@
 // the License.
 
 module.exports = function(grunt) {
-  var _ = grunt.util._;
+  var _ = grunt.util._,
+      fs = require('fs');
 
   grunt.registerMultiTask('template', 'generates an html file from a specified template', function(){
     var data = this.data,
@@ -24,11 +25,10 @@ module.exports = function(grunt) {
   grunt.registerMultiTask('get_deps', 'Fetch external dependencies', function(version) {
     grunt.log.writeln("Fetching external dependencies");
 
-    var path = require('path');
-        done = this.async(),
+    var done = this.async(),
         data = this.data,
         target = data.target || "app/addons/",
-        settingsFile = path.existsSync(data.src) ? data.src : "settings.json.default",
+        settingsFile = fs.existsSync(data.src) ? data.src : "settings.json.default",
         settings = grunt.file.readJSON(settingsFile),
         _ = grunt.util._;
 
@@ -76,10 +76,9 @@ module.exports = function(grunt) {
   });
 
   grunt.registerMultiTask('gen_load_addons', 'Generate the load_addons.js file', function() {
-    var path = require('path');
-        data = this.data,
+    var data = this.data,
         _ = grunt.util._,
-        settingsFile = path.existsSync(data.src) ? data.src : "settings.json.default",
+        settingsFile = fs.existsSync(data.src) ? data.src : "settings.json.default",
         settings = grunt.file.readJSON(settingsFile),
         template = "app/load_addons.js.underscore",
         dest = "app/load_addons.js",


[44/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Turn workers back on for errors in the editors


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

Branch: refs/heads/2041-update-ibrowse
Commit: 72d61343b8b6edbfea3c9412bcc9edb1c246bf34
Parents: 929b3a0
Author: suelockwood <de...@apache.org>
Authored: Fri Feb 28 15:38:17 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Fri Feb 28 15:38:17 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/72d61343/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 71d78b1..0422b5a 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -284,7 +284,7 @@ function(app, FauxtonAPI, ace, spin) {
     afterRender: function () {
       this.editor = ace.edit(this.editorId);
       this.setHeightToLineCount();
-      this.editor.getSession().setUseWorker(false);
+
       this.editor.setTheme("ace/theme/" + this.theme);
 
       this.editor.getSession().setMode("ace/mode/" + this.mode);


[24/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
remove superfluous 'user_doc.type'

Fixes COUCHDB-1474


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

Branch: refs/heads/2041-update-ibrowse
Commit: ea9bc69e003426c256893f53063b24dd71b6ac46
Parents: 2625c34
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Feb 16 21:37:44 2014 +0100
Committer: Andy Wenk <an...@apache.org>
Committed: Sun Feb 16 22:02:50 2014 +0100

----------------------------------------------------------------------
 share/www/script/jquery.couch.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ea9bc69e/share/www/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index 1a4c3b7..e78b67e 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -182,8 +182,8 @@
     signup: function(user_doc, password, options) {
       options = options || {};
       user_doc.password = password;
-      user_doc.roles =  user_doc.roles || [];
-      user_doc.type =  user_doc.type = "user" || [];
+      user_doc.roles = user_doc.roles || [];
+      user_doc.type = "user";
       var user_prefix = "org.couchdb.user:";
       user_doc._id = user_doc._id || user_prefix + user_doc.name;
 


[07/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fix failing grunt test


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

Branch: refs/heads/2041-update-ibrowse
Commit: fb633cb2892ff06316b49a1549b804537beaf59e
Parents: 8ec4cbc
Author: Garren Smith <ga...@gmail.com>
Authored: Fri Feb 7 15:13:05 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Fri Feb 7 15:13:05 2014 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fb633cb2/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 9507a60..c087afa 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -426,7 +426,7 @@ module.exports = function(grunt) {
    */
   // clean out previous build artefactsa and lint
   grunt.registerTask('lint', ['clean', 'jshint']);
-  grunt.registerTask('test', ['lint', 'dependencies', 'test_inline']);
+  grunt.registerTask('test', ['lint', 'dependencies', 'gen_initialize:development', 'test_inline']);
   // lighter weight test task for use inside dev/watch
   grunt.registerTask('test_inline', ['mochaSetup','jst', 'concat:test_config_js','mocha_phantomjs']);
   // Fetch dependencies (from git or local dir), lint them and make load_addons


[08/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Add backbone.fetch-cache to license and notice


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

Branch: refs/heads/2041-update-ibrowse
Commit: b3bb78e7b54f8755faef1b8fa7ac26ceb49a0395
Parents: fb633cb
Author: Garren Smith <ga...@gmail.com>
Authored: Fri Feb 7 15:13:23 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Fri Feb 7 15:13:23 2014 +0200

----------------------------------------------------------------------
 LICENSE | 24 ++++++++++++++++++++++++
 NOTICE  |  4 ++++
 2 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b3bb78e7/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 7cd4f81..6ae7303 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1104,3 +1104,27 @@ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
+
+for src/fauxton/asserts/js/plugins/backbone.fetch-cache.js
+
+The MIT License (MIT)
+
+Copyright (c) 2012-2013 Andrew Appleton, http://floatleft.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b3bb78e7/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 0fa5d8d..fda3caf 100644
--- a/NOTICE
+++ b/NOTICE
@@ -185,3 +185,7 @@ This product also includes the following third-party components:
  * ace editor https://github.com/ajaxorg/ace
 
    Copyright (c) 2010, Ajax.org B.V.
+
+ * src/fauxton/asserts/js/plugins/backbone.fetch-cache.js
+
+   Copyright (c) 2012-2013 Andrew Appleton, http://floatleft.com


[37/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Remove editor reference to go to line 2 to stop browsers from crashing on people who have minified index functions.


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

Branch: refs/heads/2041-update-ibrowse
Commit: e0b860d0f1e024c1fd691a643dc65a4aa5d302c1
Parents: 17a9763
Author: suelockwood <de...@apache.org>
Authored: Tue Feb 25 14:58:26 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Tue Feb 25 14:58:36 2014 -0500

----------------------------------------------------------------------
 src/fauxton/app/addons/fauxton/components.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e0b860d0/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 8b21916..39c213d 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -284,11 +284,11 @@ function(app, FauxtonAPI, ace, spin) {
     afterRender: function () {
       this.editor = ace.edit(this.editorId);
       this.setHeightToLineCount();
+      this.editor.getSession().setUseWorker(false);
       this.editor.setTheme("ace/theme/" + this.theme);
+
       this.editor.getSession().setMode("ace/mode/" + this.mode);
-      this.editor.getSession().setUseWrapMode(true);
       this.editor.setShowPrintMargin(false);
-      this.editor.gotoLine(2);
       this.addCommands();
 
       if (this.couchJSHINT) {
@@ -329,7 +329,8 @@ function(app, FauxtonAPI, ace, spin) {
     },
 
     getLines: function(){
-      return this.editor.getSession().getDocument().getLength();
+      return 5;
+     // return this.editor.getSession().getDocument().getLength();
     },
 
     addCommands: function () {


[12/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Accept gzipped JSON request bodies

COUCHDB-2054


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

Branch: refs/heads/2041-update-ibrowse
Commit: 4d893387291ef4db1058a2f101bc0fd3c5064b17
Parents: f7801e6
Author: Robert Newson <rn...@apache.org>
Authored: Fri Feb 7 20:33:57 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Feb 7 20:33:57 2014 +0000

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4d893387/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index acc20d7..f00fdd0 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -544,7 +544,7 @@ body(#httpd{req_body=ReqBody}) ->
     ReqBody.
 
 json_body(Httpd) ->
-    ?JSON_DECODE(body(Httpd)).
+    ?JSON_DECODE(maybe_decompress(Httpd, body(Httpd))).
 
 json_body_obj(Httpd) ->
     case json_body(Httpd) of
@@ -554,6 +554,15 @@ json_body_obj(Httpd) ->
     end.
 
 
+maybe_decompress(Httpd, Body) ->
+    case header_value(Httpd, "Content-Encoding", "identity") of
+    "gzip" ->
+        zlib:gunzip(Body);
+    "identity" ->
+        Body;
+    Else ->
+        throw({bad_ctype, [Else, " is not a supported content encoding."]})
+    end.
 
 doc_etag(#doc{revs={Start, [DiskRev|_]}}) ->
     "\"" ++ ?b2l(couch_doc:rev_to_str({Start, DiskRev})) ++ "\"".


[31/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Remove client-side password crypto from JS tests

This removes client-side password crypto from the JavaScript tests.

In some JavaScript tests, it has been assumed that SHA-1 is used for the
password hash in user docs.  Those tests should, however, not rely on
implementation details of the user authentication hash function, as it
isn't the goal of those tests to check these.  Furthermore, this causes
problems when a password scheme is changed, or a new one is introduced.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 45e17e5fbb3c5364e7f8d0e6bb4d79e2e291ecfa
Parents: 08cf09f
Author: Klaus Trainer <kl...@posteo.de>
Authored: Wed Feb 19 21:30:53 2014 +0100
Committer: Klaus Trainer <kl...@apache.org>
Committed: Sun Feb 23 18:59:21 2014 +0100

----------------------------------------------------------------------
 share/www/script/couch_test_runner.js |  4 +---
 share/www/script/test/auth_cache.js   | 12 ++----------
 share/www/script/test/cookie_auth.js  | 11 +++++------
 3 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/45e17e5f/share/www/script/couch_test_runner.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index c04e6b1..7f435bf 100644
--- a/share/www/script/couch_test_runner.js
+++ b/share/www/script/couch_test_runner.js
@@ -460,9 +460,7 @@ CouchDB.user_prefix = "org.couchdb.user:";
 CouchDB.prepareUserDoc = function(user_doc, new_password) {
   user_doc._id = user_doc._id || CouchDB.user_prefix + user_doc.name;
   if (new_password) {
-    // handle the password crypto
-    user_doc.salt = CouchDB.newUuids(1)[0];
-    user_doc.password_sha = hex_sha1(new_password + user_doc.salt);
+    user_doc.password = new_password;
   }
   user_doc.type = "user";
   if (!user_doc.roles) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/45e17e5f/share/www/script/test/auth_cache.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/auth_cache.js b/share/www/script/test/auth_cache.js
index 57e6a8d..2229c20 100644
--- a/share/www/script/test/auth_cache.js
+++ b/share/www/script/test/auth_cache.js
@@ -184,11 +184,7 @@ couchTests.auth_cache = function(debug) {
     hits_before = hits_after;
     misses_before = misses_after;
 
-    var new_salt = CouchDB.newUuids(1)[0];
-    var new_passwd = hex_sha1("foobar" + new_salt);
-    fdmanana.salt = new_salt;
-    fdmanana.password_sha = new_passwd;
-
+    fdmanana.password = "foobar";
     T(authDb.save(fdmanana).ok);
 
     // cache was refreshed
@@ -206,11 +202,7 @@ couchTests.auth_cache = function(debug) {
     misses_before = misses_after;
 
     // and yet another update
-    new_salt = CouchDB.newUuids(1)[0];
-    new_passwd = hex_sha1("javascript" + new_salt);
-    fdmanana.salt = new_salt;
-    fdmanana.password_sha = new_passwd;
-
+    fdmanana.password = "javascript";
     T(authDb.save(fdmanana).ok);
 
     // cache was refreshed

http://git-wip-us.apache.org/repos/asf/couchdb/blob/45e17e5f/share/www/script/test/cookie_auth.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/cookie_auth.js b/share/www/script/test/cookie_auth.js
index 40b633b..9b4bd64 100644
--- a/share/www/script/test/cookie_auth.js
+++ b/share/www/script/test/cookie_auth.js
@@ -115,7 +115,7 @@ couchTests.cookie_auth = function(debug) {
 
       // we can't create docs with malformed ids
       var badIdDoc = CouchDB.prepareUserDoc({
-        name: "foo"
+        name: "w00x"
       }, "bar");
 
       badIdDoc._id = "org.apache.couchdb:w00x";
@@ -153,8 +153,8 @@ couchTests.cookie_auth = function(debug) {
         usersDb.deleteDoc(jchrisUserDoc);
         T(false && "Can't delete other users docs. Should have thrown an error.");
       } catch (e) {
-        TEquals("forbidden", e.error);
-        TEquals(403, usersDb.last_req.status);
+        TEquals("not_found", e.error);
+        TEquals(404, usersDb.last_req.status);
       }
 
       // TODO should login() throw an exception here?
@@ -197,8 +197,8 @@ couchTests.cookie_auth = function(debug) {
         usersDb.save(jasonUserDoc);
         T(false && "Can't update someone else's user doc. Should have thrown an error.");
       } catch (e) {
-        T(e.error == "forbidden");
-        T(usersDb.last_req.status == 403);
+        T(e.error == "not_found");
+        T(usersDb.last_req.status == 404);
       }
 
       // test that you can't edit roles unless you are admin
@@ -272,7 +272,6 @@ couchTests.cookie_auth = function(debug) {
 
   var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
   usersDb.deleteDb();
-  usersDb.createDb();
 
   run_on_modified_server(
     [


[25/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Negotiate max uri length in response to 414's


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

Branch: refs/heads/2041-update-ibrowse
Commit: 3ce13c52bc0a01395bd3a77fbebc8cdddf84fc80
Parents: 90a989a
Author: Robert Newson <rn...@apache.org>
Authored: Thu Feb 13 17:09:58 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 17 13:48:58 2014 +0000

----------------------------------------------------------------------
 .../src/couch_replicator_api_wrap.erl           | 40 ++++++++++++++------
 1 file changed, 29 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ce13c52/src/couch_replicator/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index 52e15b7..3cf942d 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -50,6 +50,9 @@
 
 -define(MAX_WAIT, 5 * 60 * 1000).
 
+-define(MAX_URL_LEN, 7000).
+-define(MIN_URL_LEN, 200).
+
 db_uri(#httpdb{url = Url}) ->
     couch_util:url_strip_password(Url);
 
@@ -171,13 +174,16 @@ open_doc_revs(#httpdb{} = HttpDb, Id, Revs, Options, Fun, Acc) ->
     QS = options_to_query_args(HttpDb, Path, [revs, {open_revs, Revs} | Options]),
     {Pid, Ref} = spawn_monitor(fun() ->
         Self = self(),
-        Callback = fun(200, Headers, StreamDataFun) ->
+        Callback = fun
+          (200, Headers, StreamDataFun) ->
             remote_open_doc_revs_streamer_start(Self),
             {<<"--">>, _, _} = couch_httpd:parse_multipart_request(
                 get_value("Content-Type", Headers),
                 StreamDataFun,
                 fun mp_parse_mixed/1
-            )
+            );
+          (414, _, _) ->
+            exit(request_uri_too_long)
         end,
         Streamer = spawn_link(fun() ->
             Params = [
@@ -217,6 +223,17 @@ open_doc_revs(#httpdb{} = HttpDb, Id, Revs, Options, Fun, Acc) ->
             Ret;
         {'DOWN', Ref, process, Pid, {{nocatch, {missing_stub,_} = Stub}, _}} ->
             throw(Stub);
+        {'DOWN', Ref, process, Pid, request_uri_too_long} ->
+            NewMaxLen = get_value(max_url_len, Options, ?MAX_URL_LEN) div 2,
+            case NewMaxLen < ?MIN_URL_LEN of
+                true ->
+                    throw(request_uri_too_long);
+                false ->
+                    ?LOG_INFO("Reducing url length to ~B because of 414 response", [NewMaxLen]),
+                    Options1 = lists:keystore(max_url_len, 1, Options,
+                                              {max_url_len, NewMaxLen}),
+                    open_doc_revs(HttpDb, Id, Revs, Options1, Fun, Acc)
+            end;
         {'DOWN', Ref, process, Pid, Else} ->
             Url = couch_util:url_strip_password(
                 couch_replicator_httpc:full_url(HttpDb, [{path,Path}, {qs,QS}])
@@ -501,7 +518,11 @@ changes_json_req(Db, FilterName, {QueryParams}, _Options) ->
     ]}.
 
 
-options_to_query_args(HttpDb, Path, Options) ->
+options_to_query_args(HttpDb, Path, Options0) ->
+    case lists:keytake(max_url_len, 1, Options0) of
+        false -> MaxLen = ?MAX_URL_LEN, Options = Options0;
+        {value, {max_url_len, MaxLen}, Options} -> ok
+    end,
     case lists:keytake(atts_since, 1, Options) of
     false ->
         options_to_query_args(Options, []);
@@ -514,7 +535,7 @@ options_to_query_args(HttpDb, Path, Options) ->
         RevList = atts_since_arg(
             length("GET " ++ FullUrl ++ " HTTP/1.1\r\n") +
             length("&atts_since=") + 6,  % +6 = % encoded [ and ]
-            PAs, []),
+            PAs, MaxLen, []),
         [{"atts_since", ?JSON_ENCODE(RevList)} | QueryArgs1]
     end.
 
@@ -535,12 +556,9 @@ options_to_query_args([{open_revs, Revs} | Rest], Acc) ->
     JsonRevs = ?b2l(?JSON_ENCODE(couch_doc:revs_to_strs(Revs))),
     options_to_query_args(Rest, [{"open_revs", JsonRevs} | Acc]).
 
-
--define(MAX_URL_LEN, 7000).
-
-atts_since_arg(_UrlLen, [], Acc) ->
+atts_since_arg(_UrlLen, [], _MaxLen, Acc) ->
     lists:reverse(Acc);
-atts_since_arg(UrlLen, [PA | Rest], Acc) ->
+atts_since_arg(UrlLen, [PA | Rest], MaxLen, Acc) ->
     RevStr = couch_doc:rev_to_str(PA),
     NewUrlLen = case Rest of
     [] ->
@@ -550,11 +568,11 @@ atts_since_arg(UrlLen, [PA | Rest], Acc) ->
         % plus 2 double quotes and a comma (% encoded)
         UrlLen + size(RevStr) + 9
     end,
-    case NewUrlLen >= ?MAX_URL_LEN of
+    case NewUrlLen >= MaxLen of
     true ->
         lists:reverse(Acc);
     false ->
-        atts_since_arg(NewUrlLen, Rest, [RevStr | Acc])
+        atts_since_arg(NewUrlLen, Rest, MaxLen, [RevStr | Acc])
     end.
 
 


[19/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fauxton: file name correction


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

Branch: refs/heads/2041-update-ibrowse
Commit: 6151c588245cd692b05d5bfc82db461b96ad94bc
Parents: c6c3794
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Feb 13 16:37:39 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Feb 13 16:37:39 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6151c588/src/fauxton/app/app.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/app.js b/src/fauxton/app/app.js
index 521ad6c..3ec2c99 100644
--- a/src/fauxton/app/app.js
+++ b/src/fauxton/app/app.js
@@ -24,7 +24,7 @@ define([
   "core/utils",
   // Modules
   "core/api",
-  "core/couchdbsession",
+  "core/couchdbSession",
   // Plugins.
   "plugins/backbone.layoutmanager",
   "plugins/jquery.form"


[34/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Move myself from THANKS to AUTHORS


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

Branch: refs/heads/2041-update-ibrowse
Commit: 358901a50b83fd40fe8916b922e0737e96dbabeb
Parents: 8c86757
Author: Klaus Trainer <kl...@apache.org>
Authored: Sun Feb 23 19:11:51 2014 +0100
Committer: Klaus Trainer <kl...@apache.org>
Committed: Sun Feb 23 19:11:51 2014 +0100

----------------------------------------------------------------------
 AUTHORS   | 1 +
 THANKS.in | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/358901a5/AUTHORS
----------------------------------------------------------------------
diff --git a/AUTHORS b/AUTHORS
index 863e87b..dd0260a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -27,5 +27,6 @@ documentation or developing software. Some of these people are:
  * Garren Smith <ga...@apache.org>
  * Sue Lockwood <de...@apache.org>
  * Andy Wenk <an...@apache.org>
+ * Klaus Trainer <kl...@apache.org>
 
 For a list of other credits see the `THANKS` file.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/358901a5/THANKS.in
----------------------------------------------------------------------
diff --git a/THANKS.in b/THANKS.in
index 67678f6..bdfb3cd 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -64,7 +64,6 @@ suggesting improvements or submitting changes. Some of these people are:
  * David Rose <do...@gmail.com>
  * Lim Yue Chuan <sh...@gmail.com>
  * David Davis <xa...@xantus.org>
- * Klaus Trainer <kl...@web.de>
  * Juuso Väänänen <ju...@vaananen.org>
  * Jeff Zellner <je...@gmail.com>
  * Benjamin Young <by...@bigbluehat.com>


[42/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Added Highlight to the admin party to make it stand out more.


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

Branch: refs/heads/2041-update-ibrowse
Commit: 0df722e66b66bbad172a237b6fd1521b4a346676
Parents: 48f586f
Author: suelockwood <de...@apache.org>
Authored: Fri Feb 28 09:55:05 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Fri Feb 28 09:55:05 2014 -0500

----------------------------------------------------------------------
 src/Makefile.am                                      |  1 +
 src/fauxton/app/addons/auth/assets/less/auth.less    | 15 +++++++++++++++
 .../app/addons/auth/templates/nav_link_title.html    |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0df722e6/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 32a1a6a..59aa6bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,6 +52,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/auth/base.js \
     fauxton/app/addons/auth/resources.js \
     fauxton/app/addons/auth/routes.js \
+    fauxton/app/addons/auth/assets/less/auth.less \
     fauxton/app/addons/auth/templates/change_password.html \
     fauxton/app/addons/auth/templates/create_admin.html \
     fauxton/app/addons/auth/templates/login.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0df722e6/src/fauxton/app/addons/auth/assets/less/auth.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/assets/less/auth.less b/src/fauxton/app/addons/auth/assets/less/auth.less
new file mode 100644
index 0000000..8a71817
--- /dev/null
+++ b/src/fauxton/app/addons/auth/assets/less/auth.less
@@ -0,0 +1,15 @@
+/*  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.
+ */
+#primary-navbar .navbar nav .nav li a#user-create-admin{
+  background-color: #af2d24;
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0df722e6/src/fauxton/app/addons/auth/templates/nav_link_title.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/templates/nav_link_title.html b/src/fauxton/app/addons/auth/templates/nav_link_title.html
index 699ea80..863955c 100644
--- a/src/fauxton/app/addons/auth/templates/nav_link_title.html
+++ b/src/fauxton/app/addons/auth/templates/nav_link_title.html
@@ -12,7 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <% if (admin_party) { %>
-  <a id="user-create-admin" href="#createAdmin"> 
+  <a id="user-create-admin" class="alert_nav" href="#createAdmin"> 
   	<span class="fonticon-user fonticon"></span>
   	Admin Party! [FIX THIS] 
     <small>Everyone is an admin.</small>


[21/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
fix right hand side scrolling over navigation

If the right hand content got really wide, then
it could easily be scrolled over the primary
navigation on the left.

Fixed it by fixed positioning it.


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

Branch: refs/heads/2041-update-ibrowse
Commit: e389a8ba2a79da2669b536ca242b5dfdee4faba3
Parents: 6151c58
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Thu Feb 13 09:13:50 2014 -0500
Committer: Garren Smith <ga...@gmail.com>
Committed: Fri Feb 14 08:56:54 2014 +0200

----------------------------------------------------------------------
 src/fauxton/assets/less/fauxton.less | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e389a8ba/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index ec3ff55..43e623c 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -302,8 +302,9 @@ a:hover{
   max-width: 1500px;
   .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
   border-left: 1px solid #999;
-  position: absolute;
+  position: fixed;
   left: @navWidth;
+  right: 0;
   margin-left: 0;
   background-color: @sidebarBG;
   min-width: 600px;


[38/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Accidentally committed debugging code. Return 5 ... (thanks kxepal!)


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

Branch: refs/heads/2041-update-ibrowse
Commit: b4b6fe15366c9b5ffa535df12c3060554d2af960
Parents: e0b860d
Author: suelockwood <de...@apache.org>
Authored: Tue Feb 25 15:05:07 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Tue Feb 25 15:05:07 2014 -0500

----------------------------------------------------------------------
 src/fauxton/app/addons/fauxton/components.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b4b6fe15/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 39c213d..71d78b1 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -329,8 +329,7 @@ function(app, FauxtonAPI, ace, spin) {
     },
 
     getLines: function(){
-      return 5;
-     // return this.editor.getSession().getDocument().getLength();
+     return this.editor.getSession().getDocument().getLength();
     },
 
     addCommands: function () {


[33/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Merge branch '1780-upgrade-password-hashes-on-authentication'


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

Branch: refs/heads/2041-update-ibrowse
Commit: 8c867577cea2de7410eec33aa6358d1f20b5486d
Parents: 08cf09f 3488893
Author: Klaus Trainer <kl...@apache.org>
Authored: Sun Feb 23 18:59:35 2014 +0100
Committer: Klaus Trainer <kl...@apache.org>
Committed: Sun Feb 23 18:59:35 2014 +0100

----------------------------------------------------------------------
 share/www/script/couch_test_runner.js      |  4 +-
 share/www/script/test/auth_cache.js        | 12 +----
 share/www/script/test/cookie_auth.js       | 11 ++---
 share/www/script/test/users_db_security.js | 61 ++++++++++++++++++++++++-
 src/couchdb/couch_httpd_auth.erl           | 35 ++++++++++----
 5 files changed, 94 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[23/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
fix undefined Req


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

Branch: refs/heads/2041-update-ibrowse
Commit: 2625c34b72bfdb19a96354e2bca142c263a8f610
Parents: aed283f
Author: Benoit Chesneau <bc...@gmail.com>
Authored: Sun Feb 16 13:42:38 2014 +0100
Committer: Benoit Chesneau <bc...@gmail.com>
Committed: Sun Feb 16 13:44:52 2014 +0100

----------------------------------------------------------------------
 src/couch_dbupdates/src/couch_dbupdates_httpd.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2625c34b/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_dbupdates/src/couch_dbupdates_httpd.erl b/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
index afd99a5..3656fc2 100644
--- a/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
+++ b/src/couch_dbupdates/src/couch_dbupdates_httpd.erl
@@ -39,7 +39,7 @@ handle_req(#httpd{method='GET'}=Req) ->
     couch_dbupdates:handle_dbupdates(fun handle_update/2,
                                      State, Options);
 
-handle_req(_Req) ->
+handle_req(Req) ->
     couch_httpd:send_method_not_allowed(Req, "GET").
 
 handle_update(stop, #state{resp=Resp}) ->


[10/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Merge branch 'key-vs-keys'


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

Branch: refs/heads/2041-update-ibrowse
Commit: 14a38b783f11d11fd63fcf89686431279ad91da5
Parents: b3bb78e 2bc0784
Author: Robert Newson <rn...@apache.org>
Authored: Fri Feb 7 14:41:12 2014 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Feb 7 14:41:12 2014 +0000

----------------------------------------------------------------------
 src/couch_mrview/src/couch_mrview_util.erl | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[15/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Update my email address

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

Branch: refs/heads/2041-update-ibrowse
Commit: 72adab90471f107cfd4478d04ecb3b90e3f1d3f4
Parents: 46edca2
Author: Joan Touzet <wo...@apache.org>
Authored: Wed Feb 12 14:54:44 2014 -0500
Committer: Joan Touzet <wo...@apache.org>
Committed: Wed Feb 12 14:54:44 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/72adab90/AUTHORS
----------------------------------------------------------------------
diff --git a/AUTHORS b/AUTHORS
index 1b8c412..863e87b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,7 +20,7 @@ documentation or developing software. Some of these people are:
  * Bob Dionne <bi...@apache.org>
  * Dave Cottlehuber <dc...@apache.org>
  * Jason Smith <jh...@apache.org>
- * Joan Touzet <jo...@ieee.org>
+ * Joan Touzet <wo...@apache.org>
  * Dale Harvey <da...@apache.org>
  * Dirkjan Ochtman <dj...@apache.org>
  * Alexander Shorin <kx...@apache.org>


[46/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Use $.inArray instead of indexOf for IE8 compatibility.

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/77724c94
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/77724c94
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/77724c94

Branch: refs/heads/2041-update-ibrowse
Commit: 77724c94b959ebe4feb124e21dfbad504f50f824
Parents: b22f2a4
Author: Keith Gable <kg...@decisionpt.com>
Authored: Mon Mar 3 14:00:11 2014 -0600
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Mar 4 15:10:43 2014 +0400

----------------------------------------------------------------------
 share/www/script/futon.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/77724c94/share/www/script/futon.js
----------------------------------------------------------------------
diff --git a/share/www/script/futon.js b/share/www/script/futon.js
index e2e0aaf..409becc 100644
--- a/share/www/script/futon.js
+++ b/share/www/script/futon.js
@@ -240,7 +240,7 @@ function $$(node) {
           if (userCtx.name) {
             $("#userCtx .name").text(userCtx.name).attr({href : $.couch.urlPrefix + "/_utils/document.html?"+encodeURIComponent(r.info.authentication_db)+"/org.couchdb.user%3A"+encodeURIComponent(userCtx.name)});
 
-            if (userCtx.roles.indexOf("_admin") != -1) {
+            if ($.inArray("_admin", userCtx.roles) != -1) {
               $("#userCtx .loggedin").show();
               $("#userCtx .loggedinadmin").show();
               $(".serverAdmin").removeAttr('disabled'); // user is a server admin
@@ -266,7 +266,7 @@ function $$(node) {
                 }); 
               }
             }
-          } else if (userCtx.roles.indexOf("_admin") != -1) {
+          } else if ($.inArray("_admin", userCtx.roles) != -1) {
             $("#userCtx .adminparty").show();
             $(".serverAdmin").removeAttr('disabled');
           } else {


[03/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
fixed settings.json.dev; added fauxton & cachebuster


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

Branch: refs/heads/2041-update-ibrowse
Commit: 8462b9d3dcbd789d4ca61984584c3d284bee486d
Parents: 9185631
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Fri Jan 31 16:59:16 2014 -0500
Committer: BigBlueHat <by...@bigbluehat.com>
Committed: Mon Feb 3 11:29:00 2014 -0500

----------------------------------------------------------------------
 src/fauxton/settings.json.dev | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8462b9d3/src/fauxton/settings.json.dev
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.dev b/src/fauxton/settings.json.dev
index e2df66b..d354c29 100644
--- a/src/fauxton/settings.json.dev
+++ b/src/fauxton/settings.json.dev
@@ -1,5 +1,6 @@
 {
   "deps": [
+  { "name": "fauxton" },
   { "name": "databases" },
   { "name": "documents" },
   { "name": "pouchdb" },
@@ -23,7 +24,8 @@
         "variables": {
           "requirejs": "/assets/js/libs/require.js",
           "css": "./css/index.css",
-          "base": null
+          "base": null,
+          "cachebuster": ""
         },
         "app": {
           "root": "/",
@@ -37,7 +39,8 @@
         "variables": {
           "requirejs": "./js/require.js",
           "css": "./css/index.css",
-          "base": null
+          "base": null,
+          "cachebuster": "?v1.0"
         },
         "app": {
           "root": "/_utils/fauxton/",


[36/50] [abbrv] couchdb commit: updated refs/heads/2041-update-ibrowse to 948e7d9

Posted by dc...@apache.org.
Fix formatting


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

Branch: refs/heads/2041-update-ibrowse
Commit: 17a97631fdbb3c45dd82081b51e9cf26c39fb884
Parents: 8de6b6e
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Feb 25 20:27:33 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Feb 25 20:27:33 2014 +0400

----------------------------------------------------------------------
 share/doc/src/json-structure.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a97631/share/doc/src/json-structure.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/json-structure.rst b/share/doc/src/json-structure.rst
index 8eae7df..ab3ae45 100644
--- a/share/doc/src/json-structure.rst
+++ b/share/doc/src/json-structure.rst
@@ -227,7 +227,7 @@ List of Active Tasks
 +--------------------------------+---------------------------------------------+
 | Field                          | Description                                 |
 +================================+=============================================+
-| tasks [array]                  | Active Tasks                                 |
+| tasks [array]                  | Active Tasks                                |
 +--------------------------------+---------------------------------------------+
 |     pid                        | Process ID                                  |
 +--------------------------------+---------------------------------------------+