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:
parent
c64e5c841f
commit
785954f4f5
6 changed files with 130 additions and 138 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;"/>
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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,129 +36,127 @@
|
||||||
<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"/>
|
<toolbar>
|
||||||
<label value="1.0 Alpha"/>
|
<toolbarbutton id="tb-collection-add" tooltiptext="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
|
||||||
<label class="text-link" value="About..." onclick="window.openDialog('chrome://scholar/content/about.xul','about','chrome,modal');"/>
|
<toolbarbutton id="tb-collection-rename" tooltiptext="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/>
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
<toolbarbutton id="tb-fullscreen" tooltiptext="Toggle Fullscreen" oncommand="ScholarPane.fullScreen();"/>
|
<toolbarbutton id="tb-collection-menu" type="menu">
|
||||||
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/>
|
<menupopup>
|
||||||
</toolbar>
|
<menuitem label="Import..." oncommand="Scholar_File_Interface.importFile();"/>
|
||||||
<hbox flex="1">
|
<menuitem label="Export Library..." oncommand="Scholar_File_Interface.exportFile();"/>
|
||||||
<vbox id="collections-pane" persist="width">
|
</menupopup>
|
||||||
<toolbar>
|
</toolbarbutton>
|
||||||
<toolbarbutton id="tb-collection-add" tooltiptext="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
|
</toolbar>
|
||||||
<toolbarbutton id="tb-collection-rename" tooltiptext="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/>
|
<tree id="collections-tree" hidecolumnpicker="true" context="scholar-collectionmenu"
|
||||||
<spacer flex="1"/>
|
onselect="ScholarPane.onCollectionSelected();" seltype="single"
|
||||||
<toolbarbutton id="tb-collection-menu" type="menu">
|
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
|
||||||
<menupopup>
|
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getCollectionsView());"
|
||||||
<menuitem label="Import..." oncommand="Scholar_File_Interface.importFile();"/>
|
onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteSelectedCollection(); return false; }"
|
||||||
<menuitem label="Export Library..." oncommand="Scholar_File_Interface.exportFile();"/>
|
flex="1">
|
||||||
</menupopup>
|
<treecols>
|
||||||
</toolbarbutton>
|
<treecol
|
||||||
</toolbar>
|
id="name_column"
|
||||||
<tree id="collections-tree" hidecolumnpicker="true" context="scholar-collectionmenu"
|
label="&collections.name_column;"
|
||||||
onselect="ScholarPane.onCollectionSelected();" seltype="single"
|
flex="1"
|
||||||
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
|
primary="true"/>
|
||||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getCollectionsView());"
|
</treecols>
|
||||||
onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteSelectedCollection(); return false; }"
|
<treechildren/>
|
||||||
flex="1">
|
</tree>
|
||||||
<treecols>
|
</vbox>
|
||||||
<treecol
|
<splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/>
|
||||||
id="name_column"
|
<vbox id="items-pane" persist="width" flex="1">
|
||||||
label="&collections.name_column;"
|
<toolbar align="center">
|
||||||
flex="1"
|
<toolbarbutton id="tb-add" tooltiptext="&toolbar.newItem.label;" type="menu">
|
||||||
primary="true"/>
|
<menupopup/>
|
||||||
</treecols>
|
</toolbarbutton>
|
||||||
<treechildren/>
|
<toolbarbutton label="New Note" oncommand="ScholarPane.openNoteWindow();"/>
|
||||||
</tree>
|
<spacer flex="1"/>
|
||||||
</vbox>
|
<label value="&toolbar.search.label;" control="tb-search"/>
|
||||||
<splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/>
|
<textbox id="tb-search" type="timed" timeout="250" command="cmd_scholar_search"/>
|
||||||
<vbox id="items-pane" persist="width" flex="1">
|
</toolbar>
|
||||||
<toolbar align="center">
|
<hbox id="scholar-search-options" hidden="true">
|
||||||
<toolbarbutton id="tb-add" tooltiptext="&toolbar.newItem.label;" type="menu">
|
<hbox>
|
||||||
<menupopup/>
|
<toolbarbutton type="checkbox" label="Entire Item" checked="true" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
||||||
</toolbarbutton>
|
<toolbarbutton type="checkbox" label="Info" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
||||||
<toolbarbutton label="New Note" oncommand="ScholarPane.openNoteWindow();"/>
|
<toolbarbutton type="checkbox" label="Notes" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
||||||
<spacer flex="1"/>
|
<toolbarbutton type="checkbox" label="Files" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
||||||
<label value="&toolbar.search.label;" control="tb-search"/>
|
|
||||||
<textbox id="tb-search" type="timed" timeout="250" command="cmd_scholar_search"/>
|
|
||||||
</toolbar>
|
|
||||||
<hbox id="scholar-search-options" hidden="true">
|
|
||||||
<hbox>
|
|
||||||
<toolbarbutton type="checkbox" label="Entire Item" checked="true" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
|
||||||
<toolbarbutton type="checkbox" label="Info" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
|
||||||
<toolbarbutton type="checkbox" label="Notes" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
|
||||||
<toolbarbutton type="checkbox" label="Files" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
|
|
||||||
</hbox>
|
|
||||||
<spacer flex="1"/>
|
|
||||||
<toolbarbutton label="Save"/>
|
|
||||||
<toolbarbutton label="&scholar.plus;"/>
|
|
||||||
</hbox>
|
</hbox>
|
||||||
<tree
|
<spacer flex="1"/>
|
||||||
id="items-tree" context="scholar-itemmenu"
|
<toolbarbutton label="Save"/>
|
||||||
enableColumnDrag="true" onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteSelectedItem(); return false; }"
|
<toolbarbutton label="&scholar.plus;"/>
|
||||||
onselect="ScholarPane.itemSelected();"
|
</hbox>
|
||||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getItemsView());"
|
<tree
|
||||||
ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getItemsView())"
|
id="items-tree" context="scholar-itemmenu"
|
||||||
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
|
enableColumnDrag="true" onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteSelectedItem(); return false; }"
|
||||||
ondblclick="document.getElementById('scholar-view-splitter').setAttribute('state','open');"
|
onselect="ScholarPane.itemSelected();"
|
||||||
flex="1">
|
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getItemsView());"
|
||||||
<treecols>
|
ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getItemsView())"
|
||||||
<treecol
|
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
|
||||||
id="title" primary="true"
|
ondblclick="document.getElementById('scholar-view-splitter').setAttribute('state','open');"
|
||||||
label="&items.title_column;"
|
flex="1">
|
||||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
<treecols>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="title" primary="true"
|
||||||
id="firstCreator"
|
label="&items.title_column;"
|
||||||
label="&items.creator_column;"
|
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="firstCreator"
|
||||||
id="numNotes"
|
label="&items.creator_column;"
|
||||||
label="&items.numNotes_column;"
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="numNotes"
|
||||||
id="typeIcon" hidden="true"
|
label="&items.numNotes_column;"
|
||||||
label="&items.type_column;"
|
persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
width="40" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="typeIcon" hidden="true"
|
||||||
id="source" hidden="true"
|
label="&items.type_column;"
|
||||||
label="&items.source_column;"
|
width="40" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="source" hidden="true"
|
||||||
id="rights" hidden="true"
|
label="&items.source_column;"
|
||||||
label="&items.rights_column;"
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="rights" hidden="true"
|
||||||
id="dateAdded" hidden="true"
|
label="&items.rights_column;"
|
||||||
label="&items.dateAdded_column;"
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
<splitter class="tree-splitter"/>
|
<treecol
|
||||||
<treecol
|
id="dateAdded" hidden="true"
|
||||||
id="dateModified" hidden="true"
|
label="&items.dateAdded_column;"
|
||||||
label="&items.dateModified_column;"
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
<splitter class="tree-splitter"/>
|
||||||
</treecols>
|
<treecol
|
||||||
<treechildren/>
|
id="dateModified" hidden="true"
|
||||||
</tree>
|
label="&items.dateModified_column;"
|
||||||
</vbox>
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
<splitter id="scholar-view-splitter" collapse="after" persist="state"><grippy/></splitter>
|
</treecols>
|
||||||
<deck id="item-pane" selectedIndex="0">
|
<treechildren/>
|
||||||
<box pack="center" align="center"><label id="scholar-view-selected-label"/></box>
|
</tree>
|
||||||
|
</vbox>
|
||||||
|
<splitter id="scholar-view-splitter" resizebefore="closest" resizeafter="closest"/>
|
||||||
|
<vbox>
|
||||||
|
<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">
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Add table
Reference in a new issue