You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/02/19 15:48:15 UTC

[18/23] couchdb commit: updated refs/heads/paginate-api-options to 0fca3e9

remove api options


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

Branch: refs/heads/paginate-api-options
Commit: 7e2be9f25181dfd30c7bb5b432541355d2b742c1
Parents: 7593aba
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Feb 11 08:49:47 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Feb 19 15:24:55 2014 +0200

----------------------------------------------------------------------
 .../documents/templates/advanced_options.html   |  4 +--
 .../documents/templates/all_docs_layout.html    |  6 ++--
 .../addons/documents/templates/view_editor.html |  3 ++
 src/fauxton/app/addons/documents/views.js       | 30 +++++++++++---------
 4 files changed, 25 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7e2be9f2/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 8f592f4..fbf958e 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -71,9 +71,9 @@ the License.
             <option >20</option>
             <option>30</option>
             <option>50</option>
-            <option selected="selected">100</option>
+            <option >100</option>
             <option>500</option>
-            <option>None</option>
+            <option selected="selected">None</option>
           </select>
         </label>
         <div class="checkbox inline">  

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7e2be9f2/src/fauxton/app/addons/documents/templates/all_docs_layout.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_layout.html b/src/fauxton/app/addons/documents/templates/all_docs_layout.html
index 1bbe59d..2862e16 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_layout.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_layout.html
@@ -11,9 +11,11 @@ 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 window-resizeable" id="db-views-tabs-nav">
+  <li><a id="toggle-query" href="#query" data-bypass="true" data-toggle="tab">
+    <i class="fonticon fonticon-plus"></i> Query Options</a></li>
+</ul>
 <div class="tab-content">
-  <div id="query-options-wrapper"></div>
   <div class="tab-pane" id="query">
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7e2be9f2/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 0916a45..976be7a 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -17,6 +17,9 @@ the License.
       <i class="fonticon-wrench fonticon"></i>
       <% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li>
     <% if (!newView) { %>
+    <li><a data-bypass="true" id="query-nav" href="#query" data-toggle="tab">
+      <i class="fonticon-plus fonticon"></i> Query Options</a>
+    </li>
     <li><a data-bypass="true" id="meta-nav" href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>
     <% } %>
   </ul>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7e2be9f2/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 d864c64..41b375c 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -26,8 +26,6 @@ define([
        // Plugins
        "plugins/beautify",
        "plugins/prettify",
-
-
 ],
 
 function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns, beautify) {
@@ -499,18 +497,18 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
         eventer: this.eventer
       }));
 
-      this.advancedOptionsMenu = this.insertView('#query-options-wrapper', new Views.AdvancedOptionsMenu({
+      /*this.advancedOptionsMenu = this.insertView('#query-options-wrapper', new Views.AdvancedOptionsMenu({
         hasReduce: false,
         eventer:  this.eventer
-       }));
+       }));*/
 
-      this.$('#query').hide();
+      //this.$('#query').hide();
     },
 
     afterRender: function () {
       if (this.params) {
         this.advancedOptions.updateFromParams(this.params);
-        this.advancedOptionsMenu.updateFromParams(this.params);
+        //this.advancedOptionsMenu.updateFromParams(this.params);
       }
 
     },
@@ -1144,9 +1142,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     queryParams: function () {
       var $form = this.$(".view-query-update");
       // Ignore params without a value
-      var params = _.filter($form.serializeArray(), function(param) {
-        return param.value;
-      });
+      var params = _.reduce($form.serializeArray(), function(params, param) {
+        if (!params.value) { return params; }
+        if (param.name === "limit" && param.value === 'None') { return params; }
+
+        params.push(param.value);
+        return params;
+      }, []);
 
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["key","keys","startkey","endkey"];
@@ -1468,8 +1470,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
             that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce());
           }
 
-          that.advancedOptionsMenu.setHasReduce(that.hasReduce());
-          that.advancedOptionsMenu.render();
+          //that.advancedOptionsMenu.setHasReduce(that.hasReduce());
+          //that.advancedOptionsMenu.render();
 
           FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName});
 
@@ -1712,10 +1714,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
           eventer: this.eventer
         }));
 
-        this.advancedOptionsMenu = this.insertView('#query-options-wrapper', new Views.AdvancedOptionsMenu({
+        /*this.advancedOptionsMenu = this.insertView('#query-options-wrapper', new Views.AdvancedOptionsMenu({
           hasReduce: this.hasReduce(),
           eventer:  this.eventer
-         }));
+         }));*/
       }
 
     },
@@ -1723,7 +1725,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
     afterRender: function() {
       if (this.params && !this.newView) {
         this.advancedOptions.updateFromParams(this.params);
-        this.advancedOptionsMenu.updateFromParams(this.params);
+        //this.advancedOptionsMenu.updateFromParams(this.params);
       }
 
       this.designDocSelector.updateDesignDoc();