From 785f4f6663de324cb046087c165c384dd3b9533b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 31 Mar 2011 19:12:05 +0000 Subject: [PATCH] upgrade styles with the same title instead of offering to install a second style with the same title --- chrome/content/zotero/xpcom/style.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index 9a00bb8956..1aaa207f6f 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -227,6 +227,18 @@ Zotero.Styles = new function() { } } + // also look for an existing style with the same title + if(!existingFile) { + var styleTitle = xml.info.title.toString(); + for each(var existingStyle in this.getAll()) { + if(styleTitle === existingStyle.title) { + existingFile = existingStyle.file; + existingTitle = existingStyle.title; + break; + } + } + } + // display a dialog to tell the user we're about to install the style if(hidden) { destFile = destFileHidden;