From 8b82457264631dbc3e3845e3f9a8769e7c179f5b Mon Sep 17 00:00:00 2001 From: Robin Lenz Date: Mon, 18 Nov 2024 14:43:17 +0000 Subject: [PATCH] use key: value format when inserting to field "Extra" --- README.md | 2 +- bin/build | 2 +- manifest.json | 2 +- zoterocitationcounts.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1be3de4..c21eb4c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Boilerplate for this plugin was based on Zotero's sample plugin for v7 [Make-It- - Run Zotero (version 7.x) - Go to `Tools -> Add-ons` - `Install Add-on From File` -- Choose the file `zoterocitationcountsmanager-2.0.0.xpi` +- Choose the file `zoterocitationcountsmanager-2.0.1.xpi` - Restart Zotero ## License diff --git a/bin/build b/bin/build index 615cb4c..2597324 100755 --- a/bin/build +++ b/bin/build @@ -2,7 +2,7 @@ cd .. -version='2.0' +version='2.0.1' rm -f zoterocitationcountsmanager-${version}.xpi zip -r zoterocitationcountsmanager-${version}.xpi locale/* manifest.json bootstrap.js preferences.js preferences.xhtml prefs.js zoterocitationcounts.js diff --git a/manifest.json b/manifest.json index 07da0dd..21350aa 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Zotero Citation Counts Manager", - "version": "2.0", + "version": "2.0.1", "description": "Enhanced Citation Counts Manager for Zotero 7", "homepage_url": "https://github.com/FrLars21/ZoteroCitationCountsManager", "applications": { diff --git a/zoterocitationcounts.js b/zoterocitationcounts.js index d81604f..b1af06a 100644 --- a/zoterocitationcounts.js +++ b/zoterocitationcounts.js @@ -389,13 +389,13 @@ ZoteroCitationCounts = { * Ref: https://www.zotero.org/support/kb/item_types_and_fields#citing_fields_from_extra */ _setCitationCount: function (item, source, count) { - const pattern = /^Citations \(${source}\):|^\d+ citations \(${source}\)/i; + const pattern = /^Citations: \d+ \(${source}|^Citations \(${source}\):|^\d+ citations \(${source}\)/i; const extraFieldLines = (item.getField("extra") || "") .split("\n") .filter((line) => !pattern.test(line)); const today = new Date().toISOString().split("T")[0]; - extraFieldLines.unshift(`${count} citations (${source}) [${today}]`); + extraFieldLines.unshift(`Citations: ${count} (${source}, ${today})`); item.setField("extra", extraFieldLines.join("\n")); item.saveTx();