Add "Remove All Tags…" option to item tags box context menu

This commit is contained in:
Dan Stillman 2017-07-17 16:32:56 -04:00
parent 918ae23418
commit ba514b80d9
3 changed files with 30 additions and 1 deletions

View file

@ -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;"

View file

@ -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">

View file

@ -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: