This repository contains the Zotero translation architecture code responsible for parsing Zotero translators and running them on live and static web pages to retrieve Zotero items.
A consumer of this repository needs to implement the following interfaces:
Zotero.Translators
found intranslators.js
Zotero.HTTP
found inhttp.js
Zotero.Translate.ItemSaver
found intranslation/translate_item.js
You also need to:
- Call
Zotero.Schema.init(data)
with Zoteroschema.json
. - Call
Zotero.Date.init(json)
with the JSON fromutilities/resource/dateFormats.json
- If running in a ModuleJS environment (e.g. Node.js) call
require('../utilities/cachedTypes').setTypeSchema(typeSchema)
with the result ofutilities/resource/zoteroTypeSchemaData.js
.
Please bundle translators and Zotero schema with the translation architecture. Do not load them from a remote server.
You may also want to reimplement or modify:
Zotero.Repo
found inrepo.js
to set up periodic translator update retrievalZotero.Debug
found indebug.js
to customize debug loggingZotero
andZotero.Prefs
found inzotero.js
to set up the environment and long-term preference storageZotero.Translate.ItemGetter
found intranslation/translate_item.js
for export translationZotero.Translate.SandboxManager
found intranslation/sandboxManager.js
for a tighter Sandbox environment if available on your the platform
See example/index.html
for file loading order.
To run the example:
$ git submodule update --init
$ google-chrome --disable-web-security --user-data-dir=/tmp/chromeTemvar
Open example/index.html
in the CORS ignoring Google Chrome