From b2589585db3a5d2eef6837465d6e7f20b39688df Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 4 Dec 2009 23:52:28 +0000 Subject: [PATCH] Find DOI anywhere in string in Add Item by Identifier --- chrome/content/zotero/lookup.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 1235737d06..8fb97d1e61 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -3,9 +3,10 @@ const Zotero_Lookup = new function () { document.getElementById("progress").setAttribute("status", "animate"); document.getElementById("accept-button").disabled = true; var identifier = document.getElementById("lookup-textbox").value; - if(identifier.substr(0, 3) == "10.") { - // DOI - var item = {itemType:"journalArticle", DOI:identifier}; + + var doi = Zotero.Utilities.prototype.cleanDOI(identifier); + if(doi) { + var item = {itemType:"journalArticle", DOI:doi}; } else { identifier = identifier.replace("-", "", "g"); if(identifier.length == 10 || identifier.length == 13) {