Differences

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

Link to this comparison view

Next revision
Previous revision
dev:how_to_write_a_zotero_translator_2nd_edition:chapter_14 [2011/04/03 16:24] – created debwebdev:how_to_write_a_zotero_translator_2nd_edition:chapter_14 [2017/11/22 11:18] (current) – removed bwiernik
Line 1: Line 1:
  
-===== Chapter 14: DetectWeb Tab ===== 
- 
-[[http://niche-canada.org/member-projects/zotero-guide/chapter14.html|HWZT chapter 14 (DetectWeb Tab)]]: the tutorial example works in Scaffold 2.0 and Firefox 3.5, with 2 minor exceptions 
- 
-  - HWZT says "Save your entry and click Execute": instead click icon="Run detectWeb" (the eye) 
-  - HWZT says "If you would like to see the Icon in the address bar [of the first sample page], you will likely have to relaunch Firefox": in fact, if you have in fact saved your entry, you need only reload the page or tab. 
- 
-As HWZT has gotten increasingly casual, here are some step-by-step instructions for this chapter's tutorial section: 
- 
-  - Close any running Scaffold 2.0 instances. 
-  - Ensure the [[http://niche-canada.org/member-projects/zotero-guide/sample1.html|first sample page]] is open in your browser and has focus. 
-  - Open Scaffold 2.0 from the Firefox main menu with Tools>Scaffold. This should popup dialog="Zotero Scaffold". 
-  - Hit icon=Load (the non-OS UI item closest to the upper left of the dialog). This should popup dialog="Load Translator" displaying a single table mapping "Label" to "Creator". 
-  - Scroll through the "Load Translator" table until you see Label=<code>How to Write a Zotero Translator</code>, then hit button=OK. 
-  - You will return to the main dialog="Zotero Scaffold". Check to see that tab=Metadata is properly populated. 
-  - Switch to tab=Code and enter the following:<code>function detectWeb(doc, url) { 
-  if (doc.title.match("Single Item")) { 
-    return "book"; 
-  } else if (doc.title.match("Search Results")) { 
-    return "multiple"; 
-  } 
-} 
-</code> 
-  - Click icon="Run detectWeb" (the eye): in the Test Frame you should get results like <code>12:00:00 detectWeb returned type "book"</code> 
-  - Click icon=Save (second from left): your translator should save silently. 
-  - Return focus to the page or tab containing the [[http://niche-canada.org/member-projects/zotero-guide/sample1.html|first sample page]] and refresh it: you should see the Zotero book icon in the location field of your Firefox. 
- 
-**Next**: [[dev/How to Write a Zotero Translator, 2nd Edition/Chapter 15|Chapter 15: Scraping the Search Results Page: doWeb Function]] 
dev/how_to_write_a_zotero_translator_2nd_edition/chapter_14.1301862246.txt.gz · Last modified: 2011/04/03 16:24 by debweb