Skip to content

Commit

Permalink
更新依赖,修复构建错误
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed Jan 12, 2025
1 parent 34a2881 commit ed2df3d
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 10 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 0 additions & 1 deletion addon/locale/zh-CN/addon.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ delete-item-and-attachment =
[one] 您确定将所选条目包括附件移动到回收站? 链接的附件不可恢复。
*[other] 您确定将所选{$count}个条目包括附件移动到回收站? 链接的附件不可恢复。
}
delete-collection-and-attachment = 您确定将所选分类包括附件移动到回收站? 链接的附件不可恢复。
delete-attachment-only =
{$count ->
[one] 您确定将所选条目的附件移动到回收站? 链接的附件不可恢复。
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
},
"homepage": "https://github.com/redleafnew/delitemwithatt",
"dependencies": {
"trash": "^8.1.1",
"zotero-plugin": "^2.0.34",
"zotero-plugin-toolkit": "^4.1.1"
},
"devDependencies": {
Expand All @@ -41,7 +39,7 @@
"typescript": "^5.7.3",
"typescript-eslint": "^8.19.1",
"zotero-plugin-scaffold": "^0.1.7",
"zotero-types": "^1.3.24"
"zotero-types": "^3.1.2"
},
"prettier": {}
}
5 changes: 3 additions & 2 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function onStartup() {
initLocale();
ztoolkit.ProgressWindow.setIconURI(
"default",
`chrome://${config.addonRef}/content/icons/favicon.png`
`chrome://${config.addonRef}/content/icons/favicon.png`,
);

const popupWin = new ztoolkit.ProgressWindow(config.addonName, {
Expand All @@ -40,7 +40,7 @@ async function onStartup() {

// @ts-ignore 忽略 onSelect
ZoteroPane.collectionsView.onSelect.addListener(
UIExampleFactory.displayColMenuitem
UIExampleFactory.displayColMenuitem,
); //监听分类右键显示菜单
// @ts-ignore 忽略 onSelect
ZoteroPane.itemsView.onSelect.addListener(UIExampleFactory.displayMenuitem); //监听右键显示菜单
Expand Down Expand Up @@ -68,6 +68,7 @@ function onShutdown(): void {
ztoolkit.unregisterAll();
// Remove addon object
addon.data.alive = false;
// @ts-ignore types undefined
delete Zotero.delitemwithatt;
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Addon from "./addon";
import { config } from "../package.json";

const basicTool = new BasicTool();

// @ts-ignore types undefined
if (!basicTool.getGlobal("Zotero")[config.addonInstance]) {
// Set global variables
_globalThis.Zotero = basicTool.getGlobal("Zotero");
Expand All @@ -20,7 +20,7 @@ if (!basicTool.getGlobal("Zotero")[config.addonInstance]) {
addon.data.env === "development";
ztoolkit.basicOptions.debug.disableDebugBridgePassword =
addon.data.env === "development";
// @ts-ignore types undefined
Zotero[config.addonInstance] = addon;
// Trigger addon hook for initialization
addon.hooks.onStartup();
}
3 changes: 1 addition & 2 deletions zotero-plugin.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from "zotero-plugin-scaffold";
import pkg from "./package.json";
import { copyFileSync } from "node:fs";

export default defineConfig({
source: ["src", "addon"],
Expand Down Expand Up @@ -32,7 +31,7 @@ export default defineConfig({
},
bundle: true,
target: "firefox115",
outfile: `build/addon/chrome/content/scripts/index.js`,
outfile: `build/addon/content/scripts/${pkg.config.addonRef}.js`,
},
],
makeUpdateJson: {
Expand Down

0 comments on commit ed2df3d

Please # to comment.