couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [1/2] couchdb commit: updated refs/heads/2128-autocomplete-section-name to 9482eed
Date Wed, 05 Mar 2014 20:51:56 GMT
Repository: couchdb
Updated Branches:
  refs/heads/2128-autocomplete-section-name f62790d8c -> 9482eed3b


fixes for validation


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

Branch: refs/heads/2128-autocomplete-section-name
Commit: 324564bf249b96a4b17dca36134eb676d9be18e7
Parents: f62790d
Author: suelockwood <deathbear@apache.org>
Authored: Fri Feb 28 15:37:04 2014 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Fri Feb 28 15:37:04 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/324564bf/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 637177c..3f65c5d 100644
--- a/src/fauxton/app/addons/config/resources.js
+++ b/src/fauxton/app/addons/config/resources.js
@@ -205,6 +205,13 @@ function (app, FauxtonAPI, Components) {
       Config.Events.trigger("newSection");
 
     },
+    isNew: function(){
+      var section = this.$('input[name="section"]').val(),
+          name = this.$('input[name="name"]').val(),
+          sectionFilter = _.find(this.sourceArray, function(item){ return item === section;
});
+          console.log(sectionFilter);
+          return false;
+    },
     isSection: function(){
       var section = this.$('input[name="section"]').val();
       return _.find(this.sourceArray, function(item){ return item === section; });
@@ -216,26 +223,28 @@ function (app, FauxtonAPI, Components) {
           value = this.$('input[name="value"]').val();
 
       if(!this.isSection()){
-        var notification = FauxtonAPI.addNotification({
+        FauxtonAPI.addNotification({
           msg: "You need to use an existing section.",
           type: "error",
           clear: true,
           selector: ".form-error-config"
         }); 
       } else if (!name) {
-        var notification = FauxtonAPI.addNotification({
+        FauxtonAPI.addNotification({
           msg: "Add a name.",
           type: "error",
           clear: true,
           selector: ".form-error-config"
         });
       } else if (!value) {
-        var notification = FauxtonAPI.addNotification({
+        FauxtonAPI.addNotification({
           msg: "Add a value",
           type: "error",
           clear: true,
           selector: ".form-error-config"
         });
+      } else if (this.isNew()){
+        console.log("nooo");
       } else {
         this.submitForm();
       }


Mime
View raw message