diff --git a/addon/locale/en-US/mainWindow.ftl b/addon/locale/en-US/mainWindow.ftl index cdf76e0..a5ca798 100644 --- a/addon/locale/en-US/mainWindow.ftl +++ b/addon/locale/en-US/mainWindow.ftl @@ -8,3 +8,4 @@ item-section-example2-sidenav-tooltip = .tooltiptext = This is Plugin Template section (reader) item-section-example2-button-tooltip = .tooltiptext = Unregister this section +item-info-row-example-label = Example Row diff --git a/addon/locale/zh-CN/mainWindow.ftl b/addon/locale/zh-CN/mainWindow.ftl index 8174cbb..8d888e3 100644 --- a/addon/locale/zh-CN/mainWindow.ftl +++ b/addon/locale/zh-CN/mainWindow.ftl @@ -8,3 +8,4 @@ item-section-example2-sidenav-tooltip = .tooltiptext = 这是插件模板面板(阅读器) item-section-example2-button-tooltip = .tooltiptext = 移除此面板 +item-info-row-example-label = 示例行 diff --git a/src/hooks.ts b/src/hooks.ts index 635faf9..f879236 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -28,6 +28,8 @@ async function onStartup() { await UIExampleFactory.registerExtraColumnWithCustomCell(); + UIExampleFactory.registerItemPaneCustomInfoRow(); + UIExampleFactory.registerItemPaneSection(); UIExampleFactory.registerReaderItemPaneSection(); diff --git a/src/modules/examples.ts b/src/modules/examples.ts index 5c767d7..a1dab01 100644 --- a/src/modules/examples.ts +++ b/src/modules/examples.ts @@ -221,6 +221,25 @@ export class UIExampleFactory { }); } + @example + static registerItemPaneCustomInfoRow() { + Zotero.ItemPaneManager.registerInfoRow({ + rowID: "example", + pluginID: addon.data.config.addonID, + editable: true, + label: { + l10nID: getLocaleID("item-info-row-example-label"), + }, + position: "afterCreators", + onGetData: ({ item }) => { + return item.getField("title"); + }, + onSetData: ({ item, value }) => { + item.setField("title", value); + }, + }); + } + @example static registerItemPaneSection() { Zotero.ItemPaneManager.registerSection({