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
This commit is contained in:
Simon Kornblith 2007-09-13 21:04:41 +00:00
parent f0b25656fd
commit c3e2e83df9
13 changed files with 1499 additions and 602 deletions

View File

@ -34,6 +34,7 @@ var Zotero_Citation_Dialog = new function () {
var _lastSelected = null; var _lastSelected = null;
var _previewShown = false; var _previewShown = false;
var _suppressNextTreeSelect = false; var _suppressNextTreeSelect = false;
var _locatorIndexArray = {};
var _autoRegeneratePref; var _autoRegeneratePref;
var _acceptButton; var _acceptButton;
var _sortCheckbox; var _sortCheckbox;
@ -45,8 +46,8 @@ var Zotero_Citation_Dialog = new function () {
this.toggleEditor = toggleEditor; this.toggleEditor = toggleEditor;
this.treeItemSelected = treeItemSelected; this.treeItemSelected = treeItemSelected;
this.listItemSelected = listItemSelected; this.listItemSelected = listItemSelected;
this.addCitation = addCitation; this.add = add;
this.deleteCitation = deleteCitation; this.remove = remove;
this.sortCitation = sortCitation; this.sortCitation = sortCitation;
this.confirmRegenerate = confirmRegenerate; this.confirmRegenerate = confirmRegenerate;
this.accept = accept; this.accept = accept;
@ -66,7 +67,6 @@ var Zotero_Citation_Dialog = new function () {
// find accept button // find accept button
_acceptButton = document.getElementById("add-citation-dialog").getButton("accept"); _acceptButton = document.getElementById("add-citation-dialog").getButton("accept");
_autoRegeneratePref = Zotero.Prefs.get("integration.autoRegenerate"); _autoRegeneratePref = Zotero.Prefs.get("integration.autoRegenerate");
// if a style with sortable citations, present checkbox // if a style with sortable citations, present checkbox
@ -74,8 +74,28 @@ var Zotero_Citation_Dialog = new function () {
_sortCheckbox = document.getElementById("keepSorted"); _sortCheckbox = document.getElementById("keepSorted");
_sortCheckbox.hidden = false; _sortCheckbox.hidden = false;
_sortCheckbox.checked = true; _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) // load (from selectItemsDialog.js)
doLoad(); doLoad();
@ -88,15 +108,22 @@ var Zotero_Citation_Dialog = new function () {
selectItem(io.citation.citationItems[0].itemID); // from selectItemsDialog.js selectItem(io.citation.citationItems[0].itemID); // from selectItemsDialog.js
for(var property in _preserveData) { for(var property in _preserveData) {
if(io.citation.citationItems[0][property]) { 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 { } else {
// multiple citations // multiple citations
toggleMultipleSources(); toggleMultipleSources();
for(var i=0; i<io.citation.citationItems.length; i++) { for(var i=0; i<io.citation.citationItems.length; i++) {
_addItem(io.citation.citationItems[i].itemID); var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
_itemData[io.citation.citationItems[i].itemID] = io.citation.citationItems[i]; if(item) {
_addItem(item);
_itemData[io.citation.citationItems[i].itemID] = io.citation.citationItems[i];
}
} }
} }
@ -105,6 +132,8 @@ var Zotero_Citation_Dialog = new function () {
toggleEditor(io.citation.properties.custom); toggleEditor(io.citation.properties.custom);
io.citation.properties.custom = undefined; io.citation.properties.custom = undefined;
} }
_updateAccept();
} }
} }
@ -160,7 +189,7 @@ var Zotero_Citation_Dialog = new function () {
// disable boxes if item not added; otherwise, enable // disable boxes if item not added; otherwise, enable
_itemSelected(hasBeenAdded ? itemID : false); _itemSelected(hasBeenAdded ? itemID : false);
// disable adding nothing, or things already added // disable adding nothing, or things already added
document.getElementById("citation-add").disabled = !itemID || hasBeenAdded; document.getElementById("add").disabled = !itemID || hasBeenAdded;
} else { } else {
_updateAccept(); _updateAccept();
_updatePreview(); _updatePreview();
@ -175,18 +204,21 @@ var Zotero_Citation_Dialog = new function () {
var itemID = (selectedListItem ? selectedListItem.value : false); var itemID = (selectedListItem ? selectedListItem.value : false);
_itemSelected(itemID); _itemSelected(itemID);
document.getElementById("citation-delete").disabled = !itemID; document.getElementById("remove").disabled = !itemID;
} }
/* /*
* Adds a citation to the multipleSources list * Adds a citation to the multipleSources list
*/ */
function addCitation() { function add() {
// get selected item (from selectItemsDialog.js) // get selected item (from selectItemsDialog.js)
var item = getSelectedItems()[0]; var item = getSelectedItems()[0];
_itemSelected(item.getID()); _itemSelected(item.getID());
_addItem(item); _addItem(item);
// don't let someone select it again
document.getElementById("add").disabled = true;
// allow user to press OK // allow user to press OK
_updateAccept(); _updateAccept();
_updatePreview(); _updatePreview();
@ -196,7 +228,7 @@ var Zotero_Citation_Dialog = new function () {
/* /*
* Deletes a citation from the multipleSources list * Deletes a citation from the multipleSources list
*/ */
function deleteCitation() { function remove() {
var citationList = document.getElementById("citation-list"); var citationList = document.getElementById("citation-list");
var selectedListItem = citationList.getSelectedItem(0); var selectedListItem = citationList.getSelectedItem(0);
var itemID = selectedListItem.value; var itemID = selectedListItem.value;
@ -217,6 +249,7 @@ var Zotero_Citation_Dialog = new function () {
* Sorts the list of citations * Sorts the list of citations
*/ */
function sortCitation() { function sortCitation() {
io.citation.properties.sort = _sortCheckbox.checked;
if(_sortCheckbox.checked) { if(_sortCheckbox.checked) {
_getCitation(); _getCitation();
@ -226,22 +259,14 @@ var Zotero_Citation_Dialog = new function () {
citationList.removeChild(citationList.firstChild); citationList.removeChild(citationList.firstChild);
} }
// add surrogate items to citation // run preview function to re-sort, if it hasn't already been
for(var i=0; i<io.citation.citationItems.length; i++) { // run
io.citation.citationItems[i].item = new Zotero.CSL.Item(Zotero.Items.get(io.citation.citationItems[i].itemID)); if(!_previewShown) io.previewFunction();
}
io.citation.sort();
// add items back to list // add items back to list
for(var i=0; i<io.citation.citationItems.length; i++) { for(var i=0; i<io.citation.citationItems.length; i++) {
var item = io.citation.citationItems[i].item.zoteroItem; var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
_addItem(item);
var itemNode = document.createElement("listitem");
itemNode.setAttribute("value", item.getID());
itemNode.setAttribute("label", item.getField("title"));
itemNode.setAttribute("class", "listitem-iconic");
itemNode.setAttribute("image", item.getImageSrc());
document.getElementById("citation-list").appendChild(itemNode);
} }
} }
} }
@ -365,12 +390,22 @@ var Zotero_Citation_Dialog = new function () {
var property = _preserveData[box]; var property = _preserveData[box];
// save property // save property
if(_lastSelected) _itemData[_lastSelected][box] = domBox[property]; if(_lastSelected) {
if(property == "locatorType") {
_itemData[_lastSelected][box] = domBox.selectedItem.value;
} else {
_itemData[_lastSelected][box] = domBox[property];
}
}
// restore previous property // restore previous property
if(itemID) { if(itemID) {
domBox.disabled = false; domBox.disabled = false;
if(_itemData[itemID] && _itemData[itemID][box] !== undefined) { if(_itemData[itemID] && _itemData[itemID][box] !== undefined) {
domBox[property] = _itemData[itemID][box]; if(property == "locatorType") {
domBox[property] = _locatorIndexArray[_itemData[itemID][box]];
} else {
domBox[property] = _itemData[itemID][box];
}
} }
} else if(itemID !== undefined) { } else if(itemID !== undefined) {
domBox.disabled = true; domBox.disabled = true;
@ -413,7 +448,11 @@ var Zotero_Citation_Dialog = new function () {
var citationItem = new Zotero.CSL.CitationItem(); var citationItem = new Zotero.CSL.CitationItem();
citationItem.itemID = items[0]; citationItem.itemID = items[0];
for(var property in _preserveData) { for(var property in _preserveData) {
citationItem[property] = document.getElementById(property)[_preserveData[property]]; if(property == "locatorType") {
citationItem[property] = document.getElementById(property).selectedItem.value;
} else {
citationItem[property] = document.getElementById(property)[_preserveData[property]];
}
} }
io.citation.citationItems = [citationItem]; io.citation.citationItems = [citationItem];
} }
@ -429,8 +468,5 @@ var Zotero_Citation_Dialog = new function () {
itemNode.setAttribute("class", "listitem-iconic"); itemNode.setAttribute("class", "listitem-iconic");
itemNode.setAttribute("image", item.getImageSrc()); itemNode.setAttribute("image", item.getImageSrc());
document.getElementById("citation-list").appendChild(itemNode); document.getElementById("citation-list").appendChild(itemNode);
// don't let someone select it again
document.getElementById("citation-add").disabled = true;
} }
} }

View File

@ -23,7 +23,7 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/addCitationDialog.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd"> <!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
<dialog <dialog
@ -44,102 +44,96 @@
<script src="addCitationDialog.js"/> <script src="addCitationDialog.js"/>
<vbox id="zotero-select-items-container" flex="1" style="padding: 1em"> <vbox id="zotero-select-items-container" flex="1" style="padding: 1em">
<hbox flex="1"> <vbox flex="1">
<vbox flex="1"> <hbox flex="1">
<hbox flex="1"> <vbox align="stretch" flex="1">
<vbox align="stretch" flex="1"> <hbox align="center" pack="end">
<hbox align="center" pack="end"> <label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/> <textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;">
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;"> <toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/> </textbox>
</textbox>
</hbox>
<hbox flex="1" style="margin-top: 5px">
<tree id="zotero-collections-tree"
style="width: 200px;" hidecolumnpicker="true" seltype="single"
onselect="onCollectionSelected();">
<treecols>
<treecol
id="zotero-collections-name-column"
label="&zotero.collections.name_column;"
flex="1"
primary="true"/>
</treecols>
<treechildren/>
</tree>
<tree id="zotero-items-tree"
flex="1" hidecolumnpicker="true" seltype="single"
onselect="Zotero_Citation_Dialog.treeItemSelected();">
<treecols>
<treecol
id="zotero-items-column-title" primary="true"
label="&zotero.items.title_column;"
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-firstCreator"
label="&zotero.items.creator_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateAdded" hidden="true"
label="&zotero.items.dateAdded_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateModified" hidden="true"
label="&zotero.items.dateModified_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
</treecols>
<treechildren/>
</tree>
</hbox>
</vbox>
<hbox hidden="true" id="multiple-sources">
<vbox align="center" pack="center">
<toolbarbutton id="citation-add" oncommand="Zotero_Citation_Dialog.addCitation()" disabled="true"/>
<toolbarbutton id="citation-delete" oncommand="Zotero_Citation_Dialog.deleteCitation()" disabled="true"/>
</vbox>
<vbox>
<checkbox id="keepSorted" hidden="true" checked="false" oncommand="Zotero_Citation_Dialog.sortCitation()" label="&zotero.citation.keepSorted.label;"/>
<listbox id="citation-list" flex="1" align="stretch" seltype="single"
onselect="Zotero_Citation_Dialog.listItemSelected();"></listbox>
</vbox>
</hbox> </hbox>
</hbox> <hbox flex="1" style="margin-top: 5px">
<tree id="zotero-collections-tree"
style="width: 200px;" hidecolumnpicker="true" seltype="single"
onselect="onCollectionSelected();">
<treecols>
<treecol
id="zotero-collections-name-column"
label="&zotero.collections.name_column;"
flex="1"
primary="true"/>
</treecols>
<treechildren/>
</tree>
<hbox align="stretch" style="margin-top: 8px"> <tree id="zotero-items-tree"
<vbox flex="1"> flex="1" hidecolumnpicker="true" seltype="single"
<hbox align="center"> onselect="Zotero_Citation_Dialog.treeItemSelected();">
<label value="&zotero.citation.prefix.label;"/> <treecols>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="prefix" align="stretch" flex="1"/> <treecol
</hbox> id="zotero-items-column-title" primary="true"
<hbox align="center"> label="&zotero.items.title_column;"
<label value="&zotero.citation.suffix.label;"/> flex="4" persist="width ordinal hidden sortActive sortDirection"/>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="suffix" align="stretch" flex="1"/> <splitter class="tree-splitter"/>
</hbox> <treecol
<spacer flex="1"/> id="zotero-items-column-firstCreator"
label="&zotero.items.creator_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateAdded" hidden="true"
label="&zotero.items.dateAdded_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateModified" hidden="true"
label="&zotero.items.dateModified_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
</treecols>
<treechildren/>
</tree>
</hbox>
</vbox>
<hbox hidden="true" id="multiple-sources">
<vbox align="center" pack="center">
<toolbarbutton id="add" oncommand="Zotero_Citation_Dialog.add()" disabled="true"/>
<toolbarbutton id="remove" oncommand="Zotero_Citation_Dialog.remove()" disabled="true"/>
</vbox> </vbox>
<separator flex="4"/> <vbox>
<vbox flex="1"> <checkbox id="keepSorted" hidden="true" checked="false" oncommand="Zotero_Citation_Dialog.sortCitation()" label="&zotero.citation.keepSorted.label;"/>
<hbox align="stretch"> <listbox id="citation-list" flex="1" align="stretch" seltype="single"
<menulist onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locatorType"> onselect="Zotero_Citation_Dialog.listItemSelected();"></listbox>
<menupopup id="locator-type-popup">
<menuitem value="page" label="&zotero.citation.page;" selected="1"/>
<menuitem value="paragraph" label="&zotero.citation.paragraph;"/>
<menuitem value="line" label="&zotero.citation.line;"/>
</menupopup>
</menulist>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locator" flex="1"/>
</hbox>
<separator style="height: 2px" flex="1"/>
<checkbox oncommand="Zotero_Citation_Dialog.confirmRegenerate(true)" id="suppressAuthor" label="&zotero.citation.suppressAuthor.label;"/>
</vbox> </vbox>
</hbox> </hbox>
</vbox> </hbox>
</hbox>
<hbox align="stretch" style="margin-top: 8px">
<vbox flex="1">
<hbox align="center">
<label value="&zotero.citation.prefix.label;"/>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="prefix" align="stretch" flex="1"/>
</hbox>
<hbox align="center">
<label value="&zotero.citation.suffix.label;"/>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="suffix" align="stretch" flex="1"/>
</hbox>
<spacer flex="1"/>
</vbox>
<separator flex="4"/>
<vbox flex="1">
<hbox align="stretch">
<menulist onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locatorType">
<menupopup id="locator-type-popup"/>
</menulist>
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locator" flex="1"/>
</hbox>
<separator style="height: 2px" flex="1"/>
<checkbox oncommand="Zotero_Citation_Dialog.confirmRegenerate(true)" id="suppressAuthor" label="&zotero.citation.suppressAuthor.label;"/>
</vbox>
</hbox>
</vbox>
<textbox id="editor" type="styled" hidden="true" flex="1"/> <textbox id="editor" type="styled" hidden="true" flex="1"/>

View File

@ -65,11 +65,16 @@
this._toggle = []; this._toggle = [];
// why is this necessary? because the browser takes time to // why is this necessary? because the browser takes time to
// load, but doesn't appear to fire an event when loaded. // load, but doesn't appear to fire an event when loaded,
// why does this work? no idea. // when recovering from being hidden. why does this work?
// no idea.
this._isLoaded = false; this._isLoaded = false;
var me = this; var me = this;
window.setTimeout(function() {me._loaded()}, 1); if(this.hasAttribute("hidden")) {
window.setTimeout(function() {me._loaded()}, 1);
} else {
this._browser.contentWindow.addEventListener("load", function() {me._loaded()}, false);
}
]]></constructor> ]]></constructor>
<!-- Called when loaded. Until the browser is loaded, we can't do <!-- Called when loaded. Until the browser is loaded, we can't do
@ -137,7 +142,7 @@
<setter><![CDATA[ <setter><![CDATA[
this._readonly = val; this._readonly = val;
if(this._isLoaded) { if(this._isLoaded) {
if(val == true) { if(val) {
this._browser.contentDocument.designMode = "off"; this._browser.contentDocument.designMode = "off";
} else { } else {
this._browser.contentDocument.designMode = "on"; this._browser.contentDocument.designMode = "on";
@ -201,7 +206,9 @@
this._browser.contentDocument.write("<body>"+html+"</body>"); this._browser.contentDocument.write("<body>"+html+"</body>");
this._browser.contentDocument.close(); this._browser.contentDocument.close();
this._browser.contentDocument.designMode = (this._readonly ? "off" : "on"); this._browser.contentDocument.designMode = (this._readonly ? "off" : "on");
this._browser.contentDocument.execCommand("styleWithCSS", false, this._styleWithCSS); try {
this._browser.contentDocument.execCommand("styleWithCSS", false, this._styleWithCSS);
} catch(e) {}
this._updateButtons(); this._updateButtons();
} else { } else {

View File

@ -0,0 +1,169 @@
/*
***** BEGIN LICENSE BLOCK *****
Copyright (c) 2006 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://chnm.gmu.edu
Licensed under the Educational Community License, Version 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
***** END LICENSE BLOCK *****
*/
var Zotero_Bibliography_Dialog = new function () {
var bibEditInterface;
var itemSet;
var _originalBibEntry;
var _lastSelectedItem;
this.load = load;
this.treeItemSelected = treeItemSelected;
this.listItemSelected = listItemSelected;
this.add = add;
this.remove = remove;
this.accept = accept;
/*
* initialize add citation dialog
*/
function load() {
document.getElementById('editor').format = "Integration";
if(Zotero.isWin) {
document.getElementById("zotero-select-items-container").style.border = "1px solid black";
}
bibEditInterface = window.arguments[0].wrappedJSObject;
itemSet = bibEditInterface.getItemSet();
// load (from selectItemsDialog.js)
doLoad();
// load bibliography entires
_loadItems();
}
/*
* called when an item in the item selection tree is clicked
*/
function treeItemSelected() {
// get selected item (from selectItemsDialog.js)
var items = getSelectedItems(true);
// disable add if item already in itemSet
document.getElementById("add").disabled = !items.length || itemSet.getItemsByIds([items[0]])[0];
}
/*
* called when an item in the reference list is clicked
*/
function listItemSelected() {
var selectedListItem = document.getElementById("item-list").getSelectedItem(0);
// enable remove if item is selected
document.getElementById("remove").disabled = !selectedListItem;
if(selectedListItem) {
_updatePreview(itemSet.getItemsByIds([selectedListItem.value])[0]);
} else {
_updatePreview(false);
}
}
/*
* Adds a citation to the reference list
*/
function add() {
// get selected item (from selectItemsDialog.js)
var item = getSelectedItems()[0];
bibEditInterface.add(item);
document.getElementById("add").disabled = true;
_loadItems();
}
/*
* Deletes a citation from the reference list
*/
function remove() {
var selectedListItem = document.getElementById("item-list").getSelectedItem(0);
var itemID = selectedListItem.value;
var item = itemSet.getItemsByIds([itemID])[0];
if(bibEditInterface.isCited(item)) {
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var out = {};
var regenerate = promptService.confirmEx(
window,
Zotero.getString('integration.deleteCitedItem.title'),
Zotero.getString('integration.deleteCitedItem.body'),
promptService.STD_OK_CANCEL_BUTTONS+promptService.BUTTON_POS_1_DEFAULT,
null, null, null, null, out
);
if(regenerate != 0) return;
}
bibEditInterface.remove(item);
_loadItems();
}
/*
* Called on "Accept" button
*/
function accept() {
_updatePreview();
}
/*
* Updates the contents of the preview pane
*/
function _updatePreview(item) {
var editor = document.getElementById('editor');
if(_lastSelectedItem && editor.value != _originalBibEntry) {
Zotero.debug("setting bibliography for "+_lastSelectedItem.getID()+" to "+editor.value);
_lastSelectedItem.setProperty("bibliography-Integration", editor.value);
}
editor.readonly = !item;
editor.value = _originalBibEntry = (item ? bibEditInterface.preview(item) : "");
_lastSelectedItem = item;
}
/*
* loads items from itemSet
*/
function _loadItems() {
// delete all existing items from list
var itemList = document.getElementById("item-list");
while(itemList.firstChild) {
itemList.removeChild(itemList.firstChild);
}
// add new items
for(var i=0; i<itemSet.items.length; i++) {
var item = itemSet.items[i].zoteroItem;
var itemNode = document.createElement("listitem");
itemNode.setAttribute("value", item.getID());
itemNode.setAttribute("label", item.getField("title"));
itemNode.setAttribute("class", "listitem-iconic");
itemNode.setAttribute("image", item.getImageSrc());
itemList.appendChild(itemNode);
}
_updatePreview();
}
}

View File

@ -0,0 +1,115 @@
<?xml version="1.0"?>
<!--
***** BEGIN LICENSE BLOCK *****
Copyright (c) 2006 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://chnm.gmu.edu
Licensed under the Educational Community License, Version 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
***** END LICENSE BLOCK *****
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
<dialog
id="edit-bibliography-dialog"
orient="vertical"
title="&zotero.integration.editBibliography.title;"
width="750" height="450"
onload="Zotero_Bibliography_Dialog.load();"
onunload="doUnload();"
ondialogaccept="Zotero_Bibliography_Dialog.accept();"
buttons="cancel,accept"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="padding: 0">
<script src="include.js"/>
<script src="selectItemsDialog.js"/>
<script src="editBibliographyDialog.js"/>
<vbox id="zotero-select-items-container" flex="1" style="padding: 1em">
<vbox flex="1">
<hbox flex="1">
<vbox align="stretch" flex="1">
<hbox align="center" pack="end">
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;">
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
</textbox>
</hbox>
<hbox flex="1" style="margin-top: 5px">
<tree id="zotero-collections-tree"
style="width: 150px;" hidecolumnpicker="true" seltype="single"
onselect="onCollectionSelected();">
<treecols>
<treecol
id="zotero-collections-name-column"
label="&zotero.collections.name_column;"
flex="1"
primary="true"/>
</treecols>
<treechildren/>
</tree>
<tree id="zotero-items-tree"
flex="1" hidecolumnpicker="true" seltype="single"
onselect="Zotero_Bibliography_Dialog.treeItemSelected();">
<treecols>
<treecol
id="zotero-items-column-title" primary="true"
label="&zotero.items.title_column;"
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-firstCreator"
label="&zotero.items.creator_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateAdded" hidden="true"
label="&zotero.items.dateAdded_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol
id="zotero-items-column-dateModified" hidden="true"
label="&zotero.items.dateModified_column;"
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
</treecols>
<treechildren/>
</tree>
</hbox>
</vbox>
<hbox id="source-list">
<vbox align="center" pack="center">
<toolbarbutton id="add" oncommand="Zotero_Bibliography_Dialog.add()" disabled="true"/>
<toolbarbutton id="remove" oncommand="Zotero_Bibliography_Dialog.remove()" disabled="true"/>
</vbox>
<vbox>
<label value="&zotero.integration.references.label;"/>
<listbox id="item-list" flex="1" align="stretch" seltype="single"
style="width: 250px;" onselect="Zotero_Bibliography_Dialog.listItemSelected();"/>
</vbox>
</hbox>
</hbox>
</vbox>
<textbox id="editor" type="styled" flex="1"/>
</vbox>
</dialog>

File diff suppressed because it is too large Load Diff

View File

@ -310,19 +310,28 @@ Zotero.CSL.Compat.ItemSet.prototype.add = function(items) {
} }
this.items.push(item); this.items.push(item);
returnList.push(item); returnList.push(item);
item.zoteroItem = item; item.zoteroItem = item;
item.setProperty = function(property, value) {
item._csl[property] = value;
}
item.getProperty = function(property) {
return (item._csl[property] ? item._csl[property] : "");
}
} }
return returnList; return returnList;
} }
Zotero.CSL.Compat.ItemSet.prototype.remove = function(items) { Zotero.CSL.Compat.ItemSet.prototype.remove = function(items) {
for(var i in items) { for(var i in items) {
if(!item) continue;
if(items[i] instanceof Zotero.Item) { if(items[i] instanceof Zotero.Item) {
var item = items[i]; var item = items[i];
} else { } else {
var item = Zotero.Items.get(i); var item = Zotero.Items.get(i);
} }
if(!item) continue;
this.items.splice(this.items.indexOf(item), 1); this.items.splice(this.items.indexOf(item), 1);
} }
} }
@ -456,8 +465,6 @@ Zotero.CSL.Compat.prototype.formatCitation = function(citation, format) {
var locator = citation.citationItems[0].locator; var locator = citation.citationItems[0].locator;
if(locator) { if(locator) {
var locatorType = Zotero.CSL.locatorTypeTerms[citation.citationItems[0].locatorType];
// search for elements with the same serialization // search for elements with the same serialization
var element = this._getFieldDefaults("locator"); var element = this._getFieldDefaults("locator");
if(!element) { if(!element) {
@ -469,7 +476,7 @@ Zotero.CSL.Compat.prototype.formatCitation = function(citation, format) {
if(element) { if(element) {
string.append("., "); string.append("., ");
string.appendLocator(locatorType, locator, element); string.appendLocator(citation.citationItems[0].locatorType, locator, element);
} }
} }
} }
@ -484,7 +491,7 @@ Zotero.CSL.Compat.prototype.formatCitation = function(citation, format) {
if(citationItem.prefix) string.append(citationItem.prefix+" "); if(citationItem.prefix) string.append(citationItem.prefix+" ");
var citationString = this._getCitation(citationItem.item, var citationString = this._getCitation(citationItem.item,
position, Zotero.CSL.locatorTypeTerms[citationItem.locatorType], position, citationItem.locatorType,
citationItem.locator, format, this._cit, ignore); citationItem.locator, format, this._cit, ignore);
string.concat(citationString); string.concat(citationString);
if(citationItem.suffix) string.append(citationItem.suffix+" "); if(citationItem.suffix) string.append(citationItem.suffix+" ");
@ -536,7 +543,10 @@ Zotero.CSL.Compat.prototype.formatBibliography = function(itemSet, format) {
for(var i in items) { for(var i in items) {
var item = items[i]; var item = items[i];
var string = this._getCitation(item, "first", false, false, format, this._bib).get(); var string = item.getProperty("bibliography-"+format);
if(!string) {
string = this._getCitation(item, "first", false, false, format, this._bib).get();
}
if(!string) { if(!string) {
continue; continue;
} }
@ -1085,7 +1095,7 @@ Zotero.CSL.Compat.prototype._processCreators = function(type, element, creators,
var firstName, lastName; var firstName, lastName;
for(var i=0; i<maxCreators; i++) { for(var i=0; i<maxCreators; i++) {
var firstName = ""; var firstName = "";
if(element["form"] != "short") { if(element["form"] && element["form"] != "short") {
if(child["initialize-with"] != undefined) { if(child["initialize-with"] != undefined) {
// even if initialize-with is simply an empty string, use // even if initialize-with is simply an empty string, use
// initials // initials

View File

@ -20,7 +20,7 @@
***** END LICENSE BLOCK ***** ***** END LICENSE BLOCK *****
*/ */
const API_VERSION = 2; const API_VERSION = 3;
Zotero.Integration = new function() { Zotero.Integration = new function() {
var _contentLengthRe = /[\r\n]Content-Length: *([0-9]+)/i; var _contentLengthRe = /[\r\n]Content-Length: *([0-9]+)/i;
@ -363,7 +363,7 @@ Zotero.Integration.SOAP = new function() {
/* /*
* generates a new citation for a given item * generates a new citation for a given item
* ACCEPTS: sessionID, bibliographyMode, citationMode, editCitationIndex(, fieldIndex, fieldName)+ * ACCEPTS: sessionID, bibliographyMode, citationMode, editCitationIndex(, fieldIndex, fieldName)+
* RETURNS: bibliography(, fieldIndex, fieldRename, fieldContent)+ * RETURNS: bibliography, documentData(, fieldIndex, fieldRename, fieldContent)+
*/ */
function update(vars) { function update(vars) {
if(!_sessions[vars[0]]) return "ERROR:sessionExpired"; if(!_sessions[vars[0]]) return "ERROR:sessionExpired";
@ -372,8 +372,16 @@ Zotero.Integration.SOAP = new function() {
var bibliographyMode = vars[1]; var bibliographyMode = vars[1];
var citationMode = vars[2]; var citationMode = vars[2];
// get whether to edit bibliography or edit a citation
var editCitationIndex = false;
var editBibliography = false;
if(vars[3] == "B") {
editBibliography = true;
} else if(vars[3] != "!") {
editCitationIndex = vars[3];
}
// first collect entire bibliography // first collect entire bibliography
var editCitationIndex = (vars[3] == "!" ? false : vars[3]);
var editCitation = false; var editCitation = false;
for(var i=4; i<vars.length; i+=2) { for(var i=4; i<vars.length; i+=2) {
if(vars[i+1] == "X") { // new citation has field name X if(vars[i+1] == "X") { // new citation has field name X
@ -392,6 +400,7 @@ Zotero.Integration.SOAP = new function() {
} }
session.updateItemSet(); session.updateItemSet();
if(editCitationIndex) { if(editCitationIndex) {
session.updateCitations(editCitationIndex-1); session.updateCitations(editCitationIndex-1);
var added = session.editCitation(editCitationIndex, editCitation); var added = session.editCitation(editCitationIndex, editCitation);
@ -406,28 +415,41 @@ Zotero.Integration.SOAP = new function() {
} }
session.updateCitations(); session.updateCitations();
if(editBibliography) {
session.editBibliography();
}
// update // update
var output = new Array(); var output = new Array();
if((bibliographyMode == "updated" // if we want updated bib if((bibliographyMode == "updated" // if we want updated bib
&& session.itemSetHasChanged) // and bibliography changed && session.itemSetHasChanged) // and bibliography changed
|| bibliographyMode == "true") { // or if we should generate regardless of changes || bibliographyMode == "true") { // or if we should generate regardless of changes
output.push(session.getBibliography()); var bibliography = session.getBibliography();
if(!bibliography) bibliography = "!";
output.push(bibliography);
} else { // otherwise, send no bibliography } else { // otherwise, send no bibliography
output.push("!"); output.push("!");
} }
if(session.documentDataHasChanged) {
output.push(session.getDocumentData());
} else {
output.push("!");
}
// get citations // get citations
output = output.concat(session.getCitations(citationMode == "all")); output = output.concat(session.getCitations(citationMode == "all"));
// reset citationSet // reset citationSet
session.reset(); session.resetRequest();
return output; return output;
} }
/* /*
* restores a session, given all citations * restores a session, given all citations
* ACCEPTS: version, styleID, use-endnotes, use-bookmarks(, fieldIndex, fieldName)+ * ACCEPTS: version, documentData, styleID, use-endnotes, use-bookmarks(, fieldIndex, fieldName)+
* RETURNS: sessionID * RETURNS: sessionID
*/ */
function restoreSession(vars) { function restoreSession(vars) {
@ -436,18 +458,21 @@ Zotero.Integration.SOAP = new function() {
} }
var sessionID = Zotero.randomString(); var sessionID = Zotero.randomString();
var session = _sessions[sessionID] = new Zotero.Integration.Session(vars[1], vars[2], vars[3]);
var session = _sessions[sessionID] = new Zotero.Integration.Session();
session.setStyle(vars[2], vars[3], vars[4]);
var encounteredItem = new Object(); var encounteredItem = new Object();
var newField = new Object(); var newField = new Object();
var regenerate = new Object(); var regenerate = new Object();
for(var i=4; i<vars.length; i+=2) { for(var i=5; i<vars.length; i+=2) {
session.addCitation(vars[i], vars[i+1]); session.addCitation(vars[i], vars[i+1]);
} }
session.updateItemSet(session.citationsByItemID); session.updateItemSet(session.citationsByItemID);
session.reset(); if(vars[1] != "!") session.loadDocumentData(vars[1]);
session.resetRequest();
return [sessionID]; return [sessionID];
} }
@ -474,6 +499,7 @@ Zotero.Integration.SOAP = new function() {
if(vars[0] == "!") { if(vars[0] == "!") {
// no session ID; generate a new one // no session ID; generate a new one
var sessionID = Zotero.randomString(); var sessionID = Zotero.randomString();
var session = _sessions[sessionID] = new Zotero.Integration.Session();
} else { } else {
// session ID exists // session ID exists
var sessionID = vars[0]; var sessionID = vars[0];
@ -486,10 +512,8 @@ Zotero.Integration.SOAP = new function() {
} }
watcher.openWindow(null, 'chrome://zotero/content/integrationDocPrefs.xul', '', watcher.openWindow(null, 'chrome://zotero/content/integrationDocPrefs.xul', '',
'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io); 'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io, true);
session.setStyle(io.style, io.useEndnotes, io.useBookmarks);
_sessions[sessionID] = new Zotero.Integration.Session(io.style, io.useEndnotes, io.useBookmarks);
session = _sessions[sessionID];
return [sessionID, io.style, session.style.class, session.style.hasBibliography ? "1" : "0", io.useEndnotes, io.useBookmarks]; return [sessionID, io.style, session.style.class, session.style.hasBibliography ? "1" : "0", io.useEndnotes, io.useBookmarks];
} }
@ -507,48 +531,19 @@ Zotero.Integration.SOAP = new function() {
} }
/* /*
* a class to keep track of citation objects in a document * keeps track of all session-specific variables
*/ */
Zotero.Integration.Citation = function(index, field) { Zotero.Integration.Session = function() {
} // holds items not in document that should be in bibliography
/* this.uncitedItems = new Object();
* generates a new field name based on available information
*/ this.resetRequest();
Zotero.Integration.Citation.prototype.regenerateFieldName = function() {
this.field = this.itemIDString+"_"+this.locatorString+"_"+Zotero.randomString();
} }
/* /*
* updates itemIDString and locatorString based on data * changes the Session style
*/ */
Zotero.Integration.Citation.prototype.setData = function(itemIDs, locators, locatorTypes) { Zotero.Integration.Session.prototype.setStyle = function(styleID, useEndnotes, useBookmarks) {
this.itemIDs = itemIDs;
this.itemIDString = itemIDs.join("|");
this.locators = locators;
this.locatorTypes = locatorTypes;
this.locatorString = "";
for(var i in locators) {
this.locatorString += "|"+locatorTypes[i]+locators[i].replace("|", "");
}
if(this.locatorString) this.locatorString = this.locatorString.substr(1);
this.serialization = this.itemIDString+"_"+this.locatorString;
}
/*
* loads locators from locatorString, if not already loaded
*/
Zotero.Integration.Citation.prototype.loadLocators = function() {
if(this.locators) return;
}
/*
* a class to complement Zotero.Integration.Citation, to keep track of the
* order of citations
*/
Zotero.Integration.Session = function(styleID, useEndnotes, useBookmarks) {
this.styleID = styleID; this.styleID = styleID;
this.style = Zotero.Cite.getStyle(styleID); this.style = Zotero.Cite.getStyle(styleID);
this.useEndnotes = useEndnotes; this.useEndnotes = useEndnotes;
@ -558,19 +553,20 @@ Zotero.Integration.Session = function(styleID, useEndnotes, useBookmarks) {
this.dateModified = new Object(); this.dateModified = new Object();
this.itemSetIsSorted = true; this.itemSetIsSorted = true;
this.reset(); this.loadUncitedItems();
} }
/* /*
* resets per-request variables in the CitationSet * resets per-request variables in the CitationSet
*/ */
Zotero.Integration.Session.prototype.reset = function() { Zotero.Integration.Session.prototype.resetRequest = function() {
this.citationsByItemID = new Object(); this.citationsByItemID = new Object();
this.citationsByIndex = new Array(); this.citationsByIndex = new Array();
this.itemSetHasChanged = false; this.itemSetHasChanged = false;
this.documentDataHasChanged = false;
this.updateItemIDs = new Object(); this.updateItemIDs = new Object();
this.updateIndices = new Object(); this.updateIndices = new Object()
} }
/* /*
@ -689,11 +685,11 @@ Zotero.Integration.Session.prototype.completeCitation = function(object) {
* unserializes a JSON citation into a citation object (sans items) * unserializes a JSON citation into a citation object (sans items)
*/ */
Zotero.Integration.Session.prototype.unserializeCitation = function(arg) { Zotero.Integration.Session.prototype.unserializeCitation = function(arg) {
if(arg[0] == "{") { if(arg[0] == "{") { // JSON field
// create citation // create citation
var citation = this.style.createCitation(); var citation = this.style.createCitation();
// JSON args // get JSON
var object = Zotero.JSON.unserialize(arg); var object = Zotero.JSON.unserialize(arg);
// copy properties // copy properties
@ -704,8 +700,7 @@ Zotero.Integration.Session.prototype.unserializeCitation = function(arg) {
citation[i] = object[i]; citation[i] = object[i];
} }
} }
} else { } else { // ye olde style field
// ye olde style args
var underscoreIndex = arg.indexOf("_"); var underscoreIndex = arg.indexOf("_");
var itemIDs = arg.substr(0, underscoreIndex).split("|"); var itemIDs = arg.substr(0, underscoreIndex).split("|");
@ -754,6 +749,10 @@ Zotero.Integration.Session.prototype.previewCitation = function(citation) {
this.getCitationPositions(citation); this.getCitationPositions(citation);
// sort item set // sort item set
this.sortItemSet(); this.sortItemSet();
// sort citation if desired
if(citation.properties.sort) {
citation.sort();
}
// get preview citation // get preview citation
var text = this.style.formatCitation(citation, "Integration"); var text = this.style.formatCitation(citation, "Integration");
// delete from item set // delete from item set
@ -809,9 +808,16 @@ Zotero.Integration.Session.prototype.getCitationPositions = function(citation, u
var previousCitation = (previousIndex == -1 ? false : this.citationsByIndex[previousIndex]); var previousCitation = (previousIndex == -1 ? false : this.citationsByIndex[previousIndex]);
// if only one source, and it's the same as the last, use ibid // if only one source, and it's the same as the last, use ibid
if(previousCitation && citation.citationItems.length == 1 if( // there must be a previous citation with one item, and this citation
// may only have one item
previousCitation && citation.citationItems.length == 1
&& previousCitation.citationItems.length == 1 && previousCitation.citationItems.length == 1
&& citation.citationItems[0].item == previousCitation.citationItems[0].item) { // the previous citation must have been a citation of the same item
&& citation.citationItems[0].item == previousCitation.citationItems[0].item
// and if the previous citation had a locator (page number, etc.)
// then this citation must have a locator, or else we should do the
// full citation (see Chicago Manual of Style)
&& (!previousCitation.citationItems[0].locator || citation.citationItems[0].locator)) {
// use ibid, but check whether to use ibid+pages // use ibid, but check whether to use ibid+pages
var newPosition = (citation.citationItems[0].locator == previousCitation.citationItems[0].locator var newPosition = (citation.citationItems[0].locator == previousCitation.citationItems[0].locator
&& citation.citationItems[0].locatorType == previousCitation.citationItems[0].locatorType && citation.citationItems[0].locatorType == previousCitation.citationItems[0].locatorType
@ -854,7 +860,7 @@ Zotero.Integration.Session.prototype.updateCitations = function(toIndex) {
/* /*
* updates the ItemSet, adding and deleting bibliography items as appropriate, * updates the ItemSet, adding and deleting bibliography items as appropriate,
* then resorting * then re-sorting
*/ */
Zotero.Integration.Session.prototype.updateItemSet = function() { Zotero.Integration.Session.prototype.updateItemSet = function() {
var addItems = []; var addItems = [];
@ -864,10 +870,12 @@ Zotero.Integration.Session.prototype.updateItemSet = function() {
// see if items were deleted from Zotero // see if items were deleted from Zotero
if (!Zotero.Items.get(i)) { if (!Zotero.Items.get(i)) {
deleteItems.push(itemID); deleteItems.push(itemID);
for(var j=0; j<this.citationsByItemID[i].length; j++) { if(this.citationsByItemID[i].length) {
var citation = this.citationsByItemID[i][j]; for(var j=0; j<this.citationsByItemID[i].length; j++) {
this.updateIndices[citation.properties.index] = true; var citation = this.citationsByItemID[i][j];
citation.properties.delete = true; this.updateIndices[citation.properties.index] = true;
citation.properties.delete = true;
}
} }
this.itemSetChanged(); this.itemSetChanged();
} }
@ -878,7 +886,7 @@ Zotero.Integration.Session.prototype.updateItemSet = function() {
var itemID = item.getID(); var itemID = item.getID();
// see if items were removed // see if items were removed
if(!this.citationsByItemID[itemID]) { if(!this.citationsByItemID[itemID] && !this.uncitedItems[itemID]) {
deleteItems.push(itemID); deleteItems.push(itemID);
this.itemSetChanged(); this.itemSetChanged();
continue; continue;
@ -925,6 +933,23 @@ Zotero.Integration.Session.prototype.itemSetChanged = function() {
this.itemSetHasChanged = true; this.itemSetHasChanged = true;
} }
/*
* edits integration bibliography
*/
Zotero.Integration.Session.prototype.editBibliography = function() {
var bibliographyEditor = new Zotero.Integration.Session.BibliographyEditInterface(this);
var io = new function() { this.wrappedJSObject = bibliographyEditor; }
this.documentDataHasChanged = true;
this.itemSetHasChanged = true;
Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher)
.openWindow(null, 'chrome://zotero/content/editBibliographyDialog.xul', '',
'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io, true);
}
/* /*
* gets integration bibliography * gets integration bibliography
*/ */
@ -978,3 +1003,123 @@ Zotero.Integration.Session.prototype.getCitations = function(regenerateAll) {
return output; return output;
} }
/*
* loads document data from a JSON object
*/
Zotero.Integration.Session.prototype.loadDocumentData = function(json) {
var documentData = Zotero.JSON.unserialize(json);
// set uncited
if(documentData.uncited) {
this.uncitedItems = documentData.uncited;
this.loadUncitedItems();
} else {
this.uncitedItems = new Object();
}
// set custom bibliography entries
if(documentData.custom) {
for(var itemID in documentData.custom) {
Zotero.debug("getting item "+itemID);
var item = this.itemSet.getItemsByIds([itemID])[0];
Zotero.debug(item.toSource());
item.setProperty("bibliography-Integration", documentData.custom[itemID]);
}
}
}
/*
* adds items in this.uncitedItems to itemSet, if they are not already there
*/
Zotero.Integration.Session.prototype.loadUncitedItems = function() {
for(var itemID in this.uncitedItems) {
// skip "undefined"
if(!this.uncitedItems[itemID]) continue;
// if not yet in item set, add to item set
var item = this.itemSet.getItemsByIds([itemID])[0];
if(!item) this.itemSet.add([itemID])[0];
}
}
/*
* saves document data from a JSON object
*/
Zotero.Integration.Session.prototype.getDocumentData = function() {
var documentData = {};
// add uncited if there is anything
for(var item in this.uncitedItems) {
documentData.uncited = this.uncitedItems;
break;
}
// look for custom bibliography entries
if(this.itemSet.items.length) {
for(var i=0; i<this.itemSet.items.length; i++) {
var custom = this.itemSet.items[i].getProperty("bibliography-Integration");
if(custom !== "") {
var itemID = this.itemSet.items[i].getID();
if(!documentData.custom) documentData.custom = {};
documentData.custom[itemID] = custom;
}
}
}
if(documentData.uncited || documentData.custom) {
return Zotero.JSON.serialize(documentData);
} else {
return "X"; // nothing
}
}
/*
* Interface for bibliography editor
*/
Zotero.Integration.Session.BibliographyEditInterface = function(session) {
this.session = session;
}
Zotero.Integration.Session.BibliographyEditInterface.prototype.getItemSet = function() {
return this.session.itemSet;
}
Zotero.Integration.Session.BibliographyEditInterface.prototype.isCited = function(item) {
if(this.session.citationsByItemID[item.getID()]) return true;
return false;
}
Zotero.Integration.Session.BibliographyEditInterface.prototype.add = function(item) {
// create new item
this.session.itemSet.add([item]);
this.session.uncitedItems[item.getID()] = true;
this.session.itemSetChanged();
this.session.sortItemSet();
}
Zotero.Integration.Session.BibliographyEditInterface.prototype.remove = function(item) {
// create new item
this.session.itemSet.remove([item]);
this.session.itemSetChanged();
this.session.sortItemSet();
// delete citations if necessary
var itemID = item.getID();
if(this.session.citationsByItemID[itemID]) {
for(var j=0; j<this.session.citationsByItemID[itemID].length; j++) {
var citation = this.session.citationsByItemID[itemID][j];
this.session.updateIndices[citation.properties.index] = true;
citation.properties.delete = true;
}
}
// delete uncited if neceessary
if(this.session.uncitedItems[itemID]) this.session.uncitedItems[itemID] = undefined;
}
Zotero.Integration.Session.BibliographyEditInterface.prototype.preview = function(item) {
var itemSet = this.session.style.createItemSet([item]);
return this.session.style.formatBibliography(itemSet, "Integration");
}

View File

@ -7,12 +7,48 @@
<term name="retrieved">retrieved</term> <term name="retrieved">retrieved</term>
<term name="from">from</term> <term name="from">from</term>
<term name="forthcoming">forthcoming</term> <term name="forthcoming">forthcoming</term>
<term name="references">References</term> <term name="references">references</term>
<term name="no date">n.d.</term> <term name="no date">n.d.</term>
<term name="and">and</term> <term name="and">and</term>
<term name="et-al">et al.</term> <term name="et-al">et al.</term>
<!-- LONG LOCATOR FORMS --> <!-- LONG LOCATOR FORMS -->
<term name="book">
<single>book</single>
<multiple>books</multiple>
</term>
<term name="chapter">
<single>chapter</single>
<multiple>chapters</multiple>
</term>
<term name="column">
<single>column</single>
<multiple>columns</multiple>
</term>
<term name="figure">
<single>figure</single>
<multiple>figures</multiple>
</term>
<term name="folio">
<single>folio</single>
<multiple>folios</multiple>
</term>
<term name="issue">
<single>number</single>
<multiple>numbers</multiple>
</term>
<term name="line">
<single>line</single>
<multiple>lines</multiple>
</term>
<term name="note">
<single>note</single>
<multiple>notes</multiple>
</term>
<term name="opus">
<single>opus</single>
<multiple>opera</multiple>
</term>
<term name="page"> <term name="page">
<single>page</single> <single>page</single>
<multiple>pages</multiple> <multiple>pages</multiple>
@ -21,28 +57,53 @@
<single>paragraph</single> <single>paragraph</single>
<multiple>paragraph</multiple> <multiple>paragraph</multiple>
</term> </term>
<term name="line"> <term name="part">
<single>line</single> <single>part</single>
<multiple>line</multiple> <multiple>parts</multiple>
</term>
<term name="section">
<single>section</single>
<multiple>sections</multiple>
</term>
<term name="volume">
<single>volume</single>
<multiple>volumes</multiple>
</term>
<term name="verse">
<single>verse</single>
<multiple>verses</multiple>
</term> </term>
<term name="volume">volume</term>
<term name="issue">number</term>
<!-- SHORT LOCATOR FORMS --> <!-- SHORT LOCATOR FORMS -->
<term name="book" form="short">bk</term>
<term name="chapter" form="short">chap</term>
<term name="column" form="short">col</term>
<term name="figure" form="short">fig</term>
<term name="folio" form="short">f</term>
<term name="issue" form="short">no</term>
<term name="opus" form="short">op</term>
<term name="page" form="short"> <term name="page" form="short">
<single>p</single> <single>p</single>
<multiple>pp</multiple> <multiple>pp</multiple>
</term> </term>
<term name="paragraph" form="short"> <term name="paragraph" form="short">para</term>
<term name="part" form="short">pt</term>
<term name="section" form="short">sec</term>
<term name="verse" form="short">
<single>v</single>
<multiple>vv</multiple>
</term>
<term name="volume" form="short">vol</term>
<!-- SYMBOL LOCATOR FORMS -->
<term name="paragraph" form="symbol">
<single></single> <single></single>
<multiple>¶¶</multiple> <multiple>¶¶</multiple>
</term> </term>
<term name="line" form="short"> <term name="section" form="symbol">
<single>line</single> <single>§</single>
<multiple>line</multiple> <multiple>§§</multiple>
</term> </term>
<term name="volume" form="short">vol</term>
<term name="issue" form="short">no</term>
<!-- LONG ROLE FORMS --> <!-- LONG ROLE FORMS -->
<term name="editor"> <term name="editor">
@ -91,7 +152,6 @@
<term name="month-02" form="short">Feb</term> <term name="month-02" form="short">Feb</term>
<term name="month-03" form="short">Mar</term> <term name="month-03" form="short">Mar</term>
<term name="month-04" form="short">Apr</term> <term name="month-04" form="short">Apr</term>
<term name="month-05" form="short">May</term>
<term name="month-06" form="short">Jun</term> <term name="month-06" form="short">Jun</term>
<term name="month-07" form="short">Jul</term> <term name="month-07" form="short">Jul</term>
<term name="month-08" form="short">Aug</term> <term name="month-08" form="short">Aug</term>

View File

@ -110,6 +110,7 @@
<!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.docPrefs.title "Document Preferences">
<!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation">
<!ENTITY zotero.integration.editBibliography.title "Edit Bibliography">
<!ENTITY zotero.progress.title "Progress"> <!ENTITY zotero.progress.title "Progress">
@ -143,3 +144,5 @@
<!ENTITY zotero.integration.prefs.formatUsing.label "Format Using:"> <!ENTITY zotero.integration.prefs.formatUsing.label "Format Using:">
<!ENTITY zotero.integration.prefs.bookmarks.label "Bookmarks"> <!ENTITY zotero.integration.prefs.bookmarks.label "Bookmarks">
<!ENTITY zotero.integration.prefs.bookmarks.caption "Bookmarks are preserved across Microsoft Word and OpenOffice.org, but may be accidentally modified."> <!ENTITY zotero.integration.prefs.bookmarks.caption "Bookmarks are preserved across Microsoft Word and OpenOffice.org, but may be accidentally modified.">
<!ENTITY zotero.integration.references.label "References in Bibliography">

View File

@ -460,3 +460,6 @@ integration.referenceMarks.caption = OpenOffice.org ReferenceMarks are less like
integration.regenerate.title = Do you want to regenerate the citation? integration.regenerate.title = Do you want to regenerate the citation?
integration.regenerate.body = The changes you have made in the citation editor will be lost. integration.regenerate.body = The changes you have made in the citation editor will be lost.
integration.regenerate.saveBehavior = Always follow this selection. integration.regenerate.saveBehavior = Always follow this selection.
integration.deleteCitedItem.title = Are you sure you want to remove this reference?
integration.deleteCitedItem.body = This reference is cited in the text of your document. Deleting it will remove all citations.

View File

@ -1,19 +1,26 @@
#citation-add { #add {
list-style-image: url('chrome://zotero/skin/citation-add.png'); list-style-image: url('chrome://zotero/skin/citation-add.png');
} }
#citation-add[disabled="true"] { #add[disabled="true"] {
list-style-image: url('chrome://zotero/skin/citation-add-gray.png'); list-style-image: url('chrome://zotero/skin/citation-add-gray.png');
} }
#citation-delete { #remove {
list-style-image: url('chrome://zotero/skin/citation-delete.png'); list-style-image: url('chrome://zotero/skin/citation-delete.png');
} }
#citation-delete[disabled="true"] { #remove[disabled="true"] {
list-style-image: url('chrome://zotero/skin/citation-delete-gray.png'); list-style-image: url('chrome://zotero/skin/citation-delete-gray.png');
} }
#add .toolbarbutton-text, #remove .toolbarbutton-text
{
margin: 0 !important;
padding: 0 !important;
}
#prefix, #suffix { #prefix, #suffix {
width: 200px; width: 200px;
} }

View File

@ -22,8 +22,7 @@
-- Set the following timestamp to the most recent scraper update date -- Set the following timestamp to the most recent scraper update date
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-09-13 20:50:16'));
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-09-13 12:00:00'));
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
'function detectWeb(doc, url) { 'function detectWeb(doc, url) {
@ -12583,7 +12582,7 @@ function doSearch(item) {
}'); }');
REPLACE INTO translators VALUES ('11645bd1-0420-45c1-badb-53fb41eeb753', '1.0.0b3.r1', '', '2006-11-27 22:45:00', 1, 100, 8, 'CrossRef', 'Simon Kornblith', 'http://partneraccess.oclc.org/', REPLACE INTO translators VALUES ('11645bd1-0420-45c1-badb-53fb41eeb753', '1.0.0b3.r1', '', '2007-09-13 20:50:16', 1, 100, 8, 'CrossRef', 'Simon Kornblith', 'http://partneraccess.oclc.org/',
'function detectSearch(item) { 'function detectSearch(item) {
if(item.itemType == "journalArticle") { if(item.itemType == "journalArticle") {
return true; return true;
@ -12637,6 +12636,7 @@ REPLACE INTO translators VALUES ('11645bd1-0420-45c1-badb-53fb41eeb753', '1.0.0b
item.edition = query.qr::edition_number.text().toString(); item.edition = query.qr::edition_number.text().toString();
// get first page // get first page
item.pages = query.qr::first_page.text().toString(); item.pages = query.qr::first_page.text().toString();
item.complete(); item.complete();
return true; return true;
} }
@ -12651,7 +12651,7 @@ function doSearch(item) {
var co = Zotero.Utilities.createContextObject(item); var co = Zotero.Utilities.createContextObject(item);
} }
Zotero.Utilities.HTTP.doGet("http://www.crossref.org/openurl/?"+co+"&noredirect=true", function(responseText) { Zotero.Utilities.HTTP.doGet("http://www.crossref.org/openurl?pid=zter:zter321&"+co+"&noredirect=true", function(responseText) {
processCrossRef(responseText); processCrossRef(responseText);
Zotero.done(); Zotero.done();
}); });
@ -16325,8 +16325,9 @@ function doExport() {
} }
}'); }');
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-08-28 16:45:48', 'American Psychological Association', REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-09-13 20:50:16', 'American Psychological Association',
'<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en"> '<?oxygen RNGSchema="csl.rnc" type="compact"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
<info> <info>
<title>American Psychological Association</title> <title>American Psychological Association</title>
<id>http://purl.org/net/xbiblio/csl/styles/apa.csl</id> <id>http://purl.org/net/xbiblio/csl/styles/apa.csl</id>
@ -16337,7 +16338,8 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
</author> </author>
<category term="psychology"/> <category term="psychology"/>
<category term="generic-base"/> <category term="generic-base"/>
<updated>2007-08-14T17:41:10+00:00</updated> <category term="author-date"/>
<updated>2007-09-06T06:36:07+00:00</updated>
</info> </info>
<macro name="editor-translator"> <macro name="editor-translator">
<names variable="editor translator" prefix="(" suffix=")" delimiter=", "> <names variable="editor translator" prefix="(" suffix=")" delimiter=", ">
@ -16391,10 +16393,10 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
<macro name="title"> <macro name="title">
<choose> <choose>
<if type="book"> <if type="book">
<text variable="title" font-style="italic"/> <text variable="title" enforce-case="sentence" font-style="italic"/>
</if> </if>
<else> <else>
<text variable="title"/> <text variable="title" enforce-case="sentence"/>
</else> </else>
</choose> </choose>
</macro> </macro>
@ -16405,14 +16407,18 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
</group> </group>
</macro> </macro>
<citation> <citation>
<option name="sort-algorithm" value="author-date"/>
<option name="et-al-min" value="6"/> <option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/> <option name="et-al-use-first" value="1"/>
<option name="et-al-subsequent-min" value="6"/> <option name="et-al-subsequent-min" value="3"/>
<option name="et-al-subsequent-use-first" value="1"/> <option name="et-al-subsequent-use-first" value="1"/>
<option name="disambiguate-add-year-suffix" value="true"/> <option name="disambiguate-add-year-suffix" value="true"/>
<option name="disambiguate-add-names" value="true"/> <option name="disambiguate-add-names" value="true"/>
<option name="disambiguate-add-givenname" value="true"/> <option name="disambiguate-add-givenname" value="true"/>
<option name="collapse" value="year"/>
<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; "> <layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", "> <group delimiter=", ">
<text macro="author-short"/> <text macro="author-short"/>
@ -16420,7 +16426,7 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
<date-part name="year"/> <date-part name="year"/>
</date> </date>
<group> <group>
<label variable="locator" suffix="." form="short"/> <label variable="locator" include-period="true" form="short"/>
<text variable="locator" prefix=" "/> <text variable="locator" prefix=" "/>
</group> </group>
</group> </group>
@ -16428,9 +16434,12 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
</citation> </citation>
<bibliography> <bibliography>
<option name="hanging-indent" value="true"/> <option name="hanging-indent" value="true"/>
<option name="sort-algorithm" value="author-date"/>
<option name="et-al-min" value="6"/> <option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/> <option name="et-al-use-first" value="6"/>
<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>
<layout> <layout>
<text macro="author" suffix="."/> <text macro="author" suffix="."/>
<date variable="issued" prefix=" (" suffix=")."> <date variable="issued" prefix=" (" suffix=").">
@ -16448,19 +16457,21 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
<text macro="title" prefix=" "/> <text macro="title" prefix=" "/>
<group class="container" prefix=". "> <group class="container" prefix=". ">
<text term="in" text-transform="capitalize"/> <text term="in" text-transform="capitalize"/>
<names variable="editor translator" prefix=" " suffix="," delimiter=", "> <group delimiter=", " suffix=".">
<name and="symbol" sort-separator=", " initialize-with=". "/> <names variable="editor translator" prefix=" " delimiter=", ">
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/> <name and="symbol" sort-separator=", " initialize-with=". "/>
</names> <label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
<text variable="container-title" font-style="italic" prefix=" " suffix="."/> </names>
<text variable="collection-title" prefix=" " suffix="."/> <group delimiter=" ">
<group suffix="."> <text variable="container-title" font-style="italic"/>
<text macro="publisher" prefix=" "/> <group prefix="(" suffix=")">
<group prefix=" (" suffix=")"> <label variable="page" form="short" include-period="true" suffix=" "/>
<label variable="page" form="short" suffix=". "/> <text variable="page"/>
<text variable="page"/> </group>
</group> </group>
</group> </group>
<text variable="collection-title" prefix=" " suffix="."/>
<text macro="publisher" prefix=" " suffix="."/>
</group> </group>
</else-if> </else-if>
<else> <else>
@ -17007,133 +17018,171 @@ REPLACE INTO csl VALUES('http://www.zotero.org/namespaces/CSL/chicago-note-bibli
</bibliography> </bibliography>
</style>'); </style>');
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2007-08-28 16:45:48', 'Modern Language Association', REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2007-09-13 20:50:16', 'Modern Language Association',
'<?xml version="1.0" encoding="UTF-8"?> '<?oxygen RNGSchema="csl.rnc" type="compact"?>
<?oxygen RNGSchema="../schema/trunk/csl.rnc" type="compact"?> <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
<style xmlns="http://purl.org/net/xbiblio/csl" class="author" xml:lang="en">
<info> <info>
<title>Modern Language Association</title> <title>Modern Language Association</title>
<id>http://purl.org/net/xbiblio/csl/styles/mla.csl</id> <id>http://purl.org/net/xbiblio/csl/styles/mla.csl</id>
<link>http://purl.org/net/xbiblio/csl/styles/mla.csl</link> <link>http://purl.org/net/xbiblio/csl/styles/mla.csl</link>
<author> <author>
<name>Bruce DArcus</name>
<email>bdarcus@sourceforge.net</email>
</author>
<contributor>
<name>Johan Kool</name>
<email>johankool@users.sourceforge.net</email>
</contributor>
<contributor>
<name>Simon Kornblith</name> <name>Simon Kornblith</name>
<email>simon@simonster.com</email> <email>simon@simonster.com</email>
</contributor>
<updated>2006-09-04T20:28:00+05:00</updated>
</info>
<defaults>
<contributor name-as-sort-order="first">
<name and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=", " suffix="."/>
</contributor>
<author>
<substitute>
<choose>
<editor/>
<titles/>
</choose>
</substitute>
</author> </author>
<locator> <category term="generic-base"/>
<number/> <updated>2007-08-14T17:41:10+00:00</updated>
</locator> </info>
<titles> <macro name="editor-translator">
<title/> <names variable="editor translator" prefix="(" suffix=")" delimiter=". ">
</titles> <label form="verb-short" text-transform="capitalize" suffix=". "/>
<date> <name and="symbol" delimiter=", "/>
<year/> </names>
</date> </macro>
<access> <macro name="author">
<date> <names variable="author">
<day suffix=" "/> <name name-as-sort-order="first" and="text" sort-separator=", "
<month suffix=" "/> delimiter=", " delimiter-precedes-last="always"/>
<year/> <label form="short" prefix=", " suffix="."/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title-short"/>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text term="retrieved" text-transform="capitalize" suffix=" "/>
<date variable="accessed" suffix=", ">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date> </date>
<url prefix=" &lt;" suffix="&gt;"/> <group>
</access> <text term="from" suffix=" "/>
</defaults> <text variable="URL"/>
<citation prefix="(" suffix=")" delimiter="; "> </group>
<et-al min-authors="6" use-first="6" position="first"/> </group>
<et-al min-authors="6" use-first="1" position="subsequent"/> </macro>
<layout> <macro name="title">
<item> <choose>
<group delimiter=" "> <if type="book">
<author form="short"> <text variable="title" text-decoration="underline"/>
<name and="text" sort-separator=", " delimiter=", "/> </if>
</author> <else>
<locator prefix=" "/> <text variable="title" quotes="true"/>
</group> </else>
</item> </choose>
</macro>
<macro name="title-short">
<choose>
<if type="book">
<text variable="title" form="short" text-decoration="underline"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</macro>
<macro name="publisher-year">
<group delimiter=", ">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
<date variable="issued">
<date-part name="year"/>
</date>
</group>
</macro>
<citation>
<option name="et-al-min" value="4"/>
<option name="et-al-use-first" value="1"/>
<option name="disambiguate-add-names" value="true"/>
<option name="disambiguate-add-givenname" value="true"/>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=" ">
<choose>
<if variable="author editor translator" match="any">
<text macro="author-short"/>
<choose>
<if disambiguate="true">
<text macro="title-short" prefix=", "/>
</if>
</choose>
</if>
<else>
<text macro="title-short"/>
</else>
</choose>
<text variable="locator"/>
</group>
</layout> </layout>
</citation> </citation>
<bibliography subsequent-author-substitute="---"> <bibliography>
<sort algorithm="author-date"/> <option name="hanging-indent" value="true"/>
<et-al min-authors="4" use-first="1"/> <option name="et-al-min" value="4"/>
<option name="et-al-use-first" value="1"/>
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout> <layout>
<list> <text macro="author" suffix="."/>
<heading> <text macro="title" prefix=" " suffix="."/>
<text term-name="references"/> <choose>
</heading> <if type="book">
</list> <text macro="editor-translator" prefix=" " suffix="."/>
<item> <text macro="publisher-year" prefix=" " suffix="."/>
<choose> </if>
<type name="book"> <else-if type="chapter">
<author suffix="."/> <group class="container">
<titles font-style="italic" prefix=" " suffix="."/> <text variable="container-title" text-decoration="underline" prefix=" " suffix="."/>
<group prefix=" " suffix="." delimiter=", "> <text macro="editor-translator" prefix=" " suffix="."/>
<edition/> <text macro="publisher-year" prefix=" " suffix="."/>
<group delimiter=": "> </group>
<publisher><place/></publisher> <text variable="page" prefix=" " suffix="."/>
<publisher><name/></publisher> </else-if>
</group> <else>
<date/> <group class="container" prefix=" " suffix="." delimiter=": ">
<group delimiter=" ">
<text variable="container-title" text-decoration="underline"/>
<choose>
<if type="article-journal">
<group delimiter=" ">
<group delimiter=".">
<text variable="volume"/>
<text variable="issue"/>
</group>
<date variable="issued" prefix="(" suffix=")">
<date-part name="year"/>
</date>
</group>
</if>
<else>
<date variable="issued">
<date-part name="day" suffix=" "/>
<date-part name="month" form="short" include-period="true" suffix=" "/>
<date-part name="year"/>
</date>
</else>
</choose>
</group> </group>
<access prefix=" " suffix="."/> <text variable="page"/>
</type> </group>
<type name="chapter"> </else>
<author suffix="."/> </choose>
<titles prefix=" &#8220;" suffix=".&#8221;"/> <text prefix=" " macro="access"/>
<group class="container" prefix=" " suffix=".">
<titles relation="container" font-style="italic" suffix="."/>
<editor prefix=" " suffix=".">
<label form="short" suffix=". " text-transform="capitalize"/>
<name and="text" delimiter=", "/>
</editor>
<titles relation="collection" prefix=" " suffix="."/>
<group prefix=" " delimiter=": ">
<publisher><place/></publisher>
<publisher><name/></publisher>
</group>
<date prefix=", "/>
</group>
<pages prefix=" " suffix="."/>
<access prefix=" " suffix="."/>
</type>
<type name="article">
<author suffix="."/>
<titles prefix=" &#8220;" suffix=".&#8221;"/>
<group class="container">
<editor prefix=" " suffix="."/>
<titles relation="container" font-style="italic" prefix=" " suffix="."/>
</group>
<volume prefix=" "/>
<issue prefix="."/>
<group suffix=".">
<date prefix=" (" suffix=")"/>
<pages prefix=": "/>
</group>
<access prefix=" " suffix="."/>
</type>
</choose>
</item>
</layout> </layout>
</bibliography> </bibliography>
</style>'); </style>');