From c31a3c263be1af1ae812fc8bbc0069bad9619692 Mon Sep 17 00:00:00 2001 From: Frank Bennett Date: Mon, 12 May 2014 07:35:19 +0900 Subject: [PATCH] Preselect default Export style in csledit.xul --- chrome/content/zotero/tools/csledit.xul | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/chrome/content/zotero/tools/csledit.xul b/chrome/content/zotero/tools/csledit.xul index b35b5fed8..2dae90727 100644 --- a/chrome/content/zotero/tools/csledit.xul +++ b/chrome/content/zotero/tools/csledit.xul @@ -45,15 +45,33 @@ function init() { var cslList = document.getElementById('zotero-csl-list'); if (cslList.getAttribute('initialized') == 'true') { + if (currentStyle) { + loadCSL(currentStyle); + refresh(); + } return; } + var rawDefaultStyle = Zotero.Prefs.get('export.quickCopy.setting'); + var defaultStyle = Zotero.QuickCopy.stripContentType(rawDefaultStyle); + var styles = Zotero.Styles.getAll(); + var currentStyle = null; + var listPos = 0; for each(var style in styles) { if (style.source) { continue; } var item = cslList.appendItem(style.title, style.styleID); + if (!currentStyle || defaultStyle == ('bibliography=' + style.styleID)) { + currentStyle = style.styleID; + cslList.selectedIndex = listPos; + } + listPos += 1; + } + if (currentStyle) { + loadCSL(currentStyle); + refresh(); } var pageList = document.getElementById('zotero-csl-page-type'); var locators = Zotero.Cite.labels;