Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:client_coding:javascript_api [2019/01/22 04:23] – [The Zotero Object] dstillman | dev:client_coding:javascript_api [2019/01/22 04:27] – dstillman | ||
---|---|---|---|
Line 22: | Line 22: | ||
(Before Zotero 5.0.61 is released, you'll need to install the [[: | (Before Zotero 5.0.61 is released, you'll need to install the [[: | ||
- | ===== Window Scope vs. Non-Window Scope ==== | + | |
+ | ===== Zotero Code Architecture ===== | ||
+ | |||
+ | ==== Window Scope vs. Non-Window Scope === | ||
Zotero code exists in either window scope and non-window scope. | Zotero code exists in either window scope and non-window scope. | ||
Line 44: | Line 47: | ||
</ | </ | ||
(The Zotero pane will always be available unless the main window is closed, as is possible on macOS.) | (The Zotero pane will always be available unless the main window is closed, as is possible on macOS.) | ||
- | ===== Notification System ===== | ||
- | Zotero has a built-in notification system that allows other privileged code to be notified when a change is made via the data layer---for example, when an item is added to the library. Within Zotero itself, this is used mostly to update the UI when items change, but external | + | ==== Notification System ==== |
+ | |||
+ | Zotero has a built-in notification system that allows other privileged code to be notified when a change is made via the data layer — for example, when an item is added to the library. Within Zotero itself, this is used mostly to update the UI when items change, but extensions can use the system to perform additional operations when specific events occur — say, to sync item metadata with a web-based | ||
Available events: | Available events: | ||
Line 63: | Line 67: | ||
//The Zotero JavaScript API is under-documented, | //The Zotero JavaScript API is under-documented, | ||
- | |||
- | Once you have access to the core Zotero object, you can use the objects and methods provided by the Zotero JavaScript API. | ||
- | |||
- | Zotero uses a combination of instantiatable objects (e.g. '' | ||
==== Adding items and modifying data ==== | ==== Adding items and modifying data ==== | ||
- | A typical operation might include a call to '' | + | A typical operation might include a call to '' |
<code javascript> | <code javascript> |