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/20 17:04:21 UTC

[07/14] couchdb commit: updated refs/heads/paginate-api-options to 75c7077

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

Branch: refs/heads/paginate-api-options
Commit: e69fbe9348d1f1a2db6dcf15ddb041e1d898be1c
Parents: a32ee18
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Feb 11 08:49:47 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Thu Feb 20 08:54:33 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/e69fbe93/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/e69fbe93/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/e69fbe93/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 36451e8..e08e36e 100644
--- a/src/fauxton/app/addons/documents/templates/view_editor.html
+++ b/src/fauxton/app/addons/documents/templates/view_editor.html
@@ -16,6 +16,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/e69fbe93/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 8fa426a..e9a0ee6 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) {
@@ -498,18 +496,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);
       }
 
     },
@@ -1143,9 +1141,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"];
@@ -1467,8 +1469,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});
 
@@ -1711,10 +1713,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
-         }));
+         }));*/
       }
 
     },
@@ -1722,7 +1724,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();