Skip to content

Commit

Permalink
Add "Remove All Tags…" option to item tags box context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jul 17, 2017
1 parent 918ae23 commit ba514b8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
28 changes: 27 additions & 1 deletion chrome/content/zotero/bindings/tagsbox.xml
Expand Up @@ -858,6 +858,16 @@
</method>


<method name="removeAll">
<body><![CDATA[
if (Services.prompt.confirm(null, "", Zotero.getString('pane.item.tags.removeAll'))) {
this.item.setTags([]);
this.item.saveTx();
}
]]></body>
</method>


<method name="updateCount">
<parameter name="count"/>
<body>
Expand Down Expand Up @@ -984,6 +994,14 @@
</method>


<method name="_onBackgroundContextMenuShowing">
<body><![CDATA[
var removeAllTags = this.id('remove-all-item-tags');
removeAllTags.disabled = this.count == 0;
]]></body>
</method>


<!-- unused -->
<method name="getTagIndex">
<parameter name="id"/>
Expand Down Expand Up @@ -1051,7 +1069,15 @@
</method>
</implementation>
<content>
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto" class="zotero-box">
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto" class="zotero-box"
context="tags-context-menu">
<xul:popupset>
<xul:menupopup id="tags-context-menu"
onpopupshowing="document.getBindingParent(this)._onBackgroundContextMenuShowing()">
<xul:menuitem id="remove-all-item-tags" label="&zotero.item.tags.removeAll;"
oncommand="document.getBindingParent(this).removeAll()"/>
</xul:menupopup>
</xul:popupset>
<xul:hbox align="center">
<xul:label id="tagsNum"/>
<xul:button id="addButton" label="&zotero.item.add;"
Expand Down
2 changes: 2 additions & 0 deletions chrome/locale/en-US/zotero/zotero.dtd
Expand Up @@ -143,6 +143,8 @@
<!ENTITY zotero.item.copyAsURL "Copy as URL">
<!ENTITY zotero.item.deletePermanently "Delete Permanently…">

<!ENTITY zotero.item.tags.removeAll "Remove All Tags…">

<!ENTITY zotero.toolbar.newNote "New Note">
<!ENTITY zotero.toolbar.note.standalone "New Standalone Note">
<!ENTITY zotero.toolbar.note.child "Add Child Note">
Expand Down
1 change: 1 addition & 0 deletions chrome/locale/en-US/zotero/zotero.properties
Expand Up @@ -354,6 +354,7 @@ pane.item.tags.count.singular = %S tag:
pane.item.tags.count.plural = %S tags:
pane.item.tags.icon.user = User-added tag
pane.item.tags.icon.automatic = Automatically added tag
pane.item.tags.removeAll = Remove all tags from this item?
pane.item.related.count.zero = %S related:
pane.item.related.count.singular = %S related:
pane.item.related.count.plural = %S related:
Expand Down

0 comments on commit ba514b8

Please sign in to comment.