commit a57ea28d42d6229eea39a5d77ef336e567fece93
parent 3a2fb2938dd87d8ea31a6c7d9754ad34ac9e2da5
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 3 Feb 2017 00:53:43 -0500
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.)
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git 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
@@ -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);