update: toolkit 2.0.0
This commit is contained in:
parent
e2112995ad
commit
296f03944a
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@ -9,14 +9,20 @@
|
||||
"request": "launch",
|
||||
"name": "Restart",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "restart"],
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"restart"
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Restart in Prod Mode",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "restart-prod"],
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"restart-prod"
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
@ -37,7 +37,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/windingwind/zotero-addon-template#readme",
|
||||
"dependencies": {
|
||||
"zotero-plugin-toolkit": "^1.1.1"
|
||||
"zotero-plugin-toolkit": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.17",
|
||||
@ -51,4 +51,4 @@
|
||||
"typescript": "^4.9.4",
|
||||
"zotero-types": "^1.0.6"
|
||||
}
|
||||
}
|
||||
}
|
@ -130,7 +130,7 @@ function onShortcuts(type: string) {
|
||||
KeyExampleFactory.exampleShortcutSmallerCallback();
|
||||
break;
|
||||
case "confliction":
|
||||
KeyExampleFactory.exampleShortcutConflictionCallback();
|
||||
KeyExampleFactory.exampleShortcutConflictingCallback();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -17,6 +17,10 @@ if (!basicTool.getGlobal("Zotero")[config.addonInstance]) {
|
||||
ztoolkit.basicOptions.log.disableConsole = addon.data.env === "production";
|
||||
ztoolkit.UI.basicOptions.ui.enableElementJSONLog =
|
||||
addon.data.env === "development";
|
||||
ztoolkit.UI.basicOptions.ui.enableElementDOMLog =
|
||||
addon.data.env === "development";
|
||||
ztoolkit.basicOptions.debug.disableDebugBridgePassword =
|
||||
addon.data.env === "development";
|
||||
Zotero[config.addonInstance] = addon;
|
||||
// Trigger addon hook for initialization
|
||||
addon.hooks.onStartup();
|
||||
|
@ -165,16 +165,16 @@ export class KeyExampleFactory {
|
||||
}
|
||||
|
||||
@example
|
||||
static exampleShortcutConflictionCallback() {
|
||||
const conflictionGroups = ztoolkit.Shortcut.checkAllKeyConfliction();
|
||||
new ztoolkit.ProgressWindow("Check Key Confliction")
|
||||
static exampleShortcutConflictingCallback() {
|
||||
const conflictingGroups = ztoolkit.Shortcut.checkAllKeyConflicting();
|
||||
new ztoolkit.ProgressWindow("Check Key Conflicting")
|
||||
.createLine({
|
||||
text: `${conflictionGroups.length} groups of confliction keys found. Details are in the debug output/console.`,
|
||||
text: `${conflictingGroups.length} groups of conflicting keys found. Details are in the debug output/console.`,
|
||||
})
|
||||
.show(-1);
|
||||
ztoolkit.log(
|
||||
"Conflictions:",
|
||||
conflictionGroups,
|
||||
"Conflicting:",
|
||||
conflictingGroups,
|
||||
"All keys:",
|
||||
ztoolkit.Shortcut.getAll()
|
||||
);
|
||||
@ -667,7 +667,7 @@ export class HelperExampleFactory {
|
||||
|
||||
@example
|
||||
static clipboardExample() {
|
||||
new ztoolkit.Clibpoard()
|
||||
new ztoolkit.Clipboard()
|
||||
.addText(
|
||||
"",
|
||||
"text/unicode"
|
||||
|
@ -46,7 +46,7 @@ async function updatePrefsUI() {
|
||||
// with addon.data.prefs.window.document
|
||||
// Or bind some events to the elements
|
||||
const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
|
||||
const tableHelper = new ztoolkit.VirtualizedTabel(addon.data.prefs?.window!)
|
||||
const tableHelper = new ztoolkit.VirtualizedTable(addon.data.prefs?.window!)
|
||||
.setContainerId(`${config.addonRef}-table-container`)
|
||||
.setProp({
|
||||
id: `${config.addonRef}-prefs-table`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user