-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.js
More file actions
44 lines (32 loc) · 825 Bytes
/
bootstrap.js
File metadata and controls
44 lines (32 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* global Zotero, Services */
/* eslint-disable no-unused-vars */
var ZoteroVim;
function log(msg) {
Zotero.debug('[ZoteroVim] ' + msg);
}
async function startup({ id, version, rootURI }) {
log('Starting up v' + version);
Services.scriptloader.loadSubScript(rootURI + 'content/zoteroVim.js');
await Zotero.initializationPromise;
ZoteroVim.init({ id, version, rootURI });
for (const win of Zotero.getMainWindows()) {
ZoteroVim.addToWindow(win);
}
}
function onMainWindowLoad({ window }) {
ZoteroVim?.addToWindow(window);
}
function onMainWindowUnload({ window }) {
ZoteroVim?.removeFromWindow(window);
}
function shutdown() {
log('Shutting down');
ZoteroVim?.shutdown();
ZoteroVim = undefined;
}
function install() {
log('Installed');
}
function uninstall() {
log('Uninstalled');
}