commit 4a00bf1f74486f44ab149ebcc19d2f0922749af2
parent 88e5d47ad8649d20b0d504bcdab359e1c880bbf3
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 10 Aug 2011 06:29:24 +0000
Compactify tag selector. Unfortunately, there seems to be a bug in Fx 4+ that makes <menuitem type="checkbox"/> not work quite right on OS X.
Diffstat:
2 files changed, 12 insertions(+), 39 deletions(-)
diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml
@@ -224,6 +224,7 @@
tagsToggleBox.removeChild(tagsToggleBox.firstChild);
}
+ var me = this;
var i=0;
for (var tagID in this._tags) {
// If the last tag was the same, add this tagID and tagType to it
@@ -236,8 +237,8 @@
continue;
}
- var label = document.createElement('label');
- label.setAttribute('onclick', "document.getBindingParent(this).handleTagClick(event, this)");
+ let label = document.createElement('label');
+ label.addEventListener('click', function(event) { me.handleTagClick(event, label) }, false);
label.className = 'zotero-clicky';
@@ -455,7 +456,8 @@
var mod = 'plural';
}
- this.id('num-selected').value = Zotero.getString('pane.tagSelector.numSelected.' + mod, [count]);
+ this.id('num-selected').label = Zotero.getString('pane.tagSelector.numSelected.' + mod, [count]);
+ this.id('deselect-all').disabled = count == 0;
]]>
</body>
</method>
@@ -868,23 +870,6 @@
<xul:vbox id="tag-controls">
<xul:hbox>
- <xul:hbox pack="start">
- <xul:checkbox id="display-all-tags" label="&zotero.tagSelector.displayAllInLibrary;"
- oncommand="var ts = document.getBindingParent(this); ts.filterToScope = !this.checked; event.stopPropagation();">
- </xul:checkbox>
- </xul:hbox>
-
- <!--
- <xul:hbox>
- <xul:radiogroup orient="horizontal">
- <xul:radio label="any"/>
- <xul:radio label="all"/>
- </xul:radiogroup>
- </xul:hbox>
- -->
- </xul:hbox>
-
- <xul:hbox>
<!-- TODO: &zotero.tagSelector.filter; is now unused -->
<xul:textbox id="tags-search" flex="1" type="search" timeout="250" dir="reverse"
oncommand="document.getBindingParent(this).handleKeyPress(); event.stopPropagation()"
@@ -892,29 +877,17 @@
<xul:toolbarbutton id="view-settings-menu" tooltiptext="&zotero.toolbar.actions.label;"
image="chrome://zotero/skin/tag-selector-menu.png" type="menu">
<xul:menupopup id="view-settings-popup">
+ <xul:menuitem id="num-selected" disabled="true"/>
+ <xul:menuitem id="deselect-all" label="&zotero.tagSelector.clearAll;"
+ oncommand="document.getBindingParent(this).clearAll(); event.stopPropagation();"/>
+ <xul:menuseparator/>
<xul:menuitem id="show-automatic" label="&zotero.tagSelector.showAutomatic;" autocheck="true" type="checkbox"
oncommand="var ts = document.getBindingParent(this); ts._dirty = true; ts.setAttribute('showAutomatic', this.getAttribute('checked') == 'true')"/>
+ <xul:menuitem id="display-all-tags" label="&zotero.tagSelector.displayAllInLibrary;" autocheck="true" type="checkbox"
+ oncommand="document.getBindingParent(this).filterToScope = !(this.getAttribute('checked') == 'true'); event.stopPropagation();"/>
</xul:menupopup>
</xul:toolbarbutton>
</xul:hbox>
-
- <xul:hbox align="center">
- <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="document.getBindingParent(this).selectVisible()"/>
- <xul:button label="&zotero.tagSelector.clearVisible;"
- oncommand="document.getBindingParent(this).clearVisible()"/> -->
- <xul:toolbarseparator/>
- <xul:hbox pack="center">
- <xul:button label="&zotero.tagSelector.clearAll;"
- oncommand="document.getBindingParent(this).clearAll(); event.stopPropagation();"/>
- </xul:hbox>
- </xul:hbox>
</xul:vbox>
</xul:groupbox>
</content>
diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd
@@ -112,7 +112,7 @@
<!ENTITY zotero.tagSelector.noTagsToDisplay "No tags to display">
<!ENTITY zotero.tagSelector.filter "Filter:">
<!ENTITY zotero.tagSelector.showAutomatic "Show Automatic">
-<!ENTITY zotero.tagSelector.displayAllInLibrary "Display all tags in this library">
+<!ENTITY zotero.tagSelector.displayAllInLibrary "Display All Tags in This Library">
<!ENTITY zotero.tagSelector.selectVisible "Select Visible">
<!ENTITY zotero.tagSelector.clearVisible "Deselect Visible">
<!ENTITY zotero.tagSelector.clearAll "Deselect All">