couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [08/26] fauxton commit: updated refs/heads/secondary-indexes to 7a446d8
Date Wed, 06 Aug 2014 19:31:15 GMT
Move Fauxton's apibar and breadcrumbs out into components


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

Branch: refs/heads/secondary-indexes
Commit: bcc5b3b9525a70db9246b2c0b39cd69e75d5fbcc
Parents: e528ed3
Author: deathbearbrown <deathbearbrown@gmail.com>
Authored: Mon Aug 4 11:57:41 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Wed Aug 6 12:24:18 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/base.js                     | 75 +-------------------
 app/addons/fauxton/components.js               | 76 +++++++++++++++++++++
 app/addons/indexes/templates/index_header.html | 15 ++--
 app/addons/indexes/templates/list_editor.html  |  2 +-
 4 files changed, 88 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bcc5b3b9/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 00f73a7..57530b9 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -51,7 +51,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
   Fauxton.initialize = function () {
     // app.footer = new Fauxton.Footer({el: "#footer-content"}),
     app.navBar = new Fauxton.NavBar();
-    app.apiBar = new Fauxton.ApiBar();
+    app.apiBar = new Components.ApiBar();
 
     FauxtonAPI.when.apply(null, app.navBar.establish()).done(function() {
       FauxtonAPI.masterLayout.setView("#primary-navbar", app.navBar, true);
@@ -77,7 +77,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
       var crumbs = routeObject.get('crumbs');
 
       if (crumbs.length) {
-        FauxtonAPI.masterLayout.setView('#breadcrumbs', new Fauxton.Breadcrumbs({
+        FauxtonAPI.masterLayout.setView('#breadcrumbs', new Components.Breadcrumbs({
           crumbs: crumbs
         }), true).render();
       }
@@ -93,20 +93,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
     });
   };
 
-  Fauxton.Breadcrumbs = FauxtonAPI.View.extend({
-    template: "addons/fauxton/templates/breadcrumbs",
 
-    serialize: function() {
-      var crumbs = _.clone(this.crumbs);
-      return {
-        crumbs: crumbs
-      };
-    },
-
-    initialize: function(options) {
-      this.crumbs = options.crumbs;
-    }
-  });
 
   Fauxton.VersionInfo = Backbone.Model.extend({
     url: function () {
@@ -259,64 +246,6 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
     // TODO: ADD ACTIVE CLASS
   });
 
-  Fauxton.ApiBar = FauxtonAPI.View.extend({
-    template: "addons/fauxton/templates/api_bar",
-    endpoint: '_all_docs',
-
-    documentation: 'docs',
-
-    events:  {
-      "click .api-url-btn" : "toggleAPIbar"
-    },
-
-    toggleAPIbar: function(e){
-      var $currentTarget = $(e.currentTarget).find('span');
-      if ($currentTarget.hasClass("fonticon-plus")){
-        $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
-      }else{
-        $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
-      }
-      $('.api-navbar').toggle();
-    },
-
-    serialize: function() {
-      return {
-        endpoint: this.endpoint,
-        documentation: this.documentation
-      };
-    },
-
-    hide: function(){
-      this.$el.addClass('hide');
-    },
-    show: function(){
-      this.$el.removeClass('hide');
-    },
-    update: function(endpoint) {
-      this.show();
-      this.endpoint = endpoint[0];
-      this.documentation = endpoint[1];
-      this.render();
-    },
-    afterRender: function(){
-      var client = new Components.Clipboard({
-        $el: this.$('.copy-url')
-      });
-
-      client.on("load", function(e){
-        var $apiInput = $('#api-navbar input');
-        var copyURLTimer;
-        client.on("mouseup", function(e){
-          $apiInput.css("background-color","#aaa");
-          window.clearTimeout(copyURLTimer);
-          copyURLTimer = setInterval(function () {
-            $apiInput.css("background-color","#fff");
-          }, 200);
-        });
-      });
-    }
-
-  });
 
   Fauxton.Notification = FauxtonAPI.View.extend({
     fadeTimer: 5000,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bcc5b3b9/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 72cf55a..32de027 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -34,6 +34,82 @@ define([
 function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   var Components = FauxtonAPI.addon();
 
+
+  Components.Breadcrumbs = FauxtonAPI.View.extend({
+    template: "addons/fauxton/templates/breadcrumbs",
+
+    serialize: function() {
+      var crumbs = _.clone(this.crumbs);
+      return {
+        crumbs: crumbs
+      };
+    },
+
+    initialize: function(options) {
+      this.crumbs = options.crumbs;
+    }
+  });
+
+  Components.ApiBar = FauxtonAPI.View.extend({
+    template: "addons/fauxton/templates/api_bar",
+    endpoint: '_all_docs',
+
+    documentation: 'docs',
+
+    events:  {
+      "click .api-url-btn" : "toggleAPIbar"
+    },
+
+    toggleAPIbar: function(e){
+      var $currentTarget = $(e.currentTarget).find('span');
+      if ($currentTarget.hasClass("fonticon-plus")){
+        $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
+      }else{
+        $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
+      }
+      $('.api-navbar').toggle();
+    },
+
+    serialize: function() {
+      return {
+        endpoint: this.endpoint,
+        documentation: this.documentation
+      };
+    },
+
+    hide: function(){
+      this.$el.addClass('hide');
+    },
+    show: function(){
+      this.$el.removeClass('hide');
+    },
+    update: function(endpoint) {
+      this.show();
+      this.endpoint = endpoint[0];
+      this.documentation = endpoint[1];
+      this.render();
+    },
+    afterRender: function(){
+      ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf"
});
+      var client = new ZeroClipboard(this.$(".copy-url"));
+      client.on("load", function(e){
+        var $apiInput = $('#api-navbar input');
+        var copyURLTimer;
+        client.on("mouseup", function(e){
+          $apiInput.css("background-color","#aaa");
+          window.clearTimeout(copyURLTimer);
+          copyURLTimer = setInterval(function () {
+            $apiInput.css("background-color","#fff");
+          }, 200);
+        });
+      });
+    }
+
+  });
+
+
+
+
   Components.Pagination = FauxtonAPI.View.extend({
     template: "addons/fauxton/templates/pagination",
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bcc5b3b9/app/addons/indexes/templates/index_header.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_header.html b/app/addons/indexes/templates/index_header.html
index 662f3ea..342d628 100644
--- a/app/addons/indexes/templates/index_header.html
+++ b/app/addons/indexes/templates/index_header.html
@@ -12,19 +12,22 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 
-<div class="header-left">
+<div class="header-left windowresize">
 
-<!--back arrow-->
-<span class="icon "
+  <!--back arrow-->
+  <a href=""><span class="icon "></span></a>
+  <!--title-->
+  <h2> <%-title%> </h2>
 
-<!--title-->
 
-<!-- Menu gear-->
+
+  <!-- Menu gear-->
+  <div class="header-menu"></div>
 
 </div>
 
 
-<div class="header-right">
+<div class="header-right window-resizeable">
   <!-- Query Options-->
   <!--right margin for api bar-->
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bcc5b3b9/app/addons/indexes/templates/list_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/list_editor.html b/app/addons/indexes/templates/list_editor.html
index d36004c..9eaa420 100644
--- a/app/addons/indexes/templates/list_editor.html
+++ b/app/addons/indexes/templates/list_editor.html
@@ -36,4 +36,4 @@ the License.
     </div>
     <div class="clearfix"></div>
   </form>
-</div>=
+</div>


Mime
View raw message