Command-shift-S should now work as soon as you start Firefox.

Lots of localization, moving style out of XUL and into overlay.css
This commit is contained in:
David Norton 2006-06-21 23:22:37 +00:00
parent 27025befef
commit 718d613cdc
9 changed files with 97 additions and 75 deletions

View file

@ -129,7 +129,7 @@ ScholarItemPane = new function()
function changeTypeTo(id) function changeTypeTo(id)
{ {
if(id != _itemBeingEdited.getType() && confirm('Are you sure you want to change the item type? Certain fields may be lost.')) if(id != _itemBeingEdited.getType() && confirm(Scholar.getString('pane.item.changeType')))
{ {
_itemBeingEdited.setType(id); _itemBeingEdited.setType(id);
_itemBeingEdited.save(); _itemBeingEdited.save();
@ -321,7 +321,7 @@ ScholarItemPane = new function()
function removeSelectedNote() function removeSelectedNote()
{ {
if(_notesField.value != "") if(_notesField.value != "")
if(!confirm("Are you sure you want to delete the selected note?")) if(!confirm(Scholar.getString('pane.item.notes.delete.confirm')))
return; return;
var id = _selectedNoteID(); var id = _selectedNoteID();
@ -348,7 +348,7 @@ ScholarItemPane = new function()
function addNote() function addNote()
{ {
modifySelectedNote(); modifySelectedNote();
_notesMenu.appendItem('Untitled Note',null); _notesMenu.appendItem(Scholar.getString('pane.item.notes.untitled'),null);
_notesMenu.selectedIndex = _notesMenu.firstChild.childNodes.length-1; _notesMenu.selectedIndex = _notesMenu.firstChild.childNodes.length-1;
onNoteSelected(); onNoteSelected();
@ -380,7 +380,7 @@ ScholarItemPane = new function()
if(t == "") if(t == "")
{ {
return "Untitled Note"; return Scholar.getString('pane.item.notes.untitled');
} }
else else
{ {
@ -392,7 +392,7 @@ ScholarItemPane = new function()
{ {
var c = _notesMenu.firstChild.childNodes.length; var c = _notesMenu.firstChild.childNodes.length;
_notesLabel.value = c + " note" + (c != 1 ? "s" : "") + ":"; _notesLabel.value = Scholar.getString('pane.item.notes.count.'+(c != 1 ? "plural" : "singular")).replace('%1',c) + ":";
} }
function _selectedNoteID() function _selectedNoteID()

View file

@ -5,12 +5,12 @@
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" style="margin-left: 5px;"> <tabbox id="scholar-view-item" height="1000">
<tabs> <tabs>
<tab label="Notes"/> <tab label="&tabs.notes.label;"/>
<tab label="Info"/> <tab label="&tabs.info.label;"/>
<tab label="Tags"/> <tab label="&tabs.tags.label;"/>
<tab label="Files"/> <tab label="&tabs.files.label;"/>
</tabs> </tabs>
<tabpanels flex="1"> <tabpanels flex="1">
<vbox> <vbox>
@ -19,15 +19,15 @@
<menulist flex="1" id="scholar-notes-menu" oncommand="ScholarItemPane.onNoteSelected();"> <menulist flex="1" id="scholar-notes-menu" oncommand="ScholarItemPane.onNoteSelected();">
<menupopup/> <menupopup/>
</menulist> </menulist>
<label value="-" class="clicky" onclick="ScholarItemPane.removeSelectedNote();"/> <label value="&scholar.minus;" class="clicky" onclick="ScholarItemPane.removeSelectedNote();"/>
<label value="+" class="clicky" onclick="ScholarItemPane.addNote();"/> <label value="&scholar.plus;" class="clicky" onclick="ScholarItemPane.addNote();"/>
</hbox> </hbox>
<textbox id="scholar-notes-field" <textbox id="scholar-notes-field"
type="timed" timeout="1000" oncommand="ScholarItemPane.modifySelectedNote();" type="timed" timeout="1000" oncommand="ScholarItemPane.modifySelectedNote();"
multiline="true" flex="1" multiline="true" flex="1"
onblur="ScholarItemPane.modifySelectedNote();"/> onblur="ScholarItemPane.modifySelectedNote();"/>
</vbox> </vbox>
<vbox id="scholar-metadata" flex="1"> <vbox id="scholar-info" flex="1">
<popupset> <popupset>
<popup id="creatorTypeMenu" position="after_start" oncommand="ScholarItemPane.modifyCreator(document.popupNode.getAttribute('fieldname').split('-')[1],'typeID',event.explicitOriginalTarget.getAttribute('typeid'));"/> <popup id="creatorTypeMenu" position="after_start" oncommand="ScholarItemPane.modifyCreator(document.popupNode.getAttribute('fieldname').split('-')[1],'typeID',event.explicitOriginalTarget.getAttribute('typeid'));"/>
</popupset> </popupset>

View file

@ -136,9 +136,9 @@ var ScholarPane = new function()
label.hidden = false; label.hidden = false;
if(itemsView && itemsView.selection.count) if(itemsView && itemsView.selection.count)
label.value = itemsView.selection.count + " items selected"; label.value = Scholar.getString('pane.item.selected.multiple').replace('%1', itemsView.selection.count);
else else
label.value = "No items selected"; label.value = Scholar.getString('pane.item.selected.zero');
} }
} }
@ -218,9 +218,9 @@ var ScholarPane = new function()
menu.childNodes[2].setAttribute('disabled', true); menu.childNodes[2].setAttribute('disabled', true);
if(itemsView && itemsView.selection.count > 1) if(itemsView && itemsView.selection.count > 1)
menu.childNodes[2].setAttribute('label', 'Remove Selected Items...'); menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove.multiple'));
else else
menu.childNodes[2].setAttribute('label', 'Remove Selected Item...'); menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove'));
} }
} }

View file

@ -26,22 +26,22 @@
<menuitem label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/> <menuitem label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
<menuseparator/> <menuseparator/>
<menuitem label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();"/> <menuitem label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();"/>
<menuitem label="Remove Project..." oncommand="ScholarPane.deleteSelectedCollection();"/> <menuitem label="&toolbar.removeCollection.label;" oncommand="ScholarPane.deleteSelectedCollection();"/>
</popup> </popup>
<popup id="scholar-itemmenu" onpopupshowing="ScholarPane.buildItemContextMenu();"> <popup id="scholar-itemmenu" onpopupshowing="ScholarPane.buildItemContextMenu();">
<menuitem label="&toolbar.newItem.label;" command="cmd_scholar_newItem"/> <menuitem label="&toolbar.newItem.label;" command="cmd_scholar_newItem"/>
<menuseparator/> <menuseparator/>
<menuitem label="Remove Item..." oncommand="ScholarPane.deleteSelectedItem();"/> <menuitem oncommand="ScholarPane.deleteSelectedItem();"/>
</popup> </popup>
</popupset> </popupset>
<toolbar align="end"> <toolbar align="end">
<label value="Scholar" style="font-size: larger;"/> <label value="Scholar" id="scholar-toolbar-name"/>
<label value="1.0 Alpha"/> <label value="1.0 Alpha"/>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/> <toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/>
</toolbar> </toolbar>
<hbox flex="1"> <hbox flex="1">
<vbox persist="width" width="200" style="min-width: 150px;"> <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"/>
@ -63,7 +63,7 @@
</tree> </tree>
</vbox> </vbox>
<splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/> <splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/>
<vbox persist="width" flex="1" style="min-width: 300px;"> <vbox id="items-pane" persist="width" flex="1">
<toolbar align="center"> <toolbar align="center">
<toolbarbutton id="tb-add" tooltiptext="&toolbar.newItem.label;" type="menu"> <toolbarbutton id="tb-add" tooltiptext="&toolbar.newItem.label;" type="menu">
<menupopup/> <menupopup/>
@ -81,7 +81,7 @@
</hbox> </hbox>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton label="Save"/> <toolbarbutton label="Save"/>
<toolbarbutton label="+"/> <toolbarbutton label="&scholar.plus;"/>
</hbox> </hbox>
<tree <tree
id="items-tree" context="scholar-itemmenu" id="items-tree" context="scholar-itemmenu"
@ -137,7 +137,7 @@
</tree> </tree>
</vbox> </vbox>
<splitter id="scholar-view-splitter" collapse="after" persist="state"><grippy/></splitter> <splitter id="scholar-view-splitter" collapse="after" persist="state"><grippy/></splitter>
<box width="300" style="min-width: 300px;" pack="center" align="center"> <box id="item-pane" pack="center" align="center">
<label id="scholar-view-selected-label"/> <label id="scholar-view-selected-label"/>
<tabbox id="scholar-view-item" hidden="true" flex="1"/> <tabbox id="scholar-view-item" hidden="true" flex="1"/>
</box> </box>
@ -168,6 +168,7 @@
<keyset id="mainKeyset"> <keyset id="mainKeyset">
<key id="key_openScholar" <key id="key_openScholar"
key="S" key="S"
oncommand="ScholarPane.toggleDisplay();"
modifiers="shift accel" /> modifiers="shift accel" />
</keyset> </keyset>
</overlay> </overlay>

View file

@ -12,7 +12,7 @@
<dialogheader id="header" title="&scholar.name;" description="&scholar.preferences.title;"/> <dialogheader id="header" title="&scholar.name;" description="&scholar.preferences.title;"/>
<checkbox id="autoUpdateBox" label="Automatically check for updated scrapers"/> <checkbox id="autoUpdateBox" label="&scholar.preferences.autoUpdate.label;"/>
</dialog> </dialog>

View file

@ -1,2 +1,3 @@
<!ENTITY scholar.name "Scholar"> <!ENTITY scholar.name "Scholar">
<!ENTITY scholar.preferences.title "Scholar Preferences"> <!ENTITY scholar.preferences.title "Scholar Preferences">
<!ENTITY scholar.preferences.autoUpdate.label "Automatically check for updated scrapers">

View file

@ -1,12 +1,12 @@
<!ENTITY scholar.name "Scholar"> <!ENTITY scholar.name "Scholar">
<!ENTITY metadata.label "Metadata"> <!ENTITY tabs.info.label "Info">
<!ENTITY notes.label "Notes"> <!ENTITY tabs.notes.label "Notes">
<!ENTITY tabs.tags.label "Tags">
<!ENTITY tabs.files.label "Files">
<!ENTITY metadata.creators.label "Creators"> <!ENTITY scholar.minus "-">
<!ENTITY metadata.edit.label "Edit"> <!ENTITY scholar.plus "+">
<!ENTITY metadata.cancel.label "Cancel">
<!ENTITY metadata.save.label "Save">
<!ENTITY items.type_column "Type"> <!ENTITY items.type_column "Type">
<!ENTITY items.title_column "Title"> <!ENTITY items.title_column "Title">
@ -20,12 +20,8 @@
<!ENTITY collections.name_column "Name"> <!ENTITY collections.name_column "Name">
<!ENTITY toolbar.newItem.label "New Item"> <!ENTITY toolbar.newItem.label "New Item">
<!ENTITY toolbar.removeItem.label "Remove Item...">
<!ENTITY toolbar.newCollection.label "New Project"> <!ENTITY toolbar.newCollection.label "New Project">
<!ENTITY toolbar.renameCollection.label "Rename Project..."> <!ENTITY toolbar.renameCollection.label "Rename Project...">
<!ENTITY toolbar.search.label "Search:"> <!ENTITY toolbar.removeCollection.label "Remove Project...">
<!ENTITY toolbar.metadata.label "Metadata"> <!ENTITY toolbar.search.label "Search:">
<!ENTITY toolbar.notes.label "Notes">
<!ENTITY closeCmd.label "Close">
<!ENTITY closeCmd.accesskey "C">
<!ENTITY closeCmd.commandkey "W">

View file

@ -1,13 +1,22 @@
pane.items.delete = Are you sure you want to delete the selected item?
pane.items.delete.multiple = Are you sure you want to delete the selected items?
pane.collections.delete = Are you sure you want to delete the selected project? pane.collections.delete = Are you sure you want to delete the selected project?
pane.collections.delete.multiple = Are you sure you want to delete the selected projects? pane.collections.delete.multiple = Are you sure you want to delete the selected projects?
pane.collections.rename = Rename Project: pane.collections.rename = Rename Project:
pane.collections.library = My Library
pane.collections.library = Library
pane.collections.untitled = Untitled Project pane.collections.untitled = Untitled Project
metadata.savechanges = Do you want to save changes to '%1'? pane.items.delete = Are you sure you want to delete the selected item?
pane.items.delete.multiple = Are you sure you want to delete the selected items?
pane.items.menu.remove = Remove Selected Item...
pane.items.menu.remove.multiple = Remove Selected Items...
pane.item.selected.zero = No items selected
pane.item.selected.multiple = %1 items selected
pane.item.changeType = Are you sure you want to change the item type? Certain fields may be lost.
pane.item.notes.untitled = Untitled Note
pane.item.notes.delete.confirm = Are you sure you want to delete the selected note?
pane.item.notes.count.singular = %1 note
pane.item.notes.count.plural = %1 notes
itemFields.title = Title itemFields.title = Title
itemFields.dateAdded = Date Added itemFields.dateAdded = Date Added
@ -15,7 +24,6 @@ itemFields.dateModified = Modified
itemFields.source = Source itemFields.source = Source
itemFields.rights = Rights itemFields.rights = Rights
itemFields.notes = Notes itemFields.notes = Notes
itemFields.series = Series itemFields.series = Series
itemFields.volume = Volume itemFields.volume = Volume
itemFields.number = Number itemFields.number = Number

View file

@ -5,10 +5,11 @@ vbox #scholar-pane
padding: 4px; padding: 4px;
} }
tree #collections-tree #collections-pane
{ {
min-width: 100px; min-width: 150px;
max-width: 200px; max-width: 200px;
width: 150px;
} }
#collections-tree treechildren::-moz-tree-image #collections-tree treechildren::-moz-tree-image
@ -21,9 +22,37 @@ tree #collections-tree
background: #f5f5f5; background: #f5f5f5;
} }
tree #items-tree #items-pane
{ {
min-width: 300px;
}
#item-pane
{
width: 300px;
min-width: 300px;
}
#scholar-pane toolbar
{
border-bottom: none;
background: #f5f5f5;
height: 24px;
}
#scholar-pane toolbar toolbarbutton
{
}
#scholar-pane toolbar .toggler
{
margin: 4px;
}
#scholar-toolbar-name
{
font-size: larger;
} }
#tb-collection-add #tb-collection-add
@ -46,38 +75,12 @@ tree #items-tree
list-style-image: url('chrome://scholar/skin/toolbar-item-add.png'); list-style-image: url('chrome://scholar/skin/toolbar-item-add.png');
} }
#scholar-pane toolbar
{
border-bottom: none;
background: #f5f5f5;
height: 24px;
}
#scholar-pane toolbar toolbarbutton
{
}
#scholar-pane toolbar .toggler
{
margin: 4px;
}
#tb-search #tb-search
{ {
width: 150px; width: 150px;
} }
#scholar-splitter #scholar-info
{
border-top: none;
border-bottom: 1px solid #A3A3A3;
min-height: 4px;
max-height: 4px;
background: #f5f5f5 !important;
}
#scholar-metadata
{ {
overflow: auto; overflow: auto;
} }
@ -87,6 +90,10 @@ tree #items-tree
-moz-user-focus: ignore; -moz-user-focus: ignore;
} }
#scholar-view-item
{
margin-left: 5px;
}
#scholar-view-item tabpanels #scholar-view-item tabpanels
{ {
padding: 8px 0px 0px 0px; padding: 8px 0px 0px 0px;
@ -106,4 +113,13 @@ tree #items-tree
textbox[multiline="true"][type="timed"] textbox[multiline="true"][type="timed"]
{ {
-moz-binding: url('chrome://scholar/content/customControls.xml#timed-textarea'); -moz-binding: url('chrome://scholar/content/customControls.xml#timed-textarea');
}
#scholar-splitter
{
border-top: none;
border-bottom: 1px solid #A3A3A3;
min-height: 4px;
max-height: 4px;
background: #f5f5f5 !important;
} }