Skip to content

Commit

Permalink
Merge branch 'master' of github.com:windingwind/zotero-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyu committed Mar 21, 2022
2 parents a489810 + e83909b commit d166b9c
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 90 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Part of the code of this repo refers to other open-source projects within the al
- Jusminum

## My Other Zotero Add-ons
- [Zotero PDF Translate](https://github.com/windingwind/zotero-pdf-translate)
- [Zotero PDF Translate](https://github.com/windingwind/zotero-pdf-translate/): PDF translation add-on for Zotero 6
91 changes: 16 additions & 75 deletions chrome/content/overlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,23 @@
<?xml-stylesheet href="chrome://zoterotag/skin/overlay.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://zoterotag/locale/overlay.dtd">

<overlay
id="zoterotag"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<overlay id="zoterotag" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script
type="application/x-javascript"
src="chrome://zoterotag/content/scripts/zoterotag.js"/>
<script type="application/x-javascript" src="chrome://zoterotag/content/scripts/zoterotag.js" />

<commandset id="mainCommandSet">
<command id="cmd_zotero_tag_update_all" oncommand="Zotero.ZoteroTag.updateAll();"/>
</commandset>
<commandset id="mainCommandSet">
<command id="cmd_zotero_tag_update_all" oncommand="Zotero.ZoteroTag.updateAll();" />
</commandset>

<!-- <menupopup id="menu-tools-popup">
<menuseparator/>
<menuitem
id="zotero-zoterotag-updateall"
label="&zotero.zoterotag.updateAll.label;"
command="cmd_zotero_tag_update_all"
class="menuitem-iconic zotero-zoterotag-icon"/>
</menupopup> -->
<popup id="zotero-collectionmenu">
<menuseparator />
<menuitem id="zotero-collectionmenu-zoterotag-add" label="&zotero.zoterotag.add.label;" oncommand="Zotero.ZoteroTag.updateSelectedEntity('add')" class="menuitem-iconic zotero-zoterotag-icon" />
<menuitem id="zotero-collectionmenu-zoterotag-remove" label="&zotero.zoterotag.remove.label;" oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove')" class="menuitem-iconic zotero-zoterotag-remove-icon" />
</popup>


<popup id="zotero-collectionmenu">
<menuseparator/>
<menuitem
id="zotero-collectionmenu-zoterotag-add"
label="&zotero.zoterotag.add.label;&zotero.zoterotag.rules.group.default;"
oncommand="Zotero.ZoteroTag.updateSelectedEntity('add', 1)"
class="menuitem-iconic zotero-zoterotag-add-icon"/>
<menuitem
id="zotero-collectionmenu-zoterotag-remove"
label="&zotero.zoterotag.remove.label;&zotero.zoterotag.rules.group.default;"
oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove', 1)"
class="menuitem-iconic zotero-zoterotag-remove-icon"/>
<menu id="zotero-collectionmenu-zoterotag-submenu"
label="&zotero.zoterotag.submenu.label;"
class="menu-iconic zotero-zoterotag-icon">
<menupopup id="zotero-collectionmenu-zoterotag-submenu-popup">
<menuitem label="&zotero.zoterotag.add.label; 2" oncommand="Zotero.ZoteroTag.updateSelectedEntity('add', 2);"/>
<menuitem label="&zotero.zoterotag.remove.label; 2" oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove', 2);"/>
<menuitem label="&zotero.zoterotag.add.label; 3" oncommand="Zotero.ZoteroTag.updateSelectedEntity('add', 3);"/>
<menuitem label="&zotero.zoterotag.remove.label; 3" oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove', 3);"/>
<menuitem label="&zotero.zoterotag.add.label; auto" oncommand="Zotero.ZoteroTag.updateSelectedEntity('add', 0);"/>
<menuitem label="&zotero.zoterotag.remove.label; auto" oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove', 0);"/>
<menuitem label="&zotero.zoterotag.add.label;&zotero.zoterotag.rules.group.all;" oncommand="Zotero.ZoteroTag.updateSelectedEntity('add', -1);"/>
<menuitem label="&zotero.zoterotag.remove.label;&zotero.zoterotag.rules.group.all;" oncommand="Zotero.ZoteroTag.updateSelectedEntity('remove', -1);"/>
</menupopup>
</menu>
</popup>

<popup
id="zotero-itemmenu">
<menuseparator/>
<menuitem
id="zotero-itemmenu-zoterotag-add"
label="&zotero.zoterotag.add.label;&zotero.zoterotag.rules.group.default;"
oncommand="Zotero.ZoteroTag.updateSelectedItems('add', 1)"
class="menuitem-iconic zotero-zoterotag-add-icon"/>
<menuitem
id="zotero-itemmenu-zoterotag-remove"
label="&zotero.zoterotag.remove.label;&zotero.zoterotag.rules.group.default;"
oncommand="Zotero.ZoteroTag.updateSelectedItems('remove', 1)"
class="menuitem-iconic zotero-zoterotag-remove-icon"/>
<menu id="zotero-itemmenu-zoterotag-submenu"
label="&zotero.zoterotag.submenu.label;"
class="menu-iconic zotero-zoterotag-icon">
<menupopup id="zotero-itemmenu-zoterotag-submenu-popup">
<menuitem label="&zotero.zoterotag.add.label; 2" oncommand="Zotero.ZoteroTag.updateSelectedItems('add', 2);"/>
<menuitem label="&zotero.zoterotag.remove.label; 2" oncommand="Zotero.ZoteroTag.updateSelectedItems('remove', 2);"/>
<menuitem label="&zotero.zoterotag.add.label; 3" oncommand="Zotero.ZoteroTag.updateSelectedItems('add', 3);"/>
<menuitem label="&zotero.zoterotag.remove.label; 3" oncommand="Zotero.ZoteroTag.updateSelectedItems('remove', 3);"/>
<menuitem label="&zotero.zoterotag.add.label; auto" oncommand="Zotero.ZoteroTag.updateSelectedItems('add', 0);"/>
<menuitem label="&zotero.zoterotag.remove.label; auto" oncommand="Zotero.ZoteroTag.updateSelectedItems('remove', 0);"/>
<menuitem label="&zotero.zoterotag.add.label;&zotero.zoterotag.rules.group.all;" oncommand="Zotero.ZoteroTag.updateSelectedItems('add', -1);"/>
<menuitem label="&zotero.zoterotag.remove.label;&zotero.zoterotag.rules.group.all;" oncommand="Zotero.ZoteroTag.updateSelectedItems('remove', -1);"/>
</menupopup>
</menu>
</popup>
</overlay>
<popup id="zotero-itemmenu">
<menuseparator />
<menuitem id="zotero-itemmenu-zoterotag-add" label="&zotero.zoterotag.add.label;" oncommand="Zotero.ZoteroTag.updateSelectedItems('add')" class="menuitem-iconic zotero-zoterotag-icon" />
<menuitem id="zotero-itemmenu-zoterotag-remove" label="&zotero.zoterotag.remove.label;" oncommand="Zotero.ZoteroTag.updateSelectedItems('remove')" class="menuitem-iconic zotero-zoterotag-remove-icon" />
</popup>
</overlay>
9 changes: 7 additions & 2 deletions chrome/content/scripts/zoterotag.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ Zotero.ZoteroTag = {
return JSON.parse(Zotero.Prefs.get("zoterotag.rules"));
},
getTagByGroup: function (group) {
if (typeof group === "undefined") {
return prompt("Enter tags, split by ',':", "")
.replace(/\s/g, "")
.split(",");
}
if (group === 0) {
return Zotero.ZoteroTag.getTagByAuto();
}
Expand Down Expand Up @@ -226,7 +231,7 @@ Zotero.ZoteroTag = {
);
}
},
updateSelectedEntity: function (operation = "add", group = 1) {
updateSelectedEntity: function (operation = "add", group = undefined) {
Zotero.debug("ZoteroTag: Updating items in entity");
if (!ZoteroPane.canEdit()) {
ZoteroPane.displayCannotEditLibraryMessage();
Expand All @@ -251,7 +256,7 @@ Zotero.ZoteroTag = {
);
}
},
updateSelectedItems: function (operation = "add", group = 1) {
updateSelectedItems: function (operation = "add", group = undefined) {
Zotero.debug("ZoteroTag: Updating Selected items");

Zotero.ZoteroTag.updateItems(
Expand Down
9 changes: 4 additions & 5 deletions chrome/locale/en-US/overlay.dtd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!ENTITY zotero.zoterotag.add.label "Add tag Group ">
<!ENTITY zotero.zoterotag.remove.label "Remove tag Group ">
<!ENTITY zotero.zoterotag.submenu.label "Add/Remove tag by group...">
<!ENTITY zotero.zoterotag.add.label "Add tags... ">
<!ENTITY zotero.zoterotag.remove.label "Remove tags... ">
<!ENTITY zotero.zoterotag.updateAll.label "Update All Tags">
<!ENTITY zotero.zoterotag.updateCollection.label "Update Collection Tags">

Expand Down Expand Up @@ -39,5 +38,5 @@
<!ENTITY zotero.zoterotag.help.feedback.caption.label "Feedback">
<!ENTITY zotero.zoterotag.help.feedback.label "github">

<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag VERSION 0.1.3">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-16 19:35:44">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag VERSION 0.1.4">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 00:02:26">
9 changes: 4 additions & 5 deletions chrome/locale/zh-CN/overlay.dtd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!ENTITY zotero.zoterotag.add.label "添加标签组 ">
<!ENTITY zotero.zoterotag.remove.label "删除标签组 ">
<!ENTITY zotero.zoterotag.submenu.label "更多添加/删除标签组选项...">
<!ENTITY zotero.zoterotag.add.label "添加标签...">
<!ENTITY zotero.zoterotag.remove.label "删除标签...">
<!ENTITY zotero.zoterotag.updateAll.label "更新所有标签">
<!ENTITY zotero.zoterotag.updateCollection.label "更新分类下所有标签">

Expand Down Expand Up @@ -39,5 +38,5 @@
<!ENTITY zotero.zoterotag.help.feedback.caption.label "意见反馈">
<!ENTITY zotero.zoterotag.help.feedback.label "github">

<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag 版本 0.1.3">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-16 19:35:44">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag 版本 0.1.4">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 00:02:26">
Binary file modified imgs/readme-settings-rightclickmenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RDF:about="urn:mozilla:install-manifest"
em:id="zoterotag@euclpts.com"
em:name="Zotero Tag"
em:version="0.1.3"
em:version="0.1.4"
em:type="2"
em:creator="windingwind"
em:description="One add-on to rule Tags all."
Expand Down
2 changes: 1 addition & 1 deletion update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.1.3</em:version>
<em:version>0.1.4</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>zotero@chnm.gmu.edu</em:id>
Expand Down

0 comments on commit d166b9c

Please sign in to comment.