diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 1f4a3cbc0..7239ecc19 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -31,71 +31,126 @@ const Zotero_Lookup = new function () { /** * Performs a lookup by DOI, PMID, or ISBN */ - this.accept = function() { - var identifierElement = document.getElementById("zotero-lookup-textbox"); - var identifier = identifierElement.value; - - var doi = Zotero.Utilities.cleanDOI(identifier); - if(doi) { - var item = {itemType:"journalArticle", DOI:doi}; - } else { - identifier = identifier.trim().replace(/[\- ]/g, ""); - if(identifier.length == 10 || identifier.length == 13) { - // ISBN - var item = {itemType:"book", ISBN:identifier}; - } else { - // PMID; right now, PMIDs are 8 digits, so there doesn't seem like we will need to - // discriminate for a fairly long time - var item = {itemType:"journalArticle", contextObject:"rft_id=info:pmid/"+identifier}; + this.accept = function(textBox) { + var identifier = textBox.value; + //first look for DOIs + var ids = identifier.split(/[\s\u00A0]+/); //whitespace + non-breaking space + var items = [], doi; + for(var i=0, n=ids.length; i +