couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r797024 - in /couchdb/trunk/share: Makefile.am www/_sidebar.html www/image/bg.png www/image/sidebar-toggle.png www/script/futon.js www/style/layout.css
Date Thu, 23 Jul 2009 11:38:16 GMT
Author: cmlenz
Date: Thu Jul 23 11:38:15 2009
New Revision: 797024

URL: http://svn.apache.org/viewvc?rev=797024&view=rev
Log:
Allow the Futon sidebar to be moved out of the way. Based on idea and patch by Volker Mische.
Closes COUCHDB-425.

Added:
    couchdb/trunk/share/www/image/sidebar-toggle.png   (with props)
Modified:
    couchdb/trunk/share/Makefile.am
    couchdb/trunk/share/www/_sidebar.html
    couchdb/trunk/share/www/image/bg.png
    couchdb/trunk/share/www/script/futon.js
    couchdb/trunk/share/www/style/layout.css

Modified: couchdb/trunk/share/Makefile.am
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/Makefile.am?rev=797024&r1=797023&r2=797024&view=diff
==============================================================================
--- couchdb/trunk/share/Makefile.am (original)
+++ couchdb/trunk/share/Makefile.am Thu Jul 23 11:38:15 2009
@@ -61,6 +61,7 @@
     www/image/run.png \
     www/image/running.png \
     www/image/save.png \
+    www/image/sidebar-toggle.png \
     www/image/spinner.gif \
     www/image/test_failure.gif \
     www/image/test_success.gif \

Modified: couchdb/trunk/share/www/_sidebar.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/_sidebar.html?rev=797024&r1=797023&r2=797024&view=diff
==============================================================================
--- couchdb/trunk/share/www/_sidebar.html (original)
+++ couchdb/trunk/share/www/_sidebar.html Thu Jul 23 11:38:15 2009
@@ -13,6 +13,7 @@
 
 -->
 <div id="sidebar">
+  <a id="sidebar-toggle" href="#" title="Hide Sidebar"></a>
   <a href="index.html">
     <img id="logo" src="image/logo.png" width="175" height="150" alt="Apache CouchDB:
Relax">
   </a>

Modified: couchdb/trunk/share/www/image/bg.png
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/image/bg.png?rev=797024&r1=797023&r2=797024&view=diff
==============================================================================
Binary files - no diff available.

Added: couchdb/trunk/share/www/image/sidebar-toggle.png
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/image/sidebar-toggle.png?rev=797024&view=auto
==============================================================================
Binary file - no diff available.

Propchange: couchdb/trunk/share/www/image/sidebar-toggle.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Modified: couchdb/trunk/share/www/script/futon.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.js?rev=797024&r1=797023&r2=797024&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.js (original)
+++ couchdb/trunk/share/www/script/futon.js Thu Jul 23 11:38:15 2009
@@ -100,6 +100,29 @@
       });
     }
 
+    this.toggle = function(speed) {
+      if (speed === undefined) {
+        speed = 500;
+      }
+      var sidebar = $("#sidebar").stop(true, true);
+      var hidden = !$(sidebar).is(".hidden");
+
+      sidebar.toggleClass("hidden").animate({
+        width: hidden ? 26 : 210,
+        height: hidden ? $("h1").outerHeight() - 1 : "100%",
+        right: hidden ? 0 : -210
+      }, speed).children(":not(#sidebar-toggle)").toggle(speed * 1.2);
+      $("h1").animate({marginRight: hidden ? 26 : 0}, speed);
+      $("#wrap").animate({
+        marginRight: hidden ? 0 : 210
+      }, speed, function() {
+        $(document.body).toggleClass("fullwidth", hidden);
+      });
+
+      $("#sidebar-toggle")
+        .attr("title", hidden ? "Show Sidebar" : "Hide Sidebar");
+      $.cookies.set("sidebar", hidden ? "hidden" : "show");
+    };
   }
 
   $.futon = $.futon || {};
