Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
dev:client_coding:javascript_api [2019/08/18 05:41] – [Running Ad Hoc JavaScript in Zotero] Add examples zuphilipdev:client_coding:javascript_api [2019/10/20 06:32] – [Managing citations and bibliographies] zuphilip
Line 242: Line 242:
 <code javascript>var items = await Zotero.Items.getAsync(results);</code> <code javascript>var items = await Zotero.Items.getAsync(results);</code>
  
-===== Managing citations and bibliographies =====+==== Managing citations and bibliographies ====
  
 TODO:  this is pretty sparse.  the rtfscan code is a good place to look for some guidance. TODO:  this is pretty sparse.  the rtfscan code is a good place to look for some guidance.
  
-==== Getting a bibliography for an array of items: ====+=== Getting a bibliography for an array of items: ===
  
 Here we use Zotero's Quick Copy functions to get a bibliography in the style Here we use Zotero's Quick Copy functions to get a bibliography in the style
Line 254: Line 254:
  
 <code javascript>var qc = Zotero.QuickCopy; <code javascript>var qc = Zotero.QuickCopy;
-var biblio qc.getContentFromItems([item], Zotero.Prefs.get("export.quickCopy.setting")); +var format = Zotero.Prefs.get("export.quickCopy.setting")
-var biblio_html_format = cite.html; +if (format.split("=")[0] !== "bibliography") { 
-var biblio_txt  cite.text; +   return "No bibliography style is choosen in the settings for QuickCopy."; 
 +
 +var biblio = qc.getContentFromItems([item], format); 
 +var biblio_html_format = biblio.html; 
 +var biblio_txt = biblio.text;
 </code> </code>
  
-==== Get a list of available styles ====+=== Get a list of available styles ===
  
 <code javascript>  <code javascript> 
dev/client_coding/javascript_api.txt · Last modified: 2022/07/02 18:22 by dstillman