From a57ea28d42d6229eea39a5d77ef336e567fece93 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Feb 2017 00:53:43 -0500 Subject: [PATCH] Fix csledit Closes #1149 (There's an additional change in #1149, but as far as I can tell it's not necessary for csledit.xul.) --- chrome/content/zotero/tools/csledit.js | 4 ++-- chrome/content/zotero/xpcom/style.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/tools/csledit.js b/chrome/content/zotero/tools/csledit.js index 8e00ba9c56..21b6409105 100644 --- a/chrome/content/zotero/tools/csledit.js +++ b/chrome/content/zotero/tools/csledit.js @@ -35,7 +35,7 @@ var Zotero_CSL_Editor = new function() { var lastStyle = Zotero.Prefs.get('export.lastStyle'); - var styles = Zotero.Styles.getAll(); + var styles = Zotero.Styles.getVisible(); var currentStyle = null; for (let style of styles) { if (style.source) { @@ -119,7 +119,7 @@ var Zotero_CSL_Editor = new function() { function loadCSL(cslID) { var editor = document.getElementById('zotero-csl-editor'); var style = Zotero.Styles.get(cslID); - editor.value = Zotero.File.getContents(style.file); + editor.value = style.getXML(); editor.cslID = cslID; editor.doCommand(); document.getElementById('zotero-csl-list').value = cslID; diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index 9c63947f41..bdd97be0ab 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -595,6 +595,9 @@ Zotero.Style = function (style, path) { this.path = path; this.fileName = OS.Path.basename(path); } + else { + this.string = style; + } this.styleID = Zotero.Utilities.xpathText(doc, '/csl:style/csl:info[1]/csl:id[1]', Zotero.Styles.ns);