couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [60/64] [abbrv] fauxton commit: updated refs/heads/secondary-indexes to ef01e24
Date Wed, 23 Jul 2014 19:25:09 GMT
Style API bar open tray

style and add icons to api url

add copy url functionality to api-bar

flash input bg color on api url copy button click

fix cleartimeout


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

Branch: refs/heads/secondary-indexes
Commit: f978779e904b48c7a079cb3d31f2d37d3b40bcf4
Parents: 8bf2066
Author: Jenn Schiffer <jenn@pancaketheorem.com>
Authored: Mon Jul 21 17:28:03 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Wed Jul 23 11:47:36 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/base.js                | 22 +++++++--
 app/addons/fauxton/templates/api_bar.html | 16 +++++--
 assets/less/fauxton.less                  | 63 ++++++++++++++++++++++----
 3 files changed, 86 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f978779e/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index bfc7d31..7a3ab8f 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -13,10 +13,11 @@
 define([
   "app",
   "api",
-  "addons/fauxton/resizeColumns"
+  "addons/fauxton/resizeColumns",
+  "plugins/zeroclipboard/ZeroClipboard"
 ],
 
-function(app, FauxtonAPI, resizeColumns) {
+function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
 
   var Fauxton = FauxtonAPI.addon();
   FauxtonAPI.addNotification = function (options) {
@@ -274,9 +275,7 @@ function(app, FauxtonAPI, resizeColumns) {
       }else{
         $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
       }
-
       $('.api-navbar').toggle();
-
     },
 
     serialize: function() {
@@ -297,6 +296,21 @@ function(app, FauxtonAPI, resizeColumns) {
       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);
+        });
+      });
     }
 
   });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f978779e/app/addons/fauxton/templates/api_bar.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/api_bar.html b/app/addons/fauxton/templates/api_bar.html
index f556220..773ccbd 100644
--- a/app/addons/fauxton/templates/api_bar.html
+++ b/app/addons/fauxton/templates/api_bar.html
@@ -20,12 +20,22 @@ the License.
 <div class="api-navbar" style="display: none">
     <div class="input-prepend input-append">
       <span class="add-on">
-        API reference
+        API URL
         <a class="help-link" href="<%-getDocUrl(documentation)%>" target="_blank">
           <i class="icon-question-sign"></i>
         </a>
       </span>
-      <input type="text" class="input-xxlarge" value="<%- endpoint %>">
-      <a data-bypass="true" href="<%- endpoint %>" target="_blank" class="btn">Show
me</a>
+      <input id="api-url-text" type="text" class="input-xxlarge" value="<%- endpoint
%>">
+      <a class="btn copy-url" data-clipboard-target="api-url-text">
+        <i class="fonticon-eye icon"></i>
+        Copy
+      </a>
+
+      <div class="add-on">
+        <a data-bypass="true" href="<%- endpoint %>" target="_blank" class="btn">
+          <i class="fonticon-eye icon"></i>
+          View JSON
+        </a>
+      </div>
     </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f978779e/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 26f6e39..a9ff31b 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -900,26 +900,73 @@ div.spinner {
 }
 
 .api-navbar {
-  border-top: 1px solid @red;
-  padding: 20px;
+  .border-radius(5px);
+  position: absolute;
+  right: 5px;
+  background-color: #333;
+  padding: 5px 20px;
   .input-append.input-prepend {
     margin-bottom: 0px;
+    .copying {
+      background-color: #999;
+      transition: background-color 5ms linear;
+    }
     .add-on {
       background: none;
-      padding: 14px 12px 32px 12px;
+      padding: 0px;
+      margin: 10px 0;
+      border: none;
+      display: block;
+      text-align: left;
+      color: #fff;
+      text-shadow: none;
+      height: auto;
+    }
+    .input-xxlarge {
+      .border-radius(5px 0 0 5px);
       border: none;
+      padding: 9px;
+      -moz-transition: background-color 100ms linear;
+      -webkit-transition: background-color 100ms linear;
+      transition: background-color 100ms linear;
     }
-    .btn:last-child{
+    .btn{
+      background-color: @red;
+      color: #333;
       margin-left: -1px;
-      background: none;
-      padding: 13px 12px 11px 12px;
+      padding: 10px 10px 8px;
+      border: none;
+      .border-radius(5px);
       &:hover{
-        background-color: @red;
-        color: white;
+        background-color: #cbcbcb;
       }
     }
+    .copy-url {
+      .border-radius(0 5px 5px 0);
+    }
+    .copying {
+      background-color: #999;
+    }
+    .zeroclipboard-is-hover { 
+      background-color: #cbcbcb; 
+    }
+    .icon {
+      vertical-align: bottom;
+      font-size: 17.5px;
+    }
   }
 }
+.api-navbar:before {
+  content: '';
+  position: absolute;
+  top: -25px;
+  right: 30px;
+  border-color: transparent transparent #333 transparent;
+  border-style: solid;
+  border-width: 15px;
+  width: 0;
+  height: 0;
+}
 
 .js-log-filter-form {
   ul {


Mime
View raw message