style: lint and prettier
This commit is contained in:
parent
67f2dcb7fc
commit
5852ecfc9f
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@ -9,20 +9,14 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Restart",
|
"name": "Restart",
|
||||||
"runtimeExecutable": "npm",
|
"runtimeExecutable": "npm",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": ["run", "restart"]
|
||||||
"run",
|
|
||||||
"restart"
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Restart in Prod Mode",
|
"name": "Restart in Prod Mode",
|
||||||
"runtimeExecutable": "npm",
|
"runtimeExecutable": "npm",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": ["run", "restart-prod"]
|
||||||
"run",
|
|
||||||
"restart-prod"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ class Addon {
|
|||||||
// Lifecycle hooks
|
// Lifecycle hooks
|
||||||
public hooks: typeof hooks;
|
public hooks: typeof hooks;
|
||||||
// APIs
|
// APIs
|
||||||
public api: {};
|
public api: object;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.data = {
|
this.data = {
|
||||||
|
@ -8,10 +8,7 @@ export function initLocale() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getString(
|
export function getString(localString: string, noReload = false): string {
|
||||||
localString: string,
|
|
||||||
noReload: boolean = false
|
|
||||||
): string {
|
|
||||||
try {
|
try {
|
||||||
return addon.data.locale?.stringBundle.GetStringFromName(localString);
|
return addon.data.locale?.stringBundle.GetStringFromName(localString);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -46,7 +46,8 @@ async function updatePrefsUI() {
|
|||||||
// with addon.data.prefs.window.document
|
// with addon.data.prefs.window.document
|
||||||
// Or bind some events to the elements
|
// Or bind some events to the elements
|
||||||
const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
|
const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
|
||||||
const tableHelper = new ztoolkit.VirtualizedTable(addon.data.prefs?.window!)
|
if (addon.data.prefs?.window == undefined) return;
|
||||||
|
const tableHelper = new ztoolkit.VirtualizedTable(addon.data.prefs?.window)
|
||||||
.setContainerId(`${config.addonRef}-table-container`)
|
.setContainerId(`${config.addonRef}-table-container`)
|
||||||
.setProp({
|
.setProp({
|
||||||
id: `${config.addonRef}-prefs-table`,
|
id: `${config.addonRef}-prefs-table`,
|
||||||
@ -122,7 +123,7 @@ function bindPrefEvents() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addon.data
|
addon.data
|
||||||
.prefs!!.window.document.querySelector(
|
.prefs!.window.document.querySelector(
|
||||||
`#zotero-prefpane-${config.addonRef}-input`
|
`#zotero-prefpane-${config.addonRef}-input`
|
||||||
)
|
)
|
||||||
?.addEventListener("change", (e) => {
|
?.addEventListener("change", (e) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user