diff --git a/Zotero.dot.dmg b/Zotero.dot.dmg index f11d8530a..d3bb37031 100644 Binary files a/Zotero.dot.dmg and b/Zotero.dot.dmg differ diff --git a/chrome/chromeFiles/content/scholar/bibliography.js b/chrome/chromeFiles/content/scholar/bibliography.js index 2a0b73e09..a3135d9b6 100644 --- a/chrome/chromeFiles/content/scholar/bibliography.js +++ b/chrome/chromeFiles/content/scholar/bibliography.js @@ -20,28 +20,32 @@ var Scholar_File_Interface_Bibliography = new function() { _io = window.arguments[0]; var listbox = document.getElementById("style-popup"); + var styleMenu = document.getElementById("style-menu"); var styles = Scholar.Cite.getStyles(); - var firstItem = true; + // add styles to list for(i in styles) { var itemNode = document.createElement("menuitem"); itemNode.setAttribute("value", i); itemNode.setAttribute("label", styles[i]); listbox.appendChild(itemNode); + + if(i == _io.style) { + styleMenu.selectedItem = itemNode; + } } // select first item by default - document.getElementById("style-menu").selectedIndex = 0; - - if(navigator.userAgent.toLowerCase().indexOf("mac") != -1) { - // hack to eliminate clipboard option for mac users - document.getElementById("output-radio").removeChild(document.getElementById("copy-to-clipboard")); + if(styleMenu.selectedIndex == -1) { + styleMenu.selectedIndex = 0; } } function acceptSelection() { // collect code _io.style = document.getElementById("style-menu").selectedItem.value; - _io.output = document.getElementById("output-radio").selectedItem.id; + if(document.getElementById("output-radio")) { + _io.output = document.getElementById("output-radio").selectedItem.id; + } } } \ No newline at end of file diff --git a/chrome/chromeFiles/content/scholar/ingester/browser.js b/chrome/chromeFiles/content/scholar/ingester/browser.js index 5c5aca447..ee8a26c80 100644 --- a/chrome/chromeFiles/content/scholar/ingester/browser.js +++ b/chrome/chromeFiles/content/scholar/ingester/browser.js @@ -359,7 +359,8 @@ Scholar_Ingester_Interface.Progress = new function() { if(_windowLoading || _windowLoaded) { // already loading or loaded return false; } - _progressWindow = window.openDialog("chrome://scholar/chrome/ingester/progress.xul", "", "chrome,dialog=no,titlebar=no,popup=yes"); + _progressWindow = window.openDialog("chrome://scholar/chrome/ingester/progress.xul", + "", "chrome,dialog=no,titlebar=no,popup=yes"); _progressWindow.addEventListener("load", _onWindowLoaded, false); _windowLoading = true; diff --git a/chrome/chromeFiles/content/scholar/selectItemsDialog.xul b/chrome/chromeFiles/content/scholar/selectItemsDialog.xul index 28bc8a7c2..ede99a89a 100644 --- a/chrome/chromeFiles/content/scholar/selectItemsDialog.xul +++ b/chrome/chromeFiles/content/scholar/selectItemsDialog.xul @@ -28,7 +28,6 @@ title="Select" orient="vertical" width="600" height="450" - persist="width height screenX screenY" buttons="cancel,accept" ondialogaccept="doAccept();" onload="doLoad();" diff --git a/chrome/chromeFiles/content/scholar/xpcom/cite.js b/chrome/chromeFiles/content/scholar/xpcom/cite.js index 9f8e02bc8..52c26878e 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/cite.js +++ b/chrome/chromeFiles/content/scholar/xpcom/cite.js @@ -9,10 +9,14 @@ Scholar.Cite = new function() { var _lastCSL = null; var _lastStyle = null; + this.getStyles = getStyles; + this.getStyleClass = getStyleClass; this.getBibliography = getBibliography; this.getCitation = getCitation; - this.getStyles = getStyles; + /* + * returns an associative array of cslID => styleName pairs + */ function getStyles() { // get styles var sql = "SELECT cslID, title FROM csl ORDER BY title"; @@ -27,6 +31,14 @@ Scholar.Cite = new function() { return stylesObject; } + /* + * returns the class of a given style + */ + function getStyleClass(cslID) { + var csl = _getCSL(cslID); + return csl.class; + } + /* * generates a bibliography */ @@ -86,13 +98,13 @@ CSL = function(csl) { this._terms = this._parseLocales(this._csl.terms); // load class defaults - this._class = this._csl["@class"].toString(); - Scholar.debug("CSL: style class is "+this._class); + this.class = this._csl["@class"].toString(); + Scholar.debug("CSL: style class is "+this.class); this._defaults = new Object(); // load class defaults - if(CSL._classDefaults[this._class]) { - var classDefaults = CSL._classDefaults[this._class]; + if(CSL._classDefaults[this.class]) { + var classDefaults = CSL._classDefaults[this.class]; for(var i in classDefaults) { this._defaults[i] = classDefaults[i]; } @@ -187,7 +199,7 @@ CSL.prototype.createBibliography = function(format) { var output = ""; if(format == "HTML") { - if(this._class == "note") { + if(this.class == "note") { output += '
"+string+"
\r\n"; } } else if(format == "RTF") { - if(this._class == "note") { + if(this.class == "note") { index++; output += index+". "; } @@ -230,7 +242,7 @@ CSL.prototype.createBibliography = function(format) { } if(format == "HTML") { - if(this._class == "note") { + if(this.class == "note") { output += ''; } else if(this._bib.hangingIndent) { output += '