couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [2/2] git commit: updated refs/heads/master to bc37880
Date Thu, 26 Dec 2013 16:17:57 GMT
Add messaging while waiting for DB to delete.
Remove buttons from the bottom of the editor


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

Branch: refs/heads/master
Commit: bc378807a944f37d3ba45f293f3b4c1f87728a5b
Parents: c18c2f1
Author: suelockwood <deathbear@apache.org>
Authored: Thu Dec 26 11:17:49 2013 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Thu Dec 26 11:17:49 2013 -0500

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js   | 106 ++++++++++++----------
 src/fauxton/app/templates/documents/doc.html |  17 ++--
 2 files changed, 64 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bc378807/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 96314ad..a0775a1 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -31,52 +31,55 @@ define([
 function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns) {
   var Views = {};
 
-  Views.Tabs = FauxtonAPI.View.extend({
-    template: "templates/documents/tabs",
-    initialize: function(options){
-      this.collection = options.collection;
-      this.database = options.database;
-      this.active_id = options.active_id;
-    },
-
-    events: {
-      "click #delete-database": "delete_database"
-    },
-
-    serialize: function () {
-      return {
-        // TODO make this not hard coded here
-        changes_url: '#' + this.database.url('changes'),
-        db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
-      };
-    },
-
-    beforeRender: function(manage) {
-      this.insertView("#search", new Views.SearchBox({
-        collection: this.collection,
-        database: this.database.id
-      }));
-    },
-
-    afterRender: function () {
-      if (this.active_id) {
-        this.$('.active').removeClass('active');
-        this.$('#'+this.active_id).addClass('active');
-      }
-    },
-
-    delete_database: function (event) {
-      event.preventDefault();
-
-      var result = confirm("Are you sure you want to delete this database?");
-
-      if (!result) { return; }
-
-      return this.database.destroy().done(function () {
-        app.router.navigate('#/_all_dbs', {trigger: true});
-      });
-    }
-  });
+  // Views.Tabs = FauxtonAPI.View.extend({
+  //   template: "templates/documents/tabs",
+  //   initialize: function(options){
+  //     this.collection = options.collection;
+  //     this.database = options.database;
+  //     this.active_id = options.active_id;
+  //   },
+
+  //   events: {
+  //     "click #delete-database": "delete_database"
+  //   },
+
+  //   serialize: function () {
+  //     return {
+  //       // TODO make this not hard coded here
+  //       changes_url: '#' + this.database.url('changes'),
+  //       db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
+  //     };
+  //   },
+
+  //   beforeRender: function(manage) {
+  //     this.insertView("#search", new Views.SearchBox({
+  //       collection: this.collection,
+  //       database: this.database.id
+  //     }));
+  //   },
+
+  //   afterRender: function () {
+  //     if (this.active_id) {
+  //       this.$('.active').removeClass('active');
+  //       this.$('#'+this.active_id).addClass('active');
+  //     }
+  //   },
+
+  //   delete_database: function (event) {
+  //     event.preventDefault();
+
+  //     var result = confirm("Are you sure you want to delete this database?");
+
+  //     if (!result) { return; }
+  //     FauxtonAPI.addNotification({
+  //       msg: "Deleting your database...",
+  //       type: "error"
+  //     });
+  //     return this.database.destroy().done(function () {
+  //       app.router.navigate('#/_all_dbs', {trigger: true});
+  //     });
+  //   }
+  // });
 
   Views.SearchBox = FauxtonAPI.View.extend({
     template: "templates/documents/search",
@@ -1661,16 +1664,23 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
 
       if (!result) { return; }
       var databaseName = this.database.id;
+      FauxtonAPI.addNotification({
+        msg: "Deleting your database...",
+        type: "error",
+        clear: true
+      });
 
       this.database.destroy().then(function () {
         FauxtonAPI.navigate('#/_all_dbs');
         FauxtonAPI.addNotification({
-          msg: 'The database ' + databaseName + ' has been deleted.'
+          msg: 'The database ' + databaseName + ' has been deleted.',
+          clear: true
         });
       }).fail(function (rsp, error, msg) {
         FauxtonAPI.addNotification({
           msg: 'Could not delete the database, reason ' + msg + '.',
-          type: 'error'
+          type: 'error',
+          clear: true
         });
       });
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bc378807/src/fauxton/app/templates/documents/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html
index 82f2733..10bbf8b 100644
--- a/src/fauxton/app/templates/documents/doc.html
+++ b/src/fauxton/app/templates/documents/doc.html
@@ -17,14 +17,14 @@ the License.
    
 <div class="row doc-editor-buttons"> 
   <div class="span3">
-    <button class="save-doc button green btn-large save fonticon-circle-check" type="button">Save</button>
-    <button class="button cancel-button gray btn-large">Back to _all_docs</button>
+    <button class="save-doc button green btn-medium save fonticon-circle-check" type="button">Save</button>
+    <button class="button cancel-button gray btn-medium">Back to _all_docs</button>
   </div>
 
   <div class="span7">
     <% if (attachments) { %>
     <div class="btn-group">
-      <a class="button gray btn-large dropdown-toggle btn" data-bypass="true" data-toggle="dropdown"
href="#">
+      <a class="button gray btn-medium dropdown-toggle btn" data-bypass="true" data-toggle="dropdown"
href="#">
         View Attachments
         <span class="caret"></span>
       </a>
@@ -39,11 +39,11 @@ the License.
       </ul>
     </div>
     <% } %> 
-    <button class="button gray btn-large  upload"><i class="icon-circle-arrow-up"></i>
Upload Attachment</button>
-    <button class="button gray btn-large  duplicate"><i class="icon-repeat"></i>
Duplicate document</button>
+    <button class="button gray btn-medium  upload"><i class="icon-circle-arrow-up"></i>
Upload Attachment</button>
+    <button class="button gray btn-medium duplicate"><i class="icon-repeat"></i>
Duplicate document</button>
   </div>
 
-  <button class="button red btn-large delete"><i class="icon-trash"></i></button>
+  <button class="button red btn-medium delete"><i class="icon-trash"></i></button>
   </ul>
 
 <div id="upload-modal"> </div>
@@ -51,10 +51,5 @@ the License.
 </div>
 
   <div id="editor-container" class="doc-code"><%- JSON.stringify(doc.attributes,
null, "  ") %></div>
-  <br />
-  <p>
-       <button class="save-doc button green btn-large save fonticon-circle-check" type="button">Save</button>
-       <button class="button gray btn-large cancel-button outlineGray fonticon-circle-x"
type="button">Cancel</button>
-  </p>
 
 </div>


Mime
View raw message