diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index 3e1bd00e28..93f6683749 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -95,9 +95,24 @@ var Zotero_File_Interface_Bibliography = new function() { // ONLY FOR bibliography.xul: export options if(document.getElementById("save-as-rtf")) { + var settings = Zotero.Prefs.get("export.bibliographySettings"); + try { + settings = JSON.parse(settings); + var mode = settings.mode; + var method = settings.method; + } + // If not JSON, assume it's the previous format-as-a-string + catch (e) { + method = settings; + } + if (!mode) mode = "bibliography"; + if (!method) method = "save-as-rtf"; + // restore saved bibliographic settings - document.getElementById('output-radio').selectedItem = - document.getElementById(Zotero.Prefs.get("export.bibliographySettings")); + document.getElementById('output-mode-radio').selectedItem = + document.getElementById(mode); + document.getElementById('output-method-radio').selectedItem = + document.getElementById(method); } // ONLY FOR integrationDocPrefs.xul: update status of displayAs, set @@ -126,7 +141,7 @@ var Zotero_File_Interface_Bibliography = new function() { } /* - * ONLY FOR integrationDocPrefs.xul: called when style is changed + * Called when style is changed */ function styleChanged(index) { // When called from init(), selectedItem isn't yet set @@ -139,6 +154,10 @@ var Zotero_File_Interface_Bibliography = new function() { var selectedStyle = selectedItem.getAttribute('value'); + // + // For integrationDocPrefs.xul + // + // update status of displayAs box based on style class if(document.getElementById("displayAs")) { var isNote = Zotero.Styles.get(selectedStyle).class == "note"; @@ -151,16 +170,32 @@ var Zotero_File_Interface_Bibliography = new function() { document.getElementById("bookmarks").disabled = isNote; document.getElementById("bookmarks-caption").disabled = isNote; } + + // + // For bibliography.xul + // + + // Change label to "Citation" or "Note" depending on style class + if(document.getElementById("citation")) { + if(Zotero.Styles.get(selectedStyle).class == "note") { + var label = Zotero.getString('citation.note'); + } else { + var label = Zotero.getString('citation.citation'); + } + document.getElementById("citation").label = label; + } } function acceptSelection() { // collect code _io.style = document.getElementById("style-listbox").selectedItem.value; - if(document.getElementById("output-radio")) { + if(document.getElementById("output-method-radio")) { // collect settings - _io.output = document.getElementById("output-radio").selectedItem.id; + _io.mode = document.getElementById("output-mode-radio").selectedItem.id; + _io.method = document.getElementById("output-method-radio").selectedItem.id; // save settings - Zotero.Prefs.set("export.bibliographySettings", _io.output); + Zotero.Prefs.set("export.bibliographySettings", + JSON.stringify({ mode: _io.mode, method: _io.method })); } // ONLY FOR integrationDocPrefs.xul: collect displayAs diff --git a/chrome/content/zotero/bibliography.xul b/chrome/content/zotero/bibliography.xul index ff3c3f53d8..660ea13cff 100644 --- a/chrome/content/zotero/bibliography.xul +++ b/chrome/content/zotero/bibliography.xul @@ -14,11 +14,18 @@ - + - - + + + + + + + + + diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index 32308e9dec..b9377ad186 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -268,11 +268,28 @@ - +