From 68657634ecd175dc244ed9f18a4cbf981b3a2919 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Sat, 24 Nov 2012 00:18:42 -0600 Subject: [PATCH] Don't import duplicate identifiers --- chrome/content/zotero/lookup.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 188ac5fa6..2ef6d9e6f 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -32,13 +32,15 @@ const Zotero_Lookup = new function () { * Performs a lookup by DOI, PMID, or ISBN */ this.accept = function(textBox) { + var foundIDs = []; //keep track of identifiers to avoid duplicates 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