On 6/12/14, 5:05 AM, Lena Gieseke wrote:
> Hey everyone,
> I would like to get into programming a Plugin for the Standalone
> Zotero Version. I am a fairly good programmer but have no experience
> with Java Script and/or serious web-programming.
>
> Unfortunately I am currently failing to get the Hello World Plugin to
> run. I looked through the website but couldn't find any complete,
> noob-compatible information. So my first question is, and, yes, sorry
> in advance if I should know this myself, but I currently just don't:
> How to install the hello-world-master code in zotero? I believe I need
> a .xpi file. How to write/create it?
An XPI is just a ZIP file, so if you clone the sample plugin from Git
and zip up that directory (e.g., 'zip ../zotero-hello-world.xpi *' from
within it), you should have a working XPI that you can install from the
Add-ons window in Zotero Standalone (at least, if that sample code still
works, which it might not — it's quite old).
But for actual development, you'll want to run from the local Git repo
directly. See the steps for Zotero for Firefox here:
https://www.zotero.org/support/dev/source_code#working_with_git_repositories
You can follow those steps for your own plugin, replacing
'
zot...@chnm.gmu.edu' with the id of your plugin in the install.rdf
file. To do this in Zotero Standalone, you'll need to go into the Zotero
Standalone profile directory [1] instead of the Firefox profile
directory. If you've set it up properly, you'll see your extension
listed in the Add-ons window, and you'll be able to see changes just by
restarting Firefox/Standalone.
> Second question: any recommended resource that might help me on my way?
There's some documentation on the wiki [2], but your best bet (once
you've set up your overlay and include.js) is probably the Zotero
codebase itself, particularly the zoteroPane.js file, which operates
from the same scope you'll likely be using and includes many of the
UI-initiated operations in Zotero. You can also look at the code for
some other Zotero plugins [2] to see what they do, with the caveat that
they might not all follow best practices.
Feel free to ask specific questions you have while you work on this.
- Dan
[1]
https://www.zotero.org/support/kb/profile_directory
[2]
https://www.zotero.org/support/dev/client_coding/javascript_api
[3]
https://www.zotero.org/support/plugins