From d8868cd9cbfbf5bc3f21fe4db1173b946efa31c3 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 20 Jun 2008 06:40:05 +0000 Subject: [PATCH] fixes #1030, CSL broken on trunk due to XML namespace change closes #704, EndNote to Zotero style converter (won't actually convert styles due to copyright concerns, but will load them into the DB) also adds CSL style manager --- .../content/zotero/preferences/preferences.js | 131 ++ .../zotero/preferences/preferences.xul | 23 + chrome/content/zotero/xpcom/cite.js | 76 +- chrome/content/zotero/xpcom/enstyle.js | 1374 +++++++++++++++++ chrome/content/zotero/xpcom/zotero.js | 55 +- chrome/locale/en-US/zotero/preferences.dtd | 4 + chrome/locale/en-US/zotero/zotero.properties | 7 +- chrome/skin/default/zotero/preferences.css | 7 +- chrome/skin/default/zotero/prefs-styles.png | Bin 0 -> 1437 bytes components/zotero-service.js | 4 +- 10 files changed, 1642 insertions(+), 39 deletions(-) create mode 100644 chrome/content/zotero/xpcom/enstyle.js create mode 100644 chrome/skin/default/zotero/prefs-styles.png diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index eb5cb0798..a9650bf5b 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -31,6 +31,7 @@ function init() rows[i].firstChild.nextSibling.value = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+'; } + refreshStylesList(); populateQuickCopyList(); updateQuickCopyInstructions(); initSearchPane(); @@ -912,4 +913,134 @@ function onOpenURLSelected() function onOpenURLCustomized() { document.getElementById('openURLMenu').value = "custom"; +} + +/** STYLES **/ + +/** + * Refreshes the list of styles in the styles pane + **/ +function refreshStylesList(cslID) { + var treechildren = document.getElementById('styleManager-rows'); + while (treechildren.hasChildNodes()) { + treechildren.removeChild(treechildren.firstChild); + } + + var sql = "SELECT cslID, title, updated FROM csl ORDER BY title"; + var styleData = Zotero.DB.query(sql); + if (!styleData) return; + + Zotero.debug("ASKED FOR "+cslID); + + var selectIndex = false; + for (var i=0; i