diff --git a/README.md b/README.md index 2a23664..5a83307 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,27 @@ A plugin that does one thing only: **Detect** and **Manage** duplicate items in # Changelog -## v3.0.1 +## v3.0.2
Click here to show more. In this version, we have made the following changes: +1. 🐛 **FIX!**: We have fixed the progress window icon bug in Zotero 7.0.0-beta.77. +2. 🧬 **CHANGE!**: We have updated the style of duplicate detection dialog. +3. 🧬 **CHANGE!**: We have updated the icon style in preference pane. +4. 🧬 **CHANGE!**: Items with different `itemType` will not be considered as duplicates. + +
+ +## v3.0.1 + +
+ Click here to show more. + +In this version, we have made the following changes: + 1. 🧬 **CHANGE!**: We have updated the UI of buttons in the duplicate pane. 2. 🐛 **FIX!**: We have optimized the performance of duplicate search and detection. @@ -58,7 +72,7 @@ In this version, we have made the following changes: ## v3.0.0 -
+
Click here to show more. In this version, we have made the following changes: diff --git a/addon/chrome/content/icons/preficon.svg b/addon/chrome/content/icons/preficon.svg index 1157032..a46fc6f 100644 --- a/addon/chrome/content/icons/preficon.svg +++ b/addon/chrome/content/icons/preficon.svg @@ -1,4 +1,4 @@ - - + + diff --git a/package.json b/package.json index a86a37e..2675029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zoplicate", - "version": "3.0.1", + "version": "3.0.2", "description": "Detect and manage duplicate items in Zotero.", "config": { "addonName": "Zoplicate", diff --git a/src/modules/duplicates.ts b/src/modules/duplicates.ts index e42ab67..01aaa03 100644 --- a/src/modules/duplicates.ts +++ b/src/modules/duplicates.ts @@ -158,6 +158,25 @@ export class Duplicates { savePreference: false, defaultAction: Action.CANCEL, loadCallback: () => { + const cssFiles = [ + "chrome://global/skin/", + "chrome://zotero/skin/zotero.css", + "chrome://zotero/skin/overlay.css", + "chrome://zotero-platform/content/overlay.css", + "chrome://zotero-platform/content/zotero.css", + ]; + ztoolkit.log("this.document", this.document) + cssFiles.forEach((css) => { + this.document?.head.appendChild( + ztoolkit.UI.createElement(this.document, "link", { + properties: { + rel: "stylesheet", + href: css, + }, + }), + ); + }); + const defaultActionOptions = this.document?.getElementById( `act_${this.dialogData.defaultAction}`, ) as HTMLInputElement; diff --git a/src/modules/merger.ts b/src/modules/merger.ts index 4eb1294..d2e3ade 100644 --- a/src/modules/merger.ts +++ b/src/modules/merger.ts @@ -2,11 +2,16 @@ export async function merge( masterItem: Zotero.Item, otherItems: Zotero.Item[], // Already sorted ): Promise { - Zotero.CollectionTreeCache.clear(); - const masterJSON = masterItem.toJSON(); + const masterItemType = masterItem.itemTypeID; + otherItems = otherItems.filter((item) => item.itemTypeID === masterItemType); + if (otherItems.length === 0) { + return; + } + + const masterJSON = masterItem.toJSON(); const candidateJSON: { [field in Zotero.Item.DataType]?: string | unknown; } = otherItems.reduce((acc, obj) => ({ ...acc, ...obj.toJSON() }), {}); diff --git a/src/utils/ztoolkit.ts b/src/utils/ztoolkit.ts index 736b058..250aee0 100644 --- a/src/utils/ztoolkit.ts +++ b/src/utils/ztoolkit.ts @@ -22,7 +22,8 @@ function initZToolkit(_ztoolkit: ReturnType) { _ztoolkit.UI.basicOptions.ui.enableElementDOMLog = enableUILog; _ztoolkit.basicOptions.debug.disableDebugBridgePassword = __env__ === "development"; _ztoolkit.basicOptions.api.pluginID = config.addonID; - _ztoolkit.ProgressWindow.setIconURI("default", `chrome://${config.addonRef}/content/icons/preficon.svg`); + // TODO: Uncomment the following line to set the icon URI for the progress window + // _ztoolkit.ProgressWindow.setIconURI("default", `chrome://${config.addonRef}/content/icons/preficon.svg`); } import { BasicTool, makeHelperTool, unregister } from "zotero-plugin-toolkit/dist/basic"; diff --git a/update-beta.json b/update-beta.json index 7d89d97..9cd8806 100644 --- a/update-beta.json +++ b/update-beta.json @@ -3,7 +3,7 @@ "zoplicate@chenglongma.com": { "updates": [ { - "version": "3.0.1", + "version": "3.0.2", "update_link": "https://github.com/ChenglongMa/zoplicate/releases/latest/download/zoplicate.xpi", "applications": { "zotero": { diff --git a/update.json b/update.json index 7d89d97..9cd8806 100644 --- a/update.json +++ b/update.json @@ -3,7 +3,7 @@ "zoplicate@chenglongma.com": { "updates": [ { - "version": "3.0.1", + "version": "3.0.2", "update_link": "https://github.com/ChenglongMa/zoplicate/releases/latest/download/zoplicate.xpi", "applications": { "zotero": {