1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-22 16:55:46 +01:00

Allow :dpopen/:dpclose to operate on the main service pane.

This commit is contained in:
Doug Kearns
2009-04-03 00:53:09 +11:00
parent a5e62a9bcf
commit 0bbead8d2f
2 changed files with 31 additions and 10 deletions

View File

@@ -204,21 +204,42 @@ const config = { //{{{
liberator.open(pre + newNumberStr + post); 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) function openDisplayPane(id)
{ {
let pane = document.getElementById(id); if (id == "servicepane")
let manager = Components.classes['@songbirdnest.com/Songbird/DisplayPane/Manager;1'] showServicePane(true);
.getService(Components.interfaces.sbIDisplayPaneManager); else
let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue); {
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) if (!paneinfo)
paneinfo = manager.defaultPaneInfo; 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? // FIXME: best way to format these args? Hyphenated? One word like :dialog?
let displayPanes = { let displayPanes = {
"service pane left": "servicepane",
"content pane bottom": "displaypane_contentpane_bottom", "content pane bottom": "displaypane_contentpane_bottom",
"service pane bottom": "displaypane_servicepane_bottom", "service pane bottom": "displaypane_servicepane_bottom",
"right sidebar": "displaypane_right_sidebar" "right sidebar": "displaypane_right_sidebar"
@@ -454,7 +475,7 @@ const config = { //{{{
let arg = args.literalArg; let arg = args.literalArg;
if (arg in displayPanes) if (arg in displayPanes)
document.getElementById(displayPanes[arg]).hide(); closeDisplayPane(displayPanes[arg]);
else else
liberator.echoerr("E475: Invalid argument: " + arg); liberator.echoerr("E475: Invalid argument: " + arg);

View File

@@ -78,8 +78,8 @@ ________________________________________________________________________________
|:dpope| |:dpopen| |:dp| |:dpane| |:dislplayp| |:dislplaypane| |:dpope| |:dpopen| |:dp| |:dpane| |:dislplayp| |:dislplaypane|
||:displaypane {pane}|| + ||:displaypane {pane}|| +
________________________________________________________________________________ ________________________________________________________________________________
Open the specified display pane. {pane} is any of "content pane bottom", Open the specified display pane. {pane} is any of "service pane left", "service
"service pane bottom" or "right sidebar". pane bottom", "content pane bottom" or "right sidebar".
________________________________________________________________________________ ________________________________________________________________________________
// vim: set filetype=asciidoc: // vim: set filetype=asciidoc: