Fixes #116, Make full screen button text.

Fixes #115, Windows should open with Scholar Pane closed.
Fixes #105, search box loses focus after search starts.

Retooled the interface a bit, and removed the top toolbar. The close and fullscreen buttons are located to the right of the items toolbar. The item pane cannot be collapsed.
This commit is contained in:
David Norton 2006-07-17 14:09:12 +00:00
parent c64e5c841f
commit 785954f4f5
6 changed files with 130 additions and 138 deletions

View file

@ -25,6 +25,8 @@ Scholar.CollectionTreeView.prototype.setTree = function(treebox)
if(this._treebox) if(this._treebox)
return; return;
this._treebox = treebox; this._treebox = treebox;
//select Library
this.selection.select(0);
} }
/* /*

View file

@ -56,9 +56,6 @@ ScholarItemPane = new function()
*/ */
function viewItem(thisItem) function viewItem(thisItem)
{ {
if(document.commandDispatcher.focusedElement)
document.commandDispatcher.focusedElement.blur();
_itemBeingEdited = thisItem; _itemBeingEdited = thisItem;
reloadFields(); reloadFields();
@ -257,6 +254,7 @@ ScholarItemPane = new function()
t.setAttribute('value',value); t.setAttribute('value',value);
t.setAttribute('fieldname',fieldName); t.setAttribute('fieldname',fieldName);
t.setAttribute('flex','1'); t.setAttribute('flex','1');
t.className = 'fieldeditor';
var box = elem.parentNode; var box = elem.parentNode;
box.replaceChild(t,elem); box.replaceChild(t,elem);

View file

@ -5,7 +5,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="itemPane.js"/> <script src="itemPane.js"/>
<tabbox id="scholar-view-item" height="1000"> <tabbox id="scholar-view-item" flex="1">
<tabs> <tabs>
<tab label="&tabs.info.label;"/> <tab label="&tabs.info.label;"/>
<tab label="&tabs.notes.label;"/> <tab label="&tabs.notes.label;"/>

View file

@ -35,9 +35,7 @@ var ScholarPane = new function()
collectionsView = new Scholar.CollectionTreeView(); collectionsView = new Scholar.CollectionTreeView();
document.getElementById('collections-tree').view = collectionsView; document.getElementById('collections-tree').view = collectionsView;
//select Library /*
collectionsView.selection.select(0);
if(window.opener) if(window.opener)
{ {
var pane = window.opener.document.getElementById('scholar-pane'); var pane = window.opener.document.getElementById('scholar-pane');
@ -48,6 +46,7 @@ var ScholarPane = new function()
toggleDisplay(); toggleDisplay();
} }
} }
*/
//Create the add menu with each item type //Create the add menu with each item type
var addMenu = document.getElementById('tb-add').firstChild; var addMenu = document.getElementById('tb-add').firstChild;
@ -76,10 +75,10 @@ var ScholarPane = new function()
*/ */
function toggleDisplay() function toggleDisplay()
{ {
var visible = document.getElementById('scholar-pane').getAttribute('collapsed') == 'true'; var visible = document.getElementById('scholar-pane').getAttribute('hidden') == 'true';
document.getElementById('scholar-pane').setAttribute('collapsed',!visible); document.getElementById('scholar-pane').setAttribute('hidden',!visible);
document.getElementById('scholar-splitter').setAttribute('collapsed',!visible); document.getElementById('scholar-splitter').setAttribute('hidden',!visible);
if(!visible) if(!visible)
document.getElementById('content').setAttribute('collapsed', false); document.getElementById('content').setAttribute('collapsed', false);
@ -89,6 +88,7 @@ var ScholarPane = new function()
{ {
var visible = document.getElementById('content').getAttribute('collapsed') == 'true'; var visible = document.getElementById('content').getAttribute('collapsed') == 'true';
document.getElementById('content').setAttribute('collapsed', !visible); document.getElementById('content').setAttribute('collapsed', !visible);
document.getElementById('scholar-splitter').setAttribute('hidden', !visible);
} }
/* /*

View file

@ -15,14 +15,14 @@
<script src="fileInterface.js"/> <script src="fileInterface.js"/>
<commandset id="mainCommandSet"> <commandset id="mainCommandSet">
<command id="cmd_scholar_newItem" oncommand="ScholarPane.newItem(1);"/> <command id="cmd_scholar_newItem" oncommand="ScholarPane.newItem(2);"/>
<command id="cmd_scholar_newCollection" oncommand="ScholarPane.newCollection();"/> <command id="cmd_scholar_newCollection" oncommand="ScholarPane.newCollection();"/>
<command id="cmd_scholar_search" oncommand="ScholarPane.search();"/> <command id="cmd_scholar_search" oncommand="ScholarPane.search();"/>
</commandset> </commandset>
<vbox id="appcontent"> <vbox id="appcontent">
<splitter id="scholar-splitter" resizebefore="closest" resizeafter="closest" persist="collapsed"/> <splitter id="scholar-splitter" resizebefore="closest" resizeafter="closest" hidden="true"/>
<vbox id="scholar-pane" flex="1" persist="height collapsed"> <hbox id="scholar-pane" hidden="true" flex="1">
<popupset> <popupset>
<popup id="scholar-collectionmenu" onpopupshowing="ScholarPane.buildCollectionContextMenu();"> <popup id="scholar-collectionmenu" onpopupshowing="ScholarPane.buildCollectionContextMenu();">
<menuitem label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/> <menuitem label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
@ -36,16 +36,7 @@
<menuitem oncommand="ScholarPane.deleteSelectedItem();"/> <menuitem oncommand="ScholarPane.deleteSelectedItem();"/>
</popup> </popup>
</popupset> </popupset>
<toolbar align="end"> <vbox id="collections-pane" persist="width" flex="1">
<label value="Scholar" id="scholar-toolbar-name"/>
<label value="1.0 Alpha"/>
<label class="text-link" value="About..." onclick="window.openDialog('chrome://scholar/content/about.xul','about','chrome,modal');"/>
<spacer flex="1"/>
<toolbarbutton id="tb-fullscreen" tooltiptext="Toggle Fullscreen" oncommand="ScholarPane.fullScreen();"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/>
</toolbar>
<hbox flex="1">
<vbox id="collections-pane" persist="width">
<toolbar> <toolbar>
<toolbarbutton id="tb-collection-add" tooltiptext="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/> <toolbarbutton id="tb-collection-add" tooltiptext="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
<toolbarbutton id="tb-collection-rename" tooltiptext="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/> <toolbarbutton id="tb-collection-rename" tooltiptext="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/>
@ -148,17 +139,24 @@
<treechildren/> <treechildren/>
</tree> </tree>
</vbox> </vbox>
<splitter id="scholar-view-splitter" collapse="after" persist="state"><grippy/></splitter> <splitter id="scholar-view-splitter" resizebefore="closest" resizeafter="closest"/>
<deck id="item-pane" selectedIndex="0"> <vbox>
<box pack="center" align="center"><label id="scholar-view-selected-label"/></box> <toolbar align="right">
<toolbarbutton id="tb-fullscreen" label="Toggle Fullscreen" oncommand="ScholarPane.fullScreen();"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/>
</toolbar>
<deck id="item-pane" selectedIndex="0" flex="1">
<box pack="center" align="center">
<label id="scholar-view-selected-label"/>
</box>
<tabbox id="scholar-view-item" flex="1"/> <tabbox id="scholar-view-item" flex="1"/>
<vbox id="scholar-view-note" flex="1"> <vbox id="scholar-view-note" flex="1">
<noteeditor id="scholar-note-editor" flex="1"/> <noteeditor id="scholar-note-editor" flex="1"/>
<button label="Edit in a separate window" oncommand="ScholarPane.openNoteWindow(this.getAttribute('noteID'));"/> <button label="Edit in a separate window" oncommand="ScholarPane.openNoteWindow(this.getAttribute('noteID'));"/>
</vbox> </vbox>
</deck> </deck>
</hbox>
</vbox> </vbox>
</hbox>
</vbox> </vbox>
<statusbar id="status-bar"> <statusbar id="status-bar">

View file

@ -1,4 +1,4 @@
vbox #scholar-pane #scholar-pane
{ {
background: #f5f5f5; background: #f5f5f5;
min-height: 150px; min-height: 150px;
@ -8,7 +8,6 @@ vbox #scholar-pane
#collections-pane #collections-pane
{ {
min-width: 150px; min-width: 150px;
max-width: 200px;
width: 150px; width: 150px;
} }
@ -17,7 +16,7 @@ vbox #scholar-pane
margin-right: 5px; margin-right: 5px;
} }
#scholar-tree-splitter #scholar-pane splitter
{ {
background: #f5f5f5; background: #f5f5f5;
} }
@ -60,11 +59,6 @@ vbox #scholar-pane
font-size: larger; font-size: larger;
} }
#tb-fullscreen
{
list-style-image: url('chrome://scholar/skin/toolbar-fullscreen.png');
}
#tb-collection-add #tb-collection-add
{ {
list-style-image: url('chrome://scholar/skin/toolbar-collection-add.png'); list-style-image: url('chrome://scholar/skin/toolbar-collection-add.png');