Enanium: added collapse for left sidebar
authorDan
Sun, 10 May 2009 14:42:18 -0400
changeset 958 3dafe0969e5a
parent 957 6b7644fec887
child 959 68a91587271a
Enanium: added collapse for left sidebar
themes/enanium/css/babygrand.css
themes/enanium/header.tpl
themes/enanium/js/inlinerename.js
--- a/themes/enanium/css/babygrand.css	Sun May 10 14:41:51 2009 -0400
+++ b/themes/enanium/css/babygrand.css	Sun May 10 14:42:18 2009 -0400
@@ -215,7 +215,7 @@
   background-color: #292929;
 }
 
-div.sidebar.right a.closebtn {
+div.sidebar a.closebtn {
   display: block;
   float: right;
   margin-right: 10px;
@@ -226,11 +226,24 @@
   cursor: pointer;
 }
 
+div.sidebar.left a.closebtn {
+  color: #f0f0f0;
+  background-color: #404040;
+  margin-right: 0px;
+  -moz-border-radius: 0 0 0 4px;
+  line-height: 19px;
+}
+
 div.right-sidebar-hidden {
   margin-left: 10px;
   display: none;
 }
 
+div.left-sidebar-hidden {
+  display: none;
+  position: absolute;
+}
+
 div.right-sidebar-hidden a.openbtn {
   display: block;
   float: right;
@@ -242,6 +255,17 @@
   cursor: pointer;
 }
 
+div.left-sidebar-hidden a.openbtn {
+  display: block;
+  float: left;
+  margin-top: 1.8em;
+  color: #456798;
+  background-color: #f0f0f0;
+  padding: 5px 4px;
+  -moz-border-radius: 0 4px 4px 0;
+  cursor: pointer;
+}
+
 div.slider {
   margin-bottom: 7px;
 }
@@ -394,3 +418,12 @@
 ul.userpage_links li a:visited, ul.userpage_links li a:hover {
   color: #202020 !important;
 }
+
+/*
+ * Some table stuff
+ */
+
+div.tblholder th a {
+  text-decoration: underline;
+  color: #f0f0f0 !important;
+}
--- a/themes/enanium/header.tpl	Sun May 10 14:41:51 2009 -0400
+++ b/themes/enanium/header.tpl	Sun May 10 14:42:18 2009 -0400
@@ -56,9 +56,13 @@
     <table border="0" cellspacing="0" cellpadding="0" id="body-wrapper">
     <tr>
       <td valign="top" id="cell-sbleft">
-        <div class="left sidebar">
+        <div class="left sidebar" id="enanium_sidebar_left">
+          <a class="closebtn" onclick="enanium_toggle_sidebar_left(); return false;">&laquo;</a>
           {SIDEBAR_LEFT}
         </div>
+        <div class="left-sidebar-hidden" id="enanium_sidebar_left_hidden">
+          <a class="openbtn" onclick="enanium_toggle_sidebar_left(); return false;">&raquo;</a>
+        </div>
         <!-- HOOK sidebar_left_post -->
       </td>
       <td valign="top" id="cell-content">
@@ -79,6 +83,7 @@
             {SIDEBAR_LINK}
             {ADMIN_LINK}
             <!-- END auth_admin -->
+            <li><a href="{url:Special:Memberlist|escape}">{lang:specialpage_member_list}</a></li>
           </ul>
           <span class="menuclear"></span>
         </div>
--- a/themes/enanium/js/inlinerename.js	Sun May 10 14:41:51 2009 -0400
+++ b/themes/enanium/js/inlinerename.js	Sun May 10 14:42:18 2009 -0400
@@ -1,24 +1,40 @@
 // Sidebar collapse
-function enanium_toggle_sidebar_right()
+function enanium_toggle_sidebar(side)
 {
-  if ( document.getElementById('enanium_sidebar_right').style.display == 'none' )
+  if ( document.getElementById('enanium_sidebar_' + side).style.display == 'none' )
   {
     // show
-    document.getElementById('enanium_sidebar_right').style.display = 'block';
-    document.getElementById('enanium_sidebar_right_hidden').style.display = 'none';
-    createCookie('right_sidebar', 'open', 365);
+    document.getElementById('enanium_sidebar_' + side).style.display = 'block';
+    document.getElementById('enanium_sidebar_' + side + '_hidden').style.display = 'none';
+    createCookie(side + '_sidebar', 'open', 365);
   }
   else
   {
     // hide
-    document.getElementById('enanium_sidebar_right').style.display = 'none';
-    document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
-    createCookie('right_sidebar', 'collapsed', 365);
+    document.getElementById('enanium_sidebar_' + side).style.display = 'none';
+    document.getElementById('enanium_sidebar_' + side + '_hidden').style.display = 'block';
+    createCookie(side + '_sidebar', 'collapsed', 365);
   }
 }
 
+function enanium_toggle_sidebar_right()
+{
+  enanium_toggle_sidebar('right');
+}
+
+function enanium_toggle_sidebar_left()
+{
+  enanium_toggle_sidebar('left');
+}
+
 addOnloadHook(function()
   {
+    if ( readCookie('left_sidebar') == 'collapsed' )
+    {
+      document.getElementById('enanium_sidebar_left').style.display = 'none';
+      document.getElementById('enanium_sidebar_left_hidden').style.display = 'block';
+    }
+    
     if ( readCookie('right_sidebar') == 'collapsed' )
     {
       document.getElementById('enanium_sidebar_right').style.display = 'none';