From 759f846610122b2ee42cc62954c536beb22a69a0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 30 Mar 2011 00:39:08 +0000 Subject: [PATCH] Missed file from previous commit --- chrome/content/zotero/xpcom/utilities.js | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index ea95e5f044..3773209e2e 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -361,7 +361,31 @@ Zotero.Utilities = { } return vals; }, - + + /** + * Return new array with duplicate values removed + * + * From the JSLab Standard Library (JSL) + * Copyright 2007 - 2009 Tavs Dokkedahl + * Contact: http://www.jslab.dk/contact.php + * + * @param {Array} array + * @return {Array} + */ + "arrayUnique":function(arr) { + var a = []; + var l = arr.length; + for(var i=0; i