commit ba514b80d9bfdab0b0a0549a15b39d1bf2ee1185
parent 918ae234187f0dfb3db1ba380947f8ea24176f48
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 17 Jul 2017 16:32:56 -0400
Add "Remove All Tags…" option to item tags box context menu
Diffstat:
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml
@@ -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>
@@ -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"/>
@@ -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;"
diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd
@@ -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">
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
@@ -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: