From 0bbead8d2f27809b46a420bcadc63641aa43e066 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 3 Apr 2009 00:53:09 +1100 Subject: [PATCH] Allow :dpopen/:dpclose to operate on the main service pane. --- xulmus/content/config.js | 37 +++++++++++++++++++++++++++++-------- xulmus/locale/en-US/gui.txt | 4 ++-- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 3de9ca50..842a58c6 100644 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -204,21 +204,42 @@ const config = { //{{{ liberator.open(pre + newNumberStr + post); } + function showServicePane(value) + { + const key = "splitter.servicepane_splitter.was_collapsed"; + gServicePane.open = value; + SBDataSetBoolValue(key, gServicePane.open); + } + function openDisplayPane(id) { - let pane = document.getElementById(id); - let manager = Components.classes['@songbirdnest.com/Songbird/DisplayPane/Manager;1'] - .getService(Components.interfaces.sbIDisplayPaneManager); - let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue); + if (id == "servicepane") + showServicePane(true); + else + { + let pane = document.getElementById(id); + let manager = Components.classes['@songbirdnest.com/Songbird/DisplayPane/Manager;1'] + .getService(Components.interfaces.sbIDisplayPaneManager); + let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue); - if (!paneinfo) - paneinfo = manager.defaultPaneInfo; + if (!paneinfo) + paneinfo = manager.defaultPaneInfo; - pane.loadContent(paneinfo); + pane.loadContent(paneinfo); + } + } + + function closeDisplayPane(id) + { + if (id == "servicepane") + showServicePane(false); + else + document.getElementById(id).hide(); } // FIXME: best way to format these args? Hyphenated? One word like :dialog? let displayPanes = { + "service pane left": "servicepane", "content pane bottom": "displaypane_contentpane_bottom", "service pane bottom": "displaypane_servicepane_bottom", "right sidebar": "displaypane_right_sidebar" @@ -454,7 +475,7 @@ const config = { //{{{ let arg = args.literalArg; if (arg in displayPanes) - document.getElementById(displayPanes[arg]).hide(); + closeDisplayPane(displayPanes[arg]); else liberator.echoerr("E475: Invalid argument: " + arg); diff --git a/xulmus/locale/en-US/gui.txt b/xulmus/locale/en-US/gui.txt index 69129064..4edce370 100644 --- a/xulmus/locale/en-US/gui.txt +++ b/xulmus/locale/en-US/gui.txt @@ -78,8 +78,8 @@ ________________________________________________________________________________ |:dpope| |:dpopen| |:dp| |:dpane| |:dislplayp| |:dislplaypane| ||:displaypane {pane}|| + ________________________________________________________________________________ -Open the specified display pane. {pane} is any of "content pane bottom", -"service pane bottom" or "right sidebar". +Open the specified display pane. {pane} is any of "service pane left", "service +pane bottom", "content pane bottom" or "right sidebar". ________________________________________________________________________________ // vim: set filetype=asciidoc: