Home > zotero-plugin-toolkit > PreferencePaneManager > register
Register a preference pane from an xhtml, for Zotero 6 & 7.
Signature:
register(options: PrefPaneOptions): void;
Parameter |
Type |
Description |
---|---|---|
options |
See PrefPaneOptions |
void
options:
export interface PrefPaneOptions {
pluginID: string;
src: string;
id?: string;
parent?: string;
label?: string;
image?: string;
extraDTD?: string[];
scripts?: string[];
defaultXUL?: boolean;
// Only for Zotero 6
onload?: (win: Window) => any;
}
const prefsManager = new PreferencePaneManager();
function initPrefs() {
const prefOptions = {
pluginID: addonID,
src: rootURI + "chrome/content/preferences.xhtml",
label: "Template",
image: `chrome://${addonRef}/content/icons/favicon.png`,
extraDTD: [`chrome://${addonRef}/locale/overlay.dtd`],
defaultXUL: true
};
prefsManager.register(prefOptions);
};
function unInitPrefs() {
prefsManager.unregisterAll();
};
// bootstrap.js:startup initPrefs();
// bootstrap.js:shutdown unInitPrefs();