-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
deb2cd0
commit d842292
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { config } from "../../package.json"; | ||
import { getLocaleID, getString } from "../utils/locale"; | ||
|
||
function example( | ||
|
@@ -53,7 +52,7 @@ export class BasicExampleFactory { | |
|
||
@example | ||
static exampleNotifierCallback() { | ||
new ztoolkit.ProgressWindow(config.addonName) | ||
new ztoolkit.ProgressWindow(addon.data.config.addonName) | ||
.createLine({ | ||
text: "Open Tab Detected!", | ||
type: "success", | ||
|
@@ -70,10 +69,10 @@ export class BasicExampleFactory { | |
@example | ||
static registerPrefs() { | ||
Zotero.PreferencePanes.register({ | ||
pluginID: config.addonID, | ||
pluginID: addon.data.config.addonID, | ||
src: rootURI + "content/preferences.xhtml", | ||
label: getString("prefs-title"), | ||
image: `chrome://${config.addonRef}/content/icons/favicon.png`, | ||
image: `chrome://${addon.data.config.addonRef}/content/icons/favicon.png`, | ||
}); | ||
} | ||
} | ||
|
@@ -92,7 +91,7 @@ export class KeyExampleFactory { | |
} | ||
}); | ||
|
||
new ztoolkit.ProgressWindow(config.addonName) | ||
new ztoolkit.ProgressWindow(addon.data.config.addonName) | ||
.createLine({ | ||
text: "Example Shortcuts: Alt+L/S/C", | ||
type: "success", | ||
|
@@ -102,7 +101,7 @@ export class KeyExampleFactory { | |
|
||
@example | ||
static exampleShortcutLargerCallback() { | ||
new ztoolkit.ProgressWindow(config.addonName) | ||
new ztoolkit.ProgressWindow(addon.data.config.addonName) | ||
.createLine({ | ||
text: "Larger!", | ||
type: "default", | ||
|
@@ -112,7 +111,7 @@ export class KeyExampleFactory { | |
|
||
@example | ||
static exampleShortcutSmallerCallback() { | ||
new ztoolkit.ProgressWindow(config.addonName) | ||
new ztoolkit.ProgressWindow(addon.data.config.addonName) | ||
.createLine({ | ||
text: "Smaller!", | ||
type: "default", | ||
|
@@ -129,7 +128,7 @@ export class UIExampleFactory { | |
properties: { | ||
type: "text/css", | ||
rel: "stylesheet", | ||
href: `chrome://${config.addonRef}/content/zoteroPane.css`, | ||
href: `chrome://${addon.data.config.addonRef}/content/zoteroPane.css`, | ||
}, | ||
}); | ||
doc.documentElement.appendChild(styles); | ||
|
@@ -138,7 +137,7 @@ export class UIExampleFactory { | |
|
||
@example | ||
static registerRightClickMenuItem() { | ||
const menuIcon = `chrome://${config.addonRef}/content/icons/[email protected]`; | ||
const menuIcon = `chrome://${addon.data.config.addonRef}/content/icons/[email protected]`; | ||
// item menuitem with icon | ||
ztoolkit.Menu.register("item", { | ||
tag: "menuitem", | ||
|
@@ -188,7 +187,7 @@ export class UIExampleFactory { | |
static async registerExtraColumn() { | ||
const field = "test1"; | ||
await Zotero.ItemTreeManager.registerColumns({ | ||
pluginID: config.addonID, | ||
pluginID: addon.data.config.addonID, | ||
dataKey: field, | ||
label: "text column", | ||
dataProvider: (item: Zotero.Item, dataKey: string) => { | ||
|
@@ -202,7 +201,7 @@ export class UIExampleFactory { | |
static async registerExtraColumnWithCustomCell() { | ||
const field = "test2"; | ||
await Zotero.ItemTreeManager.registerColumns({ | ||
pluginID: config.addonID, | ||
pluginID: addon.data.config.addonID, | ||
dataKey: field, | ||
label: "custom column", | ||
dataProvider: (item: Zotero.Item, dataKey: string) => { | ||
|
@@ -226,7 +225,7 @@ export class UIExampleFactory { | |
static registerItemPaneSection() { | ||
Zotero.ItemPaneManager.registerSection({ | ||
paneID: "example", | ||
pluginID: config.addonID, | ||
pluginID: addon.data.config.addonID, | ||
header: { | ||
l10nID: getLocaleID("item-section-example1-head-text"), | ||
icon: "chrome://zotero/skin/16/universal/book.svg", | ||
|
@@ -249,7 +248,7 @@ export class UIExampleFactory { | |
static async registerReaderItemPaneSection() { | ||
Zotero.ItemPaneManager.registerSection({ | ||
paneID: "reader-example", | ||
pluginID: config.addonID, | ||
pluginID: addon.data.config.addonID, | ||
header: { | ||
l10nID: getLocaleID("item-section-example2-head-text"), | ||
// Optional | ||
|
@@ -833,7 +832,7 @@ export class HelperExampleFactory { | |
|
||
@example | ||
static progressWindowExample() { | ||
new ztoolkit.ProgressWindow(config.addonName) | ||
new ztoolkit.ProgressWindow(addon.data.config.addonName) | ||
.createLine({ | ||
text: "ProgressWindow Example!", | ||
type: "success", | ||
|