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