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

[01/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Repository: couchdb
Updated Branches:
  refs/heads/1.6.x d1bc0a9cf -> eeb31cbbd


Fauxton: fix regression for document editor

Introduced with ebade0f2f82d4da60e386f4aeaf24ecb98181e81


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

Branch: refs/heads/1.6.x
Commit: 9bdbea82a940a5f5fa2f51aea865166d7fddf23c
Parents: 0583ac2
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 9 23:03:50 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri May 9 23:03:50 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9bdbea82/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 2df3ab6..8d10bd0 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -946,6 +946,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       });
       this.editor.render();
 
+      editor = this.editor;
+      model = this.model;
+
       this.listenTo(this.model, "sync", this.updateValues);
       this.listenTo(editor.editor, "change", function (event) {
         var changedDoc;
@@ -973,9 +976,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           clear:  true
         });
       });
-
-      editor = this.editor;
-      model = this.model;
     },
 
     cleanup: function () {


[36/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
add ZeroClipboard to LICENSE file


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

Branch: refs/heads/1.6.x
Commit: 46db1a2d70c02bdca7c0c4a177404a554a3a6c1d
Parents: 9484bda
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Tue Jun 24 20:34:02 2014 +0100
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Tue Jun 24 20:34:02 2014 +0100

----------------------------------------------------------------------
 LICENSE | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/46db1a2d/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 193355e..67c84e6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1054,6 +1054,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 
+
+for src/fauxton/assets/js/plugins/zeroclipboard/*
+
+The MIT License (MIT)
+Copyright (c) 2014 Jon Rohan, James M. Greene
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
 For share/doc/ext/httpdomain.py
 
 Copyright (c) 2010 by the contributors Hong Minhee <mi...@dahlia.kr>.


[16/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Fix Id added to edit doc view

When updating a document, after the save a "id" field is incorrectly
added. This patch fixes that.


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

Branch: refs/heads/1.6.x
Commit: 75fa89c6fb1a4f996907d4c8a1bab6f90c92ce79
Parents: 31c7ce7
Author: Garren Smith <ga...@gmail.com>
Authored: Wed May 28 15:09:23 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed May 28 15:16:05 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |   4 +-
 src/fauxton/app/addons/documents/resources.js   |   6 +-
 src/fauxton/app/addons/documents/routes.js      |  24 +----
 .../addons/documents/templates/code_editor.html |  55 ++++++++++
 .../app/addons/documents/templates/doc.html     |  55 ----------
 .../documents/templates/doc_field_editor.html   |  74 --------------
 .../templates/doc_field_editor_tabs.html        |  19 ----
 src/fauxton/app/addons/documents/views.js       | 101 +++----------------
 8 files changed, 74 insertions(+), 264 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 240b4e0..dde0810 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -177,9 +177,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/documents/templates/ddoc_info.html \
     fauxton/app/addons/documents/templates/delete_database_modal.html \
     fauxton/app/addons/documents/templates/design_doc_selector.html \
-    fauxton/app/addons/documents/templates/doc.html \
-    fauxton/app/addons/documents/templates/doc_field_editor.html \
-    fauxton/app/addons/documents/templates/doc_field_editor_tabs.html \
+    fauxton/app/addons/documents/templates/code_editor.html \
     fauxton/app/addons/documents/templates/duplicate_doc_modal.html \
     fauxton/app/addons/documents/templates/edit_tools.html \
     fauxton/app/addons/documents/templates/index_menu_item.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/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 709d9a9..21ee55f 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -194,15 +194,19 @@ function(app, FauxtonAPI, PagingCollection) {
         if (typeof(this.id) === "undefined") {
           resp._id = resp.id;
         }
+
+        delete resp.id;
       }
+
       if (resp.ok) {
         delete resp.ok;
       }
+
       return resp;
     },
 
     prettyJSON: function() {
-      var data = this.get("doc") ? this.get("doc") : this;
+      var data = this.get("doc") ? this.get("doc") : this.attributes;
 
       return JSON.stringify(data, null, "  ");
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/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 b8b01fb..8f163a7 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -36,18 +36,9 @@ function(app, FauxtonAPI, Documents, Databases) {
       }, {
         database: this.database
       });
-
-      this.tabsView = this.setView("#tabs", new Documents.Views.FieldEditorTabs({
-        disableLoader: true,
-        selected: "code_editor",
-        model: this.doc
-      }));
-
     },
 
     routes: {
-      // We are hiding the field_editor for this first release
-      // "database/:database/:doc/field_editor": "field_editor",
       "database/:database/:doc/code_editor": "code_editor",
       "database/:database/:doc": "code_editor"
     },
@@ -65,9 +56,8 @@ function(app, FauxtonAPI, Documents, Databases) {
     },
 
     code_editor: function (database, doc) {
-      this.tabsView.updateSelected('code_editor');
 
-      this.docView = this.setView("#dashboard-content", new Documents.Views.Doc({
+      this.docView = this.setView("#dashboard-content", new Documents.Views.CodeEditor({
         model: this.doc,
         database: this.database
       }));
@@ -77,13 +67,6 @@ function(app, FauxtonAPI, Documents, Databases) {
       this.docView.forceRender();
     },
 
-    field_editor: function(events) {
-      this.tabsView.updateSelected('field_editor');
-      this.docView = this.setView("#dashboard-content", new Documents.Views.DocFieldEditor({
-        model: this.doc
-      }));
-    },
-
     duplicateDoc: function (newId) {
       var doc = this.doc,
       docView = this.docView,
@@ -120,11 +103,6 @@ function(app, FauxtonAPI, Documents, Databases) {
         database: this.database
       });
 
-      this.tabsView = this.setView("#tabs", new Documents.Views.FieldEditorTabs({
-        selected: "code_editor",
-        model: this.doc
-      }));
-
     },
     crumbs: function() {
       return [

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/src/fauxton/app/addons/documents/templates/code_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/code_editor.html b/src/fauxton/app/addons/documents/templates/code_editor.html
new file mode 100644
index 0000000..e9a46cf
--- /dev/null
+++ b/src/fauxton/app/addons/documents/templates/code_editor.html
@@ -0,0 +1,55 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div id="doc">
+  <div class="errors-container"></div>
+   
+<div class="nav">
+  <div class="span3">
+    <button class="save-doc btn btn-success save" type="button"><i class="icon fonticon-circle-check"></i> Save</button>
+    <button class="btn cancel-button">Back to _all_docs</button>
+  </div>
+
+  <div class="span7">
+    <% if (attachments) { %>
+    <div class="btn-group">
+      <button class="dropdown-toggle btn" data-bypass="true" data-toggle="dropdown">
+        View Attachments
+        <span class="caret"></span>
+      </button>
+      <ul class="dropdown-menu">
+        <%_.each(attachments, function (att) { %>
+        <li>
+        <a href="<%- att.url %>" target="_blank"> <strong> <%- att.fileName %> </strong> -
+          <span> <%- att.contentType %>, <%- formatSize(att.size)%> </span>
+        </a>
+        </li>
+        <% }) %>
+      </ul>
+    </div>
+    <% } %> 
+    <button class="btn upload"><i class="icon icon-circle-arrow-up"></i> Upload Attachment</button>
+    <button class="btn duplicate"><i class="icon icon-repeat"></i> Clone document</button>
+  </div>
+
+  <button class="btn btn-danger delete"><i class="icon icon-trash"></i></button>
+  </ul>
+
+<div id="upload-modal"> </div>
+<div id="duplicate-modal"> </div> 
+</div>
+
+  <div id="editor-container" class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></div>
+
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/src/fauxton/app/addons/documents/templates/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/doc.html b/src/fauxton/app/addons/documents/templates/doc.html
deleted file mode 100644
index e9a46cf..0000000
--- a/src/fauxton/app/addons/documents/templates/doc.html
+++ /dev/null
@@ -1,55 +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.
--->
-
-<div id="doc">
-  <div class="errors-container"></div>
-   
-<div class="nav">
-  <div class="span3">
-    <button class="save-doc btn btn-success save" type="button"><i class="icon fonticon-circle-check"></i> Save</button>
-    <button class="btn cancel-button">Back to _all_docs</button>
-  </div>
-
-  <div class="span7">
-    <% if (attachments) { %>
-    <div class="btn-group">
-      <button class="dropdown-toggle btn" data-bypass="true" data-toggle="dropdown">
-        View Attachments
-        <span class="caret"></span>
-      </button>
-      <ul class="dropdown-menu">
-        <%_.each(attachments, function (att) { %>
-        <li>
-        <a href="<%- att.url %>" target="_blank"> <strong> <%- att.fileName %> </strong> -
-          <span> <%- att.contentType %>, <%- formatSize(att.size)%> </span>
-        </a>
-        </li>
-        <% }) %>
-      </ul>
-    </div>
-    <% } %> 
-    <button class="btn upload"><i class="icon icon-circle-arrow-up"></i> Upload Attachment</button>
-    <button class="btn duplicate"><i class="icon icon-repeat"></i> Clone document</button>
-  </div>
-
-  <button class="btn btn-danger delete"><i class="icon icon-trash"></i></button>
-  </ul>
-
-<div id="upload-modal"> </div>
-<div id="duplicate-modal"> </div> 
-</div>
-
-  <div id="editor-container" class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/src/fauxton/app/addons/documents/templates/doc_field_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/doc_field_editor.html b/src/fauxton/app/addons/documents/templates/doc_field_editor.html
deleted file mode 100644
index 3ad9484..0000000
--- a/src/fauxton/app/addons/documents/templates/doc_field_editor.html
+++ /dev/null
@@ -1,74 +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.
--->
-
-<div id="doc-field-editor">
-  <div class="tools">
-
-    <div class="btn-toolbar pull-left">
-      <button class="btn btn-small all">&#x2713; All</button>
-      <button class="btn btn-small disabled delete"><i class="icon-trash"></i> Delete field</button>
-      <button class="btn btn-small new" style="margin-left: 64px"><i class="icon-plus"></i> New field</button>
-    </div>
-    <div class="btn-toolbar pull-right">
-      <button class="btn btn-small cancel cancel-button"><i class="icon fonticon-circle-x"></i> Cancel</button>
-      <button class="btn btn-small btn-success save"><i class="icon fonticon-circle-check"></i> Save</button>
-    </div>
-  </div>
-
-  <div class="clearfix"></div>
-  <!-- <hr style="margin-top: 0"/> -->
-
-  <table class="table table-striped  table-condensed">
-    <thead>
-      <tr>
-        <th class="select">
-        </th>
-        <th>Key</th>
-        <th>Value</th>
-      </tr>
-    </thead>
-    <tbody>
-      <tr style="display:none">
-        <td class="select"><input type="checkbox" /></td>
-        <td class="key"><input type="text" class="input-large" value='' /></td>
-        <td class="value"><input type="text" class="input-xxlarge" value='' /></td>
-      </tr>
-      <% _.each(doc, function(value, key) { %>
-        <tr>
-          <td class="select"><input type="checkbox" /></td>
-          <td class="key">
-            <input type="text" class="input-large" name="doc[<%= key %>]" value="<%= key %>" />
-          </td>
-          <td class="value"><input type="text" class="input-xxlarge" value='<%= JSON.stringify(value) %>' /></td>
-        </tr>
-      <% }); %>
-        <tr>
-          <th colspan="3">
-            Attachments
-          </th>
-        </tr>
-      <%_.each(attachments, function (att) { %>
-        <tr>
-          <td class="select"><input type="checkbox" /></td>
-          <td colspan="2">
-            <a href="<%= att.url %>" target="_blank"> <%= att.fileName %> </a>
-            <span> <%= att.contentType %>, <%= formatSize(att.size)%> </span>
-          </td>
-        </tr>
-      <% }) %>
-    </tbody>
-  </table>
-  <a class="btn btn-small new" style="margin-left: 64px"><i class="icon-plus"></i> New field</a>
-
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/src/fauxton/app/addons/documents/templates/doc_field_editor_tabs.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/doc_field_editor_tabs.html b/src/fauxton/app/addons/documents/templates/doc_field_editor_tabs.html
deleted file mode 100644
index 766647c..0000000
--- a/src/fauxton/app/addons/documents/templates/doc_field_editor_tabs.html
+++ /dev/null
@@ -1,19 +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 id="field_editor" class="<%= isSelectedClass('field_editor') %>"><a href="#<%= doc.url('app') %>/field_editor">Doc fields</a></li>
-  <li id="code_editor" class="<%= isSelectedClass('code_editor') %>"><a href="#<%= doc.url('app') %>/code_editor"><i class="icon-pencil"> </i> Code editor</a>
-  </li>
-</ul>-->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/75fa89c6/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 c58241c..87bc7ae 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -238,37 +238,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     }
   });
 
-  Views.FieldEditorTabs = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/doc_field_editor_tabs",
-    disableLoader: true,
-    initialize: function(options) {
-      this.selected = options.selected;
-    },
-
-    events: {
-    },
-    updateSelected: function (selected) {
-      this.selected = selected;
-      this.$('.active').removeClass('active');
-      this.$('#'+this.selected).addClass('active');
-    },
-
-    serialize: function() {
-      var selected = this.selected;
-      return {
-        doc: this.model,
-        isNewDoc: this.model.isNewDoc(),
-        isSelectedClass: function(item) {
-          return item && item === selected ? "active" : "";
-        }
-      };
-    },
-
-    establish: function() {
-      return [this.model.fetch()];
-    }
-  });
-
   Views.Document = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_item",
     tagName: "tr",
@@ -723,8 +692,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     }
   });
 
-  Views.Doc = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/doc",
+  Views.CodeEditor = FauxtonAPI.View.extend({
+    template: "addons/documents/templates/code_editor",
     events: {
       "click button.save-doc": "saveDoc",
       "click button.delete": "destroy",
@@ -732,14 +701,18 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       "click button.upload": "upload",
       "click button.cancel-button": "goback"
     },
+
     disableLoader: true,
+
     initialize: function (options) {
       this.database = options.database;
       _.bindAll(this);
     },
+
     goback: function(){
       FauxtonAPI.navigate(this.database.url("index") + "?limit=100");
     },
+
     destroy: function(event) {
       if (this.model.isNewDoc()) {
         FauxtonAPI.addNotification({
@@ -806,9 +779,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     updateValues: function() {
-      var notification;
       if (this.model.changedAttributes()) {
-        notification = FauxtonAPI.addNotification({
+        FauxtonAPI.addNotification({
           msg: "Document saved successfully.",
           type: "success",
           clear: true
@@ -841,7 +813,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     saveDoc: function(event) {
-      var json, notification,
+      var json,
       that = this,
       editor = this.editor,
       validDoc = this.getDocFromEditor();
@@ -849,15 +821,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       if (validDoc) {
         this.getDocFromEditor();
 
-        notification = FauxtonAPI.addNotification({msg: "Saving document."});
+        FauxtonAPI.addNotification({msg: "Saving document."});
 
         this.model.save().then(function () {
           editor.editSaved();
           FauxtonAPI.navigate('/database/' + that.database.safeID() + '/' + that.model.id);
         }).fail(function(xhr) {
-
           var responseText = JSON.parse(xhr.responseText).reason;
-          notification = FauxtonAPI.addNotification({
+          FauxtonAPI.addNotification({
             msg: "Save failed: " + responseText,
             type: "error",
             fade: false,
@@ -866,7 +837,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           });
         });
       } else if(this.model.validationError && this.model.validationError === 'Cannot change a documents id.') {
-          notification = FauxtonAPI.addNotification({
+          FauxtonAPI.addNotification({
             msg: "Cannot save: " + 'Cannot change a documents _id, try Duplicate doc instead!',
             type: "error",
             selector: "#doc .errors-container",
@@ -874,7 +845,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           });
         delete this.model.validationError;
       } else {
-        notification = FauxtonAPI.addNotification({
+        FauxtonAPI.addNotification({
           msg: "Please fix the JSON errors and try again.",
           type: "error",
           selector: "#doc .errors-container",
@@ -983,54 +954,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     }
   });
 
-  Views.DocFieldEditor = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/doc_field_editor",
-    disableLoader: true,
-    events: {
-      "click button.save": "saveDoc"
-    },
-
-    saveDoc: function(event) {
-      FauxtonAPI.addNotification({
-        type: "warning",
-        msg: "Save functionality coming soon.",
-        clear:  true
-      });
-    },
-
-    serialize: function() {
-      return {
-        doc: this.getModelWithoutAttachments(),
-        attachments: this.getAttachments()
-      };
-    },
-
-    getModelWithoutAttachments: function() {
-      var model = this.model.toJSON();
-      delete model._attachments;
-      return model;
-    },
-
-    getAttachments: function () {
-      var attachments = this.model.get('_attachments');
-
-      if (!attachments) { return []; }
-
-      return _.map(attachments, function (att, key) {
-        return {
-          fileName: key,
-          size: att.length,
-          contentType: att.content_type,
-          url: this.model.url() + '/' + key
-        };
-      }, this);
-    },
-
-    establish: function() {
-      return [this.model.fetch()];
-    }
-  });
-
   Views.AdvancedOptions = FauxtonAPI.View.extend({
     template: "addons/documents/templates/advanced_options",
     className: "advanced-options well",


[42/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Upgrade node-http-proxy

Some modifications have to be made because the API changed when
the module reached v1.0


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

Branch: refs/heads/1.6.x
Commit: 08d25e979bd64d0835a6a07c16e201d5749af498
Parents: af59351
Author: Michaƫl Zasso <mi...@gmail.com>
Authored: Wed Jul 2 13:42:23 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Jul 2 16:31:46 2014 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js         |  9 +--------
 src/fauxton/package.json         |  2 +-
 src/fauxton/tasks/couchserver.js | 16 +++++++++-------
 3 files changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/08d25e97/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 8ffb2f8..047962e 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -124,14 +124,7 @@ module.exports = function(grunt) {
       dist: './dist/debug/',
       port: 8000,
       proxy: {
-        target: {
-          host: 'localhost',
-          port: 5984,
-          https: false
-        },
-        // This sets the Host header in the proxy so that you can use external
-        // CouchDB instances and not have the Host set to 'localhost'
-        changeOrigin: true
+        target: "http://localhost:5984/"
       }
     };
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/08d25e97/src/fauxton/package.json
----------------------------------------------------------------------
diff --git a/src/fauxton/package.json b/src/fauxton/package.json
index d84c881..a955892 100644
--- a/src/fauxton/package.json
+++ b/src/fauxton/package.json
@@ -27,7 +27,7 @@
     "underscore": "~1.4.2",
     "url": "~0.7.9",
     "urls": "~0.0.3",
-    "http-proxy": "~0.10.2",
+    "http-proxy": "~1.1.4",
     "send": "~0.1.1",
     "grunt-mocha-phantomjs": "~0.3.0"
   },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/08d25e97/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 8e95c5c..3e82e98 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -19,6 +19,7 @@ module.exports = function (grunt) {
         http = require("http"),
         httpProxy = require('http-proxy'),
         send = require('send'),
+        urlLib = require('url'),
         options = grunt.config('couchserver'),
         _ = grunt.util._;
 
@@ -30,18 +31,14 @@ module.exports = function (grunt) {
 
     // Proxy options with default localhost
     var proxy_settings = options.proxy || {
-      target: {
-        host: 'localhost',
-        port: 5984,
-        https: false
-      }
+      target: "http://localhost:5984/"
     };
 
     // inform grunt that this task is async
     var done = this.async();
 
     // create proxy to couch for all couch requests
-    var proxy = new httpProxy.HttpProxy(proxy_settings);
+    var proxy = httpProxy.createServer(proxy_settings);
 
     http.createServer(function (req, res) {
       var url = req.url.replace('app/',''),
@@ -97,7 +94,12 @@ module.exports = function (grunt) {
           .pipe(res);
       }
 
-      proxy.proxyRequest(req, res);
+      // This sets the Host header in the proxy so that one can use external
+      // CouchDB instances and not have the Host set to 'localhost'
+      var urlObj = urlLib.parse(req.url);
+      req.headers['host'] = urlObj.host;
+
+      proxy.web(req, res);
     }).listen(port);
 
     // Fail this task if any errors have been logged


[40/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Add view filter

This allows a module to register an extension to filter out what views
should be displayed in the side bar.
An example of usage is to only display views that have
"language:javascript"


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

Branch: refs/heads/1.6.x
Commit: 88e1bca621bec214e2d297e765457b3e9f10654a
Parents: dc1b148
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jul 1 14:31:12 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jul 2 10:06:45 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js |  8 +++++++
 src/fauxton/app/addons/documents/views.js     | 26 +++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/88e1bca6/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 21cdfdd..dc71153 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -482,6 +482,14 @@ function(app, FauxtonAPI, PagingCollection) {
       });
 
       return PagingCollection.prototype.parse.call(this, resp);
+    },
+
+    clone: function () {
+      return new this.constructor(this.models, {
+        database: this.database,
+        params: this.params,
+        paging: this.paging
+      });
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/88e1bca6/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 4e7459a..6ccb733 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -26,7 +26,7 @@ define([
        // Plugins
        "plugins/beautify",
        "plugins/prettify",
-       // this should be never global available:
+       // this should never be global available:
        // https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/security.md
        "plugins/zeroclipboard/ZeroClipboard"
 ],
@@ -1710,8 +1710,19 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         this.reduceFunStr = this.model.viewHasReduce(this.viewName);
       }
 
+      var viewFilters = FauxtonAPI.getExtensions('sidebar:viewFilters'),
+          filteredModels = this.ddocs.models,
+          designDocs = this.ddocs.clone();
+
+      if (!_.isEmpty(viewFilters)) {
+        _.each(viewFilters, function (filter) {
+          filteredModels = _.filter(filteredModels, filter);
+        });
+        designDocs.reset(filteredModels, {silent: true});
+      }
+
       this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
-        collection: this.ddocs,
+        collection: designDocs,
         ddocName: this.model.id,
         database: this.database
       }));
@@ -1874,7 +1885,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         extension.render();
       }, this);
 
-      this.collection.each(function(design) {
+      var viewFilters = FauxtonAPI.getExtensions('sidebar:viewFilters'),
+          collection = this.collection.models;
+
+      if (!_.isEmpty(viewFilters)) {
+        _.each(viewFilters, function (filter) {
+          collection = _.filter(collection, filter);
+        });
+      }
+
+      _.each(collection, function(design) {
         if (design.has('doc')){
           var ddoc = design.id.replace(/^_design\//,"");
           if (design.get('doc').views){


[10/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: do not load unnessecary d3 & backbone


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

Branch: refs/heads/1.6.x
Commit: 4a614b39719035042e0b124d8a91d6cc285a643f
Parents: cd8286e
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 6 23:42:04 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu May 15 21:17:10 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/resources.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4a614b39/src/fauxton/app/addons/activetasks/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/resources.js b/src/fauxton/app/addons/activetasks/resources.js
index 3d1798f..92165dc 100644
--- a/src/fauxton/app/addons/activetasks/resources.js
+++ b/src/fauxton/app/addons/activetasks/resources.js
@@ -12,12 +12,10 @@
 
 define([
   "app",
-  "backbone",
   "addons/fauxton/base",
-  "d3"
 ],
 
-function (app, backbone, Fauxton) {
+function (app, Fauxton) {
   var Active = {},
       apiv = app.versionAPI;
       app.taskSortBy = 'type';


[33/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
fix attachment view to bypass


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

Branch: refs/heads/1.6.x
Commit: 4fbeff9aca77863108535225a9a934b00e2a3b7d
Parents: 4e90456
Author: sebastianrothbucher <se...@googlemail.com>
Authored: Sat Jun 14 13:57:22 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Jun 18 19:43:35 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/templates/code_editor.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4fbeff9a/src/fauxton/app/addons/documents/templates/code_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/code_editor.html b/src/fauxton/app/addons/documents/templates/code_editor.html
index e9a46cf..811e111 100644
--- a/src/fauxton/app/addons/documents/templates/code_editor.html
+++ b/src/fauxton/app/addons/documents/templates/code_editor.html
@@ -31,7 +31,7 @@ the License.
       <ul class="dropdown-menu">
         <%_.each(attachments, function (att) { %>
         <li>
-        <a href="<%- att.url %>" target="_blank"> <strong> <%- att.fileName %> </strong> -
+        <a href="<%- att.url %>" target="_blank" data-bypass="true"> <strong> <%- att.fileName %> </strong> -
           <span> <%- att.contentType %>, <%- formatSize(att.size)%> </span>
         </a>
         </li>


[27/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Add Experimental Content-Security-Policy-Support (CSP) for Fauxton

Like every web application, Fauxton is vulnerable against XSS and
CSP is a technology that tries to help against that.

The patch makes it possible to enable CSP for the /_utils path and
allows configuration of the sent header.

The default setting for the value of the header breaks the old
Futon, when CSP is enabled there. The old Futon has alot of
inline-JavaScript which is not allowed in the setting I have
chosen as default.

For development, the header is also sent from the Node server
which launches Fauxton in dev-mode.

People can enable the feature by setting enable = true in the
section [csp] of their configs


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

Branch: refs/heads/1.6.x
Commit: 3bcf664b2f46750bf64bf970da07f9b133f98047
Parents: 698f55b
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat May 17 18:37:30 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Jun 9 19:09:06 2014 +0200

----------------------------------------------------------------------
 etc/couchdb/default.ini.tpl.in            |  4 ++
 share/doc/src/config/misc.rst             | 24 ++++++++
 share/doc/src/experimental.rst            | 15 +++++
 src/couchdb/couch_httpd_misc_handlers.erl | 16 ++++-
 src/fauxton/tasks/couchserver.js          |  4 ++
 test/etap/232-csp.t                       | 85 ++++++++++++++++++++++++++
 6 files changed, 145 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 934c6cd..4c29faa 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -88,6 +88,10 @@ credentials = false
 ; List of accepted methods
 ; methods =
 
+; Experimental CSP (Content Security Policy) Support for _utils
+[csp]
+enable = false
+; header_value = default-src 'self'; img-src 'self'; font-src *; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';
 
 ; Configuration for a vhost
 ;[cors:http://example.com]

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/share/doc/src/config/misc.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/misc.rst b/share/doc/src/config/misc.rst
index 58d079c..e97575a 100644
--- a/share/doc/src/config/misc.rst
+++ b/share/doc/src/config/misc.rst
@@ -232,3 +232,27 @@ Vendor information
     [vendor]
     name = The Apache Software Foundation
     version = 1.5.0
+
+.. _config/csp:
+
+Content-Security-Policy
+=======================
+
+.. config:section:: csp :: Content-Security-Policy
+
+  Experimental support of CSP Headers for ``/_utils`` (Fauxton).
+
+  .. config:option:: enable
+
+    Enable the sending of the Header ``Content-Security-Policy``::
+
+      [csp]
+      enable = true
+
+
+  .. config:option:: header_value
+
+    You can change the default value for the Header which is sent::
+
+      [csp]
+      header_value = default-src 'self'; img-src *; font-src *;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/share/doc/src/experimental.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/experimental.rst b/share/doc/src/experimental.rst
index 3157f53..fae925c 100644
--- a/share/doc/src/experimental.rst
+++ b/share/doc/src/experimental.rst
@@ -81,3 +81,18 @@ Plugins
 See `src/couch_plugins/README.md`.
 
 
+Content-Security-Policy (CSP) Header Support for /_utils (Fauxton)
+==================================================================
+
+This will just work with Fauxton, and not Futon. You can enable it
+in your config: you can enable the feature in general and change
+the default header that is sent for everything in /_utils.
+
+    .. code-block:: ini
+
+      [csp]
+      enable = true
+
+Then restart CouchDB.
+
+Have fun!

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/src/couchdb/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index c86f5c7..51e8156 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -68,9 +68,10 @@ handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) ->
     case couch_httpd:partition(UrlPath) of
     {_ActionKey, "/", RelativePath} ->
         % GET /_utils/path or GET /_utils/
-        CachingHeaders =
-                [{"Cache-Control", "private, must-revalidate"}],
-        couch_httpd:serve_file(Req, RelativePath, DocumentRoot, CachingHeaders);
+        CachingHeaders = [{"Cache-Control", "private, must-revalidate"}],
+        EnableCsp = couch_config:get("csp", "enable", "false"),
+        Headers = maybe_add_csp_headers(CachingHeaders, EnableCsp),
+        couch_httpd:serve_file(Req, RelativePath, DocumentRoot, Headers);
     {_ActionKey, "", _RelativePath} ->
         % GET /_utils
         RedirectPath = couch_httpd:path(Req) ++ "/",
@@ -79,6 +80,15 @@ handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) ->
 handle_utils_dir_req(Req, _) ->
     send_method_not_allowed(Req, "GET,HEAD").
 
+maybe_add_csp_headers(Headers, "true") ->
+    DefaultValues = "default-src 'self'; img-src 'self'; font-src 'self'; "
+                    "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';",
+    Value = couch_config:get("csp", "header_value", DefaultValues),
+    [{"Content-Security-Policy", Value} | Headers];
+maybe_add_csp_headers(Headers, _) ->
+    Headers.
+
+
 handle_all_dbs_req(#httpd{method='GET'}=Req) ->
     {ok, DbNames} = couch_server:all_databases(),
     send_json(Req, DbNames);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 67b0ae0..3a17ab6 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -47,6 +47,10 @@ module.exports = function (grunt) {
           accept = req.headers.accept.split(','),
           filePath;
 
+      var headerValue = "default-src 'self'; img-src 'self'; font-src 'self'; " +
+                        "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
+      res.setHeader('Content-Security-Policy', headerValue);
+
       if (!!url.match(/^\/addons\/.*\/assets\/js/)) {
         filePath = path.join(app_dir, url.replace('/_utils/fauxton/',''));
       } else if (!!url.match(/assets/)) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bcf664b/test/etap/232-csp.t
----------------------------------------------------------------------
diff --git a/test/etap/232-csp.t b/test/etap/232-csp.t
new file mode 100644
index 0000000..6dbce6a
--- /dev/null
+++ b/test/etap/232-csp.t
@@ -0,0 +1,85 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+
+% 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.
+
+server() ->
+    lists:concat([
+        "http://127.0.0.1:",
+        mochiweb_socket_server:get(couch_httpd, port),
+        "/_utils/"
+    ]).
+
+
+main(_) ->
+    test_util:init_code_path(),
+
+    etap:plan(3),
+    case (catch test()) of
+        ok ->
+            etap:end_tests();
+        Other ->
+            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
+            etap:bail(Other)
+    end,
+    ok.
+
+test() ->
+    %% launch couchdb
+    couch_server_sup:start_link(test_util:config_files()),
+
+    % CSP is disabled by default
+    test_no_csp_headers_server(),
+
+    % Now enable CSP
+    ok = couch_config:set("csp", "enable", "true", false),
+
+    test_default_header_value(),
+
+    ok = couch_config:set("csp", "header_value", "default-src 'http://example.com';", false),
+    test_custom_header_value(),
+
+    % Disabled on all other values than true
+    ok = couch_config:set("csp", "enable", "blerg", false),
+    test_all_other_values_for_enable(),
+
+    timer:sleep(3000),
+    couch_server_sup:stop(),
+    ok.
+
+test_no_csp_headers_server() ->
+    Headers = [{"Origin", "http://127.0.0.1"}],
+    {ok, _, Resp, _} = ibrowse:send_req(server(), Headers, get, []),
+    etap:is(proplists:get_value("Content-Security-Policy", Resp),
+            undefined, "No CSP Headers when disabled").
+
+test_default_header_value() ->
+    Headers = [{"Origin", "http://127.0.0.1"}],
+    {ok, _, Resp, _} = ibrowse:send_req(server(), Headers, get, []),
+    etap:is(proplists:get_value("Content-Security-Policy", Resp),
+            "default-src 'self'; img-src 'self'; font-src 'self'; "
+            "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';",
+            "Default CSP Headers when enabled").
+
+test_custom_header_value() ->
+    Headers = [{"Origin", "http://127.0.0.1"}],
+    {ok, _, Resp, _} = ibrowse:send_req(server(), Headers, get, []),
+    etap:is(proplists:get_value("Content-Security-Policy", Resp),
+            "default-src 'http://example.com';",
+            "Custom CSP Headers possible").
+
+test_all_other_values_for_enable() ->
+    Headers = [{"Origin", "http://127.0.0.1"}],
+    {ok, _, Resp, _} = ibrowse:send_req(server(), Headers, get, []),
+    etap:is(proplists:get_value("Content-Security-Policy", Resp),
+            undefined, "No CSP Headers when wrong value given").


[08/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: reformat code & remove whitespace


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

Branch: refs/heads/1.6.x
Commit: 7b80bc2e0aae6d43bf15b19da3a482d15c336d38
Parents: 99e2b9e
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 6 18:17:36 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu May 15 21:07:08 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/base.js       |  2 +-
 src/fauxton/app/addons/activetasks/routes.js     | 19 ++++++++++++-------
 .../app/addons/activetasks/templates/table.html  |  2 +-
 .../app/addons/activetasks/tests/viewsSpec.js    | 12 ++++++------
 src/fauxton/app/addons/activetasks/views.js      |  4 ++--
 5 files changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/base.js b/src/fauxton/app/addons/activetasks/base.js
index 647add0..c01fd55 100644
--- a/src/fauxton/app/addons/activetasks/base.js
+++ b/src/fauxton/app/addons/activetasks/base.js
@@ -21,6 +21,6 @@ function (app, FauxtonAPI, Activetasks) {
   Activetasks.initialize = function() {
     FauxtonAPI.addHeaderLink({title: "Active Tasks", icon: "fonticon-activetasks", href: "#/activetasks"});
   };
- 
+
   return Activetasks;
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/routes.js b/src/fauxton/app/addons/activetasks/routes.js
index 89bcfcc..dcb2efe 100644
--- a/src/fauxton/app/addons/activetasks/routes.js
+++ b/src/fauxton/app/addons/activetasks/routes.js
@@ -21,34 +21,39 @@ function (app, FauxtonAPI, Activetasks, Views) {
 
   var  ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "with_sidebar",
+
     routes: {
       "activetasks/:id": "defaultView",
       "activetasks": "defaultView"
     },
+
     selectedHeader: 'Active Tasks',
+
     crumbs: [
-    {"name": "Active tasks", "link": "activetasks"}
+      {"name": "Active tasks", "link": "activetasks"}
     ],
-    apiUrl: function(){
+
+    apiUrl: function () {
       return [this.newtasks.url("apiurl"), this.newtasks.documentation];
-    }, 
+    },
 
     roles: ["_admin"],
 
-    defaultView: function(id){
+    defaultView: function (id) {
      this.newtasks = new Activetasks.Tasks({
-        currentView: "all", 
+        currentView: "all",
         id:'activeTasks'
       });
+
       this.setView("#sidebar-content", new Views.TabMenu({
         currentView: "all",
         model: this.newtasks
-      })); 
+      }));
 
       this.setView("#dashboard-content", new Views.DataSection({
         model: this.newtasks,
         currentView: "all"
-      })); 
+      }));
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/templates/table.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/templates/table.html b/src/fauxton/app/addons/activetasks/templates/table.html
index 77d2a42..84dbccd 100644
--- a/src/fauxton/app/addons/activetasks/templates/table.html
+++ b/src/fauxton/app/addons/activetasks/templates/table.html
@@ -27,7 +27,7 @@ the License.
 -->
 
 <% if (collection.length === 0){%>
-   <tr> 
+   <tr>
     <td>
       <p>No tasks.</p>
     </td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
index c1be25b..5da2c3f 100644
--- a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
+++ b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
@@ -17,13 +17,13 @@ define([
 ], function (FauxtonAPI, Views, Models, testUtils) {
   var assert = testUtils.assert,
       ViewSandbox = testUtils.ViewSandbox;
-  
+
   describe("TabMenu", function () {
     var tabMenu;
 
     beforeEach(function () {
       var newtasks = new Models.Tasks({
-        currentView: "all", 
+        currentView: "all",
         id:'activeTasks'
       });
 
@@ -37,7 +37,7 @@ define([
       var viewSandbox;
       beforeEach(function () {
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu); 
+        viewSandbox.renderView(tabMenu);
       });
 
       afterEach(function () {
@@ -76,7 +76,7 @@ define([
       var viewSandbox;
       beforeEach(function () {
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu); 
+        viewSandbox.renderView(tabMenu);
       });
 
       afterEach(function () {
@@ -105,7 +105,7 @@ define([
     var viewSandbox, dataSection;
     beforeEach(function () {
       var newtasks = new Models.Tasks({
-        currentView: "all", 
+        currentView: "all",
         id:'activeTasks'
       });
       newtasks.parse([]);
@@ -116,7 +116,7 @@ define([
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(dataSection); 
+      viewSandbox.renderView(dataSection);
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/views.js b/src/fauxton/app/addons/activetasks/views.js
index c7e904a..22918a6 100644
--- a/src/fauxton/app/addons/activetasks/views.js
+++ b/src/fauxton/app/addons/activetasks/views.js
@@ -74,7 +74,7 @@ function (app, FauxtonAPI, activetasks) {
       if (this.dataView) {
        this.dataView.update(currentData, this.model.get('currentView').replace('_',' '));
       } else {
-        this.dataView = this.insertView( new Views.TableData({ 
+        this.dataView = this.insertView( new Views.TableData({
           collection: currentData,
           currentView: this.model.get('currentView').replace('_',' ')
         }));
@@ -140,7 +140,7 @@ function (app, FauxtonAPI, activetasks) {
     beforeRender: function(){
       //iterate over the collection to add each
       this.collection.forEach(function(item) {
-        this.insertView("#tasks_go_here", new Views.TableDetail({ 
+        this.insertView("#tasks_go_here", new Views.TableDetail({
           model: item
         }));
       }, this);


[26/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Update breadcrumb on duplicate doc

Small fix that makes sure the breadcrumb is updated with the new doc id
when a document is duplicated.


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

Branch: refs/heads/1.6.x
Commit: 698f55b1bd72d2ab3585cf9be239095f2c38a2d3
Parents: 3e981dc
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Jun 5 12:30:44 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Fri Jun 6 09:21:35 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/698f55b1/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 6d67dae..a21bdaa 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -71,6 +71,7 @@ function(app, FauxtonAPI, Documents, Databases) {
       var doc = this.doc,
       docView = this.docView,
       database = this.database;
+      this.docID = newId;
 
       doc.copy(newId).then(function () {
         doc.set({_id: newId});


[38/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Docs: fix typo in Accept header value

This closes #250

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


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

Branch: refs/heads/1.6.x
Commit: fda86ae1ca1ed666acc4c99d5e70625b49404242
Parents: 04bc532
Author: Christoph <xr...@yahoo.com>
Authored: Wed Jun 18 17:57:40 2014 +0200
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Jun 30 02:40:20 2014 +0400

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fda86ae1/share/doc/src/intro/api.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/intro/api.rst b/share/doc/src/intro/api.rst
index 9525bee..d68f6e6 100644
--- a/share/doc/src/intro/api.rst
+++ b/share/doc/src/intro/api.rst
@@ -281,7 +281,7 @@ browsers will display the JSON as text.
   .. _JSONView: http://jsonview.com/
 
 Do you remember the :header:`Accept` request header and how it is set to 
-``\*/\* -> */*`` to express interest in any MIME type? If you send ``Accept:
+``*/*`` to express interest in any MIME type? If you send ``Accept:
 application/json`` in your request, CouchDB knows that you can deal with a pure 
 JSON response with the proper :header:`Content-Type` header and will 
 use it instead of :mimetype:`text/plain`.


[43/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: fix build


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

Branch: refs/heads/1.6.x
Commit: 7221f7036d0b6e574020679381f0c142302af159
Parents: 08d25e9
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Jul 2 16:38:14 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Jul 2 16:38:14 2014 +0200

----------------------------------------------------------------------
 .gitignore            | 1 -
 src/Makefile.am       | 1 -
 src/fauxton/readme.md | 3 +--
 3 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7221f703/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 4b12bf7..0e39c34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,7 +110,6 @@ src/fauxton/app/addons/*
 !src/fauxton/app/addons/styletests
 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

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7221f703/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index d7cea21..6b5a5dd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -324,7 +324,6 @@ FAUXTON_FILES = \
     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/7221f703/src/fauxton/readme.md
----------------------------------------------------------------------
diff --git a/src/fauxton/readme.md b/src/fauxton/readme.md
index dc36a17..4db17a0 100644
--- a/src/fauxton/readme.md
+++ b/src/fauxton/readme.md
@@ -21,8 +21,7 @@ A recent of [node.js](http://nodejs.org/) and npm is required.
 
 ### Dev Server
 Using the dev server is the easiest way to use fauxton, specially when
-developing for it. Copy or symlink the `settings.json.default` (or the
-`settings.json.dev` file if you'd like to see the `styletests` addon).
+developing for it. Copy or symlink the `settings.json.default` file if you'd like to see the `styletests` addon).
 
 And then...
 


[02/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Use `os:timestamp/0 instead of `erlang:now/0`

We don't need the guarantees of `erlang:now/0` in `make_cookie_time/0`,
so `os:timestamp/0` is just fine.


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

Branch: refs/heads/1.6.x
Commit: 85df08859e731797df1f60d41ea3a322b735926e
Parents: 9bdbea8
Author: Klaus Trainer <kl...@apache.org>
Authored: Fri Mar 7 00:17:08 2014 +0100
Committer: Klaus Trainer <kl...@apache.org>
Committed: Sun May 11 20:15:55 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/85df0885/src/couchdb/couch_httpd_auth.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_auth.erl b/src/couchdb/couch_httpd_auth.erl
index 6888f06..faf8789 100644
--- a/src/couchdb/couch_httpd_auth.erl
+++ b/src/couchdb/couch_httpd_auth.erl
@@ -395,7 +395,7 @@ auth_name(String) when is_list(String) ->
     ?l2b(Name).
 
 make_cookie_time() ->
-    {NowMS, NowS, _} = erlang:now(),
+    {NowMS, NowS, _} = os:timestamp(),
     NowMS * 1000000 + NowS.
 
 cookie_scheme(#httpd{mochi_req=MochiReq}) ->


[15/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Query Parse url


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

Branch: refs/heads/1.6.x
Commit: 31c7ce756645041c67221a267cc901ea6eea15ce
Parents: 9fb9b4b
Author: Garren Smith <ga...@gmail.com>
Authored: Wed May 28 12:46:32 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed May 28 12:46:32 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/31c7ce75/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 ad61e78..709d9a9 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -414,6 +414,7 @@ function(app, FauxtonAPI, PagingCollection) {
 
     urlRef: function(context, params) {
       var query = "";
+      
       if (params) {
         if (!_.isEmpty(params)) {
           query = "?" + $.param(params);
@@ -421,7 +422,8 @@ function(app, FauxtonAPI, PagingCollection) {
           query = '';
         }
       } else if (this.params) {
-        query = "?" + $.param(this.params);
+        var parsedParam = Documents.QueryParams.stringify(this.params);
+        query = "?" + $.param(parsedParam);
       }
 
       var startOfUrl = app.host;


[05/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: fix loading of pouch

Added a red test which turned green


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

Branch: refs/heads/1.6.x
Commit: ad8e28c8037416d56d2c527045063cb7cd927869
Parents: 95600b7
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Tue May 13 18:08:45 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Tue May 13 18:09:36 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |  1 +
 .../app/addons/documents/tests/viewsSpec.js     | 23 ++++++++++++++++++++
 src/fauxton/app/addons/pouchdb/base.js          |  2 +-
 src/fauxton/app/addons/pouchdb/pouch.collate.js |  2 +-
 .../app/addons/pouchdb/pouchdb.mapreduce.js     |  4 ++--
 5 files changed, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ad8e28c8/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index f09d313..1e3515d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -152,6 +152,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/documents/resources.js \
     fauxton/app/addons/documents/routes.js \
     fauxton/app/addons/documents/tests/resourcesSpec.js \
+    fauxton/app/addons/documents/tests/viewsSpec.js \
     fauxton/app/addons/documents/views.js \
     fauxton/app/addons/fauxton/base.js \
     fauxton/app/addons/fauxton/components.js \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ad8e28c8/src/fauxton/app/addons/documents/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/tests/viewsSpec.js b/src/fauxton/app/addons/documents/tests/viewsSpec.js
new file mode 100644
index 0000000..8bc1397
--- /dev/null
+++ b/src/fauxton/app/addons/documents/tests/viewsSpec.js
@@ -0,0 +1,23 @@
+// 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/documents/views',
+        'testUtils'
+], function (Views, testUtils) {
+  var assert = testUtils.assert;
+
+  describe('DocumentsViews', function () {
+    it('should load', function () {
+      assert.equal(typeof Views.Views.Changes, 'function');
+    });
+  });
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ad8e28c8/src/fauxton/app/addons/pouchdb/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/pouchdb/base.js b/src/fauxton/app/addons/pouchdb/base.js
index 69962bb..3cd2b43 100644
--- a/src/fauxton/app/addons/pouchdb/base.js
+++ b/src/fauxton/app/addons/pouchdb/base.js
@@ -22,7 +22,7 @@ define([
   "api",
 
   // Modules
-  "addons/pouchdb/pouchdb.mapreduce.js"
+  "addons/pouchdb/pouchdb.mapreduce"
 ],
 
 function(app, FauxtonAPI, MapReduce) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ad8e28c8/src/fauxton/app/addons/pouchdb/pouch.collate.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/pouchdb/pouch.collate.js b/src/fauxton/app/addons/pouchdb/pouch.collate.js
index 8f15808..e48ab85 100644
--- a/src/fauxton/app/addons/pouchdb/pouch.collate.js
+++ b/src/fauxton/app/addons/pouchdb/pouch.collate.js
@@ -21,7 +21,7 @@ define([
   "api",
 
   // Modules
-  "addons/pouchdb/pouch.collate.js"
+  "addons/pouchdb/pouch.collate"
 ],
 
 function(app, FauxtonAPI, Collate) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ad8e28c8/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js b/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
index 502e0eb..30e01e5 100644
--- a/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
+++ b/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
@@ -29,7 +29,7 @@ define([
   "api",
 
   // Modules
-  "addons/pouchdb/pouch.collate.js"
+  "addons/pouchdb/pouch.collate"
 ],
 
 function(app, FauxtonAPI, Collate) {
@@ -90,7 +90,7 @@ function(app, FauxtonAPI, Collate) {
           id: current.doc._id,
           key: key,
           value: val
-        }; 
+        };
         //console.log("VIEW ROW: ", viewRow);
 
         if (options.startkey && Pouch.collate(key, options.startkey) < 0) return;


[46/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Documentation formatting typo

fixed a formatting typo as reported by
Blake Gideon


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

Branch: refs/heads/1.6.x
Commit: ffa54d8a208f7584d2d65259e80bf31b55399155
Parents: c9397ec
Author: Andy Wenk <an...@apache.org>
Authored: Tue Jul 8 21:30:01 2014 +0200
Committer: Andy Wenk <an...@apache.org>
Committed: Tue Jul 8 21:30:01 2014 +0200

----------------------------------------------------------------------
 share/doc/src/couchapp/views/intro.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ffa54d8a/share/doc/src/couchapp/views/intro.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/couchapp/views/intro.rst b/share/doc/src/couchapp/views/intro.rst
index 5e1dab4..f7d0738 100644
--- a/share/doc/src/couchapp/views/intro.rst
+++ b/share/doc/src/couchapp/views/intro.rst
@@ -378,7 +378,7 @@ B-trees are structured, we can cache the intermediate reduce results in the
 non-leaf nodes of the tree, so reduce queries can be computed along arbitrary
 key ranges in logarithmic time. See Figure 1, ā€œComments map functionā€.
 
-In the blog app, we use ``group_leve``l reduce queries to compute the count of
+In the blog app, we use ``group_leve`` reduce queries to compute the count of
 comments both on a per-post and total basis, achieved by querying the same view
 index with different methods. With some array keys, and assuming each key has
 the value ``1``:


[22/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Implement bulk deletion for all-docs-listing

Introduce a collection which keeps track of documents that will
deleted using the CouchDB Bulk-update API.

The collection fires events, so the view is noticed.

Closes COUCHDB-2153


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

Branch: refs/heads/1.6.x
Commit: 6a46608604812346628e21fa75c99b2b2a095cc3
Parents: f5a25ea
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 2 21:39:21 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat May 31 22:57:25 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js   |  90 +++++++++-
 src/fauxton/app/addons/documents/routes.js      |   3 +-
 .../documents/templates/all_docs_item.html      |   4 +-
 .../documents/templates/all_docs_list.html      |   6 +-
 .../app/addons/documents/tests/resourcesSpec.js |  83 ++++++++-
 src/fauxton/app/addons/documents/views.js       | 178 ++++++++++++-------
 6 files changed, 290 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/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 21ee55f..21cdfdd 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -44,7 +44,7 @@ function(app, FauxtonAPI, PagingCollection) {
     };
   })();
 
-  
+
   Documents.Doc = FauxtonAPI.Model.extend({
     idAttribute: "_id",
     documentation: function(){
@@ -302,6 +302,94 @@ function(app, FauxtonAPI, PagingCollection) {
 
   });
 
+  Documents.BulkDeleteDoc = FauxtonAPI.Model.extend({
+    idAttribute: "_id"
+  });
+
+  Documents.BulkDeleteDocCollection = FauxtonAPI.Collection.extend({
+
+    model: Documents.BulkDeleteDoc,
+
+    sync: function ()Ā {
+
+    },
+
+    initialize: function (models, options) {
+      this.databaseId = options.databaseId;
+    },
+
+    bulkDelete: function () {
+      var payload = this.createPayload(this.toJSON()),
+          that = this;
+
+      $.ajax({
+        type: 'POST',
+        url: app.host + '/' + this.databaseId + '/_bulk_docs',
+        contentType: 'application/json',
+        dataType: 'json',
+        data: JSON.stringify(payload),
+      })
+      .then(function (res) {
+        that.handleResponse(res);
+      })
+      .fail(function () {
+        var ids = _.reduce(that.toArray(), function (acc, doc) {
+          acc.push(doc.id);
+          return acc;
+        }, []);
+        that.trigger('error', ids);
+      });
+    },
+
+    handleResponse: function (res) {
+      var ids = _.reduce(res, function (ids, doc) {
+        if (doc.error) {
+          ids.errorIds.push(doc.id);
+        }
+
+        if (doc.ok === true) {
+          ids.successIds.push(doc.id);
+        }
+
+        return ids;
+      }, {errorIds: [], successIds: []});
+
+      this.removeDocuments(ids.successIds);
+
+      if (ids.errorIds.length) {
+        this.trigger('error', ids.errorIds);
+      }
+
+      this.trigger('updated');
+    },
+
+    removeDocuments: function (ids) {
+      var reloadDesignDocs = false;
+      _.each(ids, function (id) {
+        if (/_design/.test(id)) {
+          reloadDesignDocs = true;
+        }
+
+        this.remove(this.get(id));
+      }, this);
+
+      if (reloadDesignDocs) {
+        FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
+      }
+
+      this.trigger('removed', ids);
+    },
+
+    createPayload: function (documents) {
+      var documentList = documents;
+
+      return {
+        docs: documentList
+      };
+    }
+  });
+
+
   Documents.AllDocs = PagingCollection.extend({
     model: Documents.Doc,
     documentation: function(){

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/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 a24a3bd..6d67dae 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -224,7 +224,8 @@ function(app, FauxtonAPI, Documents, Databases) {
         database: this.data.database,
         collection: this.data.database.allDocs,
         docParams: docParams,
-        params: urlParams
+        params: urlParams,
+        bulkDeleteDocsCollection: new Documents.BulkDeleteDocCollection([], {databaseId: this.data.database.get('id')})
       }));
 
       this.crumbs = [

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/src/fauxton/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_item.html b/src/fauxton/app/addons/documents/templates/all_docs_item.html
index bfedaaa..a8ef20f 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_item.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_item.html
@@ -12,13 +12,13 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<td class="select"><input type="checkbox" class="row-select"></td>
+<td class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></td>
 <td>
   <div>
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
     <% if (doc.isEditable()) { %>
       <div class="btn-group">
-        <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit <%= doc.docType() %></a>
+        <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit <%- doc.docType() %></a>
         <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>
       </div>
     <% } %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/src/fauxton/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_list.html b/src/fauxton/app/addons/documents/templates/all_docs_list.html
index a521ff9..a643427 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_list.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_list.html
@@ -17,7 +17,7 @@ the License.
     <div class="row">
       <div class="btn-toolbar span6">
         <button type="button" class="btn btn-small all" data-toggle="button">āœ“ All</button>
-        <button class="btn btn-small disabled bulk-delete"><i class="icon-trash"></i></button>
+        <button class="btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
         <% if (expandDocs) { %>
         <button id="collapse" class="btn btn-small"><i class="icon-minus"></i> Collapse</button>
         <% } else { %>
@@ -32,8 +32,8 @@ the License.
   <table class="all-docs table table-striped table-condensed">
     <tbody></tbody>
   </table>
-  
-  <% if (endOfResults) { %>  
+
+  <% if (endOfResults) { %>
   <div class="text-center well">
     <p class="muted">
       End of results - <a id="js-end-results" href="#query" data-bypass="true" data-toggle="tab">edit query</a>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/src/fauxton/app/addons/documents/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/tests/resourcesSpec.js b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
index e120582..1159360 100644
--- a/src/fauxton/app/addons/documents/tests/resourcesSpec.js
+++ b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
@@ -10,8 +10,8 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 define([
-      'addons/documents/resources',
-      'testUtils'
+        'addons/documents/resources',
+        'testUtils'
 ], function (Models, testUtils) {
   var assert = testUtils.assert;
 
@@ -50,7 +50,6 @@ define([
       });
 
     });
-
   });
 
   describe('QueryParams', function() {
@@ -148,5 +147,81 @@ define([
       });
     });
   });
-});
 
+  describe('Bulk Delete', function () {
+    var databaseId = 'ente',
+        collection,
+        values;
+
+    values = [{
+      _id: '1',
+      _rev: '1234561',
+      _deleted: true
+    },
+    {
+      _id: '2',
+      _rev: '1234562',
+      _deleted: true
+    },
+    {
+      _id: '3',
+      _rev: '1234563',
+      _deleted: true
+    }];
+
+    beforeEach(function () {
+      collection = new Models.BulkDeleteDocCollection(values, {
+        databaseId: databaseId
+      });
+    });
+
+    it("contains the models", function () {
+      collection = new Models.BulkDeleteDocCollection(values, {
+        databaseId: databaseId
+      });
+
+      assert.equal(collection.length, 3);
+    });
+
+    it("clears the memory if no errors happened", function () {
+      collection.handleResponse([
+        {"ok":true,"id":"1","rev":"10-72cd2edbcc0d197ce96188a229a7af01"},
+        {"ok":true,"id":"2","rev":"6-da537822b9672a4b2f42adb1be04a5b1"}
+      ]);
+
+      assert.equal(collection.length, 1);
+    });
+
+    it("triggers a removed event with all ids", function () {
+      collection.listenToOnce(collection, 'removed', function (ids) {
+        assert.deepEqual(ids, ['Deferred', 'DeskSet']);
+      });
+
+      collection.handleResponse([
+        {"ok":true,"id":"Deferred","rev":"10-72cd2edbcc0d197ce96188a229a7af01"},
+        {"ok":true,"id":"DeskSet","rev":"6-da537822b9672a4b2f42adb1be04a5b1"}
+      ]);
+    });
+
+    it("triggers a error event with all errored ids", function () {
+      collection.listenToOnce(collection, 'error', function (ids) {
+        assert.deepEqual(ids, ['Deferred']);
+      });
+      collection.handleResponse([
+        {"error":"confclict","id":"Deferred","rev":"10-72cd2edbcc0d197ce96188a229a7af01"},
+        {"ok":true,"id":"DeskSet","rev":"6-da537822b9672a4b2f42adb1be04a5b1"}
+      ]);
+    });
+
+    it("removes successfull deleted from the collection but keeps one with errors", function () {
+      collection.handleResponse([
+        {"error":"confclict","id":"1","rev":"10-72cd2edbcc0d197ce96188a229a7af01"},
+        {"ok":true,"id":"2","rev":"6-da537822b9672a4b2f42adb1be04a5b1"},
+        {"error":"conflict","id":"3","rev":"6-da537822b9672a4b2f42adb1be04a5b1"}
+      ]);
+      assert.ok(collection.get('1'));
+      assert.ok(collection.get('3'));
+      assert.notOk(collection.get('2'));
+    });
+  });
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6a466086/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 87bc7ae..97f82b4 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -33,6 +33,15 @@ define([
 
 function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
          resizeColumns, beautify, prettify, ZeroClipboard) {
+
+  function showError (msg) {
+    FauxtonAPI.addNotification({
+      msg: msg,
+      type: 'error',
+      clear:  true
+    });
+  }
+
   var Views = {};
 
   Views.SearchBox = FauxtonAPI.View.extend({
@@ -243,6 +252,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     tagName: "tr",
     className: "all-docs-item",
 
+    initialize: function (options) {
+      this.checked = options.checked;
+    },
+
     events: {
       "click button.delete": "destroy",
       "dblclick pre.prettyprint": "edit"
@@ -256,7 +269,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
     serialize: function() {
       return {
-        doc: this.model
+        doc: this.model,
+        checked: this.checked
       };
     },
 
@@ -279,7 +293,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.model.destroy().then(function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Succesfully destroyed your doc",
+          msg: "Succesfully deleted your doc",
           clear:  true
         });
         that.$el.fadeOut(function () {
@@ -292,7 +306,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         }
       }, function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Failed to destroy your doc!",
+          msg: "Failed to deleted your doc!",
           type: "error",
           clear:  true
         });
@@ -499,29 +513,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     template: "addons/documents/templates/all_docs_list",
     events: {
       "click button.all": "selectAll",
-      "click button.bulk-delete": "bulkDelete",
+      "click button.js-bulk-delete": "bulkDelete",
       "click #collapse": "collapse",
-      "change .row-select":"toggleTrash",
+      "click .all-docs-item": "toggleDocument",
       "click #js-end-results": "scrollToQuery"
     },
 
-    toggleTrash: function () {
-      if (this.$('.row-select:checked').length > 0) {
-        this.$('.bulk-delete').removeClass('disabled');
-      } else {
-        this.$('.bulk-delete').addClass('disabled');
-      }
-    },
-
-    scrollToQuery: function () {
-      $('#dashboard-content').animate({ scrollTop: 0 }, 'slow');
-    },
-
-    initialize: function(options){
+    initialize: function (options) {
       this.nestedView = options.nestedView || Views.Document;
       this.rows = {};
-      this.viewList = !! options.viewList;
-      this.database = options.database;
+      this.viewList = !!options.viewList;
 
       if (options.ddocInfo) {
         this.designDocs = options.ddocInfo.designDocs;
@@ -532,6 +533,74 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.params = options.params || {};
       this.expandDocs = true;
       this.perPageDefault = this.docParams.limit || 20;
+
+      // some doclists don't have an option to delete
+      if (!this.viewList) {
+        this.bulkDeleteDocsCollection = options.bulkDeleteDocsCollection;
+      }
+    },
+
+    removeDocuments: function (ids) {
+      _.each(ids, function (id) {
+        this.removeDocument(id);
+      }, this);
+
+      this.pagination.updatePerPage(parseInt(this.$('#select-per-page :selected').val(), 10));
+      FauxtonAPI.triggerRouteEvent('perPageChange', this.pagination.documentsLeftToFetch());
+    },
+
+    removeDocument: function (id) {
+      var that = this;
+
+      if (!this.rows[id]) {
+        return;
+      }
+
+      this.rows[id].$el.fadeOut('slow', function () {
+        that.rows[id].remove();
+      });
+    },
+
+    showError: function (ids) {
+      if (ids) {
+        showError('Failed to delete: ' + ids.join(', '));
+        return;
+      }
+
+      showError('Failed to delete your doc!');
+    },
+
+    toggleDocument: function (event) {
+      var $row = this.$(event.target).closest('tr'),
+          docId = $row.attr('data-id'),
+          db = this.database.get('id'),
+          rev = this.collection.get(docId).get('_rev'),
+          data = {_id: docId, _rev: rev, _deleted: true};
+
+      if (!$row.hasClass('js-to-delete'))Ā {
+        this.bulkDeleteDocsCollection.add(data);
+      } else {
+        this.bulkDeleteDocsCollection.remove(this.bulkDeleteDocsCollection.get(docId));
+      }
+
+      $row.find('.js-row-select').prop('checked', !$row.hasClass('js-to-delete'));
+      $row.toggleClass('js-to-delete');
+
+      this.toggleTrash();
+    },
+
+    toggleTrash: function () {
+      var $bulkdDeleteButton = this.$('.js-bulk-delete');
+
+      if (this.bulkDeleteDocsCollection.length > 0) {
+        $bulkdDeleteButton.removeClass('disabled');
+      } else {
+        $bulkdDeleteButton.addClass('disabled');
+      }
+    },
+
+    scrollToQuery: function () {
+      $('#dashboard-content').animate({ scrollTop: 0 }, 'slow');
     },
 
     establish: function() {
@@ -551,7 +620,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
           //now redirect back to alldocs
           FauxtonAPI.navigate(model.database.url("index") + "?limit=100");
-          console.log("ERROR: ", arguments);
         }
       });
     },
@@ -580,48 +648,17 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.render();
     },
 
-    /*
-     * TODO: this should be reconsidered
-     * This currently performs delete operations on the model level,
-     * when we could be using bulk docs with _deleted = true. Using
-     * individual models is cleaner from a backbone standpoint, but
-     * not from the couchdb api.
-     * Also, the delete method is naive and leaves the body intact,
-     * when we should switch the doc to only having id/rev/deleted.
-     */
     bulkDelete: function() {
-      var that = this;
-      // yuck, data binding ftw?
-      var eles = this.$el.find("input.row-select:checked")
-                         .parents("tr.all-docs-item")
-                         .map(function(e) { return $(this).attr("data-id"); })
-                         .get();
+      var that = this,
+          documentsLength = this.bulkDeleteDocsCollection.length,
+          msg;
 
-      if (eles.length === 0 || !window.confirm("Are you sure you want to delete these " + eles.length + " docs?")) {
+      msg = "Are you sure you want to delete these " + documentsLength + " docs?";
+      if (documentsLength === 0 || !window.confirm(msg)) {
         return false;
       }
 
-      _.each(eles, function(ele) {
-        var model = this.collection.get(ele);
-
-        model.destroy().then(function(resp) {
-          that.rows[ele].$el.fadeOut(function () {
-            $(this).remove();
-          });
-
-          model.collection.remove(model.id);
-          if (!!model.id.match('_design')) {
-            FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
-          }
-          that.$('.bulk-delete').addClass('disabled');
-        }, function(resp) {
-          FauxtonAPI.addNotification({
-            msg: "Failed to destroy your doc!",
-            type: "error",
-            clear:  true
-          });
-        });
-      }, this);
+      this.bulkDeleteDocsCollection.bulkDelete();
     },
 
     addPagination: function () {
@@ -640,6 +677,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     beforeRender: function() {
+      var docs;
 
       if (!this.pagination) {
         this.addPagination();
@@ -658,11 +696,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.setView('#item-numbers', this.allDocsNumber);
 
-      var docs = this.expandDocs ? this.collection : this.collection.simple();
+      docs = this.expandDocs ? this.collection : this.collection.simple();
 
       docs.each(function(doc) {
+        var isChecked;
+        if (this.bulkDeleteDocsCollection) {
+          isChecked = this.bulkDeleteDocsCollection.get(doc.id);
+        }
         this.rows[doc.id] = this.insertView("table.all-docs tbody", new this.nestedView({
-          model: doc
+          model: doc,
+          checked: isChecked
         }));
       }, this);
     },
@@ -683,8 +726,17 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       }
     },
 
-    afterRender: function(){
+    afterRender: function () {
       prettyPrint();
+
+      if (this.bulkDeleteDocsCollection) {
+        this.stopListening(this.bulkDeleteDocsCollection);
+        this.listenTo(this.bulkDeleteDocsCollection, 'error', this.showError);
+        this.listenTo(this.bulkDeleteDocsCollection, 'removed', this.removeDocuments);
+        this.listenTo(this.bulkDeleteDocsCollection, 'updated', this.toggleTrash);
+      }
+
+      this.toggleTrash();
     },
 
     perPage: function () {
@@ -731,13 +783,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.model.destroy().then(function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Succesfully destroyed your doc",
+          msg: "Succesfully deleted your doc",
           clear:  true
         });
         FauxtonAPI.navigate(database.url("index"));
       }, function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Failed to destroy your doc!",
+          msg: "Failed to delete your doc!",
           type: "error",
           clear:  true
         });


[49/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
etap: add 232-csp.t to Makefile


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

Branch: refs/heads/1.6.x
Commit: 1ad8b50f4892c48f9c8eb8da42667b57a7b32e6a
Parents: 43ccf52
Author: Dave Cottlehuber <dc...@apache.org>
Authored: Thu Aug 14 01:09:27 2014 +0200
Committer: Dave Cottlehuber <dc...@apache.org>
Committed: Thu Aug 14 01:09:39 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ad8b50f/test/etap/Makefile.am
----------------------------------------------------------------------
diff --git a/test/etap/Makefile.am b/test/etap/Makefile.am
index c9778ca..122649a 100644
--- a/test/etap/Makefile.am
+++ b/test/etap/Makefile.am
@@ -100,6 +100,7 @@ tap_files = \
     220-compaction-daemon.t \
     230-pbkfd2.t \
     231-cors.t \
+    232-csp.t \
     250-upgrade-legacy-view-files.t
 
 EXTRA_DIST = \


[25/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: use local version of font awesome

We are currently referencing to Font-Awesome on a CDN in the
variables.less, which is basically nice, but some users of
CouchDB are firewalled at work and can just use the local
network.

Additionally offline people without internet can't use Fauxton
if the font is loaded via CDN.

This also removes the cache-buster for imgs (GET-Params with
version) in our routing for the local files of the dev-server
to make it work, in the future we might want to use a real
router module for the long if/else block.

Closes: COUCHDB-2238


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

Branch: refs/heads/1.6.x
Commit: 3e981dc047f65a32e758929ed82077b791d683a9
Parents: e2104fa
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Thu May 22 23:01:23 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Jun 5 20:59:25 2014 +0200

----------------------------------------------------------------------
 src/fauxton/assets/less/bootstrap/font-awesome/variables.less | 4 ++--
 src/fauxton/tasks/couchserver.js                              | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3e981dc0/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/font-awesome/variables.less b/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
index bb2986d..5d93614 100644
--- a/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
+++ b/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
@@ -1,8 +1,8 @@
 // Variables
 // --------------------------
 
-//@FontAwesomePath:    "../../img";
-@FontAwesomePath:    "//netdna.bootstrapcdn.com/font-awesome/3.2.1/font"; // for referencing Bootstrap CDN font files directly
+@FontAwesomePath:    "../../img";
+//@FontAwesomePath:    "//netdna.bootstrapcdn.com/font-awesome/3.2.1/font"; // for referencing Bootstrap CDN font files directly
 @FontAwesomeVersion: "3.2.1";
 @borderColor:        #eee;
 @iconMuted:          #eee;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3e981dc0/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index e1f18f9..67b0ae0 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -56,6 +56,7 @@ module.exports = function (grunt) {
       } else if (!!url.match(/mocha|\/test\/core\/|test\.config/)) {
         filePath = path.join('./test', url.replace('/test/',''));
       } else if (!!url.match(/\.css|img/)) {
+        url = url.replace(/\?.*/, '');
         filePath = path.join(dist_dir,url);
       /*} else if (!!url.match(/\/js\//)) {
         // serve any javascript or files from dist debug dir
@@ -87,7 +88,7 @@ module.exports = function (grunt) {
             res.end(JSON.stringify({error: err.message}));
           })
           .pipe(res);
-      } 
+      }
 
       proxy.proxyRequest(req, res);
     }).listen(port);


[37/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: updated dev dependancies


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

Branch: refs/heads/1.6.x
Commit: 04bc532eaee22b26eccf9656441b7c0cab836063
Parents: 46db1a2
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Jun 25 15:56:34 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jun 25 15:57:25 2014 +0200

----------------------------------------------------------------------
 src/fauxton/package.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/04bc532e/src/fauxton/package.json
----------------------------------------------------------------------
diff --git a/src/fauxton/package.json b/src/fauxton/package.json
index fd5e3d3..d84c881 100644
--- a/src/fauxton/package.json
+++ b/src/fauxton/package.json
@@ -15,9 +15,9 @@
     "grunt-contrib-clean": "~0.4.1",
     "grunt-contrib-jshint": "~0.6.0",
     "grunt-contrib-concat": "~0.3.0",
-    "grunt-contrib-less": "~0.5.0",
+    "grunt-contrib-less": "~0.11.0",
     "grunt-contrib-jst": "~0.5.0",
-    "grunt-contrib-watch": "~0.4.4",
+    "grunt-contrib-watch": "~0.6.1",
     "grunt-contrib-uglify": "~0.2.0",
     "grunt-contrib-copy": "~0.4.1",
     "grunt-couchapp": "~0.1.0",


[31/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Content Security Policy optional for dev

This just makes the content security policy optional for
development.


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

Branch: refs/heads/1.6.x
Commit: 672cacb8060e9fdbe0d08e0b5aa36fbc7b898cc6
Parents: aca4bc7
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jun 10 15:19:32 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jun 11 11:21:34 2014 +0200

----------------------------------------------------------------------
 src/fauxton/tasks/couchserver.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/672cacb8/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 3a17ab6..8e95c5c 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -25,7 +25,8 @@ module.exports = function (grunt) {
     // Options
     var dist_dir = options.dist || './dist/debug/',
         app_dir = './app',
-        port = options.port || 8000;
+        port = options.port || 8000,
+        setContentSecurityPolicy = _.isUndefined(options.contentSecurityPolicy) ? true : options.contentSecurityPolicy;
 
     // Proxy options with default localhost
     var proxy_settings = options.proxy || {
@@ -47,9 +48,11 @@ module.exports = function (grunt) {
           accept = req.headers.accept.split(','),
           filePath;
 
-      var headerValue = "default-src 'self'; img-src 'self'; font-src 'self'; " +
-                        "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
-      res.setHeader('Content-Security-Policy', headerValue);
+      if (setContentSecurityPolicy) {
+        var headerValue = "default-src 'self'; img-src 'self'; font-src 'self'; " +
+                          "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
+        res.setHeader('Content-Security-Policy', headerValue);
+      }
 
       if (!!url.match(/^\/addons\/.*\/assets\/js/)) {
         filePath = path.join(app_dir, url.replace('/_utils/fauxton/',''));


[19/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxtin: Remove Todo, clean up readme

We haven't used todo.md in a long time. All the tickets are in JIRA.
I've just removed some old wording from the readme.md


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

Branch: refs/heads/1.6.x
Commit: 9c301c16231ef1cca00176446bedaea52fcc1c9b
Parents: 17031e8
Author: Garren Smith <ga...@gmail.com>
Authored: Thu May 29 11:43:05 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu May 29 14:17:02 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am       |  1 -
 src/fauxton/TODO.md   | 24 ------------------------
 src/fauxton/readme.md | 35 +++++++++++------------------------
 3 files changed, 11 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9c301c16/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 92ec8f1..7801c98 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -343,6 +343,5 @@ FAUXTON_FILES = \
     fauxton/test/mocha/testUtils.js \
     fauxton/test/runner.html \
     fauxton/test/test.config.underscore \
-    fauxton/TODO.md \
     fauxton/CONTRIBUTING.md \
     fauxton/writing_addons.md

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9c301c16/src/fauxton/TODO.md
----------------------------------------------------------------------
diff --git a/src/fauxton/TODO.md b/src/fauxton/TODO.md
deleted file mode 100644
index a4b2a8e..0000000
--- a/src/fauxton/TODO.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Fauxton todo
-In no particular order
-
-- [ ] docco docs
-- [ ] user management
-- [ ] view options
-- [ ] view editor
-- [ ] visual view builder
-- [ ] new db as modal
-- [ ] new view button
-- [ ] show design docs only
-- [ ] fix delete doc button UI bug
-- [ ] delete multiple docs via _bulk_docs
-- [x] show change events in database view
-- [ ] pouchdb addon
-- [ ] bespoke bootstrap style
-- [ ] responsive interface
-- [ ] sticky subnav for some UI components on _all_docs
-- [ ] "show me" button in API bar doesn't
-- [ ] edit index button doesn't
-- [ ] replicate UI
-- [x] delete database
-- [x] format dates better (e.g. in logs plugin)
-- [ ] restore unfiltered data in logs UI

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9c301c16/src/fauxton/readme.md
----------------------------------------------------------------------
diff --git a/src/fauxton/readme.md b/src/fauxton/readme.md
index bb81095..dc36a17 100644
--- a/src/fauxton/readme.md
+++ b/src/fauxton/readme.md
@@ -1,19 +1,7 @@
 Fauxton
 =======
 
-This is the initial implementation of Fauxton, focused on fleshing out
-the various pieces of functionality and as a test bed for new ideas.
-Full functionality and design considerations will be added later.
-
-
-
-Current items of interest:
-
-  * Live JSON editor with dynamic JS Hinting and error popups
-  * Initial plugin system
-  * Minimal externally loadable plugin example
-  * Data popups for additional db info on \_all_dbs page
-  * CouchDB API compliant urls
+Fauxton is the new Web UI for CouchDB. To get it running in development on your machine. Follow the steps below.
 
 ## Setup Fauxton ##
 
@@ -40,17 +28,6 @@ And then...
 
     grunt dev
 
-#### (Optional) To avoid a npm global install
-    # Add node_modules/.bin to your path
-    # export PATH=./node_modules/.bin:$PATH
-		# Or just use the wrappers in ./bin/
-
-    # Development mode, non minified files
-    ./bin/grunt couchdebug
-
-    # Or fully compiled install
-    # ./bin/grunt couchdb
-
 ### Prepare Fauxton Release
     Follow the "Fauxton Setup" section,
     Edit settings.json variable root where the document will live.  eg.  "/_utils/fauxton/"
@@ -81,3 +58,13 @@ Each module must have a `base.js` file, this is read and compile when Fauxton is
 
 Checkout [Jira](https://issues.apache.org/jira/browse/COUCHDB/component/12320406) for a list of items to do.
 
+## (Optional) To avoid a npm global install
+    # Add node_modules/.bin to your path
+    # export PATH=./node_modules/.bin:$PATH
+		# Or just use the wrappers in ./bin/
+
+    # Development mode, non minified files
+    ./bin/grunt couchdebug
+
+    # Or fully compiled install
+    # ./bin/grunt couchdb


[28/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Fix show me api link

 * use data-bypass attribute to circumvent backbone routing


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

Branch: refs/heads/1.6.x
Commit: 061295ab0dfabf73164ef4f1e07fa4b4283fa8e2
Parents: 3bcf664
Author: Robin Drexler <dr...@gmail.com>
Authored: Sun Jun 8 20:07:58 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Jun 9 19:54:27 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/fauxton/templates/api_bar.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/061295ab/src/fauxton/app/addons/fauxton/templates/api_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/templates/api_bar.html b/src/fauxton/app/addons/fauxton/templates/api_bar.html
index ecd92f1..886c06e 100644
--- a/src/fauxton/app/addons/fauxton/templates/api_bar.html
+++ b/src/fauxton/app/addons/fauxton/templates/api_bar.html
@@ -25,6 +25,6 @@ the License.
         </a>
       </span>
       <input type="text" class="input-xxlarge" value="<%- endpoint %>">
-      <a href="<%- endpoint %>" target="_blank" class="btn">Show me</a>
+      <a data-bypass="true" href="<%- endpoint %>" target="_blank" class="btn">Show me</a>
     </div>
 </div>


[17/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Use "single-master" technical term which inspired by RFC 3384

COUCHDB-2248


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

Branch: refs/heads/1.6.x
Commit: 11f726ec9e690abb5d40cdc77ee3860cbba4ff20
Parents: 75fa89c
Author: Alexander Shorin <kx...@apache.org>
Authored: Thu May 29 01:28:18 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Thu May 29 01:28:18 2014 +0400

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/11f726ec/share/doc/src/intro/consistency.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/intro/consistency.rst b/share/doc/src/intro/consistency.rst
index 96519c3..c104ded 100644
--- a/share/doc/src/intro/consistency.rst
+++ b/share/doc/src/intro/consistency.rst
@@ -280,7 +280,7 @@ consistency between multiple database servers. If a client makes a write
 operation on server `A`, how do we make sure that this is consistent with
 server `B`, or `C`, or `D`? For relational databases, this is a very complex
 problem with entire books devoted to its solution. You could use
-multi-master, master/slave, partitioning, sharding, write-through caches,
+multi-master, single-master, partitioning, sharding, write-through caches,
 and all sorts of other complex techniques.
 
 


[12/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Do not add empty filters

Do not add filters, when someone submits the form and did not
enter anything


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

Branch: refs/heads/1.6.x
Commit: 2abdb2cca937ca4551edb92bba8066672033042f
Parents: d8bd7ee
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 16 21:25:00 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri May 16 21:25:00 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/fauxton/components.js           | 6 +++++-
 src/fauxton/app/addons/fauxton/tests/filterViewSpec.js | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2abdb2cc/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 52e7e8b..79a9320 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -354,7 +354,11 @@ function(app, FauxtonAPI, ace, spin) {
     filterLogs: function (event) {
       event.preventDefault();
       var $filter = this.$('input[name="filter"]'),
-          filter = $filter.val();
+          filter = $.trim($filter.val());
+
+      if (!filter) {
+        return;
+      }
 
       this.eventListener.trigger(this.eventNamespace + ":filter", filter);
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2abdb2cc/src/fauxton/app/addons/fauxton/tests/filterViewSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/tests/filterViewSpec.js b/src/fauxton/app/addons/fauxton/tests/filterViewSpec.js
index 3fb1748..fec970d 100644
--- a/src/fauxton/app/addons/fauxton/tests/filterViewSpec.js
+++ b/src/fauxton/app/addons/fauxton/tests/filterViewSpec.js
@@ -77,5 +77,11 @@ define([
 
       assert.equal(0, filterView.$('.js-remove-filter').length);
     });
+
+    it('should not add empty filters', function () {
+      filterView.$('[name="filter"]').val('');
+      filterView.$('.js-log-filter-form').submit();
+      assert.equal(0, filterView.$('.js-remove-filter').length);
+    });
   });
 });


[23/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Show design doc name in status dashboard for indexer

Using a custom objectField that consists of the database name and
the design document name when the type of the task is indexer in the
status dashboard.

Closes COUCHDB-2222


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

Branch: refs/heads/1.6.x
Commit: 23490c143d3e8abc029c0ceaeb81d910e0a06949
Parents: 6a46608
Author: thriqon <gi...@jonasw.de>
Authored: Sat May 31 21:13:43 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Jun 2 23:10:03 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/views.js | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/23490c14/src/fauxton/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/views.js b/src/fauxton/app/addons/activetasks/views.js
index 83ef861..87d56e2 100644
--- a/src/fauxton/app/addons/activetasks/views.js
+++ b/src/fauxton/app/addons/activetasks/views.js
@@ -168,6 +168,8 @@ function (app, FauxtonAPI, ActiveTasks) {
       var objectField = this.model.get('database');
       if (this.type === "replication"){
         objectField = this.model.get('source') + " to " + this.model.get('target');
+      } else if (this.type === "indexer") {
+        objectField = this.model.get("database") + " / " + this.model.get("design_document");
       }
       return objectField;
     },


[24/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Remove dead code/view: database sidebar


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

Branch: refs/heads/1.6.x
Commit: e2104faffc9437696f0a2e2cb420ed68508690d8
Parents: 23490c1
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Jun 4 18:23:32 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Jun 5 20:57:38 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |  1 -
 .../app/addons/databases/templates/sidebar.html | 31 ---------
 src/fauxton/app/addons/databases/views.js       | 71 ++------------------
 3 files changed, 4 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e2104faf/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 7801c98..d7cea21 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -160,7 +160,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/databases/templates/item.html \
     fauxton/app/addons/databases/templates/list.html \
     fauxton/app/addons/databases/templates/newdatabase.html \
-    fauxton/app/addons/databases/templates/sidebar.html \
     fauxton/app/addons/documents/templates/advanced_options.html \
     fauxton/app/addons/documents/templates/all_docs_item.html \
     fauxton/app/addons/documents/templates/all_docs_layout.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e2104faf/src/fauxton/app/addons/databases/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/databases/templates/sidebar.html b/src/fauxton/app/addons/databases/templates/sidebar.html
deleted file mode 100644
index a8bbd89..0000000
--- a/src/fauxton/app/addons/databases/templates/sidebar.html
+++ /dev/null
@@ -1,31 +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.
--->
-
-<div class="row-fluid">
-  <a href="http://couchdb.org" target="_blank"><img src="img/couchdblogo.png"/></a>
-  <br/>
-</div>
-<hr>
-<ul class="nav nav-list">
-  <!-- <li class="nav-header">Database types</li> -->
-  <li class="active"><a class="toggle-view" id="owned">Your databases</a></li>
-  <li><a class="btn new" id="new"><i class="icon-plus"></i> New database</a></li>
-</ul>
-<hr>
-
-<div>
-  <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/CouchDB" data-widget-id="314360971646869505">Tweets by @CouchDB</a>
-<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e2104faf/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 0806b92..5629cb1 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -12,7 +12,7 @@
 
 define([
   "app",
-  
+
   "addons/fauxton/components",
   "api",
   "addons/databases/resources"
@@ -28,7 +28,7 @@ function(app, Components, FauxtonAPI, Databases) {
       return [this.model.fetch()];
     },
     serialize: function() {
-      
+
       return {
         encoded: app.utils.safeURLName(this.model.get("name")),
         database: this.model
@@ -125,8 +125,8 @@ function(app, Components, FauxtonAPI, Databases) {
 
     afterRender: function() {
       var that = this,
-          AllDBsArray = _.map(this.collection.toJSON(), function(item, key){ 
-            return item.name; 
+          AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
+            return item.name;
           });
 
       this.dbSearchTypeahead = new Components.Typeahead({
@@ -192,68 +192,5 @@ function(app, Components, FauxtonAPI, Databases) {
     }
   });
 
-  Views.Sidebar = FauxtonAPI.View.extend({
-    template: "addons/databases/templates/sidebar",
-    events: {
-      "click a#new": "newDatabase",
-      "click a#owned": "showMine",
-      "click a#shared": "showShared"
-    },
-
-    newDatabase: function() {
-      var notification;
-      var db;
-      // TODO: use a modal here instead of the prompt
-      var name = prompt('Name of database', 'newdatabase');
-      if (name === null) {
-        return;
-      } else if (name.length === 0) {
-        notification = FauxtonAPI.addNotification({
-          msg: "Please enter a valid database name",
-          type: "error",
-          clear: true
-        });
-        return;
-      }
-      db = new this.collection.model({
-        id: encodeURIComponent(name),
-        name: name
-      });
-      notification = FauxtonAPI.addNotification({msg: "Creating database."});
-      db.save().done(function() {
-        notification = FauxtonAPI.addNotification({
-          msg: "Database created successfully",
-          type: "success",
-          clear: true
-        });
-        var route = "#/database/" +  name + "/_all_docs?limit=" + Databases.DocLimit;
-        app.router.navigate(route, { trigger: true });
-      }
-      ).error(function(xhr) {
-        var responseText = JSON.parse(xhr.responseText).reason;
-        notification = FauxtonAPI.addNotification({
-          msg: "Create database failed: " + responseText,
-          type: "error",
-          clear: true
-        });
-      }
-      );
-    },
-
-    showMine: function(){
-      $.contribute(
-        'Show unshared databases',
-        'app/addons/databases/views.js'
-      );
-    },
-
-    showShared: function(){
-      $.contribute(
-        'Show shared databases (e.g. continuous replications to/from the database)',
-        'app/addons/databases/views.js'
-      );
-    }
-  });
-
   return Views;
 });


[35/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Fix clone cancel button

This fixes the issue that when a user cancels a clone doc it goes back
to all docs. Now it just closes the modal.


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

Branch: refs/heads/1.6.x
Commit: 9484bdaff8103bca4e9ee7684e0f78b0281334f7
Parents: 18f7d7d
Author: sebastianrothbucher <se...@googlemail.com>
Authored: Sat Jun 21 20:11:17 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Jun 23 10:00:15 2014 +0200

----------------------------------------------------------------------
 .../app/addons/documents/templates/duplicate_doc_modal.html        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9484bdaf/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html b/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
index 54be01f..3038559 100644
--- a/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
+++ b/src/fauxton/app/addons/documents/templates/duplicate_doc_modal.html
@@ -28,7 +28,7 @@ the License.
 
   </div>
   <div class="modal-footer">
-    <button data-dismiss="modal" class="btn cancel-button"><i class="icon fonticon-circle-x"></i> Cancel</button>
+    <button data-dismiss="modal" class="btn"><i class="icon fonticon-circle-x"></i> Cancel</button>
     <button id="duplicate-btn" class="btn btn-success save"><i class="fonticon-circle-check"></i> Clone</button>
   </div>
 </div>


[50/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
build: set version for 1.6.1 release


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

Branch: refs/heads/1.6.x
Commit: eeb31cbbd93c1c1879aa1b6509ac6c71e12b6dcb
Parents: 1ad8b50
Author: Dave Cottlehuber <dc...@apache.org>
Authored: Thu Aug 14 00:53:30 2014 +0200
Committer: Dave Cottlehuber <dc...@apache.org>
Committed: Thu Aug 14 01:09:39 2014 +0200

----------------------------------------------------------------------
 acinclude.m4.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/eeb31cbb/acinclude.m4.in
----------------------------------------------------------------------
diff --git a/acinclude.m4.in b/acinclude.m4.in
index 9f0b3f4..ef4e8a6 100644
--- a/acinclude.m4.in
+++ b/acinclude.m4.in
@@ -18,7 +18,7 @@ m4_define([LOCAL_PACKAGE_NAME], [Apache CouchDB])
 m4_define([LOCAL_BUG_URI], [https://issues.apache.org/jira/browse/COUCHDB])
 m4_define([LOCAL_VERSION_MAJOR], [1])
 m4_define([LOCAL_VERSION_MINOR], [6])
-m4_define([LOCAL_VERSION_REVISION], [0])
+m4_define([LOCAL_VERSION_REVISION], [1])
 m4_define([LOCAL_VERSION_STAGE], [])
 m4_define([LOCAL_VERSION_RELEASE], [])
 m4_define([LOCAL_VERSION_PRIMARY],


[03/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Remove unused variable and function call

Finally get rid of that compiler warning.


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

Branch: refs/heads/1.6.x
Commit: 7fe850914d9230e164209eff7255df4c3bc54983
Parents: 85df088
Author: Klaus Trainer <kl...@apache.org>
Authored: Mon May 12 00:41:41 2014 +0200
Committer: Klaus Trainer <kl...@apache.org>
Committed: Mon May 12 00:50:31 2014 +0200

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7fe85091/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 3eb2e39..cc5c3d3 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -233,8 +233,6 @@ handle_request_int(MochiReq, DefaultFun,
     RawUri = MochiReq:get(raw_path),
     {"/" ++ Path, _, _} = mochiweb_util:urlsplit_path(RawUri),
 
-    Headers = MochiReq:get(headers),
-
     % get requested path
     RequestedPath = case MochiReq:get_header_value("x-couchdb-vhost-path") of
         undefined ->


[13/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: encode uri component for config url

Fixes the "/" in httpd_global_handlers in the config dashboard


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

Branch: refs/heads/1.6.x
Commit: f8d535c0aeff405aef6cbcf1e507c79c8548dce2
Parents: 2abdb2c
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Tue May 20 22:10:59 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed May 21 19:52:20 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f8d535c0/src/fauxton/app/addons/config/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/config/resources.js b/src/fauxton/app/addons/config/resources.js
index 317e355..bbd0d2a 100644
--- a/src/fauxton/app/addons/config/resources.js
+++ b/src/fauxton/app/addons/config/resources.js
@@ -26,7 +26,7 @@ function (app, FauxtonAPI) {
     documentation: "config",
 
     url: function () {
-      return app.host + '/_config/' + this.get("section") + '/' + this.get("name");
+      return app.host + '/_config/' + this.get("section") + '/' + encodeURIComponent(this.get("name"));
     },
 
     isNew: function () { return false; },
@@ -77,7 +77,7 @@ function (app, FauxtonAPI) {
     }
   });
 
- 
+
 
   return Config;
 });


[32/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
add sinon.js


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

Branch: refs/heads/1.6.x
Commit: 4e904561e38223bc298df1f39d99bcf238e3078a
Parents: 672cacb
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Jun 16 23:27:48 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Jun 16 23:27:48 2014 +0200

----------------------------------------------------------------------
 LICENSE | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4e904561/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 4c58f19..193355e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -886,6 +886,36 @@ for src/fauxton/test/mocha/sinon-chai.js
 
   0. You just DO WHAT THE FUCK YOU WANT TO.
 
+for src/fauxton/test/mocha/sinon.js
+
+(The BSD License)
+
+Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of Christian Johansen nor the names of his contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 for src/fauxton/js/libs/spin.js
   The MIT License
 


[44/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
hash admin passwords on startup when list


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

Branch: refs/heads/1.6.x
Commit: d43f69d90740d5a230b0054fa32b6843b33691bc
Parents: 7221f70
Author: Robert Newson <rn...@apache.org>
Authored: Fri Jun 6 20:38:14 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 2 17:20:45 2014 +0100

----------------------------------------------------------------------
 src/couchdb/couch_passwords.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d43f69d9/src/couchdb/couch_passwords.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_passwords.erl b/src/couchdb/couch_passwords.erl
index bbf6d9a..9abf31b 100644
--- a/src/couchdb/couch_passwords.erl
+++ b/src/couchdb/couch_passwords.erl
@@ -26,7 +26,9 @@ 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().
+-spec hash_admin_password(binary() | list()) -> binary().
+hash_admin_password(ClearPassword) when is_list(ClearPassword) ->
+    hash_admin_password(?l2b(ClearPassword));
 hash_admin_password(ClearPassword) when is_binary(ClearPassword) ->
     Iterations = couch_config:get("couch_httpd_auth", "iterations", "10000"),
     Salt = couch_uuids:random(),


[18/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: remove the Log Component

As prepration for the BigCouch merge and a LTS Couch 1.x with
Fauxton. After the merge the _logs resource will not be available
and logging happens with Lager. See
http://www.mail-archive.com/dev@couchdb.apache.org/msg32934.html
for more details.


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

Branch: refs/heads/1.6.x
Commit: 17031e89f3d35286f0a04993a4dbcd710b484ea8
Parents: 11f726e
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed May 28 20:34:02 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu May 29 12:07:25 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |   8 -
 src/fauxton/TODO.md                             |   2 -
 .../app/addons/logs/assets/less/logs.less       |  24 ---
 src/fauxton/app/addons/logs/base.js             |  28 ---
 src/fauxton/app/addons/logs/resources.js        | 212 -------------------
 src/fauxton/app/addons/logs/routes.js           |  58 -----
 .../app/addons/logs/templates/dashboard.html    |  50 -----
 .../app/addons/logs/templates/sidebar.html      |  18 --
 src/fauxton/app/addons/logs/tests/baseSpec.js   |  38 ----
 .../app/addons/logs/tests/resourcesSpec.js      | 117 ----------
 src/fauxton/assets/less/fauxton.less            |   6 -
 src/fauxton/settings.json.default               |   1 -
 src/fauxton/settings.json.dev                   |   1 -
 13 files changed, 563 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index dde0810..92ec8f1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,13 +77,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/contribute/base.js \
     fauxton/app/addons/exampleAuth/base.js \
     fauxton/app/addons/exampleAuth/templates/noAccess.html \
-    fauxton/app/addons/logs/base.js \
-    fauxton/app/addons/logs/resources.js \
-    fauxton/app/addons/logs/routes.js \
-    fauxton/app/addons/logs/templates/dashboard.html \
-    fauxton/app/addons/logs/templates/sidebar.html \
-    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 \
@@ -321,7 +314,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/databases/assets/less/databases.less \
     fauxton/assets/less/fauxton.less \
     fauxton/assets/less/icons.less \
-    fauxton/app/addons/logs/assets/less/logs.less \
     fauxton/assets/less/prettyprint.less \
     fauxton/assets/less/variables.less \
     fauxton/bin/grunt \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/TODO.md
----------------------------------------------------------------------
diff --git a/src/fauxton/TODO.md b/src/fauxton/TODO.md
index b929e05..a4b2a8e 100644
--- a/src/fauxton/TODO.md
+++ b/src/fauxton/TODO.md
@@ -21,6 +21,4 @@ In no particular order
 - [ ] replicate UI
 - [x] delete database
 - [x] format dates better (e.g. in logs plugin)
-- [ ] format log entry better
-- [ ] filter logs by method
 - [ ] restore unfiltered data in logs UI

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/app/addons/logs/assets/less/logs.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/assets/less/logs.less b/src/fauxton/app/addons/logs/assets/less/logs.less
deleted file mode 100644
index 17a4182..0000000
--- a/src/fauxton/app/addons/logs/assets/less/logs.less
+++ /dev/null
@@ -1,24 +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.
- */
-
-.logs {
-  padding: 0 15px;
-  .log-table {
-    width: auto;
-    white-space: nowrap;
-    .args {
-      width: 100%;
-      white-space: normal;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/app/addons/logs/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/base.js b/src/fauxton/app/addons/logs/base.js
deleted file mode 100644
index 1aecbdf..0000000
--- a/src/fauxton/app/addons/logs/base.js
+++ /dev/null
@@ -1,28 +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([
-  "app",
-
-  "api",
-
-  // Modules
-  "addons/logs/routes"
-],
-
-function(app, FauxtonAPI, Log) {
-  Log.initialize = function() {
-    FauxtonAPI.addHeaderLink({title: "Log", href: "#_log", icon: "fonticon-log", className: 'logs'});
-  };
-
-  return Log;
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/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
deleted file mode 100644
index cd0f54a..0000000
--- a/src/fauxton/app/addons/logs/resources.js
+++ /dev/null
@@ -1,212 +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([
-  "app",
-  "api",
-  "backbone",
-  "d3",
-  "addons/fauxton/components"
-],
-
-function (app, FauxtonAPI, Backbone, d3, Components) {
-
-  var Log = FauxtonAPI.addon();
-
-  Log.Model = Backbone.Model.extend({
-
-    initialize: function () {
-      this.dateObject = new Date(this.get('date'));
-    },
-
-    date: function () {
-      var formatter = d3.time.format("%b %e");
-
-      return formatter(this.dateObject);
-    },
-
-    time: function () {
-      var formatter = d3.time.format("%H:%M:%S");
-
-      return formatter(this.dateObject);
-    },
-
-    logLevel: function () {
-      return this.get('log_level').replace(/ /g,'');
-    },
-
-    pid: function () {
-      return _.escape(this.get('pid'));
-    },
-
-    args: function () {
-      return _.escape(this.get('args'));
-    }
-
-  });
-
-  Log.Collection = Backbone.Collection.extend({
-    model: Log.Model,
-
-    initialize: function (options) {
-      this.params = {bytes: 5000};
-    },
-
-    documentation: "log",
-
-    url: function () {
-      var query = "?" + $.param(this.params);
-      return app.host + '/_log' + query;
-    },
-
-    // override fetch because backbone expects json and couchdb sends text/html for logs,
-    // I think its more elegant to set the dataType here than where ever fetch is called
-    fetch: function (options) {
-      options = options ? options : {};
-
-      return Backbone.Collection.prototype.fetch.call(this, _.extend(options, {dataType: "html"}));
-    },
-
-    sortLogsIntoDays: function () {
-      return _.reduce(this.toArray(), function (sortedCollection, log, key) {
-        var date = log.date();
-
-        if (!sortedCollection[date]) {
-          sortedCollection[date] = [];
-        }
-
-        sortedCollection[date].push(log);
-        return sortedCollection;
-      }, {});
-    },
-
-    parse: function (resp) {
-      resp = resp.replace(/\n\s/g, '');
-      var lines = resp.split(/\n/);
-      return _.foldr(lines, function (acc, logLine) {
-        var match = logLine.match(/^\[(.*?)\]\s\[(.*?)\]\s\[(.*?)\]\s(.*)/);
-
-        if (!match) { return acc;}
-
-        acc.push({
-                  date: match[1],
-                  log_level: match[2],
-                  pid: match[3],
-                  args: match[4].replace(/\s\s+/g, '')
-                 });
-
-        return acc;
-      }, []);
-    }
-  });
-
-  Log.events = {};
-  _.extend(Log.events, Backbone.Events);
-
-  Log.Views.View = FauxtonAPI.View.extend({
-    template: "addons/logs/templates/dashboard",
-
-    initialize: function (options) {
-      this.refreshTime = options.refreshTime || 5000;
-
-      Log.events.on("log:filter", this.filterLogs, this);
-      Log.events.on("log:remove", this.removeFilterLogs, this);
-
-      this.filters = [];
-
-      this.collection.on("add", function () {
-        this.render();
-      }, this);
-    },
-
-    establish: function () {
-      return [this.collection.fetch()];
-    },
-
-    serialize: function () {
-      var collection = new Log.Collection(this.createFilteredCollection());
-
-      return {
-        days: collection.sortLogsIntoDays()
-      };
-    },
-
-    afterRender: function () {
-      this.startRefreshInterval();
-    },
-
-    cleanup: function () {
-      this.stopRefreshInterval();
-    },
-
-    filterLogs: function (filter) {
-      this.filters.push(filter);
-      this.render();
-    },
-
-    createFilteredCollection: function () {
-      var that = this;
-
-      return _.reduce(this.filters, function (logs, filter) {
-
-        return _.filter(logs, function (log) {
-          var match = false;
-
-          _.each(log, function (value) {
-            if (value.toString().match(new RegExp(filter))) {
-              match = true;
-            }
-          });
-          return match;
-        });
-
-
-      }, this.collection.toJSON(), this);
-
-    },
-
-    removeFilterLogs: function (filter) {
-      this.filters.splice(this.filters.indexOf(filter), 1);
-      this.render();
-    },
-
-    startRefreshInterval: function () {
-      var collection = this.collection;
-
-      // Interval already set
-      if (this.intervalId) { return ; }
-
-      this.intervalId = setInterval(function () {
-        collection.fetch();
-      }, this.refreshTime);
-
-    },
-
-    stopRefreshInterval: function () {
-      clearInterval(this.intervalId);
-    }
-  });
-
-  Log.Views.Sidebar = FauxtonAPI.View.extend({
-    template: "addons/logs/templates/sidebar",
-
-    initialize: function (options) {
-      this.setView(".js-filter", new Components.FilterView({
-        eventListener: Log.events,
-        eventNamespace: "log"
-      }));
-    }
-  });
-
-  return Log;
-
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/app/addons/logs/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/routes.js b/src/fauxton/app/addons/logs/routes.js
deleted file mode 100644
index ce6522b..0000000
--- a/src/fauxton/app/addons/logs/routes.js
+++ /dev/null
@@ -1,58 +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([
-       "app",
-
-       "api",
-
-       // Modules
-       "addons/logs/resources"
-],
-
-function(app, FauxtonAPI, Log) {
-
-  var  LogRouteObject = FauxtonAPI.RouteObject.extend({
-    layout: "with_sidebar",
-
-    crumbs: [
-      {"name": "Logs", "link": "_log"}
-    ],
-
-    routes: {
-      "_log": "showLog"
-    },
-
-    selectedHeader: "Log",
-
-    roles: ["_admin"],
-
-    apiUrl: function() {
-      return [this.logs.url(), this.logs.documentation];
-    },
-
-    initialize: function () {
-      this.logs = new Log.Collection();
-      this.setView("#sidebar-content", new Log.Views.Sidebar({}));
-    },
-
-    showLog: function () {
-      this.setView("#dashboard-content", new Log.Views.View({collection: this.logs}));
-    }
-  });
-
-  Log.RouteObjects = [LogRouteObject];
-
-  return Log;
-
-});
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/app/addons/logs/templates/dashboard.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/templates/dashboard.html b/src/fauxton/app/addons/logs/templates/dashboard.html
deleted file mode 100644
index 855da37..0000000
--- a/src/fauxton/app/addons/logs/templates/dashboard.html
+++ /dev/null
@@ -1,50 +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.
--->
-
-<div class="logs">
-  <h2>CouchDB Logs</h2>
-  <table class="table table-bordered log-table">
-    <thead>
-      <tr>
-        <th class="time">Date</th>
-        <th class="level">Log Value</th>
-        <th class="pid">Pid</th>
-        <th class="args">Url</th>
-      </tr>
-    </thead>
-
-    <tbody>
-      <%  _.forEach(days, function (logs, date) { %>
-        <tr><td class="day" colspan="4"><%= date %></td></tr>
-        <% _.forEach(logs, function (log) { %>
-          <tr class="<%= log.logLevel() %>">
-            <td>
-              <%= log.time() %>
-            </td>
-            <td>
-              <%= log.logLevel() %>
-            </td>
-            <td class="pid">
-              <%= log.pid() %>
-            </td>
-            <td class="args">
-              <!-- TODO: split the line, maybe put method in it's own column -->
-              <%= log.args() %>
-            </td>
-          </tr>
-        <% }); %>
-      <% }); %>
-    </tbody>
-  </table>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/app/addons/logs/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/templates/sidebar.html b/src/fauxton/app/addons/logs/templates/sidebar.html
deleted file mode 100644
index b9116f1..0000000
--- a/src/fauxton/app/addons/logs/templates/sidebar.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.
--->
-
-<div id="log-sidebar">
-  <header>Log Filter</header>
-  <div class="js-filter"></div>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/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
deleted file mode 100644
index 621cc9b..0000000
--- a/src/fauxton/app/addons/logs/tests/baseSpec.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/17031e89/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
deleted file mode 100644
index 916dc91..0000000
--- a/src/fauxton/app/addons/logs/tests/resourcesSpec.js
+++ /dev/null
@@ -1,117 +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/resources',
-       'testUtils'
-], function (Log, testUtils) {
-  var assert = testUtils.assert,
-      ViewSandbox = testUtils.ViewSandbox;
-
-  describe('Logs Resources', function () {
-
-    describe('Log Parser', function () {
-      it('parses GET messages', function () {
-        var parsedLog,
-            collection,
-            log = '[Sat, 12 Apr 2014 13:02:58 GMT] [info] [<0.3097.2>] 127.0.0.1 - - GET /_session 200\n' +
-                  '[Sat, 12 Apr 2014 13:02:58 GMT] [info] [<0.3098.2>] 127.0.0.1 - - GET /_session 200\n' +
-                  '[Sat, 12 Apr 2014 13:02:58 GMT] [info] [<0.3099.2>] 127.0.0.1 - - GET / 200\n';
-
-        collection = new Log.Collection();
-        parsedLog = collection.parse(log);
-        assert.equal(parsedLog[0].date, 'Sat, 12 Apr 2014 13:02:58 GMT');
-        assert.equal(parsedLog[0].args, '127.0.0.1 - - GET / 200');
-      });
-
-      it('parses GET messages with erlang errors', function () {
-        var parsedLog,
-            collection,
-            log = '[Sat, 12 Apr 2014 13:14:15 GMT] [info] [<0.9491.2>] Retrying GET to http://176.9.4.195/registry/genstatic?revs=true&open_revs=%5B%224-a9be203658a59fd2116ae9acbd10f0de%22%5D&latest=true in 1.0 seconds due to error {error,\n' +
-                  '                                                                                                                                                                                      {error,\n' +
-                  '                                                                                                                                                                                       connection_closing}}\n' +
-                  '[Sat, 12 Apr 2014 13:14:15 GMT] [error] [<0.9499.2>] Replicator, request GET to "http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%2219-380884ba97e3d6fc48c8c7db3dc0e91b%22%5D&latest=true" failed due to error {error,connection_closing}\n' +
-                  '[Sat, 12 Apr 2014 13:14:15 GMT] [info] [<0.9497.2>] Retrying GET to http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%2219-380884ba97e3d6fc48c8c7db3dc0e91b%22%5D&latest=true in 1.0 seconds due to error {error,\n' +
-                  '                                                                                                                                                                                           {error,\n' +
-                  '                                                                                                                                                                                            connection_closing}}\n' +
-                  '[Sat, 12 Apr 2014 13:14:15 GMT] [error] [<0.9507.2>] Replicator, request GET to "http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%224-c8ba4809e2cacc1635f8887ec0d8d49a%22%5D&latest=true" failed due to error {error,connection_closing}\n' +
-                  '[Sat, 12 Apr 2014 13:14:15 GMT] [info] [<0.9505.2>] Retrying GET to http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%224-c8ba4809e2cacc1635f8887ec0d8d49a%22%5D&latest=true in 1.0 seconds due to error {error,\n' +
-                  '                                                                                                                                                                                          {error,\n' +
-                  '                                                                                                                                                                                           connection_closing}}\n';
-
-        collection = new Log.Collection();
-        parsedLog = collection.parse(log);
-        assert.equal(parsedLog[1].date, 'Sat, 12 Apr 2014 13:14:15 GMT');
-        assert.equal(parsedLog[1].args, 'Replicator, request GET to "http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%224-c8ba4809e2cacc1635f8887ec0d8d49a%22%5D&latest=true" failed due to error {error,connection_closing}');
-        assert.equal(parsedLog[2].args, 'Retrying GET to http://176.9.4.195/registry/google-openid?revs=true&open_revs=%5B%2219-380884ba97e3d6fc48c8c7db3dc0e91b%22%5D&latest=true in 1.0 seconds due to error {error,{error,connection_closing}}');
-      });
-    });
-
-    describe('uses a heading for each date (COUCHDB-2136)', function () {
-      var collection,
-          view;
-
-      beforeEach(function () {
-        collection = new Log.Collection([
-          new Log.Model({
-            date: new Date('Fri Apr 19 2014 12:06:01 GMT+0200 (CEST)'),
-            log_level: 'info',
-            pid: 1337,
-            args: 'ente ente'
-          }),
-          new Log.Model({
-            date: new Date('Fri Apr 18 2014 12:06:01 GMT+0200 (CEST)'),
-            log_level: 'info',
-            pid: 1337,
-            args: 'ente ente'
-          }),
-          new Log.Model({
-            date: new Date('Thu Apr 17 2014 12:06:01 GMT+0200 (CEST)'),
-            log_level: 'info',
-            pid: 1337,
-            args: 'ente ente'
-          }),
-          new Log.Model({
-            date: new Date('Thu Apr 16 2014 12:06:01 GMT+0200 (CEST)'),
-            log_level: 'info',
-            pid: 1337,
-            args: 'ente ente'
-          })
-        ]);
-
-      });
-
-      it('sorts the data into an object', function () {
-        var sortedCollection = collection.sortLogsIntoDays();
-
-        assert.property(sortedCollection, 'Apr 18');
-        assert.property(sortedCollection, 'Apr 17');
-      });
-
-      it('creates headers with dates', function () {
-        var titles = [],
-            viewSandbox,
-            view;
-
-        view = new Log.Views.View({collection: collection});
-        viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(view);
-
-        view.$('td[colspan="4"]').each(function (i, elem) {
-          titles.push($(elem).text());
-        });
-        assert.include(titles, 'Apr 18');
-        assert.include(titles, 'Apr 17');
-      });
-    });
-  });
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 177cadc..fc92909 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -859,12 +859,6 @@ form.view-query-update, form.view-query-save {
   max-width: 100%;
 }
 
-/*logs*/
-#log-sidebar{
-  padding: 20px;
-}
-
-
 /*documents and databases */
 .view.show{
   color: @fontGrey;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index eedf2f1..bc5a617 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -6,7 +6,6 @@
   { "name": "pouchdb" },
   { "name": "activetasks" },
   { "name": "config" },
-  { "name": "logs" },
   { "name": "stats" },
   { "name": "replication" },
   { "name": "plugins" },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17031e89/src/fauxton/settings.json.dev
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.dev b/src/fauxton/settings.json.dev
index d354c29..62cd1e7 100644
--- a/src/fauxton/settings.json.dev
+++ b/src/fauxton/settings.json.dev
@@ -6,7 +6,6 @@
   { "name": "pouchdb" },
   { "name": "activetasks" },
   { "name": "config" },
-  { "name": "logs" },
   { "name": "stats" },
   { "name": "replication" },
   { "name": "plugins" },


[07/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Rephrase part of the replicator documentation

This tries to make the replicator documentation's "Delegations" section
more clear and easier to read.


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

Branch: refs/heads/1.6.x
Commit: 99e2b9e28000d3960dba82fcd483b25afc5551a5
Parents: 7f9f66e
Author: Klaus Trainer <kl...@apache.org>
Authored: Mon May 12 00:08:25 2014 +0200
Committer: Klaus Trainer <kl...@apache.org>
Committed: Wed May 14 16:34:06 2014 +0200

----------------------------------------------------------------------
 share/doc/src/replication/replicator.rst | 46 +++++++++++++--------------
 1 file changed, 22 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/99e2b9e2/share/doc/src/replication/replicator.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/replication/replicator.rst b/share/doc/src/replication/replicator.rst
index 5117752..347b5a5 100644
--- a/share/doc/src/replication/replicator.rst
+++ b/share/doc/src/replication/replicator.rst
@@ -354,29 +354,27 @@ Delegations
 
 Replication documents can have a custom ``user_ctx`` property. This
 property defines the user context under which a replication runs. For
-the old way of triggering replications (POSTing to ``/_replicate/``),
-this property was not needed (it didn't exist in fact) - this is because
-at the moment of triggering the replication it has information about the
-authenticated user. With the replicator database, since it's a regular
-database, the information about the authenticated user is only present
-at the moment the replication document is written to the database - the
-replicator database implementation is like a ``_changes`` feed consumer
-(with ``?include_docs=true``) that reacts to what was written to the
-replicator database - in fact this feature could be implemented with an
-external script/program. This implementation detail implies that for non
-admin users, a ``user_ctx`` property, containing the user's name and a
-subset of their roles, must be defined in the replication document.
-This is ensured by the document update validation function present in
-the default design document of the replicator database. This validation
-function also ensure that a non admin user can set a user name property
-in the ``user_ctx`` property that doesn't match their own name (same
-principle applies for the roles).
+the old way of triggering a replication (POSTing to ``/_replicate/``),
+this property is not needed. That's because information about the
+authenticated user is readily available during the replication, which is
+not persistent in that case. Now, with the replicator database, the
+problem is that information about which user is starting a particular
+replication is only present when the replication document is written.
+The information in the replication document and the replication itself
+are persistent, however. This implementation detail implies that in the
+case of a non-admin user, a ``user_ctx`` property containing the user's
+name and a subset of their roles must be defined in the replication
+document. This is enforced by the document update validation function
+present in the default design document of the replicator database. The
+validation function also ensures that non-admin users are unable to set
+the value of the user context's ``name`` property to anything other than
+their own user name. The same principle applies for roles.
 
 For admins, the ``user_ctx`` property is optional, and if it's missing
-it defaults to a user context with name null and an empty list of roles
-- this mean design documents will not be written to local targets. If
-writing design documents to local targets is desired, the a user context
-with the roles ``_admin`` must be set explicitly.
+it defaults to a user context with name ``null`` and an empty list of
+roles, which means design documents won't be written to local targets.
+If writing design documents to local targets is desired, the role
+``_admin`` must be present in the user context's list of roles.
 
 Also, for admins the ``user_ctx`` property can be used to trigger a
 replication on behalf of another user. This is the user context that
@@ -400,6 +398,6 @@ Example delegated replication document:
          }
     }
 
-As stated before, for admins the ``user_ctx`` property is optional, while
-for regular (non admin) users it's mandatory. When the roles property of
-``user_ctx`` is missing, it defaults to the empty list ``[ ]``.
+As stated before, the ``user_ctx`` property is optional for admins, while
+being mandatory for regular (non-admin) users. When the roles property
+of ``user_ctx`` is missing, it defaults to the empty list ``[]``.


[20/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: add missing closing tags


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

Branch: refs/heads/1.6.x
Commit: 705711eb1b9bd4ba5cee74f7a5fd9c933dd70c09
Parents: 9c301c1
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Thu May 29 17:28:50 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu May 29 17:32:54 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/layouts/with_sidebar.html     | 10 +++++-----
 src/fauxton/app/templates/layouts/with_tabs.html        | 11 +++++------
 .../app/templates/layouts/with_tabs_sidebar.html        | 12 +++++-------
 3 files changed, 15 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/705711eb/src/fauxton/app/templates/layouts/with_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_sidebar.html b/src/fauxton/app/templates/layouts/with_sidebar.html
index 0bba4a1..4eba634 100644
--- a/src/fauxton/app/templates/layouts/with_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_sidebar.html
@@ -15,13 +15,13 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid">
-<header class="fixed-header">
-  <div id="breadcrumbs"></div>
-  <div id="api-navbar"></div>
-</header>
+  <header class="fixed-header">
+    <div id="breadcrumbs"></div>
+    <div id="api-navbar"></div>
+  </header>
+
   <div class="with-sidebar content-area">
     <div id="sidebar-content" class="sidebar"></div>
     <div id="dashboard-content" class="list window-resizeable"></div>
   </div>
 </div>
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/705711eb/src/fauxton/app/templates/layouts/with_tabs.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_tabs.html b/src/fauxton/app/templates/layouts/with_tabs.html
index 8bfc7e0..fc372ff 100644
--- a/src/fauxton/app/templates/layouts/with_tabs.html
+++ b/src/fauxton/app/templates/layouts/with_tabs.html
@@ -15,14 +15,13 @@ the License.
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid">
 
-<div class="fixed-header">
-  <div id="breadcrumbs"></div>
-  <div id="api-navbar"></div>
-</div>
+  <div class="fixed-header">
+    <div id="breadcrumbs"></div>
+    <div id="api-navbar"></div>
+  </div>
 
   <div class="row-fluid content-area">
   	<div id="tabs" class="row-fluid"></div>
     <div id="dashboard-content" class="list span12 window-resizeable"></div>
   </div>
-
-
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/705711eb/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
index d4efc8d..c808ac9 100644
--- a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
@@ -15,11 +15,10 @@ the License.
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid">
 
-<header class="fixed-header">
-  <div id="breadcrumbs"></div>
-  <div id="api-navbar"></div>
-</header>
-
+  <header class="fixed-header">
+    <div id="breadcrumbs"></div>
+    <div id="api-navbar"></div>
+  </header>
 
   <div class="with-sidebar content-area">
 
@@ -37,5 +36,4 @@ the License.
     </section>
 
   </div>
-
-
+</div>


[47/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
really fix typo


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

Branch: refs/heads/1.6.x
Commit: ade9dae2311b43b9c742d7a94ce0159416ebba0f
Parents: ffa54d8
Author: Robert Newson <rn...@apache.org>
Authored: Thu Jul 10 09:15:52 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Jul 10 09:15:52 2014 +0100

----------------------------------------------------------------------
 share/doc/src/couchapp/views/intro.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ade9dae2/share/doc/src/couchapp/views/intro.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/couchapp/views/intro.rst b/share/doc/src/couchapp/views/intro.rst
index f7d0738..5d588ed 100644
--- a/share/doc/src/couchapp/views/intro.rst
+++ b/share/doc/src/couchapp/views/intro.rst
@@ -378,7 +378,7 @@ B-trees are structured, we can cache the intermediate reduce results in the
 non-leaf nodes of the tree, so reduce queries can be computed along arbitrary
 key ranges in logarithmic time. See Figure 1, ā€œComments map functionā€.
 
-In the blog app, we use ``group_leve`` reduce queries to compute the count of
+In the blog app, we use ``group_level`` reduce queries to compute the count of
 comments both on a per-post and total basis, achieved by querying the same view
 index with different methods. With some array keys, and assuming each key has
 the value ``1``:


[04/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Send a real EventSource event for heartbeat

The EventSource connection can get stuck (in TCP half-open state*) and there's no way
for the client to detect that. This commit changes the way heartbeat is sent, instead of
sending a newline character, it sends an empty event of type heartbeat:

    event: heartbeat
    data:

This event doesn't have an id: field, so the client will retain its latest Last-Event-ID state.

This doesn't change the expectations of clients that used EventSource till now, because they
subscribe to the 'message' event type. To get the 'heartbeat' events a client will need to
explicitly subscribe to it:

    source.addEventListener('heartbeat', function () { /* cancel a timer that would otherwise reconnect the source */ });

* this can happen when you suspend your laptop, on flaky internet connection, ADSL reconnect,
bad wifi signals, bad routers etc. Pretty often in a typical internet usage nowadays.


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

Branch: refs/heads/1.6.x
Commit: 95600b70e6cd36e460cc06958f624954419aa9e1
Parents: 7fe8509
Author: Damjan Georgievski <gd...@gmail.com>
Authored: Fri May 2 17:04:41 2014 +0200
Committer: Klaus Trainer <kl...@apache.org>
Committed: Tue May 13 14:53:42 2014 +0200

----------------------------------------------------------------------
 share/doc/src/api/database/changes.rst | 10 ++++++++++
 share/www/script/test/changes.js       | 21 ++++++++++++++++++++-
 src/couchdb/couch_httpd_db.erl         |  2 ++
 3 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/95600b70/share/doc/src/api/database/changes.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/database/changes.rst b/share/doc/src/api/database/changes.rst
index fc46412..6e48f9b 100644
--- a/share/doc/src/api/database/changes.rst
+++ b/share/doc/src/api/database/changes.rst
@@ -398,6 +398,16 @@ parameter.
 
     }
 
+If you set a heartbeat interval (using the ``heartbeat`` query argument), CouchDB will
+send a ``hearbeat`` event that you can subscribe to with:
+
+.. code-block:: javascript
+
+    source.addEventListener('heartbeat', function () {}, false);
+
+This can be monitored by the client application to restart the EventSource connection if
+needed (i.e. if the TCP connection gets stuck in a half-open state).
+
 .. note::
 
    EventSource connections are subject to cross-origin resource sharing

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95600b70/share/www/script/test/changes.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index 0fba9f9..b034a0b 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -123,7 +123,7 @@ couchTests.changes = function(debug) {
 
     xhr = CouchDB.newXhr();
 
-    //verify the hearbeat newlines are sent
+    //verify the heartbeat newlines are sent
     xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&heartbeat=10&timeout=500"), true);
     xhr.send("");
 
@@ -171,6 +171,25 @@ couchTests.changes = function(debug) {
       T(results[1].changes[0].rev == docBar._rev);
     }
 
+    // test that we receive EventSource heartbeat events
+    if (!!window.EventSource) {
+      var source = new EventSource(
+              "/test_suite_db/_changes?feed=eventsource&heartbeat=10");
+
+      var count_heartbeats = 0;
+      source.addEventListener('heartbeat', function () { count_heartbeats = count_heartbeats + 1; } , false);
+
+      waitForSuccess(function() {
+        if (count_heartbeats < 3) {
+          throw "keep waiting";
+        }
+        return true;
+      }, "eventsource-heartbeat");
+
+      T(count_heartbeats >= 3);
+      source.close();
+    }
+
     // test longpolling
     xhr = CouchDB.newXhr();
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95600b70/src/couchdb/couch_httpd_db.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 6940e47..c52094e 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -105,6 +105,8 @@ handle_changes_req2(Req, Db) ->
                 io_lib:format("\n],\n\"last_seq\":~w}\n", [EndSeq])
             ),
             end_json_response(Resp);
+        (timeout, "eventsource") ->
+            send_chunk(Resp, "event: heartbeat\ndata: \n\n");
         (timeout, _) ->
             send_chunk(Resp, "\n")
         end


[11/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Hide preview functionality until we improve it


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

Branch: refs/heads/1.6.x
Commit: d8bd7ee0d22c403c314d18021e8bd2da8fdf2015
Parents: 4a614b3
Author: Garren Smith <ga...@gmail.com>
Authored: Fri May 16 12:10:36 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Fri May 16 12:10:36 2014 +0200

----------------------------------------------------------------------
 .../app/addons/documents/templates/view_editor.html |  1 -
 src/fauxton/app/addons/documents/views.js           | 16 +++-------------
 2 files changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8bd7ee0/src/fauxton/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/view_editor.html b/src/fauxton/app/addons/documents/templates/view_editor.html
index 7ba6e23..1a10ff5 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -74,7 +74,6 @@ the License.
 
           <div class="control-group">
             <button class="btn btn-success save"><i class="icon fonticon-circle-check"></i> Save &amp; Build Index</button>
-            <button class="btn btn-info preview">Preview</button>
             <% if (!newView) { %>
             <button class="btn btn-danger delete"><i class="icon fonticon-circle-x"></i> Delete</button>
             <% } %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8bd7ee0/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 8d10bd0..c58241c 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1048,11 +1048,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         this.hasReduce = options.hasReduce;
       }
 
-      if (typeof(options.showPreview) === 'undefined') {
+      /*if (typeof(options.showPreview) === 'undefined') {
         this.showPreview = true;
       } else {
         this.showPreview = options.showPreview;
-      }
+      }*/
     },
 
     events: {
@@ -1188,7 +1188,6 @@ 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();
@@ -1196,13 +1195,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       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);
@@ -1283,12 +1275,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       }, this);
     },
 
-
-
     serialize: function () {
       return {
         hasReduce: this.hasReduce,
-        showPreview: this.showPreview
+        showPreview: false
       };
     }
   });


[21/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Inject database into view

it's handled in the options and used, but was never passed


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

Branch: refs/heads/1.6.x
Commit: f5a25eaa416f263ddefbba40318293dc819fd6c8
Parents: 705711e
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 2 21:33:46 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat May 31 19:56:04 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f5a25eaa/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 8f163a7..a24a3bd 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -221,6 +221,7 @@ function(app, FauxtonAPI, Documents, Databases) {
       }));
 
       this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
+        database: this.data.database,
         collection: this.data.database.allDocs,
         docParams: docParams,
         params: urlParams


[09/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: refactor ActiveTasks

- do not use a model as a collection, directly operate on the
  collection which gets filtered for the view
- remove the view which acted as layer to fetch collections from
  the model and passed it to a view
- remove not used html-template
- format code


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

Branch: refs/heads/1.6.x
Commit: cd8286ec6efde1ba98e98d1c9e1a8a5720e6242f
Parents: 7b80bc2
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 6 23:15:16 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu May 15 21:17:09 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |   1 -
 src/fauxton/app/addons/activetasks/resources.js |  96 ++-------
 src/fauxton/app/addons/activetasks/routes.js    |  24 +--
 .../addons/activetasks/templates/detail.html    |  21 --
 .../app/addons/activetasks/templates/table.html |   2 +-
 .../app/addons/activetasks/tests/viewsSpec.js   |  54 +++--
 src/fauxton/app/addons/activetasks/views.js     | 195 ++++++++++---------
 7 files changed, 154 insertions(+), 239 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 1e3515d..240b4e0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -43,7 +43,6 @@ FAUXTON_FILES = \
     fauxton/app/addons/activetasks/base.js \
     fauxton/app/addons/activetasks/resources.js \
     fauxton/app/addons/activetasks/routes.js \
-    fauxton/app/addons/activetasks/templates/detail.html \
     fauxton/app/addons/activetasks/templates/table.html \
     fauxton/app/addons/activetasks/templates/tabledetail.html \
     fauxton/app/addons/activetasks/templates/tabs.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/resources.js b/src/fauxton/app/addons/activetasks/resources.js
index 3c5a513..3d1798f 100644
--- a/src/fauxton/app/addons/activetasks/resources.js
+++ b/src/fauxton/app/addons/activetasks/resources.js
@@ -22,93 +22,23 @@ function (app, backbone, Fauxton) {
       apiv = app.versionAPI;
       app.taskSortBy = 'type';
 
-  Active.Task = Backbone.Model.extend({
-    initialize: function() {
-      this.set({"id": this.get('pid')});
-    }
-  });
 
-// ALL THE TASKS
-  Active.Tasks = Backbone.Model.extend({
-    alltypes: {
-      "all": "All tasks",
-      "replication": "Replication",
-      "database_compaction":" Database Compaction",
-      "indexer": "Indexer",
-      "view_compaction": "View Compaction"
-    },
-    documentation: "_active_tasks",
-    url: function (context) {
-      if (context === "apiurl"){
-        return window.location.origin + '/_active_tasks';
-      } else {
-        return app.host + '/_active_tasks';
-      }
-    },
-    fetch: function (options) {
-     var fetchoptions = options || {};
-     fetchoptions.cache = false;
-     return Backbone.Model.prototype.fetch.call(this, fetchoptions);
-    },
-    parse: function(resp){
-      var types = this.getUniqueTypes(resp),
-          that = this;
-
-      var typeCollections = _.reduce(types, function (collection, val, key) {
-          collection[key] = new Active.AllTasks(that.sortThis(resp, key));
-          return collection;
-        }, {});
-
-      typeCollections.all = new Active.AllTasks(resp);
-
-      this.set(typeCollections);  //now set them all to the model
-    },
-    getUniqueTypes: function(resp){
-      var types = this.alltypes;
-
-      _.each(resp, function(type){
-        if( typeof(types[type.type]) === "undefined"){
-          types[type.type] = type.type.replace(/_/g,' ');
-        }
-      },this);
+  Active.events = {};
+  _.extend(Active.events, Backbone.Events);
 
-      this.alltypes = types;
-      return types;
-    },
-    sortThis: function(resp, type){
-      return _.filter(resp, function(item) { return item.type === type; });
-    },
-    changeView: function (view){
-      this.set({
-        "currentView": view
-      });
-    },
-    getCurrentViewData: function(){
-      var currentView = this.get('currentView');
-      return this.get(currentView);
-    },
-    getDatabaseCompactions: function(){
-      return this.get('databaseCompactions');
-    },
-    getIndexes: function(){
-      return this.get('indexes');
-    },
-    getViewCompactions: function(){
-      return this.get('viewCompactions');
-    }
+  Active.Task = Backbone.Model.extend({
+    idAttribute: "pid"
   });
 
-//ALL TASKS
-
-//NEW IDEA. Lets make this extremely generic, so if there are new weird tasks, they get sorted and collected.
-
   Active.AllTasks = Backbone.Collection.extend({
     model: Active.Task,
-    sortByColumn: function(colName) {
+
+    sortByColumn: function (colName) {
       app.taskSortBy = colName;
       this.sort();
     },
-    comparator: function(item) {
+
+    comparator: function (item) {
       var value = app.taskSortBy,
           values;
 
@@ -122,6 +52,16 @@ function (app, backbone, Fauxton) {
       }
 
       return item.get(value);
+    },
+
+    documentation: "_active_tasks",
+
+    url: function (context) {
+      if (context === "apiurl") {
+        return window.location.origin + "/_active_tasks";
+      } else {
+        return app.host + "/_active_tasks";
+      }
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/routes.js b/src/fauxton/app/addons/activetasks/routes.js
index dcb2efe..cdc5a01 100644
--- a/src/fauxton/app/addons/activetasks/routes.js
+++ b/src/fauxton/app/addons/activetasks/routes.js
@@ -19,7 +19,7 @@ define([
 
 function (app, FauxtonAPI, Activetasks, Views) {
 
-  var  ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({
+  var ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "with_sidebar",
 
     routes: {
@@ -34,26 +34,22 @@ function (app, FauxtonAPI, Activetasks, Views) {
     ],
 
     apiUrl: function () {
-      return [this.newtasks.url("apiurl"), this.newtasks.documentation];
+      return [this.allTasks.url("apiurl"), this.allTasks.documentation];
     },
 
     roles: ["_admin"],
 
-    defaultView: function (id) {
-     this.newtasks = new Activetasks.Tasks({
-        currentView: "all",
-        id:'activeTasks'
-      });
-
-      this.setView("#sidebar-content", new Views.TabMenu({
-        currentView: "all",
-        model: this.newtasks
-      }));
+    initialize: function () {
+      this.allTasks = new Activetasks.AllTasks();
+    },
 
-      this.setView("#dashboard-content", new Views.DataSection({
-        model: this.newtasks,
+    defaultView: function () {
+      this.setView("#dashboard-content", new Views.View({
+        collection: this.allTasks,
         currentView: "all"
       }));
+
+      this.setView("#sidebar-content", new Views.TabMenu({}));
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/templates/detail.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/templates/detail.html b/src/fauxton/app/addons/activetasks/templates/detail.html
deleted file mode 100644
index 5e53129..0000000
--- a/src/fauxton/app/addons/activetasks/templates/detail.html
+++ /dev/null
@@ -1,21 +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.
--->
-
-<div class="progress progress-striped active">
-  <div class="bar" style="width: <%=model.get("progress")%>%;"><%=model.get("progress")%>%</div>
-</div>
-<p>
-	<%= model.get("type").replace('_',' ')%> on
-	<%= model.get("node")%>
-</p>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/templates/table.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/templates/table.html b/src/fauxton/app/addons/activetasks/templates/table.html
index 84dbccd..a8cbd52 100644
--- a/src/fauxton/app/addons/activetasks/templates/table.html
+++ b/src/fauxton/app/addons/activetasks/templates/table.html
@@ -45,7 +45,7 @@ the License.
     </tr>
   </thead>
 
-  <tbody id="tasks_go_here">
+  <tbody class="js-tasks-go-here">
 
   </tbody>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
index 5da2c3f..19c5b65 100644
--- a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
+++ b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
@@ -10,11 +10,11 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 define([
-       'api',
-       'addons/activetasks/views',
-       'addons/activetasks/resources',
-      'testUtils'
-], function (FauxtonAPI, Views, Models, testUtils) {
+        'api',
+        'addons/activetasks/views',
+        'addons/activetasks/resources',
+        'testUtils'
+], function (FauxtonAPI, Views, Activetasks, testUtils) {
   var assert = testUtils.assert,
       ViewSandbox = testUtils.ViewSandbox;
 
@@ -22,15 +22,7 @@ define([
     var tabMenu;
 
     beforeEach(function () {
-      var newtasks = new Models.Tasks({
-        currentView: "all",
-        id:'activeTasks'
-      });
-
-      tabMenu = new Views.TabMenu({
-        currentView: "all",
-        model: newtasks
-      });
+      tabMenu = new Views.TabMenu({});
     });
 
     describe("on change polling rate", function () {
@@ -73,50 +65,48 @@ define([
     });
 
     describe('on request by type', function () {
-      var viewSandbox;
+      var viewSandbox, mainView;
       beforeEach(function () {
+
+        mainView = new Views.View({
+          collection: new Activetasks.AllTasks(),
+          currentView: "all"
+        });
+
         viewSandbox = new ViewSandbox();
         viewSandbox.renderView(tabMenu);
+        viewSandbox.renderView(mainView);
       });
 
       afterEach(function () {
         viewSandbox.remove();
       });
 
-      it("should change model view", function () {
-        var spy = sinon.spy(tabMenu.model, 'changeView');
+      it("should set the filter the main-view", function () {
         var $rep = tabMenu.$('li[data-type="replication"]');
         $rep.click();
-        assert.ok(spy.calledOnce);
+        assert.equal("replication", mainView.filter);
       });
 
       it("should set correct active tab", function () {
-        var spy = sinon.spy(tabMenu.model, 'changeView');
         var $rep = tabMenu.$('li[data-type="replication"]');
         $rep.click();
         assert.ok($rep.hasClass('active'));
       });
-
     });
 
   });
 
   describe('DataSection', function () {
-    var viewSandbox, dataSection;
+    var viewSandbox, mainView;
     beforeEach(function () {
-      var newtasks = new Models.Tasks({
-        currentView: "all",
-        id:'activeTasks'
-      });
-      newtasks.parse([]);
-
-      dataSection = new Views.DataSection({
-        currentView: "all",
-        model: newtasks
+      mainView = new Views.View({
+        collection: new Activetasks.AllTasks(),
+        currentView: "all"
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(dataSection);
+      viewSandbox.renderView(mainView);
     });
 
     afterEach(function () {
@@ -127,7 +117,7 @@ define([
 
       it('Should set polling interval', function () {
         var spy = sinon.spy(window, 'setInterval');
-        dataSection.setPolling();
+        mainView.setPolling();
         assert.ok(spy.calledOnce);
       });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd8286ec/src/fauxton/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/views.js b/src/fauxton/app/addons/activetasks/views.js
index 22918a6..83ef861 100644
--- a/src/fauxton/app/addons/activetasks/views.js
+++ b/src/fauxton/app/addons/activetasks/views.js
@@ -11,16 +11,16 @@
 // the License.
 
 define([
-       "app",
-       "api",
-       "addons/activetasks/resources"
+        "app",
+        "api",
+        "addons/activetasks/resources"
 ],
 
-function (app, FauxtonAPI, activetasks) {
+function (app, FauxtonAPI, ActiveTasks) {
 
   var Views = {},
       Events = {},
-      pollingInfo ={
+      pollingInfo = {
         rate: "5",
         intervalId: null
       };
@@ -28,23 +28,110 @@ function (app, FauxtonAPI, activetasks) {
 
   Views.Events = _.extend(Events, Backbone.Events);
 
+  Views.View = FauxtonAPI.View.extend({
+    tagName: "table",
+
+    className: "table table-bordered table-striped active-tasks",
+
+    template: "addons/activetasks/templates/table",
+
+    events: {
+      "click th": "sortByType"
+    },
+
+    filter: "all",
+
+    initialize: function (options) {
+      this.listenTo(ActiveTasks.events, "tasks:filter", this.filterAndRender);
+      this.listenTo(this.collection, "reset", this.render);
+    },
+
+    beforeRender: function () {
+      this.filterAndInsertView(this.filter);
+    },
+
+    filterAndRender: function (view) {
+      this.filter = view;
+      this.render();
+    },
+
+    filterAndInsertView: function () {
+      var that = this;
+      this.removeView(".js-tasks-go-here");
+
+      this.collection.forEach(function (item) {
+        if (that.filter !== "all" && item.get("type") !== that.filter) {
+          return;
+        }
+        var view = new Views.TableDetail({
+          model: item
+        });
+        this.insertView(".js-tasks-go-here", view);
+      }, this);
+    },
+
+    afterRender: function () {
+      Events.bind("update:poll", this.setPolling, this);
+      this.setPolling();
+    },
+
+    establish: function () {
+      return [this.collection.fetch()];
+    },
+
+    serialize: function () {
+      return {
+        currentView: this.currentView,
+        collection: this.collection
+      };
+    },
+
+    sortByType: function (e) {
+      var currentTarget = e.currentTarget,
+          datatype = this.$(currentTarget).attr("data-type");
+
+      this.collection.sortByColumn(datatype);
+      this.render();
+    },
+
+    setPolling: function () {
+      var collection = this.collection;
+
+      clearInterval(pollingInfo.intervalId);
+      pollingInfo.intervalId = setInterval(function () {
+        collection.fetch({reset: true});
+      }, pollingInfo.rate * 1000);
+    },
+
+    cleanup: function () {
+      clearInterval(pollingInfo.intervalId);
+    }
+  });
+
   Views.TabMenu = FauxtonAPI.View.extend({
     template: "addons/activetasks/templates/tabs",
+
     events: {
       "click .task-tabs li": "requestByType",
       "change #pollingRange": "changePollInterval"
     },
-    establish: function(){
-      return [this.model.fetch({reset: true})];
-    },
-    serialize: function(){
+
+    serialize: function () {
       return {
-        filters: this.model.alltypes
+        filters: {
+          "all": "All tasks",
+          "replication": "Replication",
+          "database_compaction":" Database Compaction",
+          "indexer": "Indexer",
+          "view_compaction": "View Compaction"
+        }
       };
     },
+
     afterRender: function(){
       this.$('.task-tabs').find('li').eq(0).addClass('active');
     },
+
     changePollInterval: function(e){
       var range = this.$(e.currentTarget).val();
       this.$('label[for="pollingRange"] span').text(range);
@@ -63,96 +150,20 @@ function (app, FauxtonAPI, activetasks) {
 
       this.$('.task-tabs').find('li').removeClass('active');
       this.$(currentTarget).addClass('active');
-      this.model.changeView(datatype);
-    }
-  });
 
-  Views.DataSection = FauxtonAPI.View.extend({
-    showData: function(){
-      var currentData = this.model.getCurrentViewData();
-
-      if (this.dataView) {
-       this.dataView.update(currentData, this.model.get('currentView').replace('_',' '));
-      } else {
-        this.dataView = this.insertView( new Views.TableData({
-          collection: currentData,
-          currentView: this.model.get('currentView').replace('_',' ')
-        }));
-      }
-    },
-    showDataAndRender: function () {
-      this.showData();
-      this.dataView.render();
-    },
-
-    beforeRender: function () {
-      this.showData();
-    },
-    establish: function(){
-      return [this.model.fetch()];
-    },
-    setPolling: function(){
-      var that = this;
-      clearInterval(pollingInfo.intervalId);
-      pollingInfo.intervalId = setInterval(function() {
-        that.establish();
-      }, pollingInfo.rate*1000);
-    },
-    cleanup: function(){
-      clearInterval(pollingInfo.intervalId);
-    },
-    afterRender: function(){
-      this.listenTo(this.model, "change", this.showDataAndRender);
-      Events.bind('update:poll', this.setPolling, this);
-      this.setPolling();
-    }
-  });
-
-  Views.TableData = FauxtonAPI.View.extend({
-    tagName: "table",
-    className: "table table-bordered table-striped active-tasks",
-    template: "addons/activetasks/templates/table",
-    events: {
-      "click th": "sortByType"
-    },
-    initialize: function(){
-      this.currentView = this.options.currentView;
-    },
-    sortByType:  function(e){
-      var currentTarget = e.currentTarget,
-          datatype = $(currentTarget).attr("data-type");
-
-      this.collection.sortByColumn(datatype);
-      this.render();
-    },
-    serialize: function(){
-      return {
-        currentView: this.currentView,
-        collection: this.collection
-      };
-    },
-
-    update: function (collection, currentView) {
-      this.collection = collection;
-      this.currentView = currentView;
-    },
-
-    beforeRender: function(){
-      //iterate over the collection to add each
-      this.collection.forEach(function(item) {
-        this.insertView("#tasks_go_here", new Views.TableDetail({
-          model: item
-        }));
-      }, this);
+      ActiveTasks.events.trigger("tasks:filter", datatype);
     }
   });
 
   Views.TableDetail = FauxtonAPI.View.extend({
     tagName: 'tr',
+
     template: "addons/activetasks/templates/tabledetail",
+
     initialize: function(){
       this.type = this.model.get('type');
     },
+
     getObject: function(){
       var objectField = this.model.get('database');
       if (this.type === "replication"){
@@ -160,6 +171,7 @@ function (app, FauxtonAPI, activetasks) {
       }
       return objectField;
     },
+
     getProgress:  function(){
       var progress = "";
       if (this.type === "indexer"){
@@ -182,6 +194,7 @@ function (app, FauxtonAPI, activetasks) {
 
       return progress;
     },
+
     serialize: function(){
       return {
         model: this.model,
@@ -191,7 +204,5 @@ function (app, FauxtonAPI, activetasks) {
     }
   });
 
-
-
   return Views;
 });


[48/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Merge branch 'refs/heads/merge/master@ade9dae' into 1.6.x

* refs/heads/merge/master: (97 commits)
  really fix typo
  Documentation formatting typo
  local.ini must be comments only
  hash admin passwords on startup when list
  Fauxton: fix build
  Fauxton: Upgrade node-http-proxy
  Fauxton: Remove settings.json.dev
  Fauxton: Add view filter
  Fix missing stale query option
  Docs: fix typo in Accept header value
  Fauxton: updated dev dependancies
  add ZeroClipboard to LICENSE file
  Fauxton: Fix clone cancel button
  Fauxton: Create fx roles
  fix attachment view to bypass
  add sinon.js
  Fauxton: Content Security Policy optional for dev
  Fauxton: Fix font awesome url to work for release
  Tentatively update version on master
  Fauxton: Fix show me api link
  ...

Conflicts:
	configure.ac
	src/fauxton/app/addons/auth/templates/nav_link_title.html
	src/fauxton/app/addons/documents/templates/code_editor.html
	src/fauxton/app/addons/documents/templates/design_doc_selector.html
	src/fauxton/app/addons/fauxton/templates/api_bar.html
	src/fauxton/app/addons/fauxton/templates/footer.html
	src/fauxton/app/addons/fauxton/templates/notification.html
	src/fauxton/app/addons/permissions/templates/section.html
	src/fauxton/app/addons/replication/templates/form.html


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

Branch: refs/heads/1.6.x
Commit: 43ccf52e151079579cc7d348c5e75b432a45dac8
Parents: d1bc0a9 ade9dae
Author: Dave Cottlehuber <dc...@apache.org>
Authored: Thu Aug 14 00:51:59 2014 +0200
Committer: Dave Cottlehuber <dc...@apache.org>
Committed: Thu Aug 14 00:51:59 2014 +0200

----------------------------------------------------------------------
 .gitignore                                      |   1 -
 LICENSE                                         |  43 ++
 configure.ac                                    |   2 +-
 etc/couchdb/default.ini.tpl.in                  |   4 +
 etc/couchdb/local.ini                           |  15 +-
 license.skip                                    |   2 +
 share/doc/build/Makefile.am                     |   2 +
 share/doc/src/api/database/changes.rst          |  10 +
 share/doc/src/api/ddoc/render.rst               |   2 -
 share/doc/src/config/http.rst                   |  35 ++
 share/doc/src/config/misc.rst                   |  24 +
 share/doc/src/couchapp/views/intro.rst          |   2 +-
 share/doc/src/experimental.rst                  |  15 +
 share/doc/src/intro/api.rst                     |   2 +-
 share/doc/src/intro/consistency.rst             |   2 +-
 share/doc/src/intro/security.rst                |  78 ++++
 share/doc/src/replication/intro.rst             |  20 +-
 share/doc/src/replication/replicator.rst        |  46 +-
 share/doc/src/whatsnew/1.6.rst                  |  20 +-
 share/www/script/test/changes.js                |  21 +-
 src/Makefile.am                                 |  21 +-
 src/couchdb/couch_httpd.erl                     |  15 +-
 src/couchdb/couch_httpd_auth.erl                |   2 +-
 src/couchdb/couch_httpd_db.erl                  |   2 +
 src/couchdb/couch_httpd_misc_handlers.erl       |  16 +-
 src/couchdb/couch_passwords.erl                 |   4 +-
 src/fauxton/Gruntfile.js                        |  45 +-
 src/fauxton/TODO.md                             |  26 --
 src/fauxton/app/addons/activetasks/base.js      |   2 +-
 src/fauxton/app/addons/activetasks/resources.js | 112 ++---
 src/fauxton/app/addons/activetasks/routes.js    |  37 +-
 .../addons/activetasks/templates/detail.html    |  21 -
 .../app/addons/activetasks/templates/table.html |   6 +-
 .../app/addons/activetasks/tests/viewsSpec.js   |  68 ++-
 src/fauxton/app/addons/activetasks/views.js     | 197 ++++----
 src/fauxton/app/addons/auth/resources.js        |   6 +-
 src/fauxton/app/addons/auth/routes.js           |   2 +-
 .../addons/auth/templates/nav_link_title.html   |  12 +-
 src/fauxton/app/addons/compaction/views.js      |   7 +-
 src/fauxton/app/addons/config/resources.js      |   4 +-
 src/fauxton/app/addons/databases/resources.js   |  18 -
 .../app/addons/databases/templates/item.html    |   2 +-
 .../app/addons/databases/templates/sidebar.html |  31 --
 src/fauxton/app/addons/databases/views.js       |  71 +--
 .../addons/documents/assets/less/documents.less |  27 +-
 src/fauxton/app/addons/documents/resources.js   | 131 +++++-
 src/fauxton/app/addons/documents/routes.js      |  57 +--
 .../documents/templates/advanced_options.html   | 189 ++++----
 .../documents/templates/all_docs_item.html      |   4 +-
 .../documents/templates/all_docs_list.html      |   6 +-
 .../addons/documents/templates/code_editor.html |  55 +++
 .../templates/design_doc_selector.html          |   4 +-
 .../app/addons/documents/templates/doc.html     |  55 ---
 .../documents/templates/doc_field_editor.html   |  74 ---
 .../templates/doc_field_editor_tabs.html        |  19 -
 .../templates/duplicate_doc_modal.html          |   2 +-
 .../addons/documents/templates/view_editor.html |  15 +-
 .../app/addons/documents/tests/resourcesSpec.js | 176 +++++++-
 .../app/addons/documents/tests/viewsSpec.js     |  23 +
 src/fauxton/app/addons/documents/views.js       | 448 ++++++++++---------
 src/fauxton/app/addons/fauxton/base.js          |  53 ++-
 src/fauxton/app/addons/fauxton/components.js    |  63 +++
 src/fauxton/app/addons/fauxton/resizeColumns.js |   3 +
 .../app/addons/fauxton/templates/api_bar.html   |   6 +-
 .../app/addons/fauxton/templates/filter.html    |  22 +
 .../addons/fauxton/templates/filter_item.html   |  16 +
 .../app/addons/fauxton/templates/footer.html    |   2 +-
 .../app/addons/fauxton/templates/nav_bar.html   |  31 +-
 .../addons/fauxton/templates/notification.html  |   2 +-
 .../app/addons/fauxton/tests/baseSpec.js        |  39 +-
 .../app/addons/fauxton/tests/filterViewSpec.js  |  87 ++++
 .../app/addons/logs/assets/less/logs.less       |  24 -
 src/fauxton/app/addons/logs/base.js             |  28 --
 src/fauxton/app/addons/logs/resources.js        | 224 ----------
 src/fauxton/app/addons/logs/routes.js           |  58 ---
 .../app/addons/logs/templates/dashboard.html    |  46 --
 .../app/addons/logs/templates/filterItem.html   |  16 -
 .../app/addons/logs/templates/sidebar.html      |  27 --
 src/fauxton/app/addons/logs/tests/baseSpec.js   |  38 --
 .../app/addons/logs/tests/resourcesSpec.js      |  38 --
 .../app/addons/permissions/templates/item.html  |   2 +-
 .../addons/permissions/templates/section.html   |  16 +-
 .../app/addons/permissions/tests/viewsSpec.js   |  10 +-
 src/fauxton/app/addons/pouchdb/base.js          |   2 +-
 src/fauxton/app/addons/pouchdb/pouch.collate.js |   2 +-
 .../app/addons/pouchdb/pouchdb.mapreduce.js     |  14 +-
 .../app/addons/replication/templates/form.html  |   4 +-
 src/fauxton/app/addons/stats/routes.js          |  11 +-
 src/fauxton/app/addons/stats/views.js           |   7 +-
 .../app/templates/layouts/with_sidebar.html     |  10 +-
 .../app/templates/layouts/with_tabs.html        |  11 +-
 .../templates/layouts/with_tabs_sidebar.html    |  12 +-
 .../less/bootstrap/font-awesome/variables.less  |   4 +-
 src/fauxton/assets/less/fauxton.less            | 216 +++++----
 src/fauxton/assets/less/variables.less          |   2 +-
 src/fauxton/package.json                        |   6 +-
 src/fauxton/readme.md                           |  38 +-
 src/fauxton/settings.json.default               |   1 -
 src/fauxton/settings.json.dev                   |  62 ---
 src/fauxton/tasks/couchserver.js                |  28 +-
 test/etap/232-csp.t                             |  85 ++++
 101 files changed, 1925 insertions(+), 1799 deletions(-)
----------------------------------------------------------------------



[29/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Tentatively update version on master


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

Branch: refs/heads/1.6.x
Commit: 8194ddb0a0af2e885f8fee0f00c7228a8a39e3b9
Parents: 061295a
Author: Dirkjan Ochtman <di...@ochtman.nl>
Authored: Tue Jun 10 19:38:12 2014 +0200
Committer: Dirkjan Ochtman <di...@ochtman.nl>
Committed: Tue Jun 10 19:38:12 2014 +0200

----------------------------------------------------------------------
 acinclude.m4.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8194ddb0/acinclude.m4.in
----------------------------------------------------------------------
diff --git a/acinclude.m4.in b/acinclude.m4.in
index db2f149..647820f 100644
--- a/acinclude.m4.in
+++ b/acinclude.m4.in
@@ -17,7 +17,7 @@ m4_define([LOCAL_PACKAGE_TARNAME], [apache-couchdb])
 m4_define([LOCAL_PACKAGE_NAME], [Apache CouchDB])
 m4_define([LOCAL_BUG_URI], [https://issues.apache.org/jira/browse/COUCHDB])
 m4_define([LOCAL_VERSION_MAJOR], [1])
-m4_define([LOCAL_VERSION_MINOR], [6])
+m4_define([LOCAL_VERSION_MINOR], [7])
 m4_define([LOCAL_VERSION_REVISION], [0])
 m4_define([LOCAL_VERSION_STAGE], [+build])
 m4_define([LOCAL_VERSION_RELEASE], [.%revision%])


[45/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
local.ini must be comments only


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

Branch: refs/heads/1.6.x
Commit: c9397ec0a01667f49bb22c97fb21f52c437cf9e5
Parents: d43f69d
Author: Robert Newson <rn...@apache.org>
Authored: Sun Jul 6 14:29:25 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Jul 6 14:35:16 2014 +0100

----------------------------------------------------------------------
 etc/couchdb/local.ini | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c9397ec0/etc/couchdb/local.ini
----------------------------------------------------------------------
diff --git a/etc/couchdb/local.ini b/etc/couchdb/local.ini
index fef2508..b0378ea 100644
--- a/etc/couchdb/local.ini
+++ b/etc/couchdb/local.ini
@@ -65,9 +65,9 @@
 ;key_file = /full/path/to/server_key.pem
 ;password = somepassword
 ; set to true to validate peer certificates
-verify_ssl_certificates = false
+;verify_ssl_certificates = false
 ; Set to true to fail if the client does not send a certificate. Only used if verify_ssl_certificates is true.
-fail_if_no_peer_cert = false
+;fail_if_no_peer_cert = false
 ; Path to file containing PEM encoded CA certificates (trusted
 ; certificates used for verifying a peer certificate). May be omitted if
 ; you do not want to verify the peer.
@@ -76,7 +76,7 @@ fail_if_no_peer_cert = false
 ; verification fun will be used.
 ;verify_fun = {Module, VerifyFun}
 ; maximum peer certificate depth
-ssl_certificate_max_depth = 1
+;ssl_certificate_max_depth = 1
 ;
 ; Reject renegotiations that do not live up to RFC 5746.
 ;secure_renegotiate = true


[34/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Create fx roles

Fauxton auth works by checking what roles a user has and then decide if
they have access to a specific route. The only problem is a regular user
might get created but not have any roles. Unlike an admin user who get
assigned all the roles on creation.

The idea behind this is that certain routes should require a user to be
logged in but not necessary have any roles eg. #changePassword route.

This allows for a standard fauxton role that all logged in users get given so that
we can check via the roles if they are logged


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

Branch: refs/heads/1.6.x
Commit: 18f7d7de741638fdd28e903f938a91c23c37680e
Parents: 4fbeff9
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Jun 18 15:55:03 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Jun 23 09:52:06 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/auth/resources.js | 4 ++++
 src/fauxton/app/addons/auth/routes.js    | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/18f7d7de/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index 6e191b1..ca9a33f 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -101,6 +101,10 @@ function (app, FauxtonAPI, CouchdbSession) {
       var user = this.user();
 
       if (user && user.roles) {
+        if (user.roles.indexOf('fx_loggedIn') === -1) {
+          user.roles.push('fx_loggedIn');
+        }
+
         return user.roles;
       }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/18f7d7de/src/fauxton/app/addons/auth/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/routes.js b/src/fauxton/app/addons/auth/routes.js
index 74395e8..ede498a 100644
--- a/src/fauxton/app/addons/auth/routes.js
+++ b/src/fauxton/app/addons/auth/routes.js
@@ -71,7 +71,7 @@ function(app, FauxtonAPI, Auth) {
     routes: {
       'changePassword': {
         route: 'changePassword',
-        roles: ['_admin', '_reader', '_replicator']
+        roles: ['fx_loggedIn']
       },
       'addAdmin': {
         roles: ['_admin'],


[06/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Support `fail_if_no_peer_cert` ssl option


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

Branch: refs/heads/1.6.x
Commit: 7f9f66e8be6ce00ee87d2ed23f8ae0ce453b0f12
Parents: ad8e28c
Author: Klaus Trainer <kl...@apache.org>
Authored: Mon May 12 01:43:05 2014 +0200
Committer: Klaus Trainer <kl...@apache.org>
Committed: Wed May 14 16:32:59 2014 +0200

----------------------------------------------------------------------
 etc/couchdb/local.ini         |  2 ++
 share/doc/src/config/http.rst | 11 +++++++++++
 src/couchdb/couch_httpd.erl   |  5 +++++
 3 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7f9f66e8/etc/couchdb/local.ini
----------------------------------------------------------------------
diff --git a/etc/couchdb/local.ini b/etc/couchdb/local.ini
index b102881..fef2508 100644
--- a/etc/couchdb/local.ini
+++ b/etc/couchdb/local.ini
@@ -66,6 +66,8 @@
 ;password = somepassword
 ; set to true to validate peer certificates
 verify_ssl_certificates = false
+; Set to true to fail if the client does not send a certificate. Only used if verify_ssl_certificates is true.
+fail_if_no_peer_cert = false
 ; Path to file containing PEM encoded CA certificates (trusted
 ; certificates used for verifying a peer certificate). May be omitted if
 ; you do not want to verify the peer.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7f9f66e8/share/doc/src/config/http.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/http.rst b/share/doc/src/config/http.rst
index dfe8d5a..f4fade1 100644
--- a/share/doc/src/config/http.rst
+++ b/share/doc/src/config/http.rst
@@ -387,6 +387,17 @@ Secure Socket Level Options
       [ssl]
       verify_ssl_certificates = false
 
+  .. config:option:: fail_if_no_peer_cert :: Require presence of client certificate if certificate verification is enabled
+
+    Set to `true` to terminate the TLS/SSL handshake with a
+    `handshake_failure` alert message if the client does not send a
+    certificate. Only used if `verify_ssl_certificates` is `true`. If
+    set to `false` it will only fail if the client sends an invalid
+    certificate (an empty certificate is considered valid)::
+
+      [ssl]
+      fail_if_no_peer_cert = false
+
   .. config:option:: secure_renegotiate :: Enable secure renegotiation
 
     Set to `true` to reject renegotiation attempt that does not live up to RFC 5746::

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7f9f66e8/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index cc5c3d3..7896252 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -66,8 +66,13 @@ start_link(https) ->
         "false" ->
             [];
         "true" ->
+            FailIfNoPeerCert = case couch_config:get("ssl", "fail_if_no_peer_cert", "false") of
+            "false" -> false;
+            "true" -> true
+            end,
             [{depth, list_to_integer(couch_config:get("ssl",
                 "ssl_certificate_max_depth", "1"))},
+             {fail_if_no_peer_cert, FailIfNoPeerCert},
              {verify, verify_peer}] ++
             case couch_config:get("ssl", "verify_fun", nil) of
                 nil -> [];


[14/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Fix QueryParams

Ensure we clone the parameters to Documents.QueryParams.parse and
Documents.QueryParams.stringify. These functions should return new data
structures rather than modifying the input in-place.

Do not use the parsed query object for url generation. Instead, use the
stringified representation. Fixes COUCHDB-2249.


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

Branch: refs/heads/1.6.x
Commit: 9fb9b4b799daea53e02a4e8ff7dee03d0ec0608c
Parents: f8d535c
Author: Will Holley <wi...@gmail.com>
Authored: Tue May 27 06:50:36 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed May 28 11:33:28 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js   |  9 +-
 src/fauxton/app/addons/documents/routes.js      |  6 +-
 .../app/addons/documents/tests/resourcesSpec.js | 97 +++++++++++++++++++-
 3 files changed, 106 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9fb9b4b7/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 99e79a2..ad61e78 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -21,13 +21,16 @@ function(app, FauxtonAPI, PagingCollection) {
 
   Documents.QueryParams = (function () {
     var _eachParams = function (params, action) {
+      // clone to avoid in-place modification
+      var result = _.clone(params);
+
       _.each(['startkey', 'endkey', 'key'], function (key) {
-        if (_.has(params, key)) {
-          params[key] = action(params[key]);
+        if (_.has(result, key)) {
+          result[key] = action(result[key]);
         }
       });
 
-      return params;
+      return result;
     };
 
     return {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9fb9b4b7/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 5a2a04f..b8b01fb 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -194,10 +194,12 @@ function(app, FauxtonAPI, Documents, Databases) {
     },
 
     createParams: function (options) {
-      var urlParams = Documents.QueryParams.parse(app.getParams(options));
+      var urlParams = app.getParams(options);
+      var params = Documents.QueryParams.parse(urlParams);
+
       return {
         urlParams: urlParams,
-        docParams: _.extend(_.clone(urlParams), {limit: this.getDocPerPageLimit(urlParams, 20)})
+        docParams: _.extend(params, {limit: this.getDocPerPageLimit(params, 20)})
       };
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9fb9b4b7/src/fauxton/app/addons/documents/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/tests/resourcesSpec.js b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
index 62506e6..e120582 100644
--- a/src/fauxton/app/addons/documents/tests/resourcesSpec.js
+++ b/src/fauxton/app/addons/documents/tests/resourcesSpec.js
@@ -10,7 +10,7 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 define([
-       'addons/documents/resources',
+      'addons/documents/resources',
       'testUtils'
 ], function (Models, testUtils) {
   var assert = testUtils.assert;
@@ -53,5 +53,100 @@ define([
 
   });
 
+  describe('QueryParams', function() {
+    describe('parse', function() {
+      it('should not parse arbitrary parameters', function() {
+        var params = {"foo":"[1]]"};
+        var result = Models.QueryParams.parse(params);
+
+        assert.deepEqual(result, params);
+      });
+
+      it('parses startkey, endkey', function() {
+        var params = {
+          "startkey":"[\"a\",\"b\"]",
+          "endkey":"[\"c\",\"d\"]"
+        };
+        var result = Models.QueryParams.parse(params);
+
+        assert.deepEqual(result, {
+          "startkey":["a","b"],
+          "endkey":["c","d"]
+        });
+      });
+
+      it('parses key', function() {
+        var params = {
+          "key":"[1,2]"
+        };
+        var result = Models.QueryParams.parse(params);
+
+        assert.deepEqual(result, {"key":[1,2]});
+      });
+
+      it('does not modify input', function() {
+        var params = {
+          "key":"[\"a\",\"b\"]"
+        };
+        var clone = _.clone(params);
+        var result = Models.QueryParams.parse(params);
+
+        assert.deepEqual(params, clone);
+      });
+    });
+
+    describe('stringify', function() {
+      it('should not stringify arbitrary parameters', function() {
+        var params = {"foo":[1,2,3]};
+        var result = Models.QueryParams.stringify(params);
+
+        assert.deepEqual(result, params);
+      });
+
+      it('stringifies startkey, endkey', function() {
+        var params = {
+          "startkey":["a","b"],
+          "endkey":["c","d"]
+        };
+
+        var result = Models.QueryParams.stringify(params);
+
+        assert.deepEqual(result, {
+          "startkey":"[\"a\",\"b\"]",
+          "endkey":"[\"c\",\"d\"]"
+        });
+      });
+
+      it('stringifies key', function() {
+        var params = {"key":["a","b"]};
+        var result = Models.QueryParams.stringify(params);
+
+        assert.deepEqual(result, { "key":"[\"a\",\"b\"]" });
+      });
+
+      it('does not modify input', function() {
+        var params = {"key":["a","b"]};
+        var clone = _.clone(params);
+        var result = Models.QueryParams.stringify(params);
+
+        assert.deepEqual(params, clone);
+      });
+
+      it('is symmetrical with parse', function() {
+        var params = {
+          "startkey":["a","b"],
+          "endkey":["c","d"],
+          "foo": "[1,2]",
+          "bar": "abc"
+        };
+
+        var clone = _.clone(params);
+        var json = Models.QueryParams.stringify(params);
+        var result = Models.QueryParams.parse(json);
+
+        assert.deepEqual(result, clone);
+      });
+    });
+  });
 });
 


[30/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Fix font awesome url to work for release


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

Branch: refs/heads/1.6.x
Commit: aca4bc797cadddce89c7c90530da30df98c51f51
Parents: 8194ddb
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jun 10 14:51:12 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jun 11 11:21:34 2014 +0200

----------------------------------------------------------------------
 src/fauxton/assets/less/bootstrap/font-awesome/variables.less | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/aca4bc79/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/font-awesome/variables.less b/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
index 5d93614..0715887 100644
--- a/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
+++ b/src/fauxton/assets/less/bootstrap/font-awesome/variables.less
@@ -1,7 +1,7 @@
 // Variables
 // --------------------------
 
-@FontAwesomePath:    "../../img";
+@FontAwesomePath:    "../img";
 //@FontAwesomePath:    "//netdna.bootstrapcdn.com/font-awesome/3.2.1/font"; // for referencing Bootstrap CDN font files directly
 @FontAwesomeVersion: "3.2.1";
 @borderColor:        #eee;


[41/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fauxton: Remove settings.json.dev

We don't use this file and its causing confusion with new contributors.
The grunt task look for a `settings.json`, if it doesn't find that it
defaults to settings.json.default


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

Branch: refs/heads/1.6.x
Commit: af593514cd835120db044d1d99ee40c32a0a11b9
Parents: 88e1bca
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Jul 2 10:08:37 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jul 2 10:08:37 2014 +0200

----------------------------------------------------------------------
 src/fauxton/settings.json.dev | 61 --------------------------------------
 1 file changed, 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/af593514/src/fauxton/settings.json.dev
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.dev b/src/fauxton/settings.json.dev
deleted file mode 100644
index 62cd1e7..0000000
--- a/src/fauxton/settings.json.dev
+++ /dev/null
@@ -1,61 +0,0 @@
-{
-  "deps": [
-  { "name": "fauxton" },
-  { "name": "databases" },
-  { "name": "documents" },
-  { "name": "pouchdb" },
-  { "name": "activetasks" },
-  { "name": "config" },
-  { "name": "stats" },
-  { "name": "replication" },
-  { "name": "plugins" },
-  { "name": "contribute" },
-  { "name": "permissions" },
-  { "name": "compaction" },
-  { "name": "auth" },
-  { "name": "verifyinstall" },
-  { "name": "styletests" }
-  ],
-    "template": {
-      "development": {
-        "src": "assets/index.underscore",
-        "dest": "dist/debug/index.html",
-        "variables": {
-          "requirejs": "/assets/js/libs/require.js",
-          "css": "./css/index.css",
-          "base": null,
-          "cachebuster": ""
-        },
-        "app": {
-          "root": "/",
-          "host": "../..",
-          "version": "1.0.dev"
-        }
-      },
-      "release": {
-        "src": "assets/index.underscore",
-        "dest": "dist/debug/index.html",
-        "variables": {
-          "requirejs": "./js/require.js",
-          "css": "./css/index.css",
-          "base": null,
-          "cachebuster": "?v1.0"
-        },
-        "app": {
-          "root": "/_utils/fauxton/",
-          "host": "../..",
-          "version": "1.0"
-        }
-      }
-    },
-
-    "couch_config": {
-      "fauxton": {
-        "db": "http://localhost:5984/fauxton",
-        "app": "./couchapp.js",
-        "options": {
-          "okay_if_missing": true
-        }
-      }
-    }
-}


[39/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb

Posted by dc...@apache.org.
Fix missing stale query option


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

Branch: refs/heads/1.6.x
Commit: dc1b1484918205570db34349c5875f7e050d31f9
Parents: fda86ae
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Jun 30 12:27:18 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Jun 30 12:27:18 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dc1b1484/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 439e864..c986d4e 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -101,10 +101,10 @@ the License.
       </div>
     </div>
     <div class="row-fluid">
-      <% if (showPreview) { %>
+      <% if (showStale) { %>
         <div class="span6">
           <div class="checkbox inline">
-            <input id="check7" name="stale" type="checkbox" value="true">
+            <input id="check7" name="stale" type="checkbox" value="ok">
             <label for="check7">Stale</label>
           </div>
         </div>
@@ -147,10 +147,6 @@ the License.
   <% } %>
   </div>
 
-
-
-
-
   <div class="controls-group">
     <div id="button-options" class="controls controls-row">
       <button type="submit" class="btn btn-success">Query</button>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/dc1b1484/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 97f82b4..4e7459a 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -592,7 +592,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     toggleTrash: function () {
       var $bulkdDeleteButton = this.$('.js-bulk-delete');
 
-      if (this.bulkDeleteDocsCollection.length > 0) {
+      if (this.bulkDeleteDocsCollection && this.bulkDeleteDocsCollection.length > 0) {
         $bulkdDeleteButton.removeClass('disabled');
       } else {
         $bulkdDeleteButton.addClass('disabled');
@@ -1016,18 +1016,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.viewName = options.viewName;
       this.updateViewFn = options.updateViewFn;
       this.previewFn = options.previewFn;
-
-      if (typeof(options.hasReduce) === 'undefined') {
-        this.hasReduce = true;
-      } else {
-        this.hasReduce = options.hasReduce;
-      }
-
-      /*if (typeof(options.showPreview) === 'undefined') {
-        this.showPreview = true;
-      } else {
-        this.showPreview = options.showPreview;
-      }*/
+      this.showStale = _.isUndefined(options.showStale) ? false : options.showStale;
+      this.hasReduce = _.isUndefined(options.hasReduce) ? true : options.hasReduce;
     },
 
     events: {
@@ -1253,7 +1243,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     serialize: function () {
       return {
         hasReduce: this.hasReduce,
-        showPreview: false
+        showPreview: false,
+        showStale: this.showStale
       };
     }
   });
@@ -1735,7 +1726,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           viewName: this.viewName,
           ddocName: this.model.id,
           hasReduce: this.hasReduce(),
-          eventer: this.eventer
+          eventer: this.eventer,
+          showStale: true
         }));
       }