commit 289e696e901cd992601ea370b32a211e990c5b80 parent be2ebe767c3321f6a4c391000dd2621506b7272e Author: Simon Kornblith <simon@simonster.com> Date: Fri, 10 Jun 2011 21:39:40 +0000 allow CSL 1.0 dependent styles to reference CSL 0.8 parents, and vice versa Diffstat:
| M | chrome/content/zotero/xpcom/style.js | | | 14 | +++++++++++++- |
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -424,7 +424,19 @@ function() { } } - if(this._version == "0.8") { + // determine version of parent style + if(this.source) { + var parentStyle = Zotero.Styles.get(this.source); + if(!parentStyle) { + throw(new Error('Style references '+this.source+', but this style is not installed', + Zotero.Styles.ios.newFileURI(this.file).spec, null)); + } + var version = parentStyle._version; + } else { + var version = this._version; + } + + if(version === "0.8") { // get XSLT processor from updateCSL.xsl file if(!Zotero.Styles.xsltProcessor) { let protHandler = Components.classes["@mozilla.org/network/protocol;1?name=chrome"]