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_3.0 [2011/08/22 14:42] – [Zotero.Utilities.removeDiacritics()] simondev:client_coding:changes_in_zotero_3.0 [2017/11/27 05:13] (current) – Remove Zotero 5 warning bwiernik
Line 9: Line 9:
 When the ''exportFileData'' option is specified and selected, attachments are no longer saved automatically. Instead, you should call the ''attachment.saveItem(relativePath, overwriteExisting)'' method to save attachments. ''relativePath'' is 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. ''overwriteExisting'' determines whether existing attachments are automatically overwritten; if false, a ''ERROR_FILE_EXISTS'' error will be thrown. When the ''exportFileData'' option is specified and selected, attachments are no longer saved automatically. Instead, you should call the ''attachment.saveItem(relativePath, overwriteExisting)'' method to save attachments. ''relativePath'' is 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. ''overwriteExisting'' determines whether existing attachments are automatically overwritten; if false, a ''ERROR_FILE_EXISTS'' error will be thrown.
  
-==== Zotero.Utilities.removeDiacritics() ====+==== ZU.removeDiacritics() ====
  
 ''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. ''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.
 ==== ZoteroItemUpdated event ==== ==== ZoteroItemUpdated event ====
-Sites can now fire the ''ZoteroItemUpdated'' event to force Zotero to re-run detection after new data is loaded asynchronously ([[exposing_metadata#using_an_open_standard_for_exposing_metadata|example code]]).+Sites can now fire the ''ZoteroItemUpdated'' event to force Zotero to re-run detection after new data is loaded asynchronously ([[:dev:exposing_metadata#using_an_open_standard_for_exposing_metadata|example code]]).
  
 ==== Modifying translators to run in the Zotero Connectors ==== ==== Modifying translators to run in the Zotero Connectors ====
Line 42: Line 42:
 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. 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.
  
-===== Making add-ons for Zotero Standalone =====+===== Translator testing framework =====
  
-It is possible to create add-ons for Zotero Standalone just as one would create add-ons for Firefox. To do so, simply add the following lines to install.rdf:+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: 
 + 
 +<code>chrome://zotero/content/tools/testTranslators/testTranslators.html</code> 
 + 
 +In Chrome and Safari, the translator tester is accessible from the Advanced pane of the preferences in [[/support/dev_builds#connector_debug_builds|connector debug builds]]. 
 + 
 +===== Add-on support in Zotero Standalone ===== 
 + 
 +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:
  
 <code xml> <code xml>
Line 56: Line 64:
 </code> </code>
  
-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 overlay [[changes_in_zotero_2.1#changes_to_interface-related_code|zoteroPane.xul]], this addition should be sufficient, and the same XPI should work in both Firefox and Zotero Standalone.+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 overlay [[changes_in_zotero_2.1#changes_to_interface-related_code|zoteroPane.xul]], this addition should be sufficient, and the same XPI should work in both Firefox and Zotero Standalone. If your add-on overlays browser.xul, you should change it to overlay zoteroPane.xul.
  
-To install an add-on in Zotero Standalone, go to Tools->Add-ons and choose "Install Add-on From File..." from the cog menu.+Calls to ''window.loadURI()'' will not work in Zotero Standalone. Howeveryou can use ''ZoteroPane.loadURI()'' to load a URI in the default browser, or ''ZoteroStandalone.openInViewer()'' to open a page in Zotero Standalone.
  
 +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 ===== ===== Miscellaneous changes =====
  
 ==== Zotero.Translate itemSaving handler ==== ==== Zotero.Translate itemSaving handler ====
-There are now both ''itemSaving'' and ''itemDone'' handlers.+Zotero.Translate now fires both ''itemSaving'' and ''itemDone'' handlers.
  
 The ''itemSaving'' handler 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. The ''itemSaving'' handler 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.
dev/client_coding/changes_in_zotero_3.0.1314038561.txt.gz · Last modified: 2011/08/22 14:42 by simon