188BET靠谱吗Changes in Zotero 3.0

Changes to translators

188BET靠谱吗Zotero.done() and Zotero.wait() are deprecated

Calling188BET靠谱吗Zotero.done()and188BET靠谱吗Zotero.wait()during translation is no longer necessary.188BET靠谱吗Zotero.done()is still used to indicate item type in translators that implement asynchronous detection (currently only unAPI).

Customizable attachment export

When theexportFileDataoption is specified and selected, attachments are no longer saved automatically.Instead, you should call theattachment.saveItem(relativePath, overwriteExisting)method to save attachments.relativePathis the path to the attachment relative to the folder in which the metadata file resides!if intermediate directories do not exist, they are created automatically.overwriteExistingdetermines whether existing attachments are automatically overwritten!if false, aERROR_FILE_EXISTSerror will be thrown.

ZU.removeDiacritics()

188BET靠谱吗Zotero.Utilities.removeDiacritics(str, lowercaseOnly)removes diacritics from a string, returning the result.The second argument is an optimization that specifies that only lowercase diacritics should be replaced.

188BET靠谱吗ZoteroItemUpdated event

Sites can now fire the188BET靠谱吗ZoteroItemUpdated188BET靠谱吗event to force Zotero to re-run detection after new data is loaded asynchronously (example code).

188BET靠谱吗Modifying translators to run in the Zotero Connectors

188BET靠谱吗Zotero Connectors now allow translators to operate outside of Firefox/XULRunner.188BET靠谱吗Legacy translators can still run inside Zotero Standalone, but will require that Zotero Standalone is running to operate.188BET靠谱吗In order to run in the Zotero Connectors, translators must conform to the following rules.

No Firefox-specific JavaScript

Firefox-specific JavaScript, with the exception of "for each", must be avoided.This includes

  • array comprehensions
  • destructuring assignment
  • several other features

E4X unavailable

E4X functionality is not available.188BET靠谱吗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.

retrieveSource() and retrieveDocument() are unavailable

188BET靠谱吗Zotero.Utilities.retrieveDocument() and Zotero.Utilities.retrieveSource() should be avoided.188BET靠谱吗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.188BET靠谱吗Code should be rewritten to use Zotero.Utilities.processDocuments(), Zotero.Utilities.HTTP.doGet(), or Zotero.Utilities.HTTP.doPost(), which remain available in all environments.

getTranslatorObject() must be called with a callback

Translate#getTranslatorObject() should now be called with a callback function as an argument, which will receive the translator object when it is available.188BET靠谱吗This is backwards compatible with Zotero 2.1b6 and later.

Translators that export objects via getTranslatorObject() must define exported objects explicitly

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.188BET靠谱吗In Zotero 2.1.9 and later, Translate#getTranslatorObject() will always return the "exports" object if it has properties.

getTranslators() does not return

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.188BET靠谱吗This is backwards compatible with Zotero 1.0 and later.

selectItems() should be called with a callback

188BET靠谱吗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.188BET靠谱吗Translators may still use Zotero.selectItems() synchronously, but this will require that the first part of the translator be executed twice.188BET靠谱吗This is backwards compatible with Zotero 2.1b6 and later.

Translator testing framework

188BET靠谱吗Zotero 3.0 contains a translator testing framework, used by Scaffold 3.0.You can also run available translator tests in batch mode by accessing the translator tester page.In Firefox, this page is available in the standard extension at:

188BET靠谱吗chrome://zotero/content/tools/testTranslators/testTranslators.html

In Chrome and Safari, the translator tester is accessible from the Advanced pane of the preferences inconnector debug builds.

188BET靠谱吗Add-on support in Zotero Standalone

188BET靠谱吗It is possible to create add-ons for Zotero Standalone just as one would create add-ons for Firefox.To do so, create a Firefox extension, but add the following lines to install.rdf:


          
           >
          
          
           >
          
          
           >
          188BET靠谱吗zotero@chnm.gmu.edu>
          
           >
          3.0b1>
          
           >
          3.0.*>>>

188BET靠谱吗where minVersion is the lowest Zotero Standalone version you have tested with, and maxVersion is the maximum version you can reasonably expect your add-on to work with.For add-ons that overlay188BET靠谱吗zoteroPane.xul188BET靠谱吗, this addition should be sufficient, and the same XPI should work in both Firefox and Zotero Standalone.188BET靠谱吗If your add-on overlays browser.xul, you should change it to overlay zoteroPane.xul.

Calls towindow.loadURI()188BET靠谱吗will not work in Zotero Standalone.However, you can use188BET靠谱吗ZoteroPane.loadURI()to load a URI in the default browser, or188BET靠谱吗ZoteroStandalone.openInViewer()188BET靠谱吗to open a page in Zotero Standalone.

188BET靠谱吗To install an add-on in Zotero Standalone, go to Tools→Add-ons and choose "Install Add-on From File…" from the cog menu.

Miscellaneous changes

188BET靠谱吗Zotero.Translate itemSaving handler

188BET靠谱吗Zotero.Translate now fires bothitemSavinganditemDonehandlers.

TheitemSavinghandler is called as soon as the translator returns an item, but before it's saved to the database.It is passed the item object returned by the translator as the second argument.

TheitemDonehandler is called after the item is saved.When not operating in connector mode, it is passed the DB item as its second argument and the item object returned by the translator as its third.When operating in connector mode, or whenfalseis passed to188BET靠谱吗Zotero.Translate#translateis passed the item object returned by the translator as both arguments.

getNotes(), getAttachments, and getTags() return empty arrays

188BET靠谱吗Zotero.Item.getNotes(), Zotero.Item.getAttachments(), and Zotero.Item.getTags() now return empty arrays rather than FALSE if no matches

Baidu
map