Skip to content

Commit

Permalink
0.95.2修复自动添加时重复提示
Browse files Browse the repository at this point in the history
  • Loading branch information
redleafnew committed Nov 26, 2022
1 parent 0941a1a commit 27651d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions chrome/content/scripts/zoteroupdateifs.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,26 @@ Zotero.UpdateIFs.showDataDir = function () {

// 添加条目时自动添加影响因子及分区
Zotero.UpdateIFs.notifierCallback = {

notify: function (event, type, ids, extraData) {
var addedItems = Zotero.Items.get(ids);
var addUppdate = Zotero.Prefs.get('extensions.updateifs.add-update', true); // 是否在添加条目时更新
var items = [];
// 得到正常的条目
for (let item of addedItems) {
if (event == 'add' && addUppdate && !item.isNote() &&
item.isRegularItem() && !item.isCollection()) {
//Zotero.UpdateIFs.updateSelectedItems();// 20221126

items.push(item);// 20221126
}

}
Zotero.UpdateIFs.updateSelectedItem(items);
}
if (event == 'add' && addUppdate) {
Zotero.UpdateIFs.updateSelectedItem(items);
}
} //此处如果以“,”结尾会提示两次。

};


Expand Down
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="[email protected]"
em:name="Zotero Update IFs"
em:version="0.95.1"
em:version="0.95.2"
em:type="2"
em:creator="Minyi Han"
em:description="Zotero plugin for update IF from http://sci.justscience.cn/"
Expand Down
6 changes: 3 additions & 3 deletions update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.95.1</em:version>
<em:version>0.95.2</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>[email protected]</em:id>
<em:minVersion>5.0.0</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/redleafnew/zotero-updateifs/releases/download/0.95.1/zotero-updateifs.xpi</em:updateLink>
<em:updateLink>https://github.com/redleafnew/zotero-updateifs/releases/download/0.95.2/zotero-updateifs.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>

Expand All @@ -21,7 +21,7 @@
<em:id>[email protected]</em:id>
<em:minVersion>4.999</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/redleafnew/zotero-updateifs/releases/download/0.95.1/zotero-updateifs.xpi</em:updateLink>
<em:updateLink>https://github.com/redleafnew/zotero-updateifs/releases/download/0.95.2/zotero-updateifs.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>

Expand Down

0 comments on commit 27651d4

Please sign in to comment.