Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:changes_in_zotero_2.1_and_zotero_standalone [2011/07/25 04:54] – [Locate Engines] fix link ajlyondev:client_coding:changes_in_zotero_2.1_and_zotero_standalone [2017/11/12 19:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Changes in Zotero 2.1 ======+<html><p id="zotero-5-update-warning" style="color: red; font-weight: bold">We’re 
 +in the process of updating the documentation for 
 +<a href="https://www.zotero.org/blog/zotero-5-0">Zotero 5.0</a>. Some documentation 
 +may be outdated in the meantime. Thanks for your understanding.</p></html>
  
-===== Changes to citation API ===== 
  
-With the introduction of citeproc-js, all Zotero.CSL APIs have been removed. Styles can be loaded in the usual way by accessing Zotero.Styles, but +Moved to [[Changes in Zotero 2.1]and [[Changes in Zotero 3.0]].
-developers should use Zotero.Style.csl to acquire a citeproc-js engine instance for citation formatting. <code>Zotero.Cite.makeFormattedBibliography(engine, format)</code> can be used to generate a fully-formatted bibliography.  +
- +
-===== Changes to interface-related code ===== +
- +
-Zotero as a tab and Zotero Standalone have required us to further abstract the interface layer. While the code for the interface has changed little, and most overlays should continue to work, as of the present Zotero trunk, plug-ins and add-ons should now overlay zoteroPane.xul instead of browser.xul or overlay.xul in chrome.manifest, e.g., using: +
- +
-<code>overlay chrome://zotero/content/zoteroPane.xul chrome://zotero-addon/content/overlay.xul</code> +
- +
-===== Changes to translators ===== +
- +
-  * Several functions in Zotero.Utilities have been eliminated, as they were essential duplications of built-in JavaScript methods. +
- +
-  * Zotero.configure() and Zotero.displayOptions() no longer exist. Instead, translators should specify config and display options in the metadata block at the top of the translator, e.g. <code>+
- "translatorID":"32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7", +
- [...] +
- "configOptions":{"dataMode":"rdf/xml"}, +
- "displayOptions":{"exportNotes":true}, +
- "lastUpdated":"2011-01-11 04:31:00" +
-}</code> +
- +
-  * It is no longer necessary to specify "dataMode":"block" or "dataMode":"line". If Zotero.read() is passed a numeric value, it reads a specified number of bytes; otherwise, it reads a full line. +
- +
-  * Import and export translators now show determinate progress bars. By default, Zotero computes progress by the percentage of the file read for import, or the percentage of items retrieved using Zotero.nextItem() for export. Translators can override this by calling Zotero.setProgress(percentage) to set the percentage the progress bar displays, or Zotero.setProgress(null) to show an indeterminate indicator. +
- +
-===== Changes to translate interface ===== +
- +
-New code should create new instances of the translate interface using type-specific constructors, e.g., to create a web translator: +
- +
-<code>new Zotero.Translate.Web();</code> +
- +
-===== Locate Engines ===== +
- +
-Zotero 2.1b6 and later support extensible locate engines. For further details, see [[dev:creating_locate_engines_using_opensearch|Creating Locate Engines using OpenSearch]]. +
- +
-====== Changes in Zotero 2.1.9 (not yet released) ====== +
- +
-===== Changes to translators ===== +
- +
-  * Z is now a shortcut for Zotero in translators, and ZU is a shortcut for Zotero.Utilities. +
- +
-  * New utility functions: +
-    * <code>Zotero.Utilities.xpath(element, xpath[, namespaces])</code> Accepts a DOM element, document, or array of elements or documents and evaluates an XPath, optionally interpreting namespace prefixes using a object whose keys correspond to namespace prefixes and whose values correspond to namespace URIs. The result is an array of nodes matching the XPath. +
-    * <code>Zotero.Utilities.xpathText(element, xpath[, namespaces[, delimiter]])</code> Behaves similarly to Zotero.Utilities.xpath, but the result is the textContent of all matching nodes, joined by a delimiter if more than one node matched. If no delimiter is specified, ", " is used. +
- +
-====== Changes in Zotero 2.2 ====== +
- +
-  * Calling Zotero.done() and Zotero.wait() during translation is no longer necessary. Zotero.done() is still used to indicate item type in translators that implement asynchronous detection (currently only unAPI). +
- +
-====== Changes for Zotero Connectors ====== +
- +
-===== Changes to translators ===== +
-Zotero Everywhere will soon allow translators to operate outside of Firefox/XULRunner. Legacy translators can still run inside Zotero Standalone, but will require that Zotero Standalone is running to operate. This will require the following code changes: +
- +
-  * Firefox-specific JavaScript, with the exception of "for each", must be avoided. This includes +
-    * array comprehensions +
-    * destructuring assignment +
-    * several other features +
- +
-  * E4X functionality is not available. As of Zotero 2.1b6, Zotero also offers DOM XML interfaces to translators. Current trunk builds offer cross-browser utility functions for working with XPaths detailed above, which greatly simplify migration away from E4X. +
-   +
-  * Zotero.Utilities.retrieveDocument() and Zotero.Utilities.retrieveSource() should be avoided. Zotero.Utilities.retrieveDocument() will throw an error outside of Firefox, whereas Zotero.Utilities.retrieveSource() will freeze the main thread and will not work across domains. Code should be rewritten to use Zotero.Utilities.processDocuments(), Zotero.Utilities.HTTP.doGet(), or Zotero.Utilities.HTTP.doPost(), which remain available in all environments. +
- +
-  * Translate#getTranslatorObject() should now be called with a callback function as an argument, which will receive the translator object when it is available. This is backwards compatible with Zotero 2.1b6 and later. +
-    * In Chrome and Safari, the "exports" object is exposed to other translators, rather than the entire translator sandbox. Any variables or functions that need to be accessible to other translators should be properties or methods of this object. In Zotero 2.1.9 and later, Translate#getTranslatorObject() will always return the "exports" object if it has properties. +
- +
-  * Translators should not expect a return value from Translate#getTranslators(). Instead, they should register a "translators" handler, which will receive the list of translators as the second argument. This is backwards compatible with Zotero 1.0 and later. +
- +
-  * Zotero.selectItems() should now be called with a callback function as an argument, which will receive the list of selected items when it is available. Translators may still use Zotero.selectItems() synchronously, but this will require that the first part of the translator be executed twice. This is backwards compatible with Zotero 2.1b6 and later.+
dev/client_coding/changes_in_zotero_2.1_and_zotero_standalone.1311584046.txt.gz · Last modified: 2011/07/25 04:54 by ajlyon