@@ -140,8 +163,19 @@
 
   $(function() {
     document.title = "Apache CouchDB - Futon: " + document.title;
+    if ($.cookies.get("sidebar") == "hidden") {
+      // doing this as early as possible prevents flickering
+      $(document.body).addClass("fullwidth");
+    }
     $.get("_sidebar.html", function(resp) {
-      $(resp).insertAfter("#wrap");
+      $("#wrap").append(resp)
+        .find("#sidebar-toggle").click(function(e) {
+            $.futon.navigation.toggle(e.shiftKey ? 2500 : 500);
+            return false;
+          });
+      if ($.cookies.get("sidebar") == "hidden") {
+        $.futon.navigation.toggle(0);
+      }
 
       $.futon.navigation.updateDatabases();
       $.futon.navigation.updateSelection();

Modified: couchdb/trunk/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=797024&r1=797023&r2=797024&view=diff
==============================================================================
--- couchdb/trunk/share/www/style/layout.css (original)
+++ couchdb/trunk/share/www/style/layout.css Thu Jul 23 11:38:15 2009
@@ -18,16 +18,13 @@
 html, body { color: #000; font: normal 90% Arial,Helvetica,sans-serif;
   height: 100%; margin: 0; padding: 0; overflow: hidden;
 }
-body { background: #fff url(../image/bg.png) 100% 0 repeat-y;
-  padding-right: 210px;
-}
 :link, :visited { color: #ba1e16; text-decoration: none; }
 :link img, :visited img { border: none; }
 
 h1 { background: #333; border-right: 2px solid #111;
   border-bottom: 1px solid #333; color: #999;
-  font: 125% normal Arial,Helvetica,sans-serif;
-  line-height: 1.8em; margin: 0 0 1em; padding: 0 0 0 1em; position: relative;
+  font: 125% normal Arial,Helvetica,sans-serif; height: 32px;
+  line-height: 32px; margin: 0; padding: 0 0 0 .5em; position: relative;
 }
 h1 :link, h1 :visited, h1 strong { padding: .4em .5em; }
 h1 :link, h1 :visited {
@@ -39,7 +36,7 @@
 h1 strong a {color:#fff !important;background:none !important;}
 h1 :link.raw, h1 :visited.raw {
   background: url(../image/rarrow.png) 100% 50% no-repeat; position: absolute;
-  right: 20px; width: 35px; height: 100%; padding: 0;
+  right: 20px; width: 35px; height: 100%; padding: 0; margin: 0;
 }
 body.loading h1 strong {
   background: url(../image/spinner.gif) right center no-repeat;
@@ -155,14 +152,25 @@
 
 /* Logo & Navigation */
 
-#sidebar { background: #fff; position: absolute; top: 0; right: 0;
+#sidebar { background: #fff; position: absolute; top: 0; right: -210px;
   width: 210px; height: 100%;
 }
-#logo { padding: 20px 18px; }
+body.fullwidth #sidebar { border-bottom: 1px solid #333; right: 0;
+  width: 26px;
+}
+#sidebar-toggle { background: url(../image/sidebar-toggle.png) 0 0 no-repeat;
+  color: #999; cursor: pointer; display: block; position: absolute; right: 0;
+  top: 0; font-size: 110%; width: 26px; height: 32px; text-indent: -9999px;
+}
+#sidebar-toggle:hover { background-position: -26px 0; }
+#sidebar-toggle:focus { outline: none; }
+#sidebar.hidden #sidebar-toggle { background-position: 0 -32px; }
+#sidebar.hidden #sidebar-toggle:hover { background-position: -26px -32px; }
+
+#logo { margin: 30px 0 0; padding: 0 18px 10px; }
 
 #nav { color: #333; font-size: 110%; font-weight: bold; list-style: none;
-  margin: 0; overflow: auto; overflow-x: hidden; padding: 0;
-  position: absolute; top: 185px; bottom: 20px; right: 0; width: 210px;
+  margin: 0; overflow: auto; overflow-x: hidden; padding: 0; width: 210px;
 }
 #nav ul { list-style: none; margin: 0; padding: 0; }
 #nav li { color: #999; margin: 5px 0 0; padding: 3px 0; }
@@ -200,8 +208,14 @@
 }
 #footer :link, #footer :visited { color: #000; }
 
-#wrap { height: 100%; overflow: auto; }
-#content { padding: 0 20px 3em; }
+#wrap { background: #fff url(../image/bg.png) 100% 0 repeat-y;
+  height: 100%; margin-right: 210px; position: relative;
+}
+body.fullwidth #wrap { margin-right: 0; }
+#content { padding: 1em 16px 3em 10px; overflow: auto; position: absolute;
+  top: 33px; bottom: 0; left: 0; right: 0;
+}
+body.fullwidth #content { padding-right: 26px; }
 
 /* Toolbar */
 



Mime
View raw message