You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/04/16 20:13:10 UTC

[01/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Repository: couchdb
Updated Branches:
  refs/heads/Query-UI-Cleanup 39d42b113 -> 7a370261c (forced update)


Update call can take longer than 5 seconds


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

Branch: refs/heads/Query-UI-Cleanup
Commit: d81619033206f09a774072dc2f84f7f275b12496
Parents: fa0617a
Author: Robert Newson <rn...@apache.org>
Authored: Tue Apr 1 23:06:33 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Apr 1 23:06:44 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8161903/src/couch_index/src/couch_index_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_index/src/couch_index_updater.erl b/src/couch_index/src/couch_index_updater.erl
index c6d3059..ec3de54 100644
--- a/src/couch_index/src/couch_index_updater.erl
+++ b/src/couch_index/src/couch_index_updater.erl
@@ -35,7 +35,7 @@ start_link(Index, Module) ->
 
 
 run(Pid, IdxState) ->
-    gen_server:call(Pid, {update, IdxState}).
+    gen_server:call(Pid, {update, IdxState}, infinity).
 
 
 is_running(Pid) ->


[25/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add CVE-2014-2668 warning to old release branches


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

Branch: refs/heads/Query-UI-Cleanup
Commit: b532aa80193fb2f80e46e2114104ed306cfa558e
Parents: d1ca821
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Apr 15 09:12:34 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Apr 15 22:28:18 2014 +0200

----------------------------------------------------------------------
 share/doc/src/whatsnew/1.3.rst | 4 ++++
 share/doc/src/whatsnew/1.4.rst | 4 ++++
 share/doc/src/whatsnew/1.5.rst | 7 ++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b532aa80/share/doc/src/whatsnew/1.3.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/whatsnew/1.3.rst b/share/doc/src/whatsnew/1.3.rst
index 7e69785..3f19f56 100644
--- a/share/doc/src/whatsnew/1.3.rst
+++ b/share/doc/src/whatsnew/1.3.rst
@@ -21,6 +21,10 @@
    :depth: 1
    :local:
 
+.. warning::
+
+   :ref:`release/1.3.x` is affected by the issue described in :ref:`cve/2014-2668`.
+   Upgrading to a more recent release is strongly recommended.
 
 .. _release/1.3.x/upgrade:
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b532aa80/share/doc/src/whatsnew/1.4.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/whatsnew/1.4.rst b/share/doc/src/whatsnew/1.4.rst
index cf10bef..65925e1 100644
--- a/share/doc/src/whatsnew/1.4.rst
+++ b/share/doc/src/whatsnew/1.4.rst
@@ -21,6 +21,10 @@
    :depth: 1
    :local:
 
+.. warning::
+
+   :ref:`release/1.4.x` is affected by the issue described in :ref:`cve/2014-2668`.
+   Upgrading to a more recent release is strongly recommended.
 
 .. _release/1.4.x/upgrade:
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b532aa80/share/doc/src/whatsnew/1.5.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/whatsnew/1.5.rst b/share/doc/src/whatsnew/1.5.rst
index 7f2d750..1b7539a 100644
--- a/share/doc/src/whatsnew/1.5.rst
+++ b/share/doc/src/whatsnew/1.5.rst
@@ -21,6 +21,11 @@
    :depth: 1
    :local:
 
+.. warning::
+
+   :ref:`release/1.5.1` contains important security fixes. Previous `1.5.x`
+   releases are not recommended for regular usage.
+
 .. _release/1.5.1:
 
 Version 1.5.1
@@ -28,7 +33,7 @@ Version 1.5.1
 
 * Add the ``max_count`` option (:ref:`config/uuids`) to allow rate-limiting
   the amount of UUIDs that can be requested from the :ref:`api/server/uuids`
-  handler in a single request.
+  handler in a single request (:ref:`CVE 2014-2668 <cve/2014-2668>`).
 
 .. _release/1.5.0:
 


[21/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Changes: Some button class cleanup


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

Branch: refs/heads/Query-UI-Cleanup
Commit: b2c7cc763e9eb16a66f1bf70798f05676a55d30f
Parents: ce6d7d5
Author: suelockwood <de...@apache.org>
Authored: Mon Apr 14 15:51:17 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 15:51:17 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/assets/less/documents.less | 5 ++++-
 src/fauxton/app/addons/documents/templates/changes.html     | 8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b2c7cc76/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 9fefd8f..e49720b 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -35,7 +35,7 @@ button.beautify {
   #select-per-page {
     margin-top: 10px;
   }
-  
+
 }
 
 
@@ -127,5 +127,8 @@ button.beautify {
   display: inline-block;
 }
 
+.change-sequence {
+  word-wrap: break-word;
+}
 
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b2c7cc76/src/fauxton/app/addons/documents/templates/changes.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/changes.html b/src/fauxton/app/addons/documents/templates/changes.html
index 8b598d2..5978e83 100644
--- a/src/fauxton/app/addons/documents/templates/changes.html
+++ b/src/fauxton/app/addons/documents/templates/changes.html
@@ -19,10 +19,10 @@ the License.
         <div class="span2">
           seq
         </div>
-        <div class="span8">
+        <div class="span8 change-sequence">
           <%= change.seq %>
         </div>
-        <div class="span2">
+        <div class="span2 text-right">
           <a class="js-copy" data-clipboard-text="<%= change.seq %>" data-bypass="true" href="#">
             <i class="icon-share"></i>
           </a>
@@ -38,7 +38,7 @@ the License.
           <% } else { %>
             <a href="#<%= database.url('app') %>/<%= safeURL(change.id) %>"><%= change.id %></a>
           <% } %>    </div>
-        <div class="span2">
+        <div class="span2 text-right">
           <a class="js-copy" data-clipboard-text="<%= change.id %>" data-bypass="true" href="#">
             <i class="icon-share"></i>
           </a>
@@ -49,7 +49,7 @@ the License.
           changes
         </div>
         <div class="span10">
-          <button class="js-toggle-json btn-small btn-primary" type="button">View JSON</button>
+          <button class="js-toggle-json btn btn-small btn-primary" type="button">View JSON</button>
         </div>
       </div>
       <div class="js-json-container">


[17/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
couchserver: also serve files with cachebuster, remove the GET-Param


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 68a828ca9a948711fd9ff92cd432b0454a48a609
Parents: 75fd476
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Mar 31 23:46:01 2014 +0200
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 14:40:15 2014 -0400

----------------------------------------------------------------------
 src/fauxton/tasks/couchserver.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/68a828ca/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 95b05e8..e1f18f9 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -51,6 +51,7 @@ module.exports = function (grunt) {
         filePath = path.join(app_dir, url.replace('/_utils/fauxton/',''));
       } else if (!!url.match(/assets/)) {
         // serve any javascript or css files from here assets dir
+        url = url.replace(/\?.*/, '');
         filePath = path.join('./',url);
       } else if (!!url.match(/mocha|\/test\/core\/|test\.config/)) {
         filePath = path.join('./test', url.replace('/test/',''));


[07/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

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

This is a new version of pagination in Fauxton using skip. It uses a
PagingCollection that has the main algorithm for pagination and exposes
a nice api.

This is an intermediate step as this is a much better pagination than we
have at the moment. However using just skip for pagination is not
optimal as there are two cases where skip pagination fails - For very
large skips and for when documents that a user have paginated past have
been deleted.

The next step once this has landed will be to add in a startkey_docid
pagination as well. The PagingCollection would then decided which method
to use to paginate for an index.


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

Branch: refs/heads/Query-UI-Cleanup
Commit: bbcd98bbfd47fa8317bba71378911b120f265bd2
Parents: fbc0545
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Mar 20 09:46:59 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Apr 10 12:04:52 2014 +0200

----------------------------------------------------------------------
 LICENSE                                         | 221 ++++++++++++++++--
 NOTICE                                          |   4 +-
 src/Makefile.am                                 |   1 +
 src/fauxton/app/addons/databases/views.js       |   2 +-
 src/fauxton/app/addons/documents/resources.js   | 181 ++-------------
 src/fauxton/app/addons/documents/routes.js      |  81 +++----
 .../documents/templates/advanced_options.html   |   5 +-
 src/fauxton/app/addons/documents/views.js       |  14 +-
 src/fauxton/app/addons/fauxton/components.js    |  16 +-
 src/fauxton/app/config.js                       |   3 +-
 .../js/plugins/cloudant.pagingcollection.js     | 224 +++++++++++++++++++
 11 files changed, 492 insertions(+), 260 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 21cfb8c..4c58f19 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1105,26 +1105,207 @@ 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
+for src/fauxton/assets/js/plugins/cloudant.pagingcollection.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:
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   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.
 
-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/bbcd98bb/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 888acd2..08e3b82 100644
--- a/NOTICE
+++ b/NOTICE
@@ -186,6 +186,6 @@ This product also includes the following third-party components:
 
    Copyright (c) 2010, Ajax.org B.V.
 
- * src/fauxton/asserts/js/plugins/backbone.fetch-cache.js
+ * src/fauxton/asserts/js/plugins/cloudant.pagingcollection.js
 
-   Copyright (c) 2012-2013 Andrew Appleton, http://floatleft.com
+   Copyright (c) 2014, Cloudant http://cloudant.com

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index e1007f9..07ee5e1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -257,6 +257,7 @@ FAUXTON_FILES = \
     fauxton/assets/js/libs/require.js \
     fauxton/assets/js/libs/spin.min.js \
     fauxton/assets/js/plugins/backbone.layoutmanager.js \
+    fauxton/assets/js/plugins/cloudant.pagingcollection.js \
     fauxton/assets/js/plugins/jquery.form.js \
     fauxton/assets/js/plugins/prettify.js \
     fauxton/assets/js/plugins/beautify.js\

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 d632486..0806b92 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -81,7 +81,7 @@ function(app, Components, FauxtonAPI, Databases) {
           // TODO: switch to using a model, or Databases.databaseUrl()
           // Neither of which are in scope right now
           // var db = new Database.Model({id: dbname});
-          var url = ["/database/", app.utils.safeURLName(dbname), "/_all_docs?limit=" + Databases.DocLimit].join('');
+          var url = ["/database/", app.utils.safeURLName(dbname), "/_all_docs"].join('');
           FauxtonAPI.navigate(url);
       } else {
         FauxtonAPI.addNotification({

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 e47bd61..a787f0d 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -12,10 +12,11 @@
 
 define([
   "app",
-  "api"
+  "api",
+  "cloudant.pagingcollection"
 ],
 
-function(app, FauxtonAPI) {
+function(app, FauxtonAPI, PagingCollection) {
   var Documents = FauxtonAPI.addon();
 
   Documents.QueryParams = (function () {
@@ -40,70 +41,7 @@ function(app, FauxtonAPI) {
     };
   })();
 
-  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(){
@@ -357,25 +295,8 @@ function(app, FauxtonAPI) {
 
   });
 
-  var DefaultParametersMixin = function() {
-    // keep this variable private
-    var defaultParams;
-
-    return {
-      saveDefaultParameters: function() {
-        // store the default parameters so we can reset to the first page
-        defaultParams = _.clone(this.params);
-      },
-
-      restoreDefaultParameters: function() {
-        this.params = _.clone(defaultParams);
-      }
-    };
-  };
-
-  Documents.AllDocs = FauxtonAPI.Collection.extend(_.extend({}, DefaultParametersMixin(), {
+  Documents.AllDocs = PagingCollection.extend({
     model: Documents.Doc,
-    isAllDocs: true,
     documentation: function(){
       return "docs";
     },
@@ -389,11 +310,9 @@ function(app, FauxtonAPI) {
       if (!this.params.limit) {
         this.params.limit = this.perPageLimit;
       }
-
-      this.saveDefaultParameters();
     },
 
-    url: function(context, params) {
+    urlRef: function(context, params) {
       var query = "";
 
       if (params) {
@@ -415,6 +334,10 @@ function(app, FauxtonAPI) {
       }
     },
 
+    url: function () {
+      return this.urlRef.apply(this, arguments);
+    },
+
     simple: function () {
       var docs = this.map(function (item) {
         return {
@@ -429,15 +352,6 @@ function(app, FauxtonAPI) {
       });
     },
 
-    updateLimit: function (limit) {
-      this.perPageLimit = limit;
-      this.params.limit = limit;
-    },
-
-    updateParams: function (params) {
-      this.params = params;
-    },
-
     totalRows: function() {
       return this.viewMeta.total_rows || "unknown";
     },
@@ -456,37 +370,17 @@ function(app, FauxtonAPI) {
     parse: function(resp) {
       var rows = resp.rows;
 
-      this.viewMeta = {
-        total_rows: resp.total_rows,
-        offset: resp.offset,
-        update_seq: resp.update_seq
-      };
-
-      //Paginating, don't show first item as it was the last
-      //item in the previous page
-      if (this.skipFirstItem) {
-        rows = rows.splice(1);
-      }
-
       // remove any query errors that may return without doc info
       // important for when querying keys on all docs
-      var noQueryErrors = _.filter(rows, function(row){
+      resp.rows = _.filter(rows, function(row){
         return row.value;
       });
 
-      return _.map(noQueryErrors, function(row) {
-          return {
-            _id: row.id,
-            _rev: row.value.rev,
-            value: row.value,
-            key: row.key,
-            doc: row.doc || undefined
-          };
-      });
+      return PagingCollection.prototype.parse.call(this, resp);
     }
-  }));
+  });
 
-  Documents.IndexCollection = FauxtonAPI.Collection.extend(_.extend({}, DefaultParametersMixin(), {
+  Documents.IndexCollection = PagingCollection.extend({
     model: Documents.ViewRow,
     documentation: function(){
       return "docs";
@@ -498,17 +392,14 @@ function(app, FauxtonAPI) {
       this.idxType = "_view";
       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;
       }
-
-      this.saveDefaultParameters();
     },
 
-    url: function(context, params) {
+    urlRef: function(context, params) {
       var query = "";
       if (params) {
         if (!_.isEmpty(params)) {
@@ -533,18 +424,8 @@ function(app, FauxtonAPI) {
       return url.join("/") + query;
     },
 
-    updateParams: function (params) {
-      this.params = params;
-    },
-
-    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 = limit;
+    url: function () {
+      return this.urlRef.apply(this, arguments);
     },
 
     totalRows: function() {
@@ -579,23 +460,7 @@ function(app, FauxtonAPI) {
       this.endTime = new Date().getTime();
       this.requestDuration = (this.endTime - this.startTime);
 
-      if (this.skipFirstItem) {
-        rows = rows.splice(1);
-      }
-
-      this.viewMeta = {
-        total_rows: resp.total_rows,
-        offset: resp.offset,
-        update_seq: resp.update_seq
-      };
-      return _.map(rows, function(row) {
-        return {
-          value: row.value,
-          key: row.key,
-          doc: row.doc,
-          id: row.id
-        };
-      });
+      return PagingCollection.prototype.parse.apply(this, arguments);
     },
 
     buildAllDocs: function(){
@@ -606,7 +471,7 @@ function(app, FauxtonAPI) {
     // we can get the request duration
     fetch: function () {
       this.startTime = new Date().getTime();
-      return FauxtonAPI.Collection.prototype.fetch.call(this);
+      return PagingCollection.prototype.fetch.call(this);
     },
 
     allDocs: function(){
@@ -645,10 +510,10 @@ function(app, FauxtonAPI) {
       return timeString;
     }
 
-  }));
+  });
 
 
-  Documents.PouchIndexCollection = FauxtonAPI.Collection.extend(_.extend({}, DefaultParametersMixin(), {
+  Documents.PouchIndexCollection = PagingCollection.extend({
     model: Documents.ViewRow,
     documentation: function(){
       return "docs";
@@ -661,8 +526,6 @@ function(app, FauxtonAPI) {
       this.params = _.extend({limit: 20, reduce: false}, options.params);
 
       this.idxType = "_view";
-
-      this.saveDefaultParameters();
     },
 
     url: function () {
@@ -717,7 +580,7 @@ function(app, FauxtonAPI) {
     allDocs: function(){
       return this.models;
     }
-  }));
+  });
 
 
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 699a496..5e8834f 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -168,10 +168,14 @@ function(app, FauxtonAPI, Documents, Databases) {
 
       this.data.designDocs = new Documents.AllDocs(null, {
         database: this.data.database,
+        paging: {
+          pageSize: 500
+        },
         params: {
-          startkey: '"_design"',
-          endkey: '"_design1"',
-          include_docs: true
+          startkey: '_design',
+          endkey: '_design1',
+          include_docs: true,
+          limit: 500
         }
       });
 
@@ -182,11 +186,11 @@ function(app, FauxtonAPI, Documents, Databases) {
     },
 
     establish: function () {
-      return this.data.designDocs.fetch();
+      return this.data.designDocs.fetch({reset: true});
     },
 
     createParams: function (options) {
-      var urlParams = app.getParams(options);
+      var urlParams = Documents.QueryParams.parse(app.getParams(options));
       return {
         urlParams: urlParams,
         docParams: _.extend(_.clone(urlParams), {limit: this.getDocPerPageLimit(urlParams, 20)})
@@ -223,6 +227,8 @@ function(app, FauxtonAPI, Documents, Databases) {
         collection: this.data.database.allDocs
       }));
 
+      this.data.database.allDocs.paging.pageSize = this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10));
+
       this.setView("#dashboard-upper-content", new Documents.Views.AllDocsLayout({
         database: this.data.database,
         collection: this.data.database.allDocs,
@@ -240,9 +246,7 @@ function(app, FauxtonAPI, Documents, Databases) {
         {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
       ];
 
-      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();
+      this.apiUrl = [this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation() ];
     },
 
     viewFn: function (databaseName, ddoc, view) {
@@ -257,7 +261,10 @@ function(app, FauxtonAPI, Documents, Databases) {
         database: this.data.database,
         design: decodeDdoc,
         view: view,
-        params: docParams
+        params: docParams,
+        paging: {
+          pageSize: this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10))
+        }
       });
      
       this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.ViewEditor({
@@ -290,8 +297,7 @@ function(app, FauxtonAPI, Documents, Databases) {
         ];
       };
 
-      this.apiUrl = [this.data.indexedDocs.url("apiurl", urlParams), "docs"];
-      Documents.paginate.reset();
+      this.apiUrl = [this.data.indexedDocs.urlRef("apiurl", urlParams), "docs"];
     },
 
     ddocInfo: function (designDoc, designDocs, view) {
@@ -344,22 +350,27 @@ function(app, FauxtonAPI, Documents, Databases) {
           urlParams = params.urlParams,
           docParams = params.docParams,
           ddoc = event.ddoc,
+          pageSize,
           collection;
 
-      docParams.limit = this.getDocPerPageLimit(urlParams, this.documentsView.perPage());
+      docParams.limit = pageSize = this.getDocPerPageLimit(urlParams, this.documentsView.perPage());
       this.documentsView.forceRender();
 
       if (event.allDocs) {
         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;
+        collection.paging.pageSize = pageSize;
 
       } else {
         collection = this.data.indexedDocs = new Documents.IndexCollection(null, {
           database: this.data.database,
           design: ddoc,
           view: view,
-          params: docParams
+          params: docParams,
+          paging: {
+            pageSize: pageSize
+          }
         });
 
         if (!this.documentsView) {
@@ -378,8 +389,7 @@ function(app, FauxtonAPI, Documents, Databases) {
       this.documentsView.setCollection(collection);
       this.documentsView.setParams(docParams, urlParams);
 
-      this.apiUrl = [collection.url("apiurl", urlParams), "docs"];
-      Documents.paginate.reset();
+      this.apiUrl = [collection.urlRef("apiurl", urlParams), "docs"];
     },
 
     updateAllDocsFromPreview: function (event) {
@@ -405,47 +415,18 @@ function(app, FauxtonAPI, Documents, Databases) {
     perPageChange: function (perPage) {
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
-      var params = this.documentsView.collection.restoreDefaultParameters();
       this.perPage = perPage;
-      this.documentsView.updatePerPage(perPage);
       this.documentsView.forceRender();
-      this.documentsView.collection.params.limit = perPage;
+      this.documentsView.collection.pageSizeReset(perPage, {fetch: false});
       this.setDocPerPageLimit(perPage);
     },
 
     paginate: function (options) {
-      var params = {},
-          urlParams = app.getParams(),
-          collection = this.documentsView.collection;
+      var collection = this.documentsView.collection;
 
       this.documentsView.forceRender();
-
-      // 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 {
-          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);
+      collection.paging.pageSize = options.perPage;
+      var promise = collection[options.direction]({fetch: false});
     },
 
     reloadDesignDocs: function (event) {
@@ -476,9 +457,9 @@ function(app, FauxtonAPI, Documents, Databases) {
       } 
 
       if (!urlParams.limit || urlParams.limit > storedPerPage) {
-        return storedPerPage;
+        return parseInt(storedPerPage, 10);
       } else {
-        return urlParams.limit;
+        return parseInt(urlParams.limit, 10);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 d8d57cd..55c5946 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -50,13 +50,14 @@ the License.
       <label class="drop-down inline">
         Limit:
         <select name="limit" class="input-small">
+          <option selected="selected">None</option>
           <option>5</option>
           <option>10</option>
-          <option selected="selected">20</option>
+          <option>20</option>
           <option>30</option>
           <option>50</option>
           <option>100</option>
-		  <option>500</option>
+		      <option>500</option>
         </select>
       </label>
       <label for="skipRows" class="inline drop-down">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 cc23e19..351b2b0 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -681,8 +681,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     },
 
     addPagination: function () {
-      var collection = this.collection;
-
       this.pagination = new Components.IndexPagination({
         collection: this.collection,
         scrollToSelector: '#dashboard-content',
@@ -703,9 +701,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         this.addPagination();
       }
 
-      if (!this.params.keys) { //cannot paginate with keys
-        this.insertView('#documents-pagination', this.pagination);
-      }
+      this.insertView('#documents-pagination', this.pagination);
 
       if (!this.allDocsNumber) {
         this.allDocsNumber = new Views.AllDocsNumber({
@@ -749,10 +745,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     perPage: function () {
       return this.allDocsNumber.perPage();
-    },
-
-    updatePerPage: function (newPerPage) {
-      this.collection.updateLimit(newPerPage);
     }
   });
 
@@ -1741,9 +1733,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         this.ddocID = this.model.id;
       } else {
         var ddocDecode = decodeURIComponent(this.ddocID);
-        this.model = this.ddocs.get(ddocDecode).dDocModel();
+        this.model = this.ddocs.get(this.ddocID).dDocModel();
         this.reduceFunStr = this.model.viewHasReduce(this.viewName);
-        
       }
 
       this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
@@ -1752,7 +1743,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         database: this.database
       }));
 
-
       if (!this.newView) {
         this.eventer = _.extend({}, Backbone.Events);
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/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 25f623c..47f4726 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -84,28 +84,18 @@ function(app, FauxtonAPI, ace, spin) {
     },
 
     canShowPreviousfn: function () {
-      if (this._pageStart === 1 || !this.enabled) {
-        return false;
-      }
-      return true;
+      if (!this.enabled) { return this.enabled; }
+      return this.collection.hasPrevious();
     },
 
     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;
+      return this.collection.hasNext();
     },
 
     previousClicked: function (event) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/src/fauxton/app/config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index 4a2f136..edcd9a2 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",
+    "cloudant.pagingcollection": "../assets/js/plugins/cloudant.pagingcollection"
   },
 
   baseUrl: '/',

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bbcd98bb/src/fauxton/assets/js/plugins/cloudant.pagingcollection.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/plugins/cloudant.pagingcollection.js b/src/fauxton/assets/js/plugins/cloudant.pagingcollection.js
new file mode 100644
index 0000000..2ab5eaf
--- /dev/null
+++ b/src/fauxton/assets/js/plugins/cloudant.pagingcollection.js
@@ -0,0 +1,224 @@
+// 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.
+
+(function(root, factory) {
+  "use strict";
+  // start with AMD, so paginate could then be used by ``var paginate = require('paginate');``
+  if (typeof define === 'function' && define.amd) {
+    define(['underscore', 'backbone', 'jquery'], function(_, Backbone, $) {
+      // Export global even in AMD case in case this script is loaded with
+      // others that may still expect a global paginate.
+      return factory(root, null, _, Backbone, $.param);
+    });
+
+  // Next check for Node.js or CommonJS. Also look to see if either
+  // underscore or lodash are the modules being used
+  } else if (typeof exports !== 'undefined') {
+    var Backbone = require('Backbone'),
+        $param = require('querystring').stringify,
+        _;
+    try {
+      _ = require('underscore');
+    } catch(e) {
+      _ = require('lodash');
+    }
+    factory(root, exports, _, Backbone, $param);
+
+  // Finally, register as a browser global.
+  } else {
+    root.PagingCollection = factory(root, {}, root._, root.Backbone, root.$.param);
+  }
+
+}(this, function(root, exports, _, Backbone, $param) {
+  "use strict";
+
+  //PagingCollection
+  //----------------
+
+  // A PagingCollection knows how to build appropriate requests to the
+  // CouchDB-like server and how to fetch. The Collection will always contain a
+  // single page of documents.
+
+  var PagingCollection = Backbone.Collection.extend({
+
+    // initialize parameters and page size
+    constructor: function() {
+      Backbone.Collection.apply(this, arguments);
+      this.configure.apply(this, arguments);
+    },
+
+    configure: function(collections, options) {
+      var querystring = _.result(this, "url").split("?")[1] || "";
+      this.paging = _.defaults((options.paging || {}), {
+        defaultParams: _.defaults({}, options.params, this._parseQueryString(querystring)),
+        hasNext: false,
+        hasPrevious: false,
+        params: {},
+        pageSize: 20,
+        direction: undefined
+      });
+
+      this.paging.params = _.clone(this.paging.defaultParams);
+      this.updateUrlQuery(this.paging.defaultParams);
+    },
+
+    calculateParams: function(currentParams, skipIncrement, limitIncrement) {
+
+      var params = _.clone(currentParams);
+      params.skip = (parseInt(currentParams.skip, 10) || 0) + skipIncrement;
+
+      // guard against hard limits
+      if(this.paging.defaultParams.limit) {
+        params.limit = Math.min(this.paging.defaultParams.limit, params.limit);
+      }
+      // request an extra row so we know that there are more results
+      params.limit = limitIncrement + 1;
+      // prevent illegal skip values
+      params.skip = Math.max(params.skip, 0);
+
+      return params;
+    },
+
+    pageSizeReset: function(pageSize, opts) {
+      var options = _.defaults((opts || {}), {fetch: true});
+      this.paging.direction = undefined;
+      this.paging.pageSize = pageSize;
+      this.paging.params = this.paging.defaultParams;
+      this.paging.params.limit = pageSize;
+      this.updateUrlQuery(this.paging.params);
+      if (options.fetch) {
+        return this.fetch();
+      }
+    },
+
+    _parseQueryString: function(uri) {
+      var queryString = decodeURI(uri).split(/&/);
+
+      return _.reduce(queryString, function (parsedQuery, item) {
+          var nameValue = item.split(/=/);
+          if (nameValue.length === 2) {
+            parsedQuery[nameValue[0]] = nameValue[1];
+          }
+
+          return parsedQuery;
+      }, {});
+    },
+
+    _iterate: function(offset, opts) {
+      var options = _.defaults((opts || {}), {fetch: true});
+
+      this.paging.params = this.calculateParams(this.paging.params, offset, this.paging.pageSize);
+
+      // Fetch the next page of documents
+      this.updateUrlQuery(this.paging.params);
+      if (options.fetch) {
+        return this.fetch({reset: true});
+      }
+    },
+
+    // `next` is called with the number of items for the next page.
+    // It returns the fetch promise.
+    next: function(options){
+      this.paging.direction = "next";
+      return this._iterate(this.paging.pageSize, options);
+    },
+
+    // `previous` is called with the number of items for the previous page.
+    // It returns the fetch promise.
+    previous: function(options){
+      this.paging.direction = "previous";
+      return this._iterate(0 - this.paging.pageSize, options);
+    },
+
+    shouldStringify: function (val) {
+      try {
+        JSON.parse(val);
+        return false;
+      } catch(e) {
+        return true;
+      }
+    },
+
+    // Encodes the parameters so that couchdb will understand them
+    // and then sets the url with the new url.
+    updateUrlQuery: function (params) {
+      var url = _.result(this, "url").split("?")[0];
+
+      _.each(['startkey', 'endkey', 'key'], function (key) {
+        if (_.has(params, key) && this.shouldStringify(params[key])) {
+          params[key] = JSON.stringify(params[key]);
+        }
+      }, this);
+
+      this.url = url + '?' + $param(params);
+    },
+
+    fetch: function () {
+      // if this is a fetch for the first time, fetch one extra to see if there is a next
+      if (!this.paging.direction && this.paging.params.limit > 0) {
+        this.paging.direction = 'fetch';
+        this.paging.params.limit = this.paging.params.limit + 1;
+        this.updateUrlQuery(this.paging.params);
+      }
+
+      return Backbone.Collection.prototype.fetch.apply(this, arguments);
+    },
+
+    parse: function (resp) {
+      var rows = resp.rows;
+
+      this.paging.hasNext = this.paging.hasPrevious = false;
+
+      this.viewMeta = {
+        total_rows: resp.total_rows,
+        offset: resp.offset,
+        update_seq: resp.update_seq
+      };
+
+      var skipLimit = this.paging.defaultParams.skip || 0;
+      if(this.paging.params.skip > skipLimit) {
+        this.paging.hasPrevious = true;
+      }
+
+      if(rows.length === this.paging.pageSize + 1) {
+        this.paging.hasNext = true;
+
+        // remove the next page marker result
+        rows.pop();
+        this.viewMeta.total_rows = this.viewMeta.total_rows - 1;
+      }
+      return rows;
+    },
+
+    hasNext: function() {
+      return this.paging.hasNext;
+    },
+
+    hasPrevious: function() {
+      return this.paging.hasPrevious;
+    }
+  });
+
+
+  if (exports) {
+    // Overload the Backbone.ajax method, this allows PagingCollection to be able to
+    // work in node.js
+    exports.setAjax = function (ajax) {
+      Backbone.ajax = ajax;
+    };
+
+    exports.PagingCollection = PagingCollection;
+  }
+
+  return PagingCollection;
+}));
+


[03/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Verify that auth-related properties are well-formed

Passing unexpected values to auth fields can result in server
issues. Notably, setting "iterations" to a string will cause an
infinite loop as the comparison 'when Iteration > Iterations' will
never evaluate to true.

The latest validate_doc_update prevents user docs with this problem
and administrators can deploy that check themselves (and only
administrators can edit design documents).

A server administrator can also insist on lower and upper bounds for
iteration count to reject weakly protected passwords and
resource-hungry passwords respectively.

COUCHDB-2221


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

Branch: refs/heads/Query-UI-Cleanup
Commit: dbe769c604e5f1e000594336f8c4546bf9e3fd5a
Parents: 9f6a919
Author: Robert Newson <rn...@apache.org>
Authored: Sun Apr 6 18:31:15 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Apr 6 22:09:54 2014 +0100

----------------------------------------------------------------------
 etc/couchdb/default.ini.tpl.in   |  2 ++
 share/doc/src/config/auth.rst    | 24 ++++++++++++++++++++++++
 src/couchdb/couch_httpd_auth.erl | 17 +++++++++++++++++
 src/couchdb/couch_passwords.erl  | 15 +++++++++++----
 4 files changed, 54 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dbe769c6/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index a0dd7db..934c6cd 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -72,6 +72,8 @@ timeout = 600 ; number of seconds before automatic logout
 auth_cache_size = 50 ; size is number of cache entries
 allow_persistent_cookies = false ; set to true to allow persistent cookies
 iterations = 10 ; iterations for password hashing
+; min_iterations = 1
+; max_iterations = 1000000000
 ; comma-separated list of public fields, 404 if empty
 ; public_fields =
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dbe769c6/share/doc/src/config/auth.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/auth.rst b/share/doc/src/config/auth.rst
index 4127288..8311140 100644
--- a/share/doc/src/config/auth.rst
+++ b/share/doc/src/config/auth.rst
@@ -166,6 +166,30 @@ Authentication Configuration
       [couch_httpd_auth]
       iterations = 10000
 
+  .. config:option:: min_iterations :: Minimum PBKDF2 iterations count
+
+    .. versionadded:: 1.6
+
+    The minimum number of iterations allowed for passwords hashed by
+    the PBKDF2 algorithm. Any user with fewer iterations is forbidden.
+
+    ::
+
+      [couch_httpd_auth]
+      min_iterations = 100
+
+  .. config:option:: max_iterations :: Maximum PBKDF2 iterations count
+
+    .. versionadded:: 1.6
+
+    The maximum number of iterations allowed for passwords hashed by
+    the PBKDF2 algorithm. Any user with greater iterations is forbidden.
+
+    ::
+
+      [couch_httpd_auth]
+      max_iterations = 100000
+
 
   .. config:option:: proxy_use_secret :: Force proxy auth use secret token
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dbe769c6/src/couchdb/couch_httpd_auth.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_auth.erl b/src/couchdb/couch_httpd_auth.erl
index 08841fb..6888f06 100644
--- a/src/couchdb/couch_httpd_auth.erl
+++ b/src/couchdb/couch_httpd_auth.erl
@@ -368,11 +368,28 @@ authenticate(Pass, UserProps) ->
             couch_util:get_value(<<"password_sha">>, UserProps, nil)};
         <<"pbkdf2">> ->
             Iterations = couch_util:get_value(<<"iterations">>, UserProps, 10000),
+            verify_iterations(Iterations),
             {couch_passwords:pbkdf2(Pass, UserSalt, Iterations),
              couch_util:get_value(<<"derived_key">>, UserProps, nil)}
     end,
     couch_passwords:verify(PasswordHash, ExpectedHash).
 
+verify_iterations(Iterations) when is_integer(Iterations) ->
+    Min = list_to_integer(couch_config:get("couch_httpd_auth", "min_iterations", "1")),
+    Max = list_to_integer(couch_config:get("couch_httpd_auth", "max_iterations", "1000000000")),
+    case Iterations < Min of
+        true ->
+            throw({forbidden, <<"Iteration count is too low for this server">>});
+        false ->
+            ok
+    end,
+    case Iterations > Max of
+        true ->
+            throw({forbidden, <<"Iteration count is too high for this server">>});
+        false ->
+            ok
+    end.
+
 auth_name(String) when is_list(String) ->
     [_,_,_,_,_,Name|_] = re:split(String, "[\\W_]", [{return, list}]),
     ?l2b(Name).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dbe769c6/src/couchdb/couch_passwords.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_passwords.erl b/src/couchdb/couch_passwords.erl
index d9e6836..bbf6d9a 100644
--- a/src/couchdb/couch_passwords.erl
+++ b/src/couchdb/couch_passwords.erl
@@ -22,12 +22,12 @@
 
 %% legacy scheme, not used for new passwords.
 -spec simple(binary(), binary()) -> binary().
-simple(Password, Salt) ->
+simple(Password, Salt) when is_binary(Password), is_binary(Salt) ->
     ?l2b(couch_util:to_hex(crypto:sha(<<Password/binary, Salt/binary>>))).
 
 %% CouchDB utility functions
 -spec hash_admin_password(binary()) -> binary().
-hash_admin_password(ClearPassword) ->
+hash_admin_password(ClearPassword) when is_binary(ClearPassword) ->
     Iterations = couch_config:get("couch_httpd_auth", "iterations", "10000"),
     Salt = couch_uuids:random(),
     DerivedKey = couch_passwords:pbkdf2(couch_util:to_binary(ClearPassword),
@@ -50,7 +50,10 @@ get_unhashed_admins() ->
 
 %% Current scheme, much stronger.
 -spec pbkdf2(binary(), binary(), integer()) -> binary().
-pbkdf2(Password, Salt, Iterations) ->
+pbkdf2(Password, Salt, Iterations) when is_binary(Password),
+                                        is_binary(Salt),
+                                        is_integer(Iterations),
+                                        Iterations > 0 ->
     {ok, Result} = pbkdf2(Password, Salt, Iterations, ?SHA1_OUTPUT_LENGTH),
     Result.
 
@@ -59,7 +62,11 @@ pbkdf2(Password, Salt, Iterations) ->
 pbkdf2(_Password, _Salt, _Iterations, DerivedLength)
     when DerivedLength > ?MAX_DERIVED_KEY_LENGTH ->
     {error, derived_key_too_long};
-pbkdf2(Password, Salt, Iterations, DerivedLength) ->
+pbkdf2(Password, Salt, Iterations, DerivedLength) when is_binary(Password),
+                                                       is_binary(Salt),
+                                                       is_integer(Iterations),
+                                                       Iterations > 0,
+                                                       is_integer(DerivedLength) ->
     L = ceiling(DerivedLength / ?SHA1_OUTPUT_LENGTH),
     <<Bin:DerivedLength/binary,_/binary>> =
         iolist_to_binary(pbkdf2(Password, Salt, Iterations, L, 1, [])),


[34/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Added Validation and cleaned up layout a little


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

Branch: refs/heads/Query-UI-Cleanup
Commit: dce35d0e1fdf2965ce619adf26ee873054dea27b
Parents: 29d023a
Author: suelockwood <de...@apache.org>
Authored: Wed Apr 2 14:19:10 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Wed Apr 16 13:37:02 2014 -0400

----------------------------------------------------------------------
 .../addons/documents/assets/less/documents.less |  26 ++-
 .../documents/templates/advanced_options.html   | 159 +++++++++++--------
 src/fauxton/app/addons/documents/views.js       |  86 +++++++---
 3 files changed, 174 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dce35d0e/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 e49720b..c09c7ff 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -40,7 +40,7 @@ button.beautify {
 
 
 #query div.controls-group.well{
-    height: 150px;
+    height: 180px;
 }
 
 /** used in all_docs_list.html **/
@@ -119,16 +119,36 @@ button.beautify {
 }
 
 #keys-input {
-  display: inline-block;
-  width: 35%;
+  width: 100%;
 }
 
 #keys-error {
   display: inline-block;
 }
 
+
 .change-sequence {
   word-wrap: break-word;
 }
 
+#dashboard-upper-content{
+  .js-query-keys-wrapper{
+    padding-top: 0;
+  }
+  /** used in advanced-options.html**/
+  .custom-inputs {
+    .row-fluid{
+      padding-top: 20px;
+      .radio, .checkbox{
+        padding-left: 0;
+      }
+      .checkbox.inline,
+      #skipRows {
+        margin-bottom: 0;
+        padding: 6px;
+      }
+    }
+  }
+}
+
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dce35d0e/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 892ce6c..aa2cdcf 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -17,7 +17,7 @@ the License.
 <!-- tabs for choosing Keys or Start & end -->
 
   <div class="btn-group toggle-btns">
-    <label for="showKeys" class="drop-down btn active">
+    <label for="showKeys" class="drop-down btn">
      Specific Key(s)
     </label>
     <label for="showStartEnd" class="drop-down btn">
@@ -25,7 +25,7 @@ the License.
     </label>
   </div>
 
-  <div class="controls-group well">
+  <div class="controls-group well hide js-query-keys-wrapper">
     <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
         <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
@@ -35,10 +35,14 @@ the License.
     </div>
     <div class="row-fluid hide" id="js-showStartEnd">
       <div class="controls controls-row">
-        <label for="startkey" class="drop-down">Start key</label>
-        <input name="startkey" id="startkey" class="span6" type="text" placeholder='e.g., "1234"' disabled>
-        <label for="endkey" class="drop-down">End key</label>
-        <input id="endkey" name="endkey" class="span6" type="text" placeholder='e.g., "1234"'>
+        <div class="span6">
+          <label for="startkey" class="drop-down">Start key</label>
+          <input name="startkey" id="startkey" type="text" placeholder='e.g., "1234"' disabled>
+        </div>
+        <div class="span6">
+          <label for="endkey" class="drop-down">End key</label>
+          <input id="endkey" name="endkey" type="text" placeholder='e.g., "1234"'>
+        </div>
       </div>
       <div class="controls controls-row checkbox inline">
         <input id="check5" name="inclusive_end" type="checkbox" value="false" disabled>
@@ -50,83 +54,102 @@ the License.
 <!-- Limit and Skip are conditional -->
 
   <div class="controls-group">
-      <label class="drop-down inline">
-        Limit:
-        <select name="limit" class="input-small">
-          <option selected="selected">None</option>
-          <option>5</option>
-          <option>10</option>
-          <option>20</option>
-          <option>30</option>
-          <option>50</option>
-          <option>100</option>
-		      <option>500</option>
-        </select>
-      </label>
-      <label for="skipRows" class="inline drop-down">
-        # of rows to skip"
-        <input name="skip" class="input-small" type="text" id="skipRows">
-      </label>
 
-      <div class="checkbox inline">
-        <input id="check1" type="checkbox" name="include_docs" value="true">
-        <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>
+    <div class="row-fluid">
+      <div class="span6">
+        <label class="drop-down inline">
+          Limit:
+          <select name="limit" class="input-medium">
+            <option selected="selected">None</option>
+            <option>5</option>
+            <option>10</option>
+            <option>20</option>
+            <option>30</option>
+            <option>50</option>
+            <option>100</option>
+  		      <option>500</option>
+          </select>
+        </label>
       </div>
+      <div class="span6">
+        <label for="skipRows" class="inline drop-down">
+          <input name="skip" class="input-small" type="text" id="skipRows">
+          # of rows to skip
 
-      <% if (hasReduce) { %>
-      <div class="checkbox inline">
-        <input id="check2" name="reduce" type="checkbox" value="true">
-        <label for="check2">Reduce</label>
+        </label>
       </div>
-      <label id="select1" class="drop-down inline">
-        Group Level:
-        <select id="select1" disabled name="group_level" class="input-small">
-          <option value="0">None</option>
-          <option value="1">1</option>
-          <option value="2">2</option>
-          <option value="3">3</option>
-          <option value="4">4</option>
-          <option value="5">5</option>
-          <option value="6">6</option>
-          <option value="7">7</option>
-          <option value="8">8</option>
-          <option value="9">9</option>
-          <option value="999" selected="selected">Exact</option>
-        </select>
-      </label>
-      <% } %>
-
-      <label id="select2" class="drop-down inline">
-        Order:
-        <select id="select2" name="descending" class="input-large">
-          <option value="false">Ascending</option>
-          <option value="true">Descending</option>
-        </select>
-      </label>
-
-      <div class="checkbox inline">
-        <input id="check6" name="update_seq" type="checkbox" value="true">
-        <label for="check6">Update Sequence</label>
+    </div>
+    <div class="row-fluid">
+      <div class="span6">
+        <label id="select2" class="drop-down inline">
+          Order:
+          <select id="select2" name="descending" class="input-medium">
+            <option value="false">Ascending</option>
+            <option value="true">Descending</option>
+          </select>
+        </label>
       </div>
-
-      <% if (showPreview) { %>
-      <div class="checkbox inline">
-        <input id="check7" name="stale" type="checkbox" value="true">
-        <label for="check7">Stale</label>
+      <div class="span6">
+        <div class="checkbox inline">
+          <input id="check6" name="update_seq" type="checkbox" value="true">
+          <label for="check6">Update Sequence</label>
+        </div>
+      </div>
+    </div>
+    <div class="row-fluid">
+      <div class="span6">
+        <div class="checkbox inline">
+          <input id="check1" type="checkbox" name="include_docs" value="true">
+          <label name="include_docs" for="check1">Include Docs <small>(show the entire doc body)</small></label>
+        </div>
+      </div>
+      <div class="span6">
+        <% if (showPreview) { %>
+        <div class="checkbox inline">
+          <input id="check7" name="stale" type="checkbox" value="true">
+          <label for="check7">Stale</label>
+        </div>
+        <% } %>
+      </div>
+    </div>
+  <% if (hasReduce) { %>
+    <div class="row-fluid">
+      <div class="span6">
+        <div class="checkbox inline">
+          <input id="check2" name="reduce" type="checkbox" value="true">
+          <label for="check2">Reduce</label>
+        </div>
       </div>
-      <% } %>
+      <div class="span6">
+        <label id="select1" class="drop-down inline">
+          Group Level:
+          <select id="select1" disabled name="group_level" class="input-small">
+            <option value="0">None</option>
+            <option value="1">1</option>
+            <option value="2">2</option>
+            <option value="3">3</option>
+            <option value="4">4</option>
+            <option value="5">5</option>
+            <option value="6">6</option>
+            <option value="7">7</option>
+            <option value="8">8</option>
+            <option value="9">9</option>
+            <option value="999" selected="selected">Exact</option>
+          </select>
+        </label>
+      </div>
+    </div>
+  <% } %>
   </div>
 
 
 
 
+
   <div class="controls-group">
     <div class="row-fluid">
       <div id="button-options" class="controls controls-row">
         <button type="submit" class="btn btn-success">Query</button>
-        <% if (showPreview) { %>
-        <button class="btn btn-info preview">Browser Preview</button>
-        <% } %>
       </div>
     </div>
   </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dce35d0e/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 bae49c0..802df14 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -392,7 +392,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.newView = options.newView || false;
       this.pagination = options.pagination;
       _.bindAll(this);
-      
+
       this._perPage = options.perPageDefault || 20;
       this.listenTo(this.collection, 'totalRows:decrement', this.render);
     },
@@ -1054,17 +1054,17 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       "change form.js-view-query-update input": "updateFilters",
       "change form.js-view-query-update select": "updateFilters",
       "submit form.js-view-query-update": "updateView",
-      "click button.preview": "previewView",
       "click .toggle-btns > label":  "toggleQuery"
     },
 
     toggleQuery: function(e){
       e.preventDefault();
+      this.$('.js-query-keys-wrapper').removeClass("hide");
       var showFunctionName =this.$(e.currentTarget).attr("for");
       //highlight current
       this.$(".toggle-btns > label").removeClass('active');
       this.$(e.currentTarget).addClass("active");
-      
+
       this.$("[id^='js-show']").hide();
 
       //show section & disable what needs to be disabled
@@ -1114,7 +1114,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       if (_.isUndefined(parsedValue)) {
         errorMsg = "Keys must be valid json.";
       } else if (!_.isArray(parsedValue)) {
-        errorMsg =  "Keys values must be in an array. E.g [1,2,3]"; 
+        errorMsg =  "Keys values must be in an array. E.g [1,2,3]";
       }
 
       if (errorMsg) {
@@ -1123,12 +1123,30 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           type: "error",
           msg: errorMsg,
           clear:  false,
-          selector: '.js-keys-error'
+          selector: '.advanced-options .errors-container'
         });
         return false;
       }
 
-      return true; 
+      return true;
+    },
+    validateFields: function(params){
+      var errors = false;
+      //so ghetto. Spaghetti code.
+      for (var i= 0; i <params.length; i++){
+        if (params[i].name === "skip"){
+          if (!(/^\d+$/).test(params[i].value)){
+            var notification = FauxtonAPI.addNotification({
+              msg: "Numbers only for skip",
+              type: "warn",
+              selector: ".advanced-options .errors-container",
+              clear:  true
+            });
+            errors = true
+          }
+        }
+      }
+      return errors;
     },
     queryParams: function () {
       var $form = this.$(".js-view-query-update"),
@@ -1145,6 +1163,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       if (keysParam && !this.validateKeys(keysParam)) { return false; }
 
+      if (params && this.validateFields(params)){ return false; }
+
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["keys","startkey","endkey"];
       var errorParams = _.filter(params, function(param) {
@@ -1158,6 +1178,21 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       return {params: params, errorParams: errorParams};
     },
 
+    //these are the saaaaameeeeeeee
+    updateView: function (event) {
+      event.preventDefault();
+      var params = this.queryParams();
+      if (!params) { return;}
+      this.updateViewFn(event, params);
+    },
+
+    // previewView: function (event) {
+    //   var params = this.queryParams();
+    //   if (!params) { return;}
+    //   this.previewFn(event, params);
+    // },
+
+
     updateFilters: function(event) {
       event.preventDefault();
       var $ele = $(event.currentTarget);
@@ -1178,17 +1213,27 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
             var notification = FauxtonAPI.addNotification({
               msg: "include_docs has been disabled as you cannot include docs on a reduced view",
               type: "warn",
-              selector: ".view.show .all-docs-list.errors-container",
+              selector: ".advanced-options .errors-container",
               clear:  true
             });
           }
           $form.find("input[name=include_docs]").prop("disabled", true);
           $form.find("select[name=group_level]").prop("disabled", false);
         } else {
-          $form.find("select[name=group_level]").prop("disabled", true);
+          $form.find("select[name=group_level]").val("999").prop("disabled", true);
           $form.find("input[name=include_docs]").prop("disabled", false);
         }
         break;
+        case "skip":
+          if (!(/^\d+$/).test($ele.val())){
+            var notification = FauxtonAPI.addNotification({
+                msg: "Numbers only for skip",
+                type: "warn",
+                selector: ".advanced-options .errors-container",
+                clear:  true
+              });
+          }
+        break;
         case "include_docs":
         break;
       }
@@ -1217,8 +1262,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           }
           this.updateFiltersFor(key, $ele);
           break;
-          case "key": 
-          case "keys": 
+          case "key":
+          case "keys":
             $form.find("textarea[name='"+key+"']").val(val);
           break;
           default:
@@ -1228,18 +1273,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       }, this);
     },
 
-    updateView: function (event) {
-      event.preventDefault();
-      var params = this.queryParams();
-      if (!params) { return;}
-      this.updateViewFn(event, params);
-    },
 
-    previewView: function (event) {
-      var params = this.queryParams();
-      if (!params) { return;}
-      this.previewFn(event, params);
-    },
 
     serialize: function () {
       return {
@@ -1619,7 +1653,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
     toggleIndexNav: function (event) {
       $('#dashboard-content').scrollTop(0); //scroll up
-      
+
       var $targetId = this.$(event.target).attr('id'),
           $previousTab = this.$(this.$('li.active a').attr('href')),
           $targetTab = this.$(this.$(event.target).attr('href'));
@@ -1628,7 +1662,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         $previousTab.removeAttr('style');
       }
       //stop polling
-      this.ddocInfoView.stopRefreshInterval(); 
+      this.ddocInfoView.stopRefreshInterval();
 
       if ($targetId === 'index-nav') {
         if (this.newView) { return; }
@@ -1640,8 +1674,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       } else if ($targetId === "meta-nav"){
         if (!$("#ddoc-info").is(":visible")){
           this.ddocInfoView.startRefreshInterval();
-        } 
-        $targetTab.toggle('slow'); 
+        }
+        $targetTab.toggle('slow');
       } else {
         $targetTab.toggle('slow');
       }
@@ -1688,7 +1722,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     renderDdocInfo: function(){
       if(this.ddocInfoView){
         this.ddocInfoView.remove();
-      } 
+      }
 
       if (this.newView) { return; }
       this.ddocInfoView = this.setView('#ddoc-info', new Views.DdocInfo({model: this.ddocInfo }));


[10/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add license header for tracking.html


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 5f69849fb4209427823f22c9523c2d7b8334a9e3
Parents: ed000ee
Author: Alexander Shorin <kx...@apache.org>
Authored: Sun Apr 13 05:39:00 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sun Apr 13 05:39:00 2014 +0400

----------------------------------------------------------------------
 share/doc/templates/tracking.html | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5f69849f/share/doc/templates/tracking.html
----------------------------------------------------------------------
diff --git a/share/doc/templates/tracking.html b/share/doc/templates/tracking.html
index e6d4037..b80e3c2 100644
--- a/share/doc/templates/tracking.html
+++ b/share/doc/templates/tracking.html
@@ -1,3 +1,18 @@
+<!--
+
+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.
+
+-->
+
 {% if not local %}
 <script type="text/javascript">
   var _gaq = _gaq || [];


[14/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton fixes

* Fix stats css was leaking over to other pages
* Fix new view creation failing for a new design doc


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 0088f6cd731e978ec68fd5d0951e64ef605f416e
Parents: 57426f0
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Apr 14 11:56:53 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Apr 14 11:56:53 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/routes.js          |  5 +++--
 src/fauxton/app/addons/stats/assets/less/stats.less | 10 +++++-----
 src/fauxton/app/addons/stats/views.js               |  3 ++-
 src/fauxton/assets/js/libs/nv.d3.js                 |  8 ++++----
 4 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0088f6cd/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 64254f1..3bf8f7e 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -351,8 +351,8 @@ function(app, FauxtonAPI, Documents, Databases) {
           pageSize,
           collection;
 
-      docParams.limit = pageSize = this.getDocPerPageLimit(urlParams, this.documentsView.perPage());
-      this.documentsView.forceRender();
+      var defaultPageSize = _.isUndefined(this.documentsView) ? 20 : this.documentsView.perPage();
+      docParams.limit = pageSize = this.getDocPerPageLimit(urlParams, defaultPageSize);
 
       if (event.allDocs) {
         this.eventAllDocs = true; // this is horrible. But I cannot get the trigger not to fire the route!
@@ -386,6 +386,7 @@ function(app, FauxtonAPI, Documents, Databases) {
 
       this.documentsView.setCollection(collection);
       this.documentsView.setParams(docParams, urlParams);
+      this.documentsView.forceRender();
 
       this.apiUrl = [collection.urlRef("apiurl", urlParams), "docs"];
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0088f6cd/src/fauxton/app/addons/stats/assets/less/stats.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/stats/assets/less/stats.less b/src/fauxton/app/addons/stats/assets/less/stats.less
index 43ddb3b..95020b5 100644
--- a/src/fauxton/app/addons/stats/assets/less/stats.less
+++ b/src/fauxton/app/addons/stats/assets/less/stats.less
@@ -12,9 +12,9 @@
 
 .datatypes {
   padding: 0 15px;
-}
 
-.span5 {
-	height:450px;
-	min-width: 450px;
-}
\ No newline at end of file
+  .span5 svg {
+    height:450px;
+    min-width: 450px;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0088f6cd/src/fauxton/app/addons/stats/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/stats/views.js b/src/fauxton/app/addons/stats/views.js
index c8374ad..4bd24d8 100644
--- a/src/fauxton/app/addons/stats/views.js
+++ b/src/fauxton/app/addons/stats/views.js
@@ -20,7 +20,8 @@ define([
 
 ],
 
-function(app, FauxtonAPI,Stats) {
+function(app, FauxtonAPI,Stats, d3, nv) {
+  console.log(nv);
   Views = {};
 
   datatypeEventer = {};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0088f6cd/src/fauxton/assets/js/libs/nv.d3.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/nv.d3.js b/src/fauxton/assets/js/libs/nv.d3.js
index 409dc65..983b901 100755
--- a/src/fauxton/assets/js/libs/nv.d3.js
+++ b/src/fauxton/assets/js/libs/nv.d3.js
@@ -1,8 +1,9 @@
 //this is a hacky fix because nv.d3 doesn't support requirejs
-define("nvd3", ["d3"], function (d3) {
+define("nv.d3", ["d3"], function (d3) {
+  var nv;
 (function(){
 
-var nv = window.nv || {};
+  nv = window.nv || {};
 
 
 nv.version = '1.1.15b';
@@ -14369,6 +14370,5 @@ nv.models.stackedAreaChart = function() {
   return chart;
 }
 })();
-
-return window.nv;
+return nv;
 });


[26/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Update 1.6.0 notes with proper CVE-2014-2668 note


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 7ae087c6479b62ccb0ecc8735339a8fe7dbe4438
Parents: b532aa8
Author: Dirkjan Ochtman <di...@ochtman.nl>
Authored: Tue Apr 15 09:13:19 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Apr 15 22:29:17 2014 +0200

----------------------------------------------------------------------
 share/doc/src/whatsnew/1.6.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7ae087c6/share/doc/src/whatsnew/1.6.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/whatsnew/1.6.rst b/share/doc/src/whatsnew/1.6.rst
index 7d93ff6..b1d9bc0 100644
--- a/share/doc/src/whatsnew/1.6.rst
+++ b/share/doc/src/whatsnew/1.6.rst
@@ -46,6 +46,16 @@ Version 1.6.0
 * Fauxton: many improvements in our experimental new user interface, including
   switching the code editor from CodeMirror to Ace as well as better support
   for various browsers.
+* Add the ``max_count`` option (:ref:`config/uuids`) to allow rate-limiting
+  the amount of UUIDs that can be requested from the :ref:`api/server/uuids`
+  handler in a single request (:ref:`CVE 2014-2668 <cve/2014-2668>`).
+* :issue:`1986`: increase socket buffer size to improve replication speed
+  for large documents and attachments, and fix tests on BSD-like systems.
+  :commit:`9a0e561b`
+* :issue:`1953`: improve performance of multipart/related requests.
+  :commit:`ce3e89dc`
+* :issue:`2221`: verify that authentication-related configuration settings
+  are well-formed. :commit:`dbe769c6`
 * :issue:`1922`: fix CORS exposed headers. :commit:`4f619833`
 * Rename ``proxy_authentification_handler`` to ``proxy_authentication_handler``.
   :commit:`c66ac4a8`


[23/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fix 231-cors test suite bad plan and duplicate start for dep apps


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

Branch: refs/heads/Query-UI-Cleanup
Commit: a83cfef06ddecd28daa269523dc4e5a217c37e6a
Parents: 6fe7583
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Apr 15 22:14:30 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Apr 15 22:27:36 2014 +0400

----------------------------------------------------------------------
 test/etap/231-cors.t | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a83cfef0/test/etap/231-cors.t
----------------------------------------------------------------------
diff --git a/test/etap/231-cors.t b/test/etap/231-cors.t
index dd08ca8..0d79310 100644
--- a/test/etap/231-cors.t
+++ b/test/etap/231-cors.t
@@ -32,7 +32,7 @@ server() ->
 main(_) ->
     test_util:init_code_path(),
 
-    etap:plan(28),
+    etap:plan(25),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -58,10 +58,6 @@ cycle_db(DbName) ->
     Db.
 
 test() ->
-
-    ibrowse:start(),
-    crypto:start(),
-
     %% launch couchdb
     couch_server_sup:start_link(test_util:config_files()),
 


[08/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add GA tracking to docs, only when not local


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 0b31731982f8edf1ec52166d4b7fc54f21723951
Parents: bbcd98b
Author: Noah Slater <ns...@tumbolia.org>
Authored: Thu Apr 10 12:45:40 2014 +0200
Committer: Noah Slater <ns...@tumbolia.org>
Committed: Thu Apr 10 12:45:40 2014 +0200

----------------------------------------------------------------------
 share/doc/src/conf.py             |  5 ++++-
 share/doc/templates/help.html     |  4 ++--
 share/doc/templates/tracking.html | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0b317319/share/doc/src/conf.py
----------------------------------------------------------------------
diff --git a/share/doc/src/conf.py b/share/doc/src/conf.py
index 14a93f5..03c5dd6 100644
--- a/share/doc/src/conf.py
+++ b/share/doc/src/conf.py
@@ -106,7 +106,9 @@ html_additional_pages = {
     'index': 'pages/index.html'
 }
 
-html_context = {}
+html_context = {
+    "ga_code": "UA-658988-6"
+}
 
 html_sidebars = {
     "**": [
@@ -115,6 +117,7 @@ html_sidebars = {
         "relations.html",
         "utilities.html",
         "help.html",
+        "tracking.html",
     ]
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0b317319/share/doc/templates/help.html
----------------------------------------------------------------------
diff --git a/share/doc/templates/help.html b/share/doc/templates/help.html
index be0cb91..a6b7859 100644
--- a/share/doc/templates/help.html
+++ b/share/doc/templates/help.html
@@ -16,9 +16,9 @@ specific language governing permissions and limitations under the License.
 <h3>More Help</h3>
 
 <ul>
-<li><a href="https://couchdb.apache.org/">Homepage</a></li>
+<li><a href="https://couchdb.apache.org/"{% if not local %} onclick="_gaq.push(['_link', 'https://couchdb.apache.org/']); return false;"{% endif %}>Homepage</a></li>
 <li><a href="http://wiki.apache.org/couchdb/">Wiki</a></li>
-<li><a href="https://couchdb.apache.org/#mailing-list">Mailing Lists</a></li>
+<li><a href="https://couchdb.apache.org/#mailing-list"{% if not local %} onclick="_gaq.push(['_link', 'https://couchdb.apache.org/#mailing-list']); return false;"{% endif %}>Mailing Lists</a></li>
 <li><a href="http://webchat.freenode.net/?channels=couchdb">IRC</a></li>
 <li><a href="https://issues.apache.org/jira/browse/CouchDB">Issues</a></li>
 <li><a href="{{ pathto('download') }}">Download</a></li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0b317319/share/doc/templates/tracking.html
----------------------------------------------------------------------
diff --git a/share/doc/templates/tracking.html b/share/doc/templates/tracking.html
new file mode 100644
index 0000000..e6d4037
--- /dev/null
+++ b/share/doc/templates/tracking.html
@@ -0,0 +1,15 @@
+{% if not local %}
+<script type="text/javascript">
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', '{{ ga_code }}']);
+  _gaq.push(['_setDomainName', 'couchdb.org']);
+  _gaq.push(['_setAllowLinker', true]);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+</script>
+{% endif %}


[11/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: Remove reset of pagination


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 198eb74752504dc62eba7d4232b5ebff9fbf988c
Parents: 5f69849
Author: Garren Smith <ga...@gmail.com>
Authored: Sat Apr 12 15:47:43 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Apr 14 08:47:45 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/198eb747/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 5e8834f..64254f1 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -340,8 +340,6 @@ function(app, FauxtonAPI, Documents, Databases) {
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
         ];
       };
-
-      Documents.paginate.reset();
     },
 
     updateAllDocsFromView: function (event) {


[33/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Query UI cleanup


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 29d023a584593d22a9557337f0b83ee5ff8ca1bc
Parents: 6941276
Author: suelockwood <de...@apache.org>
Authored: Tue Apr 1 16:47:57 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Wed Apr 16 13:34:25 2014 -0400

----------------------------------------------------------------------
 .../documents/templates/advanced_options.html   | 47 +++++++++++---------
 1 file changed, 25 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/29d023a5/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 55c5946..892ce6c 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -18,7 +18,7 @@ the License.
 
   <div class="btn-group toggle-btns">
     <label for="showKeys" class="drop-down btn active">
-     Specific Keys 
+     Specific Key(s)
     </label>
     <label for="showStartEnd" class="drop-down btn">
       Bounded Queries
@@ -28,16 +28,19 @@ the License.
   <div class="controls-group well">
     <div class="row-fluid" id="js-showKeys">
       <div class="controls controls-row">
-        <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder="Enter a key, an array of keys. This must be valid JSON."></textarea>
+        <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
+        <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder='Enter valid JSON; e.g., ["1234"] or ["1234","2345"]'></textarea>
         <div id="keys-error" class="inline-block js-keys-error"></div>
       </div>
     </div>
     <div class="row-fluid hide" id="js-showStartEnd">
       <div class="controls controls-row">
-        <input name="startkey" class="span6" type="text" placeholder="Start Key" disabled>
-        <input name="endkey" class="span6" type="text" placeholder="End Key">
+        <label for="startkey" class="drop-down">Start key</label>
+        <input name="startkey" id="startkey" class="span6" type="text" placeholder='e.g., "1234"' disabled>
+        <label for="endkey" class="drop-down">End key</label>
+        <input id="endkey" name="endkey" class="span6" type="text" placeholder='e.g., "1234"'>
       </div>
-      <div class="controls controls-row checkbox inline">  
+      <div class="controls controls-row checkbox inline">
         <input id="check5" name="inclusive_end" type="checkbox" value="false" disabled>
         <label for="check5">Disable Inclusive End</label>
       </div>
@@ -61,20 +64,20 @@ the License.
         </select>
       </label>
       <label for="skipRows" class="inline drop-down">
-        Skip: 
-        <input name="skip" class="input-large" type="text" id="skipRows" placeholder="Number of rows to skip">
+        # of rows to skip"
+        <input name="skip" class="input-small" type="text" id="skipRows">
       </label>
 
-      <div class="checkbox inline"> 
-        <input id="check1" type="checkbox" name="include_docs" value="true">  
-        <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>  
+      <div class="checkbox inline">
+        <input id="check1" type="checkbox" name="include_docs" value="true">
+        <label name="include_docs" for="check1">Include Docs (show the entire doc body)</label>
       </div>
 
       <% if (hasReduce) { %>
-      <div class="checkbox inline">  
+      <div class="checkbox inline">
         <input id="check2" name="reduce" type="checkbox" value="true">
-        <label for="check2">Reduce</label>  
-      </div> 
+        <label for="check2">Reduce</label>
+      </div>
       <label id="select1" class="drop-down inline">
         Group Level:
         <select id="select1" disabled name="group_level" class="input-small">
@@ -88,28 +91,28 @@ the License.
           <option value="7">7</option>
           <option value="8">8</option>
           <option value="9">9</option>
-          <option value="999" selected="selected">exact</option>
+          <option value="999" selected="selected">Exact</option>
         </select>
       </label>
       <% } %>
 
       <label id="select2" class="drop-down inline">
-        Order: 
+        Order:
         <select id="select2" name="descending" class="input-large">
-          <option value="false">Accending</option>
+          <option value="false">Ascending</option>
           <option value="true">Descending</option>
         </select>
       </label>
 
-      <div class="checkbox inline">  
-        <input id="check6" name="update_seq" type="checkbox" value="true">  
-        <label for="check6">Update Sequence</label>  
+      <div class="checkbox inline">
+        <input id="check6" name="update_seq" type="checkbox" value="true">
+        <label for="check6">Update Sequence</label>
       </div>
 
       <% if (showPreview) { %>
-      <div class="checkbox inline">  
-        <input id="check7" name="stale" type="checkbox" value="true">  
-        <label for="check7">Stale</label>  
+      <div class="checkbox inline">
+        <input id="check7" name="stale" type="checkbox" value="true">
+        <label for="check7">Stale</label>
       </div>
       <% } %>
   </div>


[24/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Actually, run the test case for COUCHDB-1697


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

Branch: refs/heads/Query-UI-Cleanup
Commit: d1ca821f015cceb98da443dc8e4e6478c97cf644
Parents: a83cfef
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Apr 15 22:15:09 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Apr 15 22:27:40 2014 +0400

----------------------------------------------------------------------
 test/etap/231-cors.t | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1ca821f/test/etap/231-cors.t
----------------------------------------------------------------------
diff --git a/test/etap/231-cors.t b/test/etap/231-cors.t
index 0d79310..c568e79 100644
--- a/test/etap/231-cors.t
+++ b/test/etap/231-cors.t
@@ -32,7 +32,7 @@ server() ->
 main(_) ->
     test_util:init_code_path(),
 
-    etap:plan(25),
+    etap:plan(26),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -87,6 +87,7 @@ test() ->
     test_db1_origin_request(),
     test_preflight_with_port1(),
     test_preflight_with_scheme1(),
+    test_if_none_match_header(),
 
     ok = couch_config:set("cors", "origins", "http://example.com:5984", false),
     test_preflight_with_port2(),


[28/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add some more files to the build system


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 31431faddc69b3591327a373daec04a1fe4ba420
Parents: 8eb4e32
Author: Dirkjan Ochtman <di...@ochtman.nl>
Authored: Tue Apr 15 10:20:31 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Apr 15 22:30:40 2014 +0200

----------------------------------------------------------------------
 share/doc/build/Makefile.am | 1 +
 src/Makefile.am             | 2 ++
 test/etap/Makefile.am       | 1 +
 3 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/31431fad/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 86351f4..92ec2ff 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -450,6 +450,7 @@ src_files_html = \
     ../templates/layout.html \
     ../templates/help.html \
     ../templates/searchbox.html \
+    ../templates/tracing.html \
     ../templates/utilities.html
 
 sphinx_extensions = \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/31431fad/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index c574c6e..a17674c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -326,12 +326,14 @@ FAUXTON_FILES = \
     fauxton/assets/less/variables.less \
     fauxton/bin/grunt \
     fauxton/couchapp.js \
+    fauxton/extensions.md \
     fauxton/favicon.ico \
     fauxton/Gruntfile.js \
     fauxton/index.html \
     fauxton/package.json \
     fauxton/readme.md \
     fauxton/settings.json.default \
+    fauxton/settings.json.dev \
     fauxton/settings.json.sample_external \
     fauxton/tasks/addon/rename.json \
     fauxton/tasks/addon/root/base.js.underscore \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/31431fad/test/etap/Makefile.am
----------------------------------------------------------------------
diff --git a/test/etap/Makefile.am b/test/etap/Makefile.am
index 66048a9..c9778ca 100644
--- a/test/etap/Makefile.am
+++ b/test/etap/Makefile.am
@@ -50,6 +50,7 @@ tap_files = \
     041-uuid-gen-utc.ini \
     041-uuid-gen.t \
     042-work-queue.t \
+    043-find-in-binary.t \
     050-stream.t \
     060-kt-merging.t \
     061-kt-missing-leaves.t \


[32/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
[build] fix build on Mac after ed000eea

The new subdir-objects automake option creates temp files that
trips up the license check. Thanks to Alexander and Noah for
helping to track this down.


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 6941276424cf9994d9f3735ff3c9e9a98a8c59cd
Parents: a5489a7
Author: Jan Lehnardt <ja...@apache.org>
Authored: Wed Apr 16 19:30:29 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Apr 16 19:30:29 2014 +0200

----------------------------------------------------------------------
 license.skip | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/69412764/license.skip
----------------------------------------------------------------------
diff --git a/license.skip b/license.skip
index 45558d1..f5e49da 100644
--- a/license.skip
+++ b/license.skip
@@ -114,6 +114,8 @@
 ^src/couchdb/priv/couchjs
 ^src/couchdb/priv/couchspawnkillable
 ^src/couchdb/priv/stat_descriptions.cfg
+^src/couchdb/priv/icu_driver/.deps/.dirstamp
+^src/couchdb/priv/icu_driver/.dirstamp
 ^src/couchjs-node/package.json
 ^src/couchjs-node/sandbox.js
 ^src/couchjs-node/README.md


[09/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fix automake subdir-objects warnings on Mac OS X


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

Branch: refs/heads/Query-UI-Cleanup
Commit: ed000eea295897fc521a7f224a2371f54dd92c4d
Parents: 0b31731
Author: Alexander Shorin <kx...@apache.org>
Authored: Sun Apr 13 04:40:16 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sun Apr 13 04:40:16 2014 +0400

----------------------------------------------------------------------
 src/couchdb/priv/Makefile.am | 2 ++
 src/ejson/Makefile.am        | 2 ++
 src/snappy/Makefile.am       | 2 ++
 3 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed000eea/src/couchdb/priv/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couchdb/priv/Makefile.am b/src/couchdb/priv/Makefile.am
index 9a24222..a7973ba 100644
--- a/src/couchdb/priv/Makefile.am
+++ b/src/couchdb/priv/Makefile.am
@@ -10,6 +10,8 @@
 ## License for the specific language governing permissions and limitations under
 ## the License.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 MAKE_SAFE = $(MAKE)
 
 couchlibdir = $(localerlanglibdir)/couch-$(version)

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed000eea/src/ejson/Makefile.am
----------------------------------------------------------------------
diff --git a/src/ejson/Makefile.am b/src/ejson/Makefile.am
index c1e07db..60dacc2 100644
--- a/src/ejson/Makefile.am
+++ b/src/ejson/Makefile.am
@@ -10,6 +10,8 @@
 ## License for the specific language governing permissions and limitations under
 ## the License.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 ejsonebindir = $(localerlanglibdir)/ejson-0.1.0/ebin
 ejsonprivdir = $(localerlanglibdir)/ejson-0.1.0/priv
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed000eea/src/snappy/Makefile.am
----------------------------------------------------------------------
diff --git a/src/snappy/Makefile.am b/src/snappy/Makefile.am
index ff75f07..4bcfaea 100644
--- a/src/snappy/Makefile.am
+++ b/src/snappy/Makefile.am
@@ -10,6 +10,8 @@
 ## License for the specific language governing permissions and limitations under
 ## the License.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 snappyebindir = $(localerlanglibdir)/snappy-1.0.5/ebin
 snappyprivdir = $(localerlanglibdir)/snappy-1.0.5/priv
 


[31/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add documentation for CVE-2014-2668


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

Branch: refs/heads/Query-UI-Cleanup
Commit: a5489a7e4771693974f8190710a7d074aa206f26
Parents: 4924567
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Apr 15 09:11:00 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Apr 16 16:43:10 2014 +0200

----------------------------------------------------------------------
 share/doc/src/cve/2014-2668.rst | 54 ++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a5489a7e/share/doc/src/cve/2014-2668.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/cve/2014-2668.rst b/share/doc/src/cve/2014-2668.rst
new file mode 100644
index 0000000..5ccd2a4
--- /dev/null
+++ b/share/doc/src/cve/2014-2668.rst
@@ -0,0 +1,54 @@
+.. 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.
+
+
+.. _cve/2014-2668:
+
+==================================================================================
+CVE-2014-2668: DoS (CPU and memory consumption) via the count parameter to /_uuids
+==================================================================================
+
+:Date: 26.03.2014
+
+:Affected: Apache CouchDB releases up to and including 1.3.1, 1.4.0,
+           and 1.5.0 are vulnerable.
+
+:Severity: Moderate
+
+:Vendor: The Apache Software Foundation
+
+Description
+===========
+
+The :ref:`api/server/uuids` resource's `count` query parameter is able to take
+unreasonable huge numeric value which leads to exhaustion of server resources
+(CPU and memory) and to DoS as the result.
+
+Mitigation
+==========
+
+Upgrade to a supported CouchDB release that includes this fix, such as:
+
+- :ref:`1.5.1 <release/1.5.1>`
+- :ref:`1.6.0 <release/1.6.0>`
+
+All listed releases have included a specific fix to
+
+Work-Around
+===========
+
+Disable the :ref:`api/server/uuids` handler completely, by adapting
+`local.ini` and restarting CouchDB::
+
+  [httpd_global_handlers]
+  _uuids =
+


[20/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: remove the hidden tabs

Closes #200


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 75fd476f2f4b62a9d3a82b9bd9e68737df1b2c5f
Parents: 7db8564
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Mar 31 22:59:32 2014 +0200
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 14:40:15 2014 -0400

----------------------------------------------------------------------
 src/Makefile.am                                 |  1 -
 src/fauxton/app/addons/documents/routes.js      |  6 ----
 .../app/addons/documents/templates/tabs.html    | 18 ------------
 src/fauxton/app/addons/documents/views.js       | 30 --------------------
 4 files changed, 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fd476f/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index a0d1557..c574c6e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -188,7 +188,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/documents/templates/jumpdoc.html \
     fauxton/app/addons/documents/templates/search.html \
     fauxton/app/addons/documents/templates/sidebar.html \
-    fauxton/app/addons/documents/templates/tabs.html \
     fauxton/app/addons/documents/templates/upload_modal.html \
     fauxton/app/addons/documents/templates/view_editor.html \
     fauxton/app/addons/documents/tests/resourcesSpec.js \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fd476f/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 3bf8f7e..5497a30 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -485,12 +485,6 @@ function(app, FauxtonAPI, Documents, Databases) {
       var docParams = app.getParams();
 
       this.database.buildChanges(docParams);
-
-      this.setView("#tabs", new Documents.Views.Tabs({
-        collection: this.designDocs,
-        database: this.database,
-        active_id: 'changes'
-      }));
     },
 
     changes: function (event) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fd476f/src/fauxton/app/addons/documents/templates/tabs.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/tabs.html b/src/fauxton/app/addons/documents/templates/tabs.html
deleted file mode 100644
index f8b0c4b..0000000
--- a/src/fauxton/app/addons/documents/templates/tabs.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!--
-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.
--->
-
-<ul class="nav nav-tabs">
-  <li class="active"><a href="<%= db_url %>">Docs</a></li>
-  <li id="changes"><a  href="<%= changes_url %>">Changes</a></li>
-</ul>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fd476f/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 eba2b1b..7892d18 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -34,36 +34,6 @@ define([
 function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
          resizeColumns, beautify, prettify, ZeroClipboard) {
   var Views = {};
-  Views.Tabs = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/tabs",
-    initialize: function(options){
-      this.collection = options.collection;
-      this.database = options.database;
-      this.active_id = options.active_id;
-    },
-
-    serialize: function () {
-      return {
-        // TODO make this not hard coded here
-        changes_url: '#' + this.database.url('changes'),
-        db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
-      };
-    },
-
-    beforeRender: function(manage) {
-      this.insertView("#search", new Views.SearchBox({
-        collection: this.collection,
-        database: this.database.id
-      }));
-    },
-
-    afterRender: function () {
-      if (this.active_id) {
-        this.$('.active').removeClass('active');
-        this.$('#'+this.active_id).addClass('active');
-      }
-    }
-  });
 
   Views.SearchBox = FauxtonAPI.View.extend({
     template: "addons/documents/templates/search",


[29/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Sometimes one extra character makes all the difference


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 91575baf50859cb5dd26e26435eea3131d8e92c4
Parents: 31431fa
Author: Dirkjan Ochtman <di...@ochtman.nl>
Authored: Tue Apr 15 11:04:38 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Apr 15 22:30:49 2014 +0200

----------------------------------------------------------------------
 share/doc/build/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/91575baf/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 92ec2ff..7b95d0d 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -450,7 +450,7 @@ src_files_html = \
     ../templates/layout.html \
     ../templates/help.html \
     ../templates/searchbox.html \
-    ../templates/tracing.html \
+    ../templates/tracking.html \
     ../templates/utilities.html
 
 sphinx_extensions = \


[05/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Merge branch '2221-bug-validate-auth-params'


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 631d033e37ce4116ad3f1f64a4796472c90f39ac
Parents: 9c5e437 dbe769c
Author: Robert Newson <rn...@apache.org>
Authored: Wed Apr 9 21:45:10 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Apr 9 21:45:10 2014 +0100

----------------------------------------------------------------------
 etc/couchdb/default.ini.tpl.in   |  2 ++
 share/doc/src/config/auth.rst    | 24 ++++++++++++++++++++++++
 src/couchdb/couch_httpd_auth.erl | 17 +++++++++++++++++
 src/couchdb/couch_passwords.erl  | 15 +++++++++++----
 4 files changed, 54 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[30/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
[build] add missing Makefile.am entries. Actual file still missing.


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 4924567b10c204f304b2cda431c8feb4cd9d47e7
Parents: 91575ba
Author: Jan Lehnardt <ja...@apache.org>
Authored: Wed Apr 16 16:42:00 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Apr 16 16:42:00 2014 +0200

----------------------------------------------------------------------
 share/doc/build/Makefile.am | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4924567b/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 7b95d0d..b3fba13 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -120,6 +120,7 @@ html_files = \
     html/_sources/cve/2012-5641.txt \
     html/_sources/cve/2012-5649.txt \
     html/_sources/cve/2012-5650.txt \
+    html/_sources/cve/2014-2668.txt \
     html/_sources/cve/index.txt \
     html/_sources/fauxton/addons.txt \
     html/_sources/fauxton/index.txt \
@@ -242,6 +243,7 @@ html_files = \
     html/cve/2012-5641.html \
     html/cve/2012-5649.html \
     html/cve/2012-5650.html \
+    html/cve/2014-2668.html \
     html/cve/index.html \
     html/fauxton/addons.html \
     html/fauxton/index.html \


[02/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: fix undefined d3 dependency

Fixes the ActiveTasks View


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 9f6a9190f04a23690277888b5ae2413f7cef7a96
Parents: d816190
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Apr 5 17:52:38 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Apr 5 18:02:11 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9f6a9190/src/fauxton/app/helpers.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/helpers.js b/src/fauxton/app/helpers.js
index 4e515ec..208b0d9 100644
--- a/src/fauxton/app/helpers.js
+++ b/src/fauxton/app/helpers.js
@@ -23,7 +23,7 @@ define([
   "d3"
 ],
 
-function(utils) {
+function(utils, d3) {
 
   var Helpers = {};
 


[06/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
fix test assertion


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

Branch: refs/heads/Query-UI-Cleanup
Commit: fbc0545e39d7871afc469f3079dee67f823f3220
Parents: 631d033
Author: Robert Newson <rn...@apache.org>
Authored: Wed Apr 9 21:54:08 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Apr 9 21:54:08 2014 +0100

----------------------------------------------------------------------
 share/www/script/test/basics.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fbc0545e/share/www/script/test/basics.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/basics.js b/share/www/script/test/basics.js
index c1ba0af..993456c 100644
--- a/share/www/script/test/basics.js
+++ b/share/www/script/test/basics.js
@@ -267,7 +267,7 @@ couchTests.basics = function(debug) {
   TEquals(400, xhr.status, "should return a bad request");
   result = JSON.parse(xhr.responseText);
   TEquals("bad_request", result.error);
-  TEquals("You tried to DELETE a database with a ?=rev parameter. Did you mean to DELETE a document instead?", result.reason);
+  TEquals("You tried to DELETE a database with a ?rev= parameter. Did you mean to DELETE a document instead?", result.reason);
 
   // On restart, a request for creating a database that already exists can
   // not override the existing database file


[19/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: add external ZeroClipboard Dependency


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 7db856433e751c8b4bd82fad5ee265746cde765e
Parents: bf58b64
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Mar 31 20:35:51 2014 +0200
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 14:40:15 2014 -0400

----------------------------------------------------------------------
 .../js/plugins/zeroclipboard/ZeroClipboard.js   | 1031 ++++++++++++++++++
 .../js/plugins/zeroclipboard/ZeroClipboard.swf  |  Bin 0 -> 2157 bytes
 2 files changed, 1031 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7db85643/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.js b/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.js
new file mode 100755
index 0000000..136e4a9
--- /dev/null
+++ b/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.js
@@ -0,0 +1,1031 @@
+/*!
+* ZeroClipboard
+* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
+* Copyright (c) 2014 Jon Rohan, James M. Greene
+* Licensed MIT
+* http://zeroclipboard.org/
+* v1.3.5
+*/
+(function(window) {
+  "use strict";
+  var currentElement;
+  var flashState = {
+    bridge: null,
+    version: "0.0.0",
+    disabled: null,
+    outdated: null,
+    ready: null
+  };
+  var _clipData = {};
+  var clientIdCounter = 0;
+  var _clientMeta = {};
+  var elementIdCounter = 0;
+  var _elementMeta = {};
+  var _amdModuleId = null;
+  var _cjsModuleId = null;
+  var _swfPath = function() {
+    var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
+    if (document.currentScript && (jsPath = document.currentScript.src)) {} else {
+      var scripts = document.getElementsByTagName("script");
+      if ("readyState" in scripts[0]) {
+        for (i = scripts.length; i--; ) {
+          if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
+            break;
+          }
+        }
+      } else if (document.readyState === "loading") {
+        jsPath = scripts[scripts.length - 1].src;
+      } else {
+        for (i = scripts.length; i--; ) {
+          tmpJsPath = scripts[i].src;
+          if (!tmpJsPath) {
+            jsDir = null;
+            break;
+          }
+          tmpJsPath = tmpJsPath.split("#")[0].split("?")[0];
+          tmpJsPath = tmpJsPath.slice(0, tmpJsPath.lastIndexOf("/") + 1);
+          if (jsDir == null) {
+            jsDir = tmpJsPath;
+          } else if (jsDir !== tmpJsPath) {
+            jsDir = null;
+            break;
+          }
+        }
+        if (jsDir !== null) {
+          jsPath = jsDir;
+        }
+      }
+    }
+    if (jsPath) {
+      jsPath = jsPath.split("#")[0].split("?")[0];
+      swfPath = jsPath.slice(0, jsPath.lastIndexOf("/") + 1) + swfPath;
+    }
+    return swfPath;
+  }();
+  var _camelizeCssPropName = function() {
+    var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
+      return group.toUpperCase();
+    };
+    return function(prop) {
+      return prop.replace(matcherRegex, replacerFn);
+    };
+  }();
+  var _getStyle = function(el, prop) {
+    var value, camelProp, tagName, possiblePointers, i, len;
+    if (window.getComputedStyle) {
+      value = window.getComputedStyle(el, null).getPropertyValue(prop);
+    } else {
+      camelProp = _camelizeCssPropName(prop);
+      if (el.currentStyle) {
+        value = el.currentStyle[camelProp];
+      } else {
+        value = el.style[camelProp];
+      }
+    }
+    if (prop === "cursor") {
+      if (!value || value === "auto") {
+        tagName = el.tagName.toLowerCase();
+        if (tagName === "a") {
+          return "pointer";
+        }
+      }
+    }
+    return value;
+  };
+  var _elementMouseOver = function(event) {
+    if (!event) {
+      event = window.event;
+    }
+    var target;
+    if (this !== window) {
+      target = this;
+    } else if (event.target) {
+      target = event.target;
+    } else if (event.srcElement) {
+      target = event.srcElement;
+    }
+    ZeroClipboard.activate(target);
+  };
+  var _addEventHandler = function(element, method, func) {
+    if (!element || element.nodeType !== 1) {
+      return;
+    }
+    if (element.addEventListener) {
+      element.addEventListener(method, func, false);
+    } else if (element.attachEvent) {
+      element.attachEvent("on" + method, func);
+    }
+  };
+  var _removeEventHandler = function(element, method, func) {
+    if (!element || element.nodeType !== 1) {
+      return;
+    }
+    if (element.removeEventListener) {
+      element.removeEventListener(method, func, false);
+    } else if (element.detachEvent) {
+      element.detachEvent("on" + method, func);
+    }
+  };
+  var _addClass = function(element, value) {
+    if (!element || element.nodeType !== 1) {
+      return element;
+    }
+    if (element.classList) {
+      if (!element.classList.contains(value)) {
+        element.classList.add(value);
+      }
+      return element;
+    }
+    if (value && typeof value === "string") {
+      var classNames = (value || "").split(/\s+/);
+      if (element.nodeType === 1) {
+        if (!element.className) {
+          element.className = value;
+        } else {
+          var className = " " + element.className + " ", setClass = element.className;
+          for (var c = 0, cl = classNames.length; c < cl; c++) {
+            if (className.indexOf(" " + classNames[c] + " ") < 0) {
+              setClass += " " + classNames[c];
+            }
+          }
+          element.className = setClass.replace(/^\s+|\s+$/g, "");
+        }
+      }
+    }
+    return element;
+  };
+  var _removeClass = function(element, value) {
+    if (!element || element.nodeType !== 1) {
+      return element;
+    }
+    if (element.classList) {
+      if (element.classList.contains(value)) {
+        element.classList.remove(value);
+      }
+      return element;
+    }
+    if (value && typeof value === "string" || value === undefined) {
+      var classNames = (value || "").split(/\s+/);
+      if (element.nodeType === 1 && element.className) {
+        if (value) {
+          var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
+          for (var c = 0, cl = classNames.length; c < cl; c++) {
+            className = className.replace(" " + classNames[c] + " ", " ");
+          }
+          element.className = className.replace(/^\s+|\s+$/g, "");
+        } else {
+          element.className = "";
+        }
+      }
+    }
+    return element;
+  };
+  var _getZoomFactor = function() {
+    var rect, physicalWidth, logicalWidth, zoomFactor = 1;
+    if (typeof document.body.getBoundingClientRect === "function") {
+      rect = document.body.getBoundingClientRect();
+      physicalWidth = rect.right - rect.left;
+      logicalWidth = document.body.offsetWidth;
+      zoomFactor = Math.round(physicalWidth / logicalWidth * 100) / 100;
+    }
+    return zoomFactor;
+  };
+  var _getDOMObjectPosition = function(obj, defaultZIndex) {
+    var info = {
+      left: 0,
+      top: 0,
+      width: 0,
+      height: 0,
+      zIndex: _getSafeZIndex(defaultZIndex) - 1
+    };
+    if (obj.getBoundingClientRect) {
+      var rect = obj.getBoundingClientRect();
+      var pageXOffset, pageYOffset, zoomFactor;
+      if ("pageXOffset" in window && "pageYOffset" in window) {
+        pageXOffset = window.pageXOffset;
+        pageYOffset = window.pageYOffset;
+      } else {
+        zoomFactor = _getZoomFactor();
+        pageXOffset = Math.round(document.documentElement.scrollLeft / zoomFactor);
+        pageYOffset = Math.round(document.documentElement.scrollTop / zoomFactor);
+      }
+      var leftBorderWidth = document.documentElement.clientLeft || 0;
+      var topBorderWidth = document.documentElement.clientTop || 0;
+      info.left = rect.left + pageXOffset - leftBorderWidth;
+      info.top = rect.top + pageYOffset - topBorderWidth;
+      info.width = "width" in rect ? rect.width : rect.right - rect.left;
+      info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
+    }
+    return info;
+  };
+  var _cacheBust = function(path, options) {
+    var cacheBust = options == null || options && options.cacheBust === true && options.useNoCache === true;
+    if (cacheBust) {
+      return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + new Date().getTime();
+    } else {
+      return "";
+    }
+  };
+  var _vars = function(options) {
+    var i, len, domain, str = [], domains = [], trustedOriginsExpanded = [];
+    if (options.trustedOrigins) {
+      if (typeof options.trustedOrigins === "string") {
+        domains.push(options.trustedOrigins);
+      } else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
+        domains = domains.concat(options.trustedOrigins);
+      }
+    }
+    if (options.trustedDomains) {
+      if (typeof options.trustedDomains === "string") {
+        domains.push(options.trustedDomains);
+      } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
+        domains = domains.concat(options.trustedDomains);
+      }
+    }
+    if (domains.length) {
+      for (i = 0, len = domains.length; i < len; i++) {
+        if (domains.hasOwnProperty(i) && domains[i] && typeof domains[i] === "string") {
+          domain = _extractDomain(domains[i]);
+          if (!domain) {
+            continue;
+          }
+          if (domain === "*") {
+            trustedOriginsExpanded = [ domain ];
+            break;
+          }
+          trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, window.location.protocol + "//" + domain ]);
+        }
+      }
+    }
+    if (trustedOriginsExpanded.length) {
+      str.push("trustedOrigins=" + encodeURIComponent(trustedOriginsExpanded.join(",")));
+    }
+    if (typeof options.jsModuleId === "string" && options.jsModuleId) {
+      str.push("jsModuleId=" + encodeURIComponent(options.jsModuleId));
+    }
+    return str.join("&");
+  };
+  var _inArray = function(elem, array, fromIndex) {
+    if (typeof array.indexOf === "function") {
+      return array.indexOf(elem, fromIndex);
+    }
+    var i, len = array.length;
+    if (typeof fromIndex === "undefined") {
+      fromIndex = 0;
+    } else if (fromIndex < 0) {
+      fromIndex = len + fromIndex;
+    }
+    for (i = fromIndex; i < len; i++) {
+      if (array.hasOwnProperty(i) && array[i] === elem) {
+        return i;
+      }
+    }
+    return -1;
+  };
+  var _prepClip = function(elements) {
+    if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.");
+    if (!elements.length) return [ elements ];
+    return elements;
+  };
+  var _dispatchCallback = function(func, context, args, async) {
+    if (async) {
+      window.setTimeout(function() {
+        func.apply(context, args);
+      }, 0);
+    } else {
+      func.apply(context, args);
+    }
+  };
+  var _getSafeZIndex = function(val) {
+    var zIndex, tmp;
+    if (val) {
+      if (typeof val === "number" && val > 0) {
+        zIndex = val;
+      } else if (typeof val === "string" && (tmp = parseInt(val, 10)) && !isNaN(tmp) && tmp > 0) {
+        zIndex = tmp;
+      }
+    }
+    if (!zIndex) {
+      if (typeof _globalConfig.zIndex === "number" && _globalConfig.zIndex > 0) {
+        zIndex = _globalConfig.zIndex;
+      } else if (typeof _globalConfig.zIndex === "string" && (tmp = parseInt(_globalConfig.zIndex, 10)) && !isNaN(tmp) && tmp > 0) {
+        zIndex = tmp;
+      }
+    }
+    return zIndex || 0;
+  };
+  var _deprecationWarning = function(deprecatedApiName, debugEnabled) {
+    if (deprecatedApiName && debugEnabled !== false && typeof console !== "undefined" && console && (console.warn || console.log)) {
+      var deprecationWarning = "`" + deprecatedApiName + "` is deprecated. See docs for more info:\n" + "    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";
+      if (console.warn) {
+        console.warn(deprecationWarning);
+      } else {
+        console.log(deprecationWarning);
+      }
+    }
+  };
+  var _extend = function() {
+    var i, len, arg, prop, src, copy, target = arguments[0] || {};
+    for (i = 1, len = arguments.length; i < len; i++) {
+      if ((arg = arguments[i]) != null) {
+        for (prop in arg) {
+          if (arg.hasOwnProperty(prop)) {
+            src = target[prop];
+            copy = arg[prop];
+            if (target === copy) {
+              continue;
+            }
+            if (copy !== undefined) {
+              target[prop] = copy;
+            }
+          }
+        }
+      }
+    }
+    return target;
+  };
+  var _extractDomain = function(originOrUrl) {
+    if (originOrUrl == null || originOrUrl === "") {
+      return null;
+    }
+    originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
+    if (originOrUrl === "") {
+      return null;
+    }
+    var protocolIndex = originOrUrl.indexOf("//");
+    originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
+    var pathIndex = originOrUrl.indexOf("/");
+    originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
+    if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
+      return null;
+    }
+    return originOrUrl || null;
+  };
+  var _determineScriptAccess = function() {
+    var _extractAllDomains = function(origins, resultsArray) {
+      var i, len, tmp;
+      if (origins != null && resultsArray[0] !== "*") {
+        if (typeof origins === "string") {
+          origins = [ origins ];
+        }
+        if (typeof origins === "object" && "length" in origins) {
+          for (i = 0, len = origins.length; i < len; i++) {
+            if (origins.hasOwnProperty(i)) {
+              tmp = _extractDomain(origins[i]);
+              if (tmp) {
+                if (tmp === "*") {
+                  resultsArray.length = 0;
+                  resultsArray.push("*");
+                  break;
+                }
+                if (_inArray(tmp, resultsArray) === -1) {
+                  resultsArray.push(tmp);
+                }
+              }
+            }
+          }
+        }
+      }
+    };
+    var _accessLevelLookup = {
+      always: "always",
+      samedomain: "sameDomain",
+      never: "never"
+    };
+    return function(currentDomain, configOptions) {
+      var asaLower, allowScriptAccess = configOptions.allowScriptAccess;
+      if (typeof allowScriptAccess === "string" && (asaLower = allowScriptAccess.toLowerCase()) && /^always|samedomain|never$/.test(asaLower)) {
+        return _accessLevelLookup[asaLower];
+      }
+      var swfDomain = _extractDomain(configOptions.moviePath);
+      if (swfDomain === null) {
+        swfDomain = currentDomain;
+      }
+      var trustedDomains = [];
+      _extractAllDomains(configOptions.trustedOrigins, trustedDomains);
+      _extractAllDomains(configOptions.trustedDomains, trustedDomains);
+      var len = trustedDomains.length;
+      if (len > 0) {
+        if (len === 1 && trustedDomains[0] === "*") {
+          return "always";
+        }
+        if (_inArray(currentDomain, trustedDomains) !== -1) {
+          if (len === 1 && currentDomain === swfDomain) {
+            return "sameDomain";
+          }
+          return "always";
+        }
+      }
+      return "never";
+    };
+  }();
+  var _objectKeys = function(obj) {
+    if (obj == null) {
+      return [];
+    }
+    if (Object.keys) {
+      return Object.keys(obj);
+    }
+    var keys = [];
+    for (var prop in obj) {
+      if (obj.hasOwnProperty(prop)) {
+        keys.push(prop);
+      }
+    }
+    return keys;
+  };
+  var _deleteOwnProperties = function(obj) {
+    if (obj) {
+      for (var prop in obj) {
+        if (obj.hasOwnProperty(prop)) {
+          delete obj[prop];
+        }
+      }
+    }
+    return obj;
+  };
+  var _safeActiveElement = function() {
+    try {
+      return document.activeElement;
+    } catch (err) {}
+    return null;
+  };
+  var _detectFlashSupport = function() {
+    var hasFlash = false;
+    if (typeof flashState.disabled === "boolean") {
+      hasFlash = flashState.disabled === false;
+    } else {
+      if (typeof ActiveXObject === "function") {
+        try {
+          if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
+            hasFlash = true;
+          }
+        } catch (error) {}
+      }
+      if (!hasFlash && navigator.mimeTypes["application/x-shockwave-flash"]) {
+        hasFlash = true;
+      }
+    }
+    return hasFlash;
+  };
+  function _parseFlashVersion(flashVersion) {
+    return flashVersion.replace(/,/g, ".").replace(/[^0-9\.]/g, "");
+  }
+  function _isFlashVersionSupported(flashVersion) {
+    return parseFloat(_parseFlashVersion(flashVersion)) >= 10;
+  }
+  var ZeroClipboard = function(elements, options) {
+    if (!(this instanceof ZeroClipboard)) {
+      return new ZeroClipboard(elements, options);
+    }
+    this.id = "" + clientIdCounter++;
+    _clientMeta[this.id] = {
+      instance: this,
+      elements: [],
+      handlers: {}
+    };
+    if (elements) {
+      this.clip(elements);
+    }
+    if (typeof options !== "undefined") {
+      _deprecationWarning("new ZeroClipboard(elements, options)", _globalConfig.debug);
+      ZeroClipboard.config(options);
+    }
+    this.options = ZeroClipboard.config();
+    if (typeof flashState.disabled !== "boolean") {
+      flashState.disabled = !_detectFlashSupport();
+    }
+    if (flashState.disabled === false && flashState.outdated !== true) {
+      if (flashState.bridge === null) {
+        flashState.outdated = false;
+        flashState.ready = false;
+        _bridge();
+      }
+    }
+  };
+  ZeroClipboard.prototype.setText = function(newText) {
+    if (newText && newText !== "") {
+      _clipData["text/plain"] = newText;
+      if (flashState.ready === true && flashState.bridge && typeof flashState.bridge.setText === "function") {
+        flashState.bridge.setText(newText);
+      } else {
+        flashState.ready = false;
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.setSize = function(width, height) {
+    if (flashState.ready === true && flashState.bridge && typeof flashState.bridge.setSize === "function") {
+      flashState.bridge.setSize(width, height);
+    } else {
+      flashState.ready = false;
+    }
+    return this;
+  };
+  var _setHandCursor = function(enabled) {
+    if (flashState.ready === true && flashState.bridge && typeof flashState.bridge.setHandCursor === "function") {
+      flashState.bridge.setHandCursor(enabled);
+    } else {
+      flashState.ready = false;
+    }
+  };
+  ZeroClipboard.prototype.destroy = function() {
+    this.unclip();
+    this.off();
+    delete _clientMeta[this.id];
+  };
+  var _getAllClients = function() {
+    var i, len, client, clients = [], clientIds = _objectKeys(_clientMeta);
+    for (i = 0, len = clientIds.length; i < len; i++) {
+      client = _clientMeta[clientIds[i]].instance;
+      if (client && client instanceof ZeroClipboard) {
+        clients.push(client);
+      }
+    }
+    return clients;
+  };
+  ZeroClipboard.version = "1.3.5";
+  var _globalConfig = {
+    swfPath: _swfPath,
+    trustedDomains: window.location.host ? [ window.location.host ] : [],
+    cacheBust: true,
+    forceHandCursor: false,
+    zIndex: 999999999,
+    debug: true,
+    title: null,
+    autoActivate: true
+  };
+  ZeroClipboard.config = function(options) {
+    if (typeof options === "object" && options !== null) {
+      _extend(_globalConfig, options);
+    }
+    if (typeof options === "string" && options) {
+      if (_globalConfig.hasOwnProperty(options)) {
+        return _globalConfig[options];
+      }
+      return;
+    }
+    var copy = {};
+    for (var prop in _globalConfig) {
+      if (_globalConfig.hasOwnProperty(prop)) {
+        if (typeof _globalConfig[prop] === "object" && _globalConfig[prop] !== null) {
+          if ("length" in _globalConfig[prop]) {
+            copy[prop] = _globalConfig[prop].slice(0);
+          } else {
+            copy[prop] = _extend({}, _globalConfig[prop]);
+          }
+        } else {
+          copy[prop] = _globalConfig[prop];
+        }
+      }
+    }
+    return copy;
+  };
+  ZeroClipboard.destroy = function() {
+    ZeroClipboard.deactivate();
+    for (var clientId in _clientMeta) {
+      if (_clientMeta.hasOwnProperty(clientId) && _clientMeta[clientId]) {
+        var client = _clientMeta[clientId].instance;
+        if (client && typeof client.destroy === "function") {
+          client.destroy();
+        }
+      }
+    }
+    var htmlBridge = _getHtmlBridge(flashState.bridge);
+    if (htmlBridge && htmlBridge.parentNode) {
+      htmlBridge.parentNode.removeChild(htmlBridge);
+      flashState.ready = null;
+      flashState.bridge = null;
+    }
+  };
+  ZeroClipboard.activate = function(element) {
+    if (currentElement) {
+      _removeClass(currentElement, _globalConfig.hoverClass);
+      _removeClass(currentElement, _globalConfig.activeClass);
+    }
+    currentElement = element;
+    _addClass(element, _globalConfig.hoverClass);
+    _reposition();
+    var newTitle = _globalConfig.title || element.getAttribute("title");
+    if (newTitle) {
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.setAttribute("title", newTitle);
+      }
+    }
+    var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
+    _setHandCursor(useHandCursor);
+  };
+  ZeroClipboard.deactivate = function() {
+    var htmlBridge = _getHtmlBridge(flashState.bridge);
+    if (htmlBridge) {
+      htmlBridge.style.left = "0px";
+      htmlBridge.style.top = "-9999px";
+      htmlBridge.removeAttribute("title");
+    }
+    if (currentElement) {
+      _removeClass(currentElement, _globalConfig.hoverClass);
+      _removeClass(currentElement, _globalConfig.activeClass);
+      currentElement = null;
+    }
+  };
+  var _bridge = function() {
+    var flashBridge, len;
+    var container = document.getElementById("global-zeroclipboard-html-bridge");
+    if (!container) {
+      var opts = ZeroClipboard.config();
+      opts.jsModuleId = typeof _amdModuleId === "string" && _amdModuleId || typeof _cjsModuleId === "string" && _cjsModuleId || null;
+      var allowScriptAccess = _determineScriptAccess(window.location.host, _globalConfig);
+      var flashvars = _vars(opts);
+      var swfUrl = _globalConfig.moviePath + _cacheBust(_globalConfig.moviePath, _globalConfig);
+      var html = '      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="' + swfUrl + '"/>         <param name="allowScriptAccess" value="' + allowScriptAccess + '"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="' + flashvars + '"/>         <embed src="' + swfUrl + '"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="' + allowScriptAccess + '"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"          
  pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="' + flashvars + '"           scale="exactfit">         </embed>       </object>';
+      container = document.createElement("div");
+      container.id = "global-zeroclipboard-html-bridge";
+      container.setAttribute("class", "global-zeroclipboard-container");
+      container.style.position = "absolute";
+      container.style.left = "0px";
+      container.style.top = "-9999px";
+      container.style.width = "15px";
+      container.style.height = "15px";
+      container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
+      document.body.appendChild(container);
+      container.innerHTML = html;
+    }
+    flashBridge = document["global-zeroclipboard-flash-bridge"];
+    if (flashBridge && (len = flashBridge.length)) {
+      flashBridge = flashBridge[len - 1];
+    }
+    flashState.bridge = flashBridge || container.children[0].lastElementChild;
+  };
+  var _getHtmlBridge = function(flashBridge) {
+    var isFlashElement = /^OBJECT|EMBED$/;
+    var htmlBridge = flashBridge && flashBridge.parentNode;
+    while (htmlBridge && isFlashElement.test(htmlBridge.nodeName) && htmlBridge.parentNode) {
+      htmlBridge = htmlBridge.parentNode;
+    }
+    return htmlBridge || null;
+  };
+  var _reposition = function() {
+    if (currentElement) {
+      var pos = _getDOMObjectPosition(currentElement, _globalConfig.zIndex);
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.style.top = pos.top + "px";
+        htmlBridge.style.left = pos.left + "px";
+        htmlBridge.style.width = pos.width + "px";
+        htmlBridge.style.height = pos.height + "px";
+        htmlBridge.style.zIndex = pos.zIndex + 1;
+      }
+      if (flashState.ready === true && flashState.bridge && typeof flashState.bridge.setSize === "function") {
+        flashState.bridge.setSize(pos.width, pos.height);
+      } else {
+        flashState.ready = false;
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.on = function(eventName, func) {
+    var i, len, events, added = {}, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (typeof eventName === "string" && eventName) {
+      events = eventName.toLowerCase().split(/\s+/);
+    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
+      for (i in eventName) {
+        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
+          this.on(i, eventName[i]);
+        }
+      }
+    }
+    if (events && events.length) {
+      for (i = 0, len = events.length; i < len; i++) {
+        eventName = events[i].replace(/^on/, "");
+        added[eventName] = true;
+        if (!handlers[eventName]) {
+          handlers[eventName] = [];
+        }
+        handlers[eventName].push(func);
+      }
+      if (added.noflash && flashState.disabled) {
+        _receiveEvent.call(this, "noflash", {});
+      }
+      if (added.wrongflash && flashState.outdated) {
+        _receiveEvent.call(this, "wrongflash", {
+          flashVersion: flashState.version
+        });
+      }
+      if (added.load && flashState.ready) {
+        _receiveEvent.call(this, "load", {
+          flashVersion: flashState.version
+        });
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.off = function(eventName, func) {
+    var i, len, foundIndex, events, perEventHandlers, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (arguments.length === 0) {
+      events = _objectKeys(handlers);
+    } else if (typeof eventName === "string" && eventName) {
+      events = eventName.split(/\s+/);
+    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
+      for (i in eventName) {
+        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
+          this.off(i, eventName[i]);
+        }
+      }
+    }
+    if (events && events.length) {
+      for (i = 0, len = events.length; i < len; i++) {
+        eventName = events[i].toLowerCase().replace(/^on/, "");
+        perEventHandlers = handlers[eventName];
+        if (perEventHandlers && perEventHandlers.length) {
+          if (func) {
+            foundIndex = _inArray(func, perEventHandlers);
+            while (foundIndex !== -1) {
+              perEventHandlers.splice(foundIndex, 1);
+              foundIndex = _inArray(func, perEventHandlers, foundIndex);
+            }
+          } else {
+            handlers[eventName].length = 0;
+          }
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.handlers = function(eventName) {
+    var prop, copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (handlers) {
+      if (typeof eventName === "string" && eventName) {
+        return handlers[eventName] ? handlers[eventName].slice(0) : null;
+      }
+      copy = {};
+      for (prop in handlers) {
+        if (handlers.hasOwnProperty(prop) && handlers[prop]) {
+          copy[prop] = handlers[prop].slice(0);
+        }
+      }
+    }
+    return copy;
+  };
+  var _dispatchClientCallbacks = function(eventName, context, args, async) {
+    var handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers[eventName];
+    if (handlers && handlers.length) {
+      var i, len, func, originalContext = context || this;
+      for (i = 0, len = handlers.length; i < len; i++) {
+        func = handlers[i];
+        context = originalContext;
+        if (typeof func === "string" && typeof window[func] === "function") {
+          func = window[func];
+        }
+        if (typeof func === "object" && func && typeof func.handleEvent === "function") {
+          context = func;
+          func = func.handleEvent;
+        }
+        if (typeof func === "function") {
+          _dispatchCallback(func, context, args, async);
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.clip = function(elements) {
+    elements = _prepClip(elements);
+    for (var i = 0; i < elements.length; i++) {
+      if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
+        if (!elements[i].zcClippingId) {
+          elements[i].zcClippingId = "zcClippingId_" + elementIdCounter++;
+          _elementMeta[elements[i].zcClippingId] = [ this.id ];
+          if (_globalConfig.autoActivate === true) {
+            _addEventHandler(elements[i], "mouseover", _elementMouseOver);
+          }
+        } else if (_inArray(this.id, _elementMeta[elements[i].zcClippingId]) === -1) {
+          _elementMeta[elements[i].zcClippingId].push(this.id);
+        }
+        var clippedElements = _clientMeta[this.id].elements;
+        if (_inArray(elements[i], clippedElements) === -1) {
+          clippedElements.push(elements[i]);
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.unclip = function(elements) {
+    var meta = _clientMeta[this.id];
+    if (meta) {
+      var clippedElements = meta.elements;
+      var arrayIndex;
+      if (typeof elements === "undefined") {
+        elements = clippedElements.slice(0);
+      } else {
+        elements = _prepClip(elements);
+      }
+      for (var i = elements.length; i--; ) {
+        if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
+          arrayIndex = 0;
+          while ((arrayIndex = _inArray(elements[i], clippedElements, arrayIndex)) !== -1) {
+            clippedElements.splice(arrayIndex, 1);
+          }
+          var clientIds = _elementMeta[elements[i].zcClippingId];
+          if (clientIds) {
+            arrayIndex = 0;
+            while ((arrayIndex = _inArray(this.id, clientIds, arrayIndex)) !== -1) {
+              clientIds.splice(arrayIndex, 1);
+            }
+            if (clientIds.length === 0) {
+              if (_globalConfig.autoActivate === true) {
+                _removeEventHandler(elements[i], "mouseover", _elementMouseOver);
+              }
+              delete elements[i].zcClippingId;
+            }
+          }
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.elements = function() {
+    var meta = _clientMeta[this.id];
+    return meta && meta.elements ? meta.elements.slice(0) : [];
+  };
+  var _getAllClientsClippedToElement = function(element) {
+    var elementMetaId, clientIds, i, len, client, clients = [];
+    if (element && element.nodeType === 1 && (elementMetaId = element.zcClippingId) && _elementMeta.hasOwnProperty(elementMetaId)) {
+      clientIds = _elementMeta[elementMetaId];
+      if (clientIds && clientIds.length) {
+        for (i = 0, len = clientIds.length; i < len; i++) {
+          client = _clientMeta[clientIds[i]].instance;
+          if (client && client instanceof ZeroClipboard) {
+            clients.push(client);
+          }
+        }
+      }
+    }
+    return clients;
+  };
+  _globalConfig.hoverClass = "zeroclipboard-is-hover";
+  _globalConfig.activeClass = "zeroclipboard-is-active";
+  _globalConfig.trustedOrigins = null;
+  _globalConfig.allowScriptAccess = null;
+  _globalConfig.useNoCache = true;
+  _globalConfig.moviePath = "ZeroClipboard.swf";
+  ZeroClipboard.detectFlashSupport = function() {
+    _deprecationWarning("ZeroClipboard.detectFlashSupport", _globalConfig.debug);
+    return _detectFlashSupport();
+  };
+  ZeroClipboard.dispatch = function(eventName, args) {
+    if (typeof eventName === "string" && eventName) {
+      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
+      if (cleanEventName) {
+        var clients = currentElement && _globalConfig.autoActivate === true ? _getAllClientsClippedToElement(currentElement) : _getAllClients();
+        for (var i = 0, len = clients.length; i < len; i++) {
+          _receiveEvent.call(clients[i], cleanEventName, args);
+        }
+      }
+    }
+  };
+  ZeroClipboard.prototype.setHandCursor = function(enabled) {
+    _deprecationWarning("ZeroClipboard.prototype.setHandCursor", _globalConfig.debug);
+    enabled = typeof enabled === "boolean" ? enabled : !!enabled;
+    _setHandCursor(enabled);
+    _globalConfig.forceHandCursor = enabled;
+    return this;
+  };
+  ZeroClipboard.prototype.reposition = function() {
+    _deprecationWarning("ZeroClipboard.prototype.reposition", _globalConfig.debug);
+    return _reposition();
+  };
+  ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
+    _deprecationWarning("ZeroClipboard.prototype.receiveEvent", _globalConfig.debug);
+    if (typeof eventName === "string" && eventName) {
+      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
+      if (cleanEventName) {
+        _receiveEvent.call(this, cleanEventName, args);
+      }
+    }
+  };
+  ZeroClipboard.prototype.setCurrent = function(element) {
+    _deprecationWarning("ZeroClipboard.prototype.setCurrent", _globalConfig.debug);
+    ZeroClipboard.activate(element);
+    return this;
+  };
+  ZeroClipboard.prototype.resetBridge = function() {
+    _deprecationWarning("ZeroClipboard.prototype.resetBridge", _globalConfig.debug);
+    ZeroClipboard.deactivate();
+    return this;
+  };
+  ZeroClipboard.prototype.setTitle = function(newTitle) {
+    _deprecationWarning("ZeroClipboard.prototype.setTitle", _globalConfig.debug);
+    newTitle = newTitle || _globalConfig.title || currentElement && currentElement.getAttribute("title");
+    if (newTitle) {
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.setAttribute("title", newTitle);
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.setDefaults = function(options) {
+    _deprecationWarning("ZeroClipboard.setDefaults", _globalConfig.debug);
+    ZeroClipboard.config(options);
+  };
+  ZeroClipboard.prototype.addEventListener = function(eventName, func) {
+    _deprecationWarning("ZeroClipboard.prototype.addEventListener", _globalConfig.debug);
+    return this.on(eventName, func);
+  };
+  ZeroClipboard.prototype.removeEventListener = function(eventName, func) {
+    _deprecationWarning("ZeroClipboard.prototype.removeEventListener", _globalConfig.debug);
+    return this.off(eventName, func);
+  };
+  ZeroClipboard.prototype.ready = function() {
+    _deprecationWarning("ZeroClipboard.prototype.ready", _globalConfig.debug);
+    return flashState.ready === true;
+  };
+  var _receiveEvent = function(eventName, args) {
+    eventName = eventName.toLowerCase().replace(/^on/, "");
+    var cleanVersion = args && args.flashVersion && _parseFlashVersion(args.flashVersion) || null;
+    var element = currentElement;
+    var performCallbackAsync = true;
+    switch (eventName) {
+     case "load":
+      if (cleanVersion) {
+        if (!_isFlashVersionSupported(cleanVersion)) {
+          _receiveEvent.call(this, "onWrongFlash", {
+            flashVersion: cleanVersion
+          });
+          return;
+        }
+        flashState.outdated = false;
+        flashState.ready = true;
+        flashState.version = cleanVersion;
+      }
+      break;
+
+     case "wrongflash":
+      if (cleanVersion && !_isFlashVersionSupported(cleanVersion)) {
+        flashState.outdated = true;
+        flashState.ready = false;
+        flashState.version = cleanVersion;
+      }
+      break;
+
+     case "mouseover":
+      _addClass(element, _globalConfig.hoverClass);
+      break;
+
+     case "mouseout":
+      if (_globalConfig.autoActivate === true) {
+        ZeroClipboard.deactivate();
+      }
+      break;
+
+     case "mousedown":
+      _addClass(element, _globalConfig.activeClass);
+      break;
+
+     case "mouseup":
+      _removeClass(element, _globalConfig.activeClass);
+      break;
+
+     case "datarequested":
+      if (element) {
+        var targetId = element.getAttribute("data-clipboard-target"), targetEl = !targetId ? null : document.getElementById(targetId);
+        if (targetEl) {
+          var textContent = targetEl.value || targetEl.textContent || targetEl.innerText;
+          if (textContent) {
+            this.setText(textContent);
+          }
+        } else {
+          var defaultText = element.getAttribute("data-clipboard-text");
+          if (defaultText) {
+            this.setText(defaultText);
+          }
+        }
+      }
+      performCallbackAsync = false;
+      break;
+
+     case "complete":
+      _deleteOwnProperties(_clipData);
+      if (element && element !== _safeActiveElement() && element.focus) {
+        element.focus();
+      }
+      break;
+    }
+    var context = element;
+    var eventArgs = [ this, args ];
+    return _dispatchClientCallbacks.call(this, eventName, context, eventArgs, performCallbackAsync);
+  };
+  if (typeof define === "function" && define.amd) {
+    define([ "require", "exports", "module" ], function(require, exports, module) {
+      _amdModuleId = module && module.id || null;
+      return ZeroClipboard;
+    });
+  } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports && typeof window.require === "function") {
+    _cjsModuleId = module.id || null;
+    module.exports = ZeroClipboard;
+  } else {
+    window.ZeroClipboard = ZeroClipboard;
+  }
+})(function() {
+  return this;
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7db85643/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf b/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf
new file mode 100755
index 0000000..55ccf96
Binary files /dev/null and b/src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf differ


[12/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: fix missing leading zeros in logs

This adds leading zeros to the times in the log view. Before that
the times were displayed like 1:5:3 (if it were 01:05:03)
because getHours() and friends are returning a Number and not
a String with a leading 0. In the case of 1:5:3 the corrected
time is now displayed as: 01:05:03. As d3 has a nice date formatter
we do not have to roll our own.


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 11f9d8af5da693a6ff3f8f33aa538caab5892869
Parents: 198eb74
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 13 13:48:00 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Apr 14 08:50:47 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |  3 +-
 src/fauxton/app/addons/logs/resources.js        | 15 ++++----
 src/fauxton/app/addons/logs/tests/baseSpec.js   | 38 ++++++++++++++++++++
 src/fauxton/app/addons/logs/tests/logSpec.js    | 38 --------------------
 .../app/addons/logs/tests/resourcesSpec.js      | 38 ++++++++++++++++++++
 5 files changed, 85 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f9d8af/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 07ee5e1..ea1a11b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -84,7 +84,8 @@ FAUXTON_FILES = \
     fauxton/app/addons/logs/templates/dashboard.html \
     fauxton/app/addons/logs/templates/filterItem.html \
     fauxton/app/addons/logs/templates/sidebar.html \
-    fauxton/app/addons/logs/tests/logSpec.js \
+    fauxton/app/addons/logs/tests/baseSpec.js \
+    fauxton/app/addons/logs/tests/resourcesSpec.js \
     fauxton/app/addons/permissions/assets/less/permissions.less \
     fauxton/app/addons/permissions/base.js \
     fauxton/app/addons/permissions/resources.js \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f9d8af/src/fauxton/app/addons/logs/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/resources.js b/src/fauxton/app/addons/logs/resources.js
index 3a47b92..5cfa673 100644
--- a/src/fauxton/app/addons/logs/resources.js
+++ b/src/fauxton/app/addons/logs/resources.js
@@ -13,22 +13,21 @@
 define([
   "app",
   "api",
-  "backbone"
+  "backbone",
+  "d3"
 ],
 
-function (app, FauxtonAPI, Backbone) {
+function (app, FauxtonAPI, Backbone, d3) {
 
   var Log = FauxtonAPI.addon();
 
   Log.Model = Backbone.Model.extend({
 
     date: function () {
-      var date = new Date(this.get('date'));
+      var date = new Date(this.get('date')),
+          formatter = d3.time.format("%b %e %H:%M%:%S");
 
-      var formatted_time = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
-      var formatted_date = date.toDateString().slice(4, 10);
-
-      return formatted_date + ' ' + formatted_time;
+      return formatter(date);
     },
 
     logLevel: function () {
@@ -51,7 +50,7 @@ function (app, FauxtonAPI, Backbone) {
     initialize: function (options) {
       this.params = {bytes: 5000};
     },
-    
+
     documentation: "log",
 
     url: function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f9d8af/src/fauxton/app/addons/logs/tests/baseSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/tests/baseSpec.js b/src/fauxton/app/addons/logs/tests/baseSpec.js
new file mode 100644
index 0000000..621cc9b
--- /dev/null
+++ b/src/fauxton/app/addons/logs/tests/baseSpec.js
@@ -0,0 +1,38 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+       'addons/logs/base',
+       'chai'
+], function (Log, chai) {
+  var expect = chai.expect;
+
+  describe('Logs Addon', function(){
+
+    describe('Log Model', function () {
+      var log;
+
+      beforeEach(function () {
+        log = new Log.Model({
+          log_level: 'DEBUG',
+          pid: '1234',
+          args: 'testing 123',
+          date: (new Date()).toString()
+        });
+      });
+
+      it('should have a log level', function () {
+        expect(log.logLevel()).to.equal('DEBUG');
+      });
+
+    });
+  });
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f9d8af/src/fauxton/app/addons/logs/tests/logSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/tests/logSpec.js b/src/fauxton/app/addons/logs/tests/logSpec.js
deleted file mode 100644
index 621cc9b..0000000
--- a/src/fauxton/app/addons/logs/tests/logSpec.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-define([
-       'addons/logs/base',
-       'chai'
-], function (Log, chai) {
-  var expect = chai.expect;
-
-  describe('Logs Addon', function(){
-
-    describe('Log Model', function () {
-      var log;
-
-      beforeEach(function () {
-        log = new Log.Model({
-          log_level: 'DEBUG',
-          pid: '1234',
-          args: 'testing 123',
-          date: (new Date()).toString()
-        });
-      });
-
-      it('should have a log level', function () {
-        expect(log.logLevel()).to.equal('DEBUG');
-      });
-
-    });
-  });
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f9d8af/src/fauxton/app/addons/logs/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/tests/resourcesSpec.js b/src/fauxton/app/addons/logs/tests/resourcesSpec.js
new file mode 100644
index 0000000..d67c677
--- /dev/null
+++ b/src/fauxton/app/addons/logs/tests/resourcesSpec.js
@@ -0,0 +1,38 @@
+// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+       'addons/logs/resources',
+       'testUtils'
+], function (Log, testUtils) {
+  var assert = testUtils.assert;
+
+  describe('Log Resources', function () {
+
+    describe('Date Formatter', function () {
+      it('adds leading zeros to minutes', function () {
+        var model;
+
+        model = new Log.Model({
+                  date: 'Sat, 12 Apr 2014 15:04:01 GMT',
+                  log_level: 'info',
+                  pid: '123',
+                  args: 'ente ente'
+                });
+        // timezones with daylightsaving in JS are hard
+        // and we use the current local time here
+        // so do not test for hours and the exact day
+        assert.ok(/Apr \d\d \d\d:04:01/.test(model.date()));
+      });
+    });
+  });
+});


[22/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: Fix global var in logs/resources


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 6fe7583a6677e7d4333d7854dd8d3f22e02f823a
Parents: b2c7cc7
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Apr 14 22:01:40 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Apr 14 22:14:47 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6fe7583a/src/fauxton/app/addons/logs/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/resources.js b/src/fauxton/app/addons/logs/resources.js
index 5cfa673..c285395 100644
--- a/src/fauxton/app/addons/logs/resources.js
+++ b/src/fauxton/app/addons/logs/resources.js
@@ -54,7 +54,7 @@ function (app, FauxtonAPI, Backbone, d3) {
     documentation: "log",
 
     url: function () {
-      query = "?" + $.param(this.params);
+      var query = "?" + $.param(this.params);
       return app.host + '/_log' + query;
     },
 


[27/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Add CVE-214-2668 documentation to build system


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 8eb4e32db434ec8b63a572f6d5841ab4dd5fe472
Parents: 7ae087c
Author: Dirkjan Ochtman <di...@ochtman.nl>
Authored: Tue Apr 15 09:35:21 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Apr 15 22:30:29 2014 +0200

----------------------------------------------------------------------
 share/doc/build/Makefile.am | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8eb4e32d/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index f332e5c..86351f4 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -390,6 +390,7 @@ src_files = \
     ../src/cve/2012-5641.rst \
     ../src/cve/2012-5649.rst \
     ../src/cve/2012-5650.rst \
+    ../src/cve/2014-2668.rst \
     ../src/cve/index.rst \
     ../src/fauxton/addons.rst \
     ../src/fauxton/index.rst \


[04/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fix for Urlencoding utils, checking for character that doesn't need encoding


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 9c5e4379ffc4fa2e935317ee4024ca5e4d574402
Parents: 9f6a919
Author: suelockwood <de...@apache.org>
Authored: Tue Apr 8 14:20:03 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Tue Apr 8 14:20:03 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/core/utils.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9c5e4379/src/fauxton/app/core/utils.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/utils.js b/src/fauxton/app/core/utils.js
index 44945e8..6bc8aea 100644
--- a/src/fauxton/app/core/utils.js
+++ b/src/fauxton/app/core/utils.js
@@ -12,7 +12,7 @@
 
 
 // This file creates a set of helper functions that will be loaded for all html
-// templates. These functions should be self contained and not rely on any 
+// templates. These functions should be self contained and not rely on any
 // external dependencies as they are loaded prior to the application. We may
 // want to change this later, but for now this should be thought of as a
 // "purely functional" helper system.
@@ -58,7 +58,7 @@ function($, _ ) {
 
     addWindowResize: function(fun, key){
       onWindowResize[key]=fun;
-      // You shouldn't need to call it here. Just define it at startup and each time it will loop 
+      // You shouldn't need to call it here. Just define it at startup and each time it will loop
       // through all the functions in the hash.
       //app.initWindowResize();
     },
@@ -84,7 +84,7 @@ function($, _ ) {
 
     safeURLName: function(name){
       var testName = name || "";
-      var checkforBad = testName.match(/[\$\-/_,+-]/g);
+      var checkforBad = testName.match(/[\$\-/,+-]/g);
       return (checkforBad !== null)?encodeURIComponent(name):name;
     }
   };


[35/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fix for linter


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 7a370261c4e6f68bb53024d7646cc05e65c7b357
Parents: dce35d0
Author: suelockwood <de...@apache.org>
Authored: Wed Apr 2 14:44:51 2014 -0400
Committer: suelockwood <de...@apache.org>
Committed: Wed Apr 16 13:37:02 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7a370261/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 802df14..66aa74d 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1136,13 +1136,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       for (var i= 0; i <params.length; i++){
         if (params[i].name === "skip"){
           if (!(/^\d+$/).test(params[i].value)){
-            var notification = FauxtonAPI.addNotification({
+            FauxtonAPI.addNotification({
               msg: "Numbers only for skip",
               type: "warn",
               selector: ".advanced-options .errors-container",
               clear:  true
             });
-            errors = true
+            errors = true;
           }
         }
       }
@@ -1226,12 +1226,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         break;
         case "skip":
           if (!(/^\d+$/).test($ele.val())){
-            var notification = FauxtonAPI.addNotification({
-                msg: "Numbers only for skip",
-                type: "warn",
-                selector: ".advanced-options .errors-container",
-                clear:  true
-              });
+            FauxtonAPI.addNotification({
+              msg: "Numbers only for skip",
+              type: "warn",
+              selector: ".advanced-options .errors-container",
+              clear:  true
+            });
           }
         break;
         case "include_docs":


[15/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: Code cleanup

Remove old linted config
Add resizeColumns to app


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

Branch: refs/heads/Query-UI-Cleanup
Commit: e528c0cbbb26f684fdff6147c2edf0806318ef42
Parents: 0088f6c
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Apr 14 15:37:21 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Apr 14 15:37:21 2014 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                        | 10 ----------
 src/fauxton/app/addons/fauxton/base.js          |  2 +-
 src/fauxton/app/addons/fauxton/resizeColumns.js |  1 +
 3 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e528c0cb/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 29111eb..c650b9f 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -147,16 +147,6 @@ module.exports = function(grunt) {
       watch: cleanableAddons
     },
 
-    // The lint task will run the build configuration and the application
-    // JavaScript through JSHint and report any errors.  You can change the
-    // options for this task, by reading this:
-    // https://github.com/cowboy/grunt/blob/master/docs/task_lint.md
-    lint: {
-      files: [
-        "build/config.js", "app/**/*.js" 
-      ]
-    },
-
     less: {
       compile: {
         options: {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e528c0cb/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 7c50211..29925e8 100644
--- a/src/fauxton/app/addons/fauxton/base.js
+++ b/src/fauxton/app/addons/fauxton/base.js
@@ -145,7 +145,7 @@ function(app, FauxtonAPI, resizeColumns) {
     initialize: function () {
       _.bindAll(this);
       //resizeAnimation
-      this.resizeColumns = new resizeColumns({});
+      app.resizeColumns = this.resizeColumns = new resizeColumns({});
       this.resizeColumns.onResizeHandler();
       
       FauxtonAPI.extensions.on('add:navbar:addHeaderLink', this.addLink);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e528c0cb/src/fauxton/app/addons/fauxton/resizeColumns.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/resizeColumns.js b/src/fauxton/app/addons/fauxton/resizeColumns.js
index abfcd2f..b081580 100644
--- a/src/fauxton/app/addons/fauxton/resizeColumns.js
+++ b/src/fauxton/app/addons/fauxton/resizeColumns.js
@@ -75,6 +75,7 @@ function(FauxtonAPI) {
         }
 
         $(this.options.selectorElements).innerWidth(panelWidth);
+        
       }
       //if there is a callback, run that
       if(this.options.callback) {


[18/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: redesign _changes-UI

Implement copying to clipboard
Change the view

Closes COUCHDB-2206


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

Branch: refs/heads/Query-UI-Cleanup
Commit: bf58b64e15eb6f8eaf5046c034baf4e64f8a2680
Parents: e528c0c
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Mar 31 20:31:23 2014 +0200
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 14:40:15 2014 -0400

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 license.skip                                    |  1 +
 src/Makefile.am                                 |  5 +-
 .../addons/documents/assets/less/documents.less | 28 +++++--
 .../app/addons/documents/templates/changes.html | 78 ++++++++++++++------
 src/fauxton/app/addons/documents/views.js       | 27 ++++++-
 6 files changed, 108 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 5e4d220..4b12bf7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -111,6 +111,7 @@ src/fauxton/app/addons/*
 src/fauxton/settings.json*
 !src/fauxton/settings.json.default
 !src/fauxton/settings.json.dev
+!src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf
 src/ibrowse/ibrowse.app
 src/ibrowse/ibrowse.app
 src/mochiweb/mochiweb.app

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/license.skip
----------------------------------------------------------------------
diff --git a/license.skip b/license.skip
index 56b48bd..45558d1 100644
--- a/license.skip
+++ b/license.skip
@@ -131,6 +131,7 @@
 ^src/fauxton/assets/js/libs/ace/.*.js
 ^src/fauxton/assets/js/libs/ace/snippets/.*.js
 ^src/fauxton/assets/js/plugins/.*.js
+^src/fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf
 ^src/fauxton/assets/less/bootstrap/.*.less
 ^src/fauxton/assets/less/bootstrap/tests/css-tests.css
 ^src/fauxton/assets/less/bootstrap/tests/buttons.html

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index ea1a11b..a0d1557 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -163,6 +163,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/pouchdb/base.js \
     fauxton/app/addons/pouchdb/pouch.collate.js \
     fauxton/app/addons/pouchdb/pouchdb.mapreduce.js \
+    fauxton/app/addons/documents/assets/less/documents.less \
     fauxton/app/addons/databases/templates/item.html \
     fauxton/app/addons/databases/templates/list.html \
     fauxton/app/addons/databases/templates/newdatabase.html \
@@ -261,7 +262,9 @@ FAUXTON_FILES = \
     fauxton/assets/js/plugins/cloudant.pagingcollection.js \
     fauxton/assets/js/plugins/jquery.form.js \
     fauxton/assets/js/plugins/prettify.js \
-    fauxton/assets/js/plugins/beautify.js\
+    fauxton/assets/js/plugins/beautify.js \
+    fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.js \
+    fauxton/assets/js/plugins/zeroclipboard/ZeroClipboard.swf \
     fauxton/assets/less/bootstrap/accordion.less \
     fauxton/assets/less/bootstrap/alerts.less \
     fauxton/assets/less/bootstrap/bootstrap.less \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/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 36429ff..e629b2c 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -80,14 +80,30 @@ button.beautify {
 }
 
 /** used in changes.html **/
-#changes-table {
+.change-box {
+  margin: 0 20px 20px 20px;
+}
 
-  #changes {
-    width: 50%;
+.change-wrapper {
+  margin-top: 57px;
+  border-bottom: 1px solid #dddddd;
+  &:last-child {
+    border-bottom: none;
   }
-
-  #seq, #deleted {
-    width: 5%;
+  .row-fluid {
+    padding: 10px 0 10px 0;
+  }
+  .row-fluid:first {
+    padding: 0px 0 10px 0;
+  }
+  a:hover.js-copy {
+    text-decoration: none;
+  }
+  .js-json-container {
+    display: none;
+  }
+  .span2 {
+    font-weight: bold;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/src/fauxton/app/addons/documents/templates/changes.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/changes.html b/src/fauxton/app/addons/documents/templates/changes.html
index 9408979..460ff74 100644
--- a/src/fauxton/app/addons/documents/templates/changes.html
+++ b/src/fauxton/app/addons/documents/templates/changes.html
@@ -12,27 +12,57 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<table id="changes-table" class="table">
-  <thead>
-    <th id="seq"> seq </th>
-    <th> id </th>
-    <th id="changes"> changes </th>
-    <th id="deleted"> deleted? </th>
-  </thead>
-  <tbody>
-  <% _.each(changes, function (change) { %>
-    <tr>
-      <td> <%= change.seq %> </td>
-      <% if (change.deleted) { %>
-        <td> <%= change.id %> </td>
-      <% } else { %>
-        <td> <a href="#<%= database.url('app') %>/<%= change.id %>"><%= change.id %></a> </td>
-      <% } %>
-        <td> 
-          <pre class="prettyprint">  <%- JSON.stringify({changes: change.changes, doc: change.doc}, null, " ") %> </pre>
-      </td>
-      <td><%= change.deleted ? "true" : "false" %></td>
-    </tr>
-  <% }); %>
-  </tbody>
-</table>
+<% _.each(changes, function (change) { %>
+  <div class="change-wrapper">
+    <div class="change-box">
+      <div class="row-fluid">
+        <div class="span2">
+          seq
+        </div>
+        <div class="span8">
+          <%= change.seq %>
+        </div>
+        <div class="span2">
+          <a class="js-copy" data-clipboard-text="<%= change.seq %>" data-bypass="true" href="#">
+            <i class="icon-share"></i>
+          </a>
+        </div>
+      </div>
+      <div class="row-fluid">
+        <div class="span2">
+          id
+        </div>
+        <div class="span8">
+          <% if (change.deleted) { %>
+            <%= change.id %>
+          <% } else { %>
+            <a href="#<%= database.url('app') %>/<%= safeURL(change.id) %>"><%= change.id %></a>
+          <% } %>    </div>
+        <div class="span2">
+          <a class="js-copy" data-clipboard-text="<%= change.id %>" data-bypass="true" href="#">
+            <i class="icon-share"></i>
+          </a>
+        </div>
+      </div>
+      <div class="row-fluid">
+        <div class="span2">
+          changes
+        </div>
+        <div class="span10">
+          <button class="js-toggle-json btn-large btn-primary" type="button">View JSON</button>
+        </div>
+      </div>
+      <div class="js-json-container">
+        <pre class="prettyprint"><%- JSON.stringify({changes: change.changes, doc: change.doc}, null, " ") %></pre>
+      </div>
+      <div class="row-fluid">
+        <div class="span2">
+          deleted
+        </div>
+        <div class="span10">
+          <%= change.deleted ? "True" : "False" %>
+        </div>
+      </div>
+    </div>
+  </div>
+<% }); %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bf58b64e/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 351b2b0..eba2b1b 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -26,9 +26,13 @@ define([
        // Plugins
        "plugins/beautify",
        "plugins/prettify",
+       // this should be never global available:
+       // https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/security.md
+       "plugins/zeroclipboard/ZeroClipboard"
 ],
 
-function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns, beautify) {
+function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
+         resizeColumns, beautify, prettify, ZeroClipboard) {
   var Views = {};
   Views.Tabs = FauxtonAPI.View.extend({
     template: "addons/documents/templates/tabs",
@@ -1934,6 +1938,25 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.listenTo( this.model.changes, 'cachesync', this.render);
     },
 
+    events: {
+      "click button.js-toggle-json": "toggleJson"
+    },
+
+    toggleJson: function(event) {
+      event.preventDefault();
+
+      var $button = this.$(event.target),
+          $container = $button.closest('.change-box').find(".js-json-container");
+
+      if ($container.hasClass("js-hidden")) {
+        $button.text("Close JSON");
+      } else {
+        $button.text("View JSON");
+      }
+
+      $container.slideToggle();
+    },
+
     establish: function() {
       return [ this.model.changes.fetchOnce({prefill: true})];
     },
@@ -1947,6 +1970,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
 
     afterRender: function(){
       prettyPrint();
+      ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
+      var client = new ZeroClipboard(this.$(".js-copy"));
     }
   });
 


[13/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Fauxton: Fix failing pagination test


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 57426f08ec55b21d99718ec4a8bf1996cc568d34
Parents: 11f9d8a
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Apr 14 08:53:36 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Apr 14 08:53:36 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/57426f08/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 8fc409a..d336ea8 100644
--- a/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
+++ b/src/fauxton/app/addons/fauxton/tests/paginateSpec.js
@@ -31,7 +31,7 @@ define([
         id:'myId2',
         doc: 'num2'
       }], {
-        database: {id: 'databaseId'},
+        database: {id: 'databaseId', safeID: function () { return this.id;}},
         design: '_design/myDoc'
       });
 


[16/35] couchdb commit: updated refs/heads/Query-UI-Cleanup to 7a37026

Posted by de...@apache.org.
Changes from review:

Fix button text trigger
Toggle button gray on click
Change padding


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

Branch: refs/heads/Query-UI-Cleanup
Commit: ce6d7d537a124f361b0d99ef62c73cbc616a3bc7
Parents: 68a828c
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Apr 9 21:26:47 2014 +0200
Committer: suelockwood <de...@apache.org>
Committed: Mon Apr 14 14:40:15 2014 -0400

----------------------------------------------------------------------
 .../app/addons/documents/assets/less/documents.less      |  4 ++--
 src/fauxton/app/addons/documents/templates/changes.html  |  2 +-
 src/fauxton/app/addons/documents/views.js                | 11 ++++++++---
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce6d7d53/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 e629b2c..9fefd8f 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -91,10 +91,10 @@ button.beautify {
     border-bottom: none;
   }
   .row-fluid {
-    padding: 10px 0 10px 0;
+    padding: 4px 0 4px 0;
   }
   .row-fluid:first {
-    padding: 0px 0 10px 0;
+    padding: 0px 0 4px 0;
   }
   a:hover.js-copy {
     text-decoration: none;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce6d7d53/src/fauxton/app/addons/documents/templates/changes.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/changes.html b/src/fauxton/app/addons/documents/templates/changes.html
index 460ff74..8b598d2 100644
--- a/src/fauxton/app/addons/documents/templates/changes.html
+++ b/src/fauxton/app/addons/documents/templates/changes.html
@@ -49,7 +49,7 @@ the License.
           changes
         </div>
         <div class="span10">
-          <button class="js-toggle-json btn-large btn-primary" type="button">View JSON</button>
+          <button class="js-toggle-json btn-small btn-primary" type="button">View JSON</button>
         </div>
       </div>
       <div class="js-json-container">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce6d7d53/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 7892d18..bae49c0 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1918,10 +1918,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       var $button = this.$(event.target),
           $container = $button.closest('.change-box').find(".js-json-container");
 
-      if ($container.hasClass("js-hidden")) {
-        $button.text("Close JSON");
+      if (!$container.is(":visible")) {
+        $button
+          .text("Close JSON")
+          .addClass("btn-secondary")
+          .removeClass("btn-primary");
       } else {
-        $button.text("View JSON");
+        $button.text("View JSON")
+          .addClass("btn-primary")
+          .removeClass("btn-secondary");
       }
 
       $container.slideToggle();