Skip to content

Commit

Permalink
fix: auto-add problem
Browse files Browse the repository at this point in the history
Remove out-dated params in auto-add to fix this problem.
  • Loading branch information
windingwind committed Mar 9, 2021
1 parent 9dabf92 commit 4265332
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 37 deletions.
Binary file removed builds/zotero-tag-0.0.8.xpi
Binary file not shown.
Binary file added builds/zotero-tag-0.0.9.xpi
Binary file not shown.
7 changes: 0 additions & 7 deletions chrome/content/scripts/preferences.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
initPreferences = function() {
// tag_name = Zotero.ZoteroTag.tag_name();
// automatic_add_tag_bool = Zotero.ZoteroTag.automatic_add_tag();

// // Apply setting to
// document.getElementById('id-zoterotag-automatic-add-tag').checked = automatic_add_tag_bool
// document.getElementById('id-zoterotag-tag-name').value = tag_name

let rules = Zotero.ZoteroTag.rules();
Zotero.debug("ZoteroTag: Initialize preferences.");
Zotero.debug(rules);
Expand Down
24 changes: 2 additions & 22 deletions chrome/content/scripts/zoterotag.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ Zotero.ZoteroTag = {
}
return tags;
},

// tag_name: function() {
// // Set default if not set.
// if(Zotero.Prefs.get('zoterotag.tag_name') === undefined) {
// Zotero.Prefs.set('zoterotag.tag_name', '\\unread')
// }
// var tag_names = Zotero.Prefs.get('zoterotag.tag_name')
// return tag_names.split(',')
// },
// automatic_add_tag: function() {
// // Set default if not set.
// if(Zotero.Prefs.get('zoterotag.automatic_add_tag') === undefined) {
// Zotero.Prefs.set('zoterotag.automatic_add_tag', true)
// }
// return Zotero.Prefs.get('zoterotag.automatic_add_tag')
// },
init: function() {
Zotero.ZoteroTag.resetState();
// Zotero.ZoteroTag.tag_name();
Expand All @@ -108,11 +92,9 @@ Zotero.ZoteroTag = {
notifierCallback: {
// Adds pdfs when new item is added to zotero.
notify: function(event, type, ids, extraData) {
automatic_add_tag_bool = Zotero.Prefs.get('zoterotag.automatic_add_tag');
Zotero.debug('ZoteroTag: add items when event == add: ' + automatic_add_tag_bool);
if(event == "add" && type=='item' && !(automatic_add_tag_bool === undefined) && automatic_add_tag_bool == true) {
Zotero.debug('ZoteroTag: add items when event == add');
if(event == "add" && type=='item') {
Zotero.debug('ZoteroTag: first try')

Zotero.ZoteroTag.updateItems(Zotero.Items.get(ids), 'add', Zotero.ZoteroTag.getTagByAuto());
}

Expand All @@ -135,8 +117,6 @@ Zotero.ZoteroTag = {
// }
}
},
// keyset: {},

initKeys: function() {
let shortcuts = [];
// init shortcuts
Expand Down
4 changes: 2 additions & 2 deletions chrome/locale/en-US/overlay.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -38,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.0.8">
<!ENTITY zotero.zoterotag.help.releasetime.label "2021-03-05 16:56:16">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag VERSION 0.0.9">
<!ENTITY zotero.zoterotag.help.releasetime.label "2021-03-09 10:08:44">
4 changes: 2 additions & 2 deletions chrome/locale/zh-CN/overlay.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -38,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.0.8">
<!ENTITY zotero.zoterotag.help.releasetime.label "2021-03-05 16:56:16">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag 版本 0.0.9">
<!ENTITY zotero.zoterotag.help.releasetime.label "2021-03-09 10:08:44">
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.0.8"
em:version="0.0.9"
em:type="2"
em:creator="windingwind"
em:description="Zotero plugin for automatically add tag for an added item."
Expand Down
6 changes: 3 additions & 3 deletions update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.0.8</em:version>
<em:version>0.0.9</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>zotero@chnm.gmu.edu</em:id>
<em:minVersion>5.0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
<em:updateLink>https://github.com/windingwind/zotero-tag/releases/download/v0.0.8/zotero-tag-0.0.8.xpi</em:updateLink>
<em:updateLink>https://github.com/windingwind/zotero-tag/releases/download/v0.0.9/zotero-tag-0.0.9.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>
<em:targetApplication>
<rdf:Description>
<em:id>juris-m@juris-m.github.io</em:id>
<em:minVersion>5.0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
<em:updateLink>https://github.com/windingwind/zotero-tag/releases/download/v0.0.8/zotero-tag-0.0.8.xpi</em:updateLink>
<em:updateLink>https://github.com/windingwind/zotero-tag/releases/download/v0.0.9/zotero-tag-0.0.9.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>
</rdf:Description>
Expand Down

0 comments on commit 4265332

Please sign in to comment.