From c3e2e83df9f9c77c53d9a889bdea12184317832d Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 13 Sep 2007 21:04:41 +0000 Subject: [PATCH] fixes #754, SVN Word plugin not working in 1687 fixes #740, possible CSL et al issues fixes #757, CSLs without sort-algorithm option fail bibliography creation fixes #747, fix issues with bookmarks fixes CrossRef translator to use authentication addresses #736, bring Zotero up to date with latest CSL revisions (new formatting attributes not yet implemented) closes #746, edit bibliography support new Word plug-in still needs compliation and testing on non-Mac platforms and needs to be tested for compatibility with old docs --- chrome/content/zotero/addCitationDialog.js | 94 ++- chrome/content/zotero/addCitationDialog.xul | 182 ++-- .../zotero/bindings/styled-textbox.xml | 17 +- .../content/zotero/editBibliographyDialog.js | 169 ++++ .../content/zotero/editBibliographyDialog.xul | 115 +++ chrome/content/zotero/xpcom/cite.js | 787 ++++++++++++------ chrome/content/zotero/xpcom/cite_compat.js | 24 +- chrome/content/zotero/xpcom/integration.js | 275 ++++-- chrome/locale/en-US/zotero/locales.xml | 86 +- chrome/locale/en-US/zotero/zotero.dtd | 5 +- chrome/locale/en-US/zotero/zotero.properties | 5 +- ...{addCitationDialog.css => integration.css} | 15 +- scrapers.sql | 327 ++++---- 13 files changed, 1499 insertions(+), 602 deletions(-) create mode 100644 chrome/content/zotero/editBibliographyDialog.js create mode 100644 chrome/content/zotero/editBibliographyDialog.xul rename chrome/skin/default/zotero/{addCitationDialog.css => integration.css} (71%) diff --git a/chrome/content/zotero/addCitationDialog.js b/chrome/content/zotero/addCitationDialog.js index 5bad4da32..552ab778e 100644 --- a/chrome/content/zotero/addCitationDialog.js +++ b/chrome/content/zotero/addCitationDialog.js @@ -34,6 +34,7 @@ var Zotero_Citation_Dialog = new function () { var _lastSelected = null; var _previewShown = false; var _suppressNextTreeSelect = false; + var _locatorIndexArray = {}; var _autoRegeneratePref; var _acceptButton; var _sortCheckbox; @@ -45,8 +46,8 @@ var Zotero_Citation_Dialog = new function () { this.toggleEditor = toggleEditor; this.treeItemSelected = treeItemSelected; this.listItemSelected = listItemSelected; - this.addCitation = addCitation; - this.deleteCitation = deleteCitation; + this.add = add; + this.remove = remove; this.sortCitation = sortCitation; this.confirmRegenerate = confirmRegenerate; this.accept = accept; @@ -66,7 +67,6 @@ var Zotero_Citation_Dialog = new function () { // find accept button _acceptButton = document.getElementById("add-citation-dialog").getButton("accept"); - _autoRegeneratePref = Zotero.Prefs.get("integration.autoRegenerate"); // if a style with sortable citations, present checkbox @@ -74,8 +74,28 @@ var Zotero_Citation_Dialog = new function () { _sortCheckbox = document.getElementById("keepSorted"); _sortCheckbox.hidden = false; _sortCheckbox.checked = true; + io.citation.properties.sort = true; } + // load locators + var locators = Zotero.CSL.Global.getLocatorStrings(); + var menu = document.getElementById("locatorType"); + var popup = document.getElementById("locator-type-popup"); + var i = 0; + for(var value in locators) { + var locator = locators[value]; + locator = locator[0].toUpperCase()+locator.substr(1); + // add to popup + var child = document.createElement("menuitem"); + child.setAttribute("value", value); + child.setAttribute("label", locator); + popup.appendChild(child); + // add to array + _locatorIndexArray[value] = i; + i++; + } + menu.selectedIndex = 0; + // load (from selectItemsDialog.js) doLoad(); @@ -88,15 +108,22 @@ var Zotero_Citation_Dialog = new function () { selectItem(io.citation.citationItems[0].itemID); // from selectItemsDialog.js for(var property in _preserveData) { if(io.citation.citationItems[0][property]) { - document.getElementById(property)[_preserveData[property]] = io.citation.citationItems[0][property]; + if(property == "locatorType") { + document.getElementById(property)[_preserveData[property]] = _locatorIndexArray[io.citation.citationItems[0][property]]; + } else { + document.getElementById(property)[_preserveData[property]] = io.citation.citationItems[0][property]; + } } } } else { // multiple citations toggleMultipleSources(); for(var i=0; i - +