From d8ad3a2d9426603b1f43a66b55a90cd69628d865 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 18 Sep 2007 08:49:49 +0000 Subject: [PATCH] merge :sbclose and viewSidebarMenu menuitem additions --- NEWS | 2 +- TODO | 2 -- chrome/content/vimperator/commands.js | 22 +++++++++++++++- chrome/content/vimperator/vimperator.xul | 33 +++++++++++++++++++++++- 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 0f133e47..3b5908c4 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@
 2007-XX-XX:
 	* version 0.5.2
-	* added a new :sidebar command
+	* added new :sidebar and :sbclose commands
 	* added 'more' and standard more-prompt key mappings to control
 	  behaviour of the message list pager 
 	* added 'hlsearchstyle' option to allow for user CSS styling of the
diff --git a/TODO b/TODO
index eac7644f..bb9a7bb8 100644
--- a/TODO
+++ b/TODO
@@ -19,8 +19,6 @@ BUGS:
 
 FEATURES:
 9 :command for new commands
-9 :sidebar {addons/bookmarks/history/downloads/...} command with tab completion
-  (and automatically getting possible sidebar elements from View->sidebar
 9 Use our own find-as-you-type mechanism (like conkeror does)
 9 make hints smarter, not only with characters from from hintchars, but use "NE" or "NP" for 'new posts' e.g. (might be too slow)
 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index 79422b1a..699c4fc5 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -1076,7 +1076,27 @@ function Commands() //{{{
             completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
         }
     ));
-    addDefaultCommand(new Command(["sideb[ar]"],
+    // TODO: sclose instead?
+    addDefaultCommand(new Command(["sbcl[ose]"],
+        function(args)
+        {
+            if (args)
+            {
+                vimperator.echoerr("E488: Trailing characters");
+                return;
+            }
+
+            document.getElementById("sidebar-box").hidden = true;;
+            document.getElementById("sidebar-splitter").hidden = true;;
+        },
+        {
+            short_help: "Close the sidebar",
+            help: "TODO"
+        }
+    ));
+    // TODO: sopen instead? Separate :sidebar from :sbopen and make them behave
+    // more like :cw, :cope etc
+    addDefaultCommand(new Command(["sideb[ar]", "sb[ar]", "sbope[n]"],
         function(args)
         {
             if (!args)
diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul
index 8b6148ad..183f434e 100644
--- a/chrome/content/vimperator/vimperator.xul
+++ b/chrome/content/vimperator/vimperator.xul
@@ -55,6 +55,7 @@ the terms of any one of the MPL, the GPL or the LGPL.