From 5e1191b43e249f705638f1877ea52b0f7cbc5733 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 7 Aug 2007 08:29:11 +0000 Subject: [PATCH] closes #689, eliminate initial prompt to migrate from fields to bookmarks closes #618, Word plugin should have required-version logic still need to: - test with Word for Windows - test with OOo (I assume the codebase is similar enough between Mac and Win) - test with files from old Word plug-in but, I will probably try to get all of the Word plug-in stuff done before I worry about this (unless there are objections) --- chrome/content/zotero/bibliography.js | 29 +++++--- chrome/content/zotero/bibliography.xul | 12 ++-- chrome/content/zotero/integrationDocPrefs.xul | 42 +++++++---- chrome/content/zotero/xpcom/integration.js | 72 +++++++++++++------ chrome/locale/en-US/zotero/zotero.dtd | 6 +- chrome/locale/en-US/zotero/zotero.properties | 8 ++- chrome/skin/default/zotero/bibliography.css | 11 +++ 7 files changed, 125 insertions(+), 55 deletions(-) create mode 100644 chrome/skin/default/zotero/bibliography.css diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index f878a6550..76e52d622 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -50,8 +50,7 @@ var Zotero_File_Interface_Bibliography = new function() { _io = _io.wrappedJSObject; } - var listbox = document.getElementById("style-popup"); - var styleMenu = document.getElementById("style-menu"); + var listbox = document.getElementById("style-listbox"); var styles = Zotero.Cite.getStyles(); // if no style is set, get the last style used @@ -62,19 +61,19 @@ var Zotero_File_Interface_Bibliography = new function() { // add styles to list for(i in styles) { - var itemNode = document.createElement("menuitem"); + var itemNode = document.createElement("listitem"); itemNode.setAttribute("value", i); itemNode.setAttribute("label", styles[i]); listbox.appendChild(itemNode); if(i == _io.style) { - styleMenu.selectedItem = itemNode; + listbox.selectedItem = itemNode; } } // select first item by default - if(styleMenu.selectedIndex == -1) { - styleMenu.selectedIndex = 0; + if(listbox.selectedIndex == -1) { + listbox.selectedIndex = 0; } // ONLY FOR bibliography.xul: export options @@ -89,9 +88,20 @@ var Zotero_File_Interface_Bibliography = new function() { } } - // ONLY FOR integrationDocPrefs.xul: update status of displayAs + // ONLY FOR integrationDocPrefs.xul: update status of displayAs, set + // bookmarks text if(document.getElementById("displayAs")) { if(_io.useEndnotes == 1) document.getElementById("displayAs").selectedIndex = 1; + if(_io.useBookmarks == 1) document.getElementById("formatUsing").selectedIndex = 1; + + if(_io.openOffice) { + var formatOption = "referenceMarks"; + } else { + var formatOption = "fields"; + } + document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label"); + document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption"); + styleChanged(); } @@ -108,14 +118,14 @@ var Zotero_File_Interface_Bibliography = new function() { */ function styleChanged() { // update status of displayAs box based - var selectedStyle = document.getElementById("style-menu").selectedItem.value; + var selectedStyle = document.getElementById("style-listbox").selectedItem.value; var styleClass = Zotero.Cite.getStyleClass(selectedStyle); document.getElementById("displayAs").disabled = styleClass != "note"; } function acceptSelection() { // collect code - _io.style = document.getElementById("style-menu").selectedItem.value; + _io.style = document.getElementById("style-listbox").selectedItem.value; if(document.getElementById("output-radio")) { // collect settings _io.output = document.getElementById("output-radio").selectedItem.id; @@ -126,6 +136,7 @@ var Zotero_File_Interface_Bibliography = new function() { // ONLY FOR integrationDocPrefs.xul: collect displayAs if(document.getElementById("displayAs")) { _io.useEndnotes = document.getElementById("displayAs").selectedIndex; + _io.useBookmarks = document.getElementById("formatUsing").selectedIndex; } // save style (this happens only for "Export Bibliography," or Word diff --git a/chrome/content/zotero/bibliography.xul b/chrome/content/zotero/bibliography.xul index ef57ff023..904c9f316 100644 --- a/chrome/content/zotero/bibliography.xul +++ b/chrome/content/zotero/bibliography.xul @@ -1,5 +1,6 @@ + - - + + + + diff --git a/chrome/content/zotero/integrationDocPrefs.xul b/chrome/content/zotero/integrationDocPrefs.xul index 91ec3e293..eccce7833 100644 --- a/chrome/content/zotero/integrationDocPrefs.xul +++ b/chrome/content/zotero/integrationDocPrefs.xul @@ -1,5 +1,7 @@ + +