Some toggling options for the Scholar pane (persists).

This commit is contained in:
David Norton 2006-05-31 22:01:31 +00:00
parent 7f1d3edf69
commit 041e607dd7
4 changed files with 18 additions and 6 deletions

View File

@ -6,6 +6,7 @@ var ScholarPane = new function()
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
this.init = init; this.init = init;
this.toggleScholar = toggleScholar;
this.newItem = newItem; this.newItem = newItem;
this.newFolder = newFolder; this.newFolder = newFolder;
this.folderSelected = folderSelected; this.folderSelected = folderSelected;
@ -30,6 +31,14 @@ var ScholarPane = new function()
} }
} }
function toggleScholar()
{
var visible = document.getElementById('scholar-pane').getAttribute('collapsed') == 'true';
document.getElementById('scholar-pane').setAttribute('collapsed',!visible);
document.getElementById('scholar-splitter').setAttribute('collapsed',!visible);
}
function newItem(typeID) function newItem(typeID)
{ {
alert("new item of type: "+typeID); alert("new item of type: "+typeID);

View File

@ -18,7 +18,7 @@
<command id="cmd_scholar_search" oncommand="ScholarPane.search();"/> <command id="cmd_scholar_search" oncommand="ScholarPane.search();"/>
<vbox id="appcontent"> <vbox id="appcontent">
<vbox id="scholar-pane" position="1" persist="height"> <vbox id="scholar-pane" position="1" persist="height collapsed">
<hbox flex="1"> <hbox flex="1">
<tree id="folders-tree" <tree id="folders-tree"
style="-moz-user-focus: ignore;" hidecolumnpicker="true" style="-moz-user-focus: ignore;" hidecolumnpicker="true"
@ -74,7 +74,7 @@
<treechildren/> <treechildren/>
</tree> </tree>
</hbox> </hbox>
<toolbar id="scholar-toolbar"> <toolbar id="scholar-toolbar" align="center">
<toolbarbutton label="&menuitem.newFolder.label;" command="cmd_scholar_newFolder"/> <toolbarbutton label="&menuitem.newFolder.label;" command="cmd_scholar_newFolder"/>
<toolbarbutton id="tb-add" label="&menuitem.newItem.label;" type="menu"> <toolbarbutton id="tb-add" label="&menuitem.newItem.label;" type="menu">
<menupopup> <menupopup>
@ -83,13 +83,14 @@
<spacer flex="1"/> <spacer flex="1"/>
<label value="Search:" control="tb-search"/> <label value="Search:" control="tb-search"/>
<textbox id="tb-search" type="timed" timeout="500" command="cmd_scholar_search"/> <textbox id="tb-search" type="timed" timeout="500" command="cmd_scholar_search"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleScholar()"/>
</toolbar> </toolbar>
</vbox> </vbox>
<splitter id="scholar-splitter" resizebefore="closest" resizeafter="closest" position="2"/> <splitter id="scholar-splitter" resizebefore="closest" resizeafter="closest" position="2" persist="collapsed"/>
</vbox> </vbox>
<statusbar id="status-bar"> <statusbar id="status-bar">
<statusbarpanel id="scholar-load-status" label="Scholar is NOT loaded"/> <statusbarpanel id="scholar-load-status" label="Scholar is NOT loaded" onclick="ScholarPane.toggleScholar();"/>
</statusbar> </statusbar>
<script> <script>
@ -103,7 +104,7 @@
<menupopup id="menu_ToolsPopup"> <menupopup id="menu_ToolsPopup">
<menuseparator id="scholarSeparator" insertbefore="devToolsSeparator"/> <menuseparator id="scholarSeparator" insertbefore="devToolsSeparator"/>
<menuitem id="tools-scholar" insertbefore="devToolsSeparator" <menuitem id="tools-scholar" insertbefore="devToolsSeparator"
oncommand="document.getElementById('scholar-pane').collapsed='false';" label="Scholar" oncommand="ScholarPane.toggleScholar();" label="Scholar"
key="key_openScholar"/> key="key_openScholar"/>
</menupopup> </menupopup>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?xml-stylesheet href="chrome://scholar/skin/scholar.css" type="text/css"?> <?xml-stylesheet href="chrome://scholar/skin/scholar.css" type="text/css"?>
<?xml-stylesheet href="chrome://scholar/skin/view.css" type="text/css"?> <?xml-stylesheet href="chrome://scholar/skin/view.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<page <page
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

View File

@ -2,6 +2,7 @@ vbox #scholar-pane
{ {
background: #f5f5f5; background: #f5f5f5;
min-height: 150px; min-height: 150px;
padding: 4px;
} }
tree #folders-tree tree #folders-tree
@ -22,7 +23,7 @@ tree #items-tree
#scholar-toolbar #scholar-toolbar
{ {
border-bottom: none;
} }
#scholar-toolbar toolbarbutton #scholar-toolbar toolbarbutton