Tags selector fixup:

- "Display All" => "Display all tags"
- "No tags to display" message when no matching tags
- "# tags selected" in bottom left
- Dropped "Deselect Visible"
- Added vertical pipe on bottom line
- "Deselect All" => "Deselect all"
This commit is contained in:
Dan Stillman 2007-01-03 21:59:43 +00:00
parent f23d9a4aeb
commit 68e082a2fb
4 changed files with 105 additions and 38 deletions

View File

@ -151,6 +151,7 @@
}
Zotero.debug('Refreshing tags selector');
var empty = true;
var tagsToggleBox = this.id('tags-toggle');
if (fetch || this._dirty) {
@ -201,6 +202,7 @@
//Zotero.debug(2);
labels[i].setAttribute('inScope', true);
labels[i].setAttribute('hidden', false);
empty = false;
}
else {
//Zotero.debug(3);
@ -220,8 +222,38 @@
}
labels[i].setAttribute('hidden', false);
empty = false;
}
}
this.updateNumSelected();
this.id('tags-toggle').setAttribute('collapsed', empty);
this.id('no-tags-box').setAttribute('collapsed', !empty);
]]>
</body>
</method>
<method name="updateNumSelected">
<body>
<![CDATA[
var count = 0;
for (var i in this.selection) {
count++;
}
switch (count) {
case 0:
var mod = 'none';
break;
case 1:
var mod = 'singular';
break;
default:
var mod = 'plural';
}
this.id('num-selected').value = Zotero.getString('pane.tagSelector.numSelected.' + mod, [count]);
]]>
</body>
</method>
@ -252,6 +284,7 @@
</method>
<!-- Not currently used -->
<method name="selectVisible">
<body>
<![CDATA[
@ -270,6 +303,7 @@
</method>
<!-- Not currently used -->
<method name="clearVisible">
<body>
<![CDATA[
@ -278,7 +312,7 @@
var labels = tagsToggleBox.getElementsByTagName('label');
for (var i=0; i<labels.length; i++){
labels[i].setAttribute('selected', 'false');
this.selection[labels[i].value] = false;
delete this.selection[labels[i].value];
}
// Bubbles up to command
@ -335,7 +369,7 @@
// Deselect
if (label.getAttribute('selected')=='true'){
this.selection[label.value] = false;
delete this.selection[label.value];
label.setAttribute('selected', 'false');
}
// Select
@ -345,6 +379,8 @@
}
this.doCommand();
this.updateNumSelected();
]]>
</body>
</method>
@ -462,29 +498,56 @@
<xul:menuitem label="&zotero.tagSelector.deleteTag;" class="menuitem-non-iconic" oncommand="this.parentNode.parentNode.parentNode.delete(document.popupNode.getAttribute('tagID')); event.stopPropagation()"/>
</xul:menupopup>
<xul:vbox id="tags-toggle" flex="1"/>
<xul:checkbox label="&zotero.tagSelector.displayAll;"
oncommand="this.parentNode.parentNode.filterToScope = !this.checked; event.stopPropagation();">
</xul:checkbox>
<xul:hbox>
<xul:label value="&zotero.tagSelector.filter;"/>
<xul:textbox id="tags-search" flex="1" type="timed" timeout="250" dir="reverse"
oncommand="this.parentNode.parentNode.parentNode.handleKeyPress(); event.stopPropagation()"
onkeypress="if (event.keyCode == event.DOM_VK_ESCAPE) { this.parentNode.parentNode.parentNode.handleKeyPress(true); }">
<xul:toolbarbutton id="search-cancel"
oncommand="this.parentNode.focus(); this.parentNode.parentNode.parentNode.parentNode.handleKeyPress(true)" hidden="true"/>
</xul:textbox>
<xul:vbox id="no-tags-box" align="center" pack="center" flex="1">
<xul:label value="&zotero.tagSelector.noTagsToDisplay;"/>
</xul:vbox>
<xul:vbox id="tags-toggle" flex="1"/>
<xul:hbox>
<xul:hbox pack="start">
<xul:checkbox label="&zotero.tagSelector.displayAll;"
oncommand="this.parentNode.parentNode.parentNode.parentNode.filterToScope = !this.checked; event.stopPropagation();">
</xul:checkbox>
</xul:hbox>
<!--
<xul:hbox>
<!--
Disabled until there's an ANY search mode
<xul:toolbarbutton label="&zotero.tagSelector.selectVisible;" class="zotero-clicky"
oncommand="this.parentNode.parentNode.parentNode.selectVisible()"/>-->
<xul:toolbarbutton label="&zotero.tagSelector.clearVisible;" class="zotero-clicky"
oncommand="this.parentNode.parentNode.parentNode.clearVisible()"/>
<xul:toolbarbutton label="&zotero.tagSelector.clearAll;" class="zotero-clicky"
oncommand="this.parentNode.parentNode.parentNode.clearAll();"/>
<xul:radiogroup orient="horizontal">
<xul:radio label="any"/>
<xul:radio label="all"/>
</xul:radiogroup>
</xul:hbox>
-->
</xul:hbox>
<xul:hbox>
<xul:label value="&zotero.tagSelector.filter;"/>
<xul:textbox id="tags-search" flex="1" type="timed" timeout="250" dir="reverse"
oncommand="this.parentNode.parentNode.parentNode.handleKeyPress(); event.stopPropagation()"
onkeypress="if (event.keyCode == event.DOM_VK_ESCAPE) { this.parentNode.parentNode.parentNode.handleKeyPress(true); }">
<xul:toolbarbutton id="search-cancel"
oncommand="this.parentNode.focus(); this.parentNode.parentNode.parentNode.parentNode.handleKeyPress(true)" hidden="true"/>
</xul:textbox>
</xul:hbox>
<xul:hbox>
<xul:hbox pack="center">
<xul:label id="num-selected"/>
</xul:hbox>
<!--
Disabled (at least) until there's an ANY search mode
<xul:toolbarbutton label="&zotero.tagSelector.selectVisible;"
oncommand="this.parentNode.parentNode.parentNode.parentNode.selectVisible()"/>
<xul:button label="&zotero.tagSelector.clearVisible;"
oncommand="this.parentNode.parentNode.parentNode.parentNode.clearVisible()"/> -->
<xul:toolbarseparator/>
<xul:hbox pack="center">
<xul:button label="&zotero.tagSelector.clearAll;"
oncommand="this.parentNode.parentNode.parentNode.parentNode.clearAll();"/>
</xul:hbox>
</xul:hbox>
</xul:groupbox>
</content>
</binding>

View File

@ -55,11 +55,12 @@
<!ENTITY zotero.toolbar.attachment.weblink "Save Link to Current Page">
<!ENTITY zotero.toolbar.attachment.snapshot "Take Snapshot of Current Page">
<!ENTITY zotero.tagSelector.noTagsToDisplay "No tags to display">
<!ENTITY zotero.tagSelector.filter "Filter:">
<!ENTITY zotero.tagSelector.displayAll "Display All">
<!ENTITY zotero.tagSelector.selectVisible "Select Visible">
<!ENTITY zotero.tagSelector.clearVisible "Deselect Visible">
<!ENTITY zotero.tagSelector.clearAll "Deselect All">
<!ENTITY zotero.tagSelector.displayAll "Display all tags">
<!ENTITY zotero.tagSelector.selectVisible "Select visible">
<!ENTITY zotero.tagSelector.clearVisible "Deselect visible">
<!ENTITY zotero.tagSelector.clearAll "Deselect all">
<!ENTITY zotero.tagSelector.renameTag "Rename Tag...">
<!ENTITY zotero.tagSelector.deleteTag "Delete Tag...">

View File

@ -21,6 +21,9 @@ pane.tagSelector.rename.title = Please enter a new name for this tag.
pane.tagSelector.rename.message = The tag will be changed in all associated items.
pane.tagSelector.delete.title = Are you sure you want to delete this tag?
pane.tagSelector.delete.message = The tag will be removed from all items.
pane.tagSelector.numSelected.none = 0 tags selected
pane.tagSelector.numSelected.singular = %S tag selected
pane.tagSelector.numSelected.plural = %S tags selected
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?

View File

@ -1,9 +1,3 @@
/* Don't focus filter textbox if pane isn't open */
zoterotagselector[collapsed=true] tags-search
{
-moz-user-focus: ignore;
}
groupbox
{
overflow: auto;
@ -21,20 +15,20 @@ checkbox
margin: .75em 0 .4em;
}
label
#tags-toggle label
{
margin-right: .2em;
padding: .15em .25em;
-moz-user-focus: ignore;
}
label[selected="true"]
#tags-toggle label[selected="true"]
{
background: #a9c6f0 !important;
}
/* Visible out-of-scope tags should be grey */
label[inScope="false"]
#tags-toggle label[inScope="false"]
{
color: #666 !important;
}
@ -46,15 +40,15 @@ label.zotero-clicky[inScope="false"]:active
background: inherit !important;
}
label[draggedOver="true"]
#tags-toggle label[draggedOver="true"]
{
color: white !important;
background: #666;
}
hbox
groupbox > hbox
{
-moz-box-align: baseline;
-moz-box-align: center;
-moz-box-pack: center;
}
@ -66,6 +60,12 @@ hbox
list-style-image: url('chrome://zotero/skin/search-cancel.png');
}
groupbox > hbox > hbox
{
-moz-box-flex: 1;
-moz-box-align: center;
}
/* Bottom buttons */
toolbarbutton.zotero-clicky
{