couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [19/26] couchdb commit: updated refs/heads/Query-Options-UI to cf93bbf
Date Thu, 20 Mar 2014 10:21:43 GMT
initial linking with paginate


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

Branch: refs/heads/Query-Options-UI
Commit: c6e5ce6ee8c52b6b42490fd9b041ec81038c0963
Parents: 1b00539
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Mar 11 11:48:50 2014 -0400
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Thu Mar 20 10:33:46 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c6e5ce6e/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 2eaff2a..8e78bcb 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -12,14 +12,10 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 <div class="errors-container"></div>
-<form class="view-query-update custom-inputs">
-
+<form class="js-view-query-update custom-inputs">
 
 <!-- tabs for choosing Keys or Start & end -->
 
-
-
-
   <div class="btn-group toggle-btns">
     <label for="showKeys" class="drop-down btn active">
      Specific Keys 
@@ -47,8 +43,6 @@ the License.
     </div>
   </div>
 
-
-
 <!-- Limit and Skip are conditional -->
 
   <div class="controls-group">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c6e5ce6e/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 dfd0752..0b62dce 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1134,31 +1134,33 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
 
     },
     queryParams: function () {
-      var $form = this.$(".view-query-update"),
+      var $form = this.$(".js-view-query-update"),
           getKeys = this.getKeys;
-      var params = _.reduce($form.serializeArray(), function(params, param) {
+
+      var rawParams = _.reduce($form.serializeArray(), function(params, param) {
         if (!param.value) { return params; }
         if (param.name === "limit" && param.value === 'None') { return params; }
 
         params.push(param);
         return params;
       }, []);
-      });
-      var filteredParams = _.filter(params, function(param) {
+
+      var filteredParams = _.filter(rawParams, function(param) {
         return param.value;
       });
-        
 
-
-      var params = _.map(filteredParams, function(param) {
+      console.log('filtered', filteredParams);
+      var params = filteredParams;
+      /*var params = _.map(filteredParams, function(param) {
         if (param.name === "keys"){
-          return getKeys(param);
+          param.value = JSON.parse(param.value);
+          //param.value = JSON.stringify(b);
+          return param;
+          //return getKeys(param);
         }else{
           return param;
         }
-      });
-
-
+      });*/
 
       // Validate *key* params to ensure they're valid JSON
       var keyParams = ["keys","startkey","endkey"];
@@ -1175,20 +1177,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         }
       });
 
-      return {params: params, errorParams: errorParams};
-
-      // Ignore params without a value
-      /*_.map($form.serializeArray(), function(param) {
-        if (param.value){
-          if (param.name === "keys"){
-            var keys = getKeys(param.value);
-            data[keys.name] = keys.value;
-          }else{
-            data[param.name] = param.value;
-          }
-        }
-      });(*/
-
+      console.log('params', params);
+      return {params: params, errorParams: {}}; //errorParams};
     },
 
     updateFilters: function(event) {


Mime
View raw message