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:
parent
f0b25656fd
commit
c3e2e83df9
|
@ -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<io.citation.citationItems.length; i++) {
|
||||
_addItem(io.citation.citationItems[i].itemID);
|
||||
_itemData[io.citation.citationItems[i].itemID] = io.citation.citationItems[i];
|
||||
var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
|
||||
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);
|
||||
io.citation.properties.custom = undefined;
|
||||
}
|
||||
|
||||
_updateAccept();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,7 +189,7 @@ var Zotero_Citation_Dialog = new function () {
|
|||
// disable boxes if item not added; otherwise, enable
|
||||
_itemSelected(hasBeenAdded ? itemID : false);
|
||||
// disable adding nothing, or things already added
|
||||
document.getElementById("citation-add").disabled = !itemID || hasBeenAdded;
|
||||
document.getElementById("add").disabled = !itemID || hasBeenAdded;
|
||||
} else {
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
|
@ -175,18 +204,21 @@ var Zotero_Citation_Dialog = new function () {
|
|||
var itemID = (selectedListItem ? selectedListItem.value : false);
|
||||
_itemSelected(itemID);
|
||||
|
||||
document.getElementById("citation-delete").disabled = !itemID;
|
||||
document.getElementById("remove").disabled = !itemID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a citation to the multipleSources list
|
||||
*/
|
||||
function addCitation() {
|
||||
function add() {
|
||||
// get selected item (from selectItemsDialog.js)
|
||||
var item = getSelectedItems()[0];
|
||||
_itemSelected(item.getID());
|
||||
_addItem(item);
|
||||
|
||||
// don't let someone select it again
|
||||
document.getElementById("add").disabled = true;
|
||||
|
||||
// allow user to press OK
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
|
@ -196,7 +228,7 @@ var Zotero_Citation_Dialog = new function () {
|
|||
/*
|
||||
* Deletes a citation from the multipleSources list
|
||||
*/
|
||||
function deleteCitation() {
|
||||
function remove() {
|
||||
var citationList = document.getElementById("citation-list");
|
||||
var selectedListItem = citationList.getSelectedItem(0);
|
||||
var itemID = selectedListItem.value;
|
||||
|
@ -217,6 +249,7 @@ var Zotero_Citation_Dialog = new function () {
|
|||
* Sorts the list of citations
|
||||
*/
|
||||
function sortCitation() {
|
||||
io.citation.properties.sort = _sortCheckbox.checked;
|
||||
if(_sortCheckbox.checked) {
|
||||
_getCitation();
|
||||
|
||||
|
@ -226,22 +259,14 @@ var Zotero_Citation_Dialog = new function () {
|
|||
citationList.removeChild(citationList.firstChild);
|
||||
}
|
||||
|
||||
// add surrogate items to citation
|
||||
for(var i=0; i<io.citation.citationItems.length; i++) {
|
||||
io.citation.citationItems[i].item = new Zotero.CSL.Item(Zotero.Items.get(io.citation.citationItems[i].itemID));
|
||||
}
|
||||
io.citation.sort();
|
||||
// run preview function to re-sort, if it hasn't already been
|
||||
// run
|
||||
if(!_previewShown) io.previewFunction();
|
||||
|
||||
// add items back to list
|
||||
for(var i=0; i<io.citation.citationItems.length; i++) {
|
||||
var item = io.citation.citationItems[i].item.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());
|
||||
document.getElementById("citation-list").appendChild(itemNode);
|
||||
var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
|
||||
_addItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -365,12 +390,22 @@ var Zotero_Citation_Dialog = new function () {
|
|||
var property = _preserveData[box];
|
||||
|
||||
// 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
|
||||
if(itemID) {
|
||||
domBox.disabled = false;
|
||||
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) {
|
||||
domBox.disabled = true;
|
||||
|
@ -413,7 +448,11 @@ var Zotero_Citation_Dialog = new function () {
|
|||
var citationItem = new Zotero.CSL.CitationItem();
|
||||
citationItem.itemID = items[0];
|
||||
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];
|
||||
}
|
||||
|
@ -429,8 +468,5 @@ var Zotero_Citation_Dialog = new function () {
|
|||
itemNode.setAttribute("class", "listitem-iconic");
|
||||
itemNode.setAttribute("image", item.getImageSrc());
|
||||
document.getElementById("citation-list").appendChild(itemNode);
|
||||
|
||||
// don't let someone select it again
|
||||
document.getElementById("citation-add").disabled = true;
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
<?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/addCitationDialog.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<dialog
|
||||
|
@ -43,103 +43,97 @@
|
|||
<script src="selectItemsDialog.js"/>
|
||||
<script src="addCitationDialog.js"/>
|
||||
|
||||
<vbox id="zotero-select-items-container" flex="1" style="padding: 1em">
|
||||
<hbox flex="1">
|
||||
<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: 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>
|
||||
<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>
|
||||
|
||||
<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"/>
|
||||
<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="add" oncommand="Zotero_Citation_Dialog.add()" disabled="true"/>
|
||||
<toolbarbutton id="remove" oncommand="Zotero_Citation_Dialog.remove()" disabled="true"/>
|
||||
</vbox>
|
||||
<separator flex="4"/>
|
||||
<vbox flex="1">
|
||||
<hbox align="stretch">
|
||||
<menulist onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locatorType">
|
||||
<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>
|
||||
<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>
|
||||
</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"/>
|
||||
|
||||
|
|
|
@ -65,11 +65,16 @@
|
|||
this._toggle = [];
|
||||
|
||||
// why is this necessary? because the browser takes time to
|
||||
// load, but doesn't appear to fire an event when loaded.
|
||||
// why does this work? no idea.
|
||||
// load, but doesn't appear to fire an event when loaded,
|
||||
// when recovering from being hidden. why does this work?
|
||||
// no idea.
|
||||
this._isLoaded = false;
|
||||
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>
|
||||
|
||||
<!-- Called when loaded. Until the browser is loaded, we can't do
|
||||
|
@ -137,7 +142,7 @@
|
|||
<setter><![CDATA[
|
||||
this._readonly = val;
|
||||
if(this._isLoaded) {
|
||||
if(val == true) {
|
||||
if(val) {
|
||||
this._browser.contentDocument.designMode = "off";
|
||||
} else {
|
||||
this._browser.contentDocument.designMode = "on";
|
||||
|
@ -201,7 +206,9 @@
|
|||
this._browser.contentDocument.write("<body>"+html+"</body>");
|
||||
this._browser.contentDocument.close();
|
||||
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();
|
||||
} else {
|
||||
|
|
169
chrome/content/zotero/editBibliographyDialog.js
Normal file
169
chrome/content/zotero/editBibliographyDialog.js
Normal 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();
|
||||
}
|
||||
}
|
115
chrome/content/zotero/editBibliographyDialog.xul
Normal file
115
chrome/content/zotero/editBibliographyDialog.xul
Normal 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
|
@ -310,19 +310,28 @@ Zotero.CSL.Compat.ItemSet.prototype.add = function(items) {
|
|||
}
|
||||
this.items.push(item);
|
||||
returnList.push(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;
|
||||
}
|
||||
|
||||
Zotero.CSL.Compat.ItemSet.prototype.remove = function(items) {
|
||||
for(var i in items) {
|
||||
if(!item) continue;
|
||||
if(items[i] instanceof Zotero.Item) {
|
||||
var item = items[i];
|
||||
} else {
|
||||
var item = Zotero.Items.get(i);
|
||||
}
|
||||
if(!item) continue;
|
||||
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;
|
||||
|
||||
if(locator) {
|
||||
var locatorType = Zotero.CSL.locatorTypeTerms[citation.citationItems[0].locatorType];
|
||||
|
||||
// search for elements with the same serialization
|
||||
var element = this._getFieldDefaults("locator");
|
||||
if(!element) {
|
||||
|
@ -469,7 +476,7 @@ Zotero.CSL.Compat.prototype.formatCitation = function(citation, format) {
|
|||
|
||||
if(element) {
|
||||
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+" ");
|
||||
var citationString = this._getCitation(citationItem.item,
|
||||
position, Zotero.CSL.locatorTypeTerms[citationItem.locatorType],
|
||||
position, citationItem.locatorType,
|
||||
citationItem.locator, format, this._cit, ignore);
|
||||
string.concat(citationString);
|
||||
if(citationItem.suffix) string.append(citationItem.suffix+" ");
|
||||
|
@ -536,7 +543,10 @@ Zotero.CSL.Compat.prototype.formatBibliography = function(itemSet, format) {
|
|||
for(var i in items) {
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1085,7 +1095,7 @@ Zotero.CSL.Compat.prototype._processCreators = function(type, element, creators,
|
|||
var firstName, lastName;
|
||||
for(var i=0; i<maxCreators; i++) {
|
||||
var firstName = "";
|
||||
if(element["form"] != "short") {
|
||||
if(element["form"] && element["form"] != "short") {
|
||||
if(child["initialize-with"] != undefined) {
|
||||
// even if initialize-with is simply an empty string, use
|
||||
// initials
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
const API_VERSION = 2;
|
||||
const API_VERSION = 3;
|
||||
|
||||
Zotero.Integration = new function() {
|
||||
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
|
||||
* ACCEPTS: sessionID, bibliographyMode, citationMode, editCitationIndex(, fieldIndex, fieldName)+
|
||||
* RETURNS: bibliography(, fieldIndex, fieldRename, fieldContent)+
|
||||
* RETURNS: bibliography, documentData(, fieldIndex, fieldRename, fieldContent)+
|
||||
*/
|
||||
function update(vars) {
|
||||
if(!_sessions[vars[0]]) return "ERROR:sessionExpired";
|
||||
|
@ -372,8 +372,16 @@ Zotero.Integration.SOAP = new function() {
|
|||
var bibliographyMode = vars[1];
|
||||
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
|
||||
var editCitationIndex = (vars[3] == "!" ? false : vars[3]);
|
||||
var editCitation = false;
|
||||
for(var i=4; i<vars.length; i+=2) {
|
||||
if(vars[i+1] == "X") { // new citation has field name X
|
||||
|
@ -392,6 +400,7 @@ Zotero.Integration.SOAP = new function() {
|
|||
}
|
||||
|
||||
session.updateItemSet();
|
||||
|
||||
if(editCitationIndex) {
|
||||
session.updateCitations(editCitationIndex-1);
|
||||
var added = session.editCitation(editCitationIndex, editCitation);
|
||||
|
@ -406,28 +415,41 @@ Zotero.Integration.SOAP = new function() {
|
|||
}
|
||||
session.updateCitations();
|
||||
|
||||
if(editBibliography) {
|
||||
session.editBibliography();
|
||||
}
|
||||
|
||||
// update
|
||||
var output = new Array();
|
||||
if((bibliographyMode == "updated" // if we want updated bib
|
||||
&& session.itemSetHasChanged) // and bibliography changed
|
||||
|| 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
|
||||
output.push("!");
|
||||
}
|
||||
|
||||
if(session.documentDataHasChanged) {
|
||||
output.push(session.getDocumentData());
|
||||
} else {
|
||||
output.push("!");
|
||||
}
|
||||
|
||||
// get citations
|
||||
output = output.concat(session.getCitations(citationMode == "all"));
|
||||
|
||||
// reset citationSet
|
||||
session.reset();
|
||||
session.resetRequest();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
function restoreSession(vars) {
|
||||
|
@ -436,18 +458,21 @@ Zotero.Integration.SOAP = new function() {
|
|||
}
|
||||
|
||||
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 newField = 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.updateItemSet(session.citationsByItemID);
|
||||
session.reset();
|
||||
if(vars[1] != "!") session.loadDocumentData(vars[1]);
|
||||
session.resetRequest();
|
||||
|
||||
return [sessionID];
|
||||
}
|
||||
|
@ -474,6 +499,7 @@ Zotero.Integration.SOAP = new function() {
|
|||
if(vars[0] == "!") {
|
||||
// no session ID; generate a new one
|
||||
var sessionID = Zotero.randomString();
|
||||
var session = _sessions[sessionID] = new Zotero.Integration.Session();
|
||||
} else {
|
||||
// session ID exists
|
||||
var sessionID = vars[0];
|
||||
|
@ -486,10 +512,8 @@ Zotero.Integration.SOAP = new function() {
|
|||
}
|
||||
|
||||
watcher.openWindow(null, 'chrome://zotero/content/integrationDocPrefs.xul', '',
|
||||
'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io);
|
||||
|
||||
_sessions[sessionID] = new Zotero.Integration.Session(io.style, io.useEndnotes, io.useBookmarks);
|
||||
session = _sessions[sessionID];
|
||||
'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io, true);
|
||||
session.setStyle(io.style, 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) {
|
||||
}
|
||||
/*
|
||||
* generates a new field name based on available information
|
||||
*/
|
||||
Zotero.Integration.Citation.prototype.regenerateFieldName = function() {
|
||||
this.field = this.itemIDString+"_"+this.locatorString+"_"+Zotero.randomString();
|
||||
Zotero.Integration.Session = function() {
|
||||
// holds items not in document that should be in bibliography
|
||||
this.uncitedItems = new Object();
|
||||
|
||||
this.resetRequest();
|
||||
}
|
||||
|
||||
/*
|
||||
* updates itemIDString and locatorString based on data
|
||||
* changes the Session style
|
||||
*/
|
||||
Zotero.Integration.Citation.prototype.setData = function(itemIDs, locators, locatorTypes) {
|
||||
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) {
|
||||
Zotero.Integration.Session.prototype.setStyle = function(styleID, useEndnotes, useBookmarks) {
|
||||
this.styleID = styleID;
|
||||
this.style = Zotero.Cite.getStyle(styleID);
|
||||
this.useEndnotes = useEndnotes;
|
||||
|
@ -558,19 +553,20 @@ Zotero.Integration.Session = function(styleID, useEndnotes, useBookmarks) {
|
|||
this.dateModified = new Object();
|
||||
this.itemSetIsSorted = true;
|
||||
|
||||
this.reset();
|
||||
this.loadUncitedItems();
|
||||
}
|
||||
|
||||
/*
|
||||
* resets per-request variables in the CitationSet
|
||||
*/
|
||||
Zotero.Integration.Session.prototype.reset = function() {
|
||||
Zotero.Integration.Session.prototype.resetRequest = function() {
|
||||
this.citationsByItemID = new Object();
|
||||
this.citationsByIndex = new Array();
|
||||
|
||||
this.itemSetHasChanged = false;
|
||||
this.documentDataHasChanged = false;
|
||||
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)
|
||||
*/
|
||||
Zotero.Integration.Session.prototype.unserializeCitation = function(arg) {
|
||||
if(arg[0] == "{") {
|
||||
if(arg[0] == "{") { // JSON field
|
||||
// create citation
|
||||
var citation = this.style.createCitation();
|
||||
|
||||
// JSON args
|
||||
// get JSON
|
||||
var object = Zotero.JSON.unserialize(arg);
|
||||
|
||||
// copy properties
|
||||
|
@ -704,8 +700,7 @@ Zotero.Integration.Session.prototype.unserializeCitation = function(arg) {
|
|||
citation[i] = object[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// ye olde style args
|
||||
} else { // ye olde style field
|
||||
var underscoreIndex = arg.indexOf("_");
|
||||
var itemIDs = arg.substr(0, underscoreIndex).split("|");
|
||||
|
||||
|
@ -754,6 +749,10 @@ Zotero.Integration.Session.prototype.previewCitation = function(citation) {
|
|||
this.getCitationPositions(citation);
|
||||
// sort item set
|
||||
this.sortItemSet();
|
||||
// sort citation if desired
|
||||
if(citation.properties.sort) {
|
||||
citation.sort();
|
||||
}
|
||||
// get preview citation
|
||||
var text = this.style.formatCitation(citation, "Integration");
|
||||
// delete from item set
|
||||
|
@ -809,9 +808,16 @@ Zotero.Integration.Session.prototype.getCitationPositions = function(citation, u
|
|||
var previousCitation = (previousIndex == -1 ? false : this.citationsByIndex[previousIndex]);
|
||||
|
||||
// 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
|
||||
&& 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
|
||||
var newPosition = (citation.citationItems[0].locator == previousCitation.citationItems[0].locator
|
||||
&& 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,
|
||||
* then resorting
|
||||
* then re-sorting
|
||||
*/
|
||||
Zotero.Integration.Session.prototype.updateItemSet = function() {
|
||||
var addItems = [];
|
||||
|
@ -864,10 +870,12 @@ Zotero.Integration.Session.prototype.updateItemSet = function() {
|
|||
// see if items were deleted from Zotero
|
||||
if (!Zotero.Items.get(i)) {
|
||||
deleteItems.push(itemID);
|
||||
for(var j=0; j<this.citationsByItemID[i].length; j++) {
|
||||
var citation = this.citationsByItemID[i][j];
|
||||
this.updateIndices[citation.properties.index] = true;
|
||||
citation.properties.delete = true;
|
||||
if(this.citationsByItemID[i].length) {
|
||||
for(var j=0; j<this.citationsByItemID[i].length; j++) {
|
||||
var citation = this.citationsByItemID[i][j];
|
||||
this.updateIndices[citation.properties.index] = true;
|
||||
citation.properties.delete = true;
|
||||
}
|
||||
}
|
||||
this.itemSetChanged();
|
||||
}
|
||||
|
@ -878,7 +886,7 @@ Zotero.Integration.Session.prototype.updateItemSet = function() {
|
|||
var itemID = item.getID();
|
||||
|
||||
// see if items were removed
|
||||
if(!this.citationsByItemID[itemID]) {
|
||||
if(!this.citationsByItemID[itemID] && !this.uncitedItems[itemID]) {
|
||||
deleteItems.push(itemID);
|
||||
this.itemSetChanged();
|
||||
continue;
|
||||
|
@ -925,6 +933,23 @@ Zotero.Integration.Session.prototype.itemSetChanged = function() {
|
|||
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
|
||||
*/
|
||||
|
@ -977,4 +1002,124 @@ Zotero.Integration.Session.prototype.getCitations = function(regenerateAll) {
|
|||
}
|
||||
|
||||
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");
|
||||
}
|
|
@ -7,12 +7,48 @@
|
|||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</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="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- 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">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
|
@ -21,28 +57,53 @@
|
|||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<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 name="volume">volume</term>
|
||||
<term name="issue">number</term>
|
||||
|
||||
<!-- 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">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</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>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="line" form="short">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
|
@ -91,7 +152,6 @@
|
|||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</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-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
|
|
|
@ -110,6 +110,7 @@
|
|||
|
||||
<!ENTITY zotero.integration.docPrefs.title "Document Preferences">
|
||||
<!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation">
|
||||
<!ENTITY zotero.integration.editBibliography.title "Edit Bibliography">
|
||||
|
||||
<!ENTITY zotero.progress.title "Progress">
|
||||
|
||||
|
@ -142,4 +143,6 @@
|
|||
|
||||
<!ENTITY zotero.integration.prefs.formatUsing.label "Format Using:">
|
||||
<!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">
|
|
@ -459,4 +459,7 @@ integration.referenceMarks.caption = OpenOffice.org ReferenceMarks are less like
|
|||
|
||||
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.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.
|
|
@ -1,19 +1,26 @@
|
|||
#citation-add {
|
||||
#add {
|
||||
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');
|
||||
}
|
||||
|
||||
#citation-delete {
|
||||
#remove {
|
||||
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');
|
||||
}
|
||||
|
||||
#add .toolbarbutton-text, #remove .toolbarbutton-text
|
||||
{
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
#prefix, #suffix {
|
||||
width: 200px;
|
||||
}
|
327
scrapers.sql
327
scrapers.sql
|
@ -22,8 +22,7 @@
|
|||
|
||||
|
||||
-- Set the following timestamp to the most recent scraper update date
|
||||
|
||||
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-09-13 12:00:00'));
|
||||
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-09-13 20:50:16'));
|
||||
|
||||
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) {
|
||||
|
@ -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) {
|
||||
if(item.itemType == "journalArticle") {
|
||||
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();
|
||||
// get first page
|
||||
item.pages = query.qr::first_page.text().toString();
|
||||
|
||||
item.complete();
|
||||
return true;
|
||||
}
|
||||
|
@ -12651,7 +12651,7 @@ function doSearch(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);
|
||||
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',
|
||||
'<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
|
||||
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-09-13 20:50:16', 'American Psychological Association',
|
||||
'<?oxygen RNGSchema="csl.rnc" type="compact"?>
|
||||
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
|
||||
<info>
|
||||
<title>American Psychological Association</title>
|
||||
<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>
|
||||
<category term="psychology"/>
|
||||
<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>
|
||||
<macro name="editor-translator">
|
||||
<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">
|
||||
<choose>
|
||||
<if type="book">
|
||||
<text variable="title" font-style="italic"/>
|
||||
<text variable="title" enforce-case="sentence" font-style="italic"/>
|
||||
</if>
|
||||
<else>
|
||||
<text variable="title"/>
|
||||
<text variable="title" enforce-case="sentence"/>
|
||||
</else>
|
||||
</choose>
|
||||
</macro>
|
||||
|
@ -16405,14 +16407,18 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
|
|||
</group>
|
||||
</macro>
|
||||
<citation>
|
||||
<option name="sort-algorithm" value="author-date"/>
|
||||
<option name="et-al-min" value="6"/>
|
||||
<option name="et-al-use-first" value="6"/>
|
||||
<option name="et-al-subsequent-min" value="6"/>
|
||||
<option name="et-al-use-first" value="1"/>
|
||||
<option name="et-al-subsequent-min" value="3"/>
|
||||
<option name="et-al-subsequent-use-first" value="1"/>
|
||||
<option name="disambiguate-add-year-suffix" value="true"/>
|
||||
<option name="disambiguate-add-names" 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="; ">
|
||||
<group delimiter=", ">
|
||||
<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>
|
||||
<group>
|
||||
<label variable="locator" suffix="." form="short"/>
|
||||
<label variable="locator" include-period="true" form="short"/>
|
||||
<text variable="locator" prefix=" "/>
|
||||
</group>
|
||||
</group>
|
||||
|
@ -16428,9 +16434,12 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-
|
|||
</citation>
|
||||
<bibliography>
|
||||
<option name="hanging-indent" value="true"/>
|
||||
<option name="sort-algorithm" value="author-date"/>
|
||||
<option name="et-al-min" value="6"/>
|
||||
<option name="et-al-use-first" value="6"/>
|
||||
<sort>
|
||||
<key macro="author"/>
|
||||
<key variable="issued"/>
|
||||
</sort>
|
||||
<layout>
|
||||
<text macro="author" 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=" "/>
|
||||
<group class="container" prefix=". ">
|
||||
<text term="in" text-transform="capitalize"/>
|
||||
<names variable="editor translator" prefix=" " suffix="," delimiter=", ">
|
||||
<name and="symbol" sort-separator=", " initialize-with=". "/>
|
||||
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
|
||||
</names>
|
||||
<text variable="container-title" font-style="italic" prefix=" " suffix="."/>
|
||||
<text variable="collection-title" prefix=" " suffix="."/>
|
||||
<group suffix=".">
|
||||
<text macro="publisher" prefix=" "/>
|
||||
<group prefix=" (" suffix=")">
|
||||
<label variable="page" form="short" suffix=". "/>
|
||||
<text variable="page"/>
|
||||
<group delimiter=", " suffix=".">
|
||||
<names variable="editor translator" prefix=" " delimiter=", ">
|
||||
<name and="symbol" sort-separator=", " initialize-with=". "/>
|
||||
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
|
||||
</names>
|
||||
<group delimiter=" ">
|
||||
<text variable="container-title" font-style="italic"/>
|
||||
<group prefix="(" suffix=")">
|
||||
<label variable="page" form="short" include-period="true" suffix=" "/>
|
||||
<text variable="page"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<text variable="collection-title" prefix=" " suffix="."/>
|
||||
<text macro="publisher" prefix=" " suffix="."/>
|
||||
</group>
|
||||
</else-if>
|
||||
<else>
|
||||
|
@ -17007,133 +17018,171 @@ REPLACE INTO csl VALUES('http://www.zotero.org/namespaces/CSL/chicago-note-bibli
|
|||
</bibliography>
|
||||
</style>');
|
||||
|
||||
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2007-08-28 16:45:48', 'Modern Language Association',
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?oxygen RNGSchema="../schema/trunk/csl.rnc" type="compact"?>
|
||||
<style xmlns="http://purl.org/net/xbiblio/csl" class="author" xml:lang="en">
|
||||
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2007-09-13 20:50:16', 'Modern Language Association',
|
||||
'<?oxygen RNGSchema="csl.rnc" type="compact"?>
|
||||
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
|
||||
<info>
|
||||
<title>Modern Language Association</title>
|
||||
<id>http://purl.org/net/xbiblio/csl/styles/mla.csl</id>
|
||||
<link>http://purl.org/net/xbiblio/csl/styles/mla.csl</link>
|
||||
<author>
|
||||
<name>Bruce D’Arcus</name>
|
||||
<email>bdarcus@sourceforge.net</email>
|
||||
</author>
|
||||
<contributor>
|
||||
<name>Johan Kool</name>
|
||||
<email>johankool@users.sourceforge.net</email>
|
||||
</contributor>
|
||||
<contributor>
|
||||
<name>Simon Kornblith</name>
|
||||
<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>
|
||||
<locator>
|
||||
<number/>
|
||||
</locator>
|
||||
<titles>
|
||||
<title/>
|
||||
</titles>
|
||||
<date>
|
||||
<year/>
|
||||
</date>
|
||||
<access>
|
||||
<date>
|
||||
<day suffix=" "/>
|
||||
<month suffix=" "/>
|
||||
<year/>
|
||||
<category term="generic-base"/>
|
||||
<updated>2007-08-14T17:41:10+00:00</updated>
|
||||
</info>
|
||||
<macro name="editor-translator">
|
||||
<names variable="editor translator" prefix="(" suffix=")" delimiter=". ">
|
||||
<label form="verb-short" text-transform="capitalize" suffix=". "/>
|
||||
<name and="symbol" delimiter=", "/>
|
||||
</names>
|
||||
</macro>
|
||||
<macro name="author">
|
||||
<names variable="author">
|
||||
<name name-as-sort-order="first" and="text" sort-separator=", "
|
||||
delimiter=", " delimiter-precedes-last="always"/>
|
||||
<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>
|
||||
<url prefix=" <" suffix=">"/>
|
||||
</access>
|
||||
</defaults>
|
||||
<citation prefix="(" suffix=")" delimiter="; ">
|
||||
<et-al min-authors="6" use-first="6" position="first"/>
|
||||
<et-al min-authors="6" use-first="1" position="subsequent"/>
|
||||
<layout>
|
||||
<item>
|
||||
<group delimiter=" ">
|
||||
<author form="short">
|
||||
<name and="text" sort-separator=", " delimiter=", "/>
|
||||
</author>
|
||||
<locator prefix=" "/>
|
||||
</group>
|
||||
</item>
|
||||
<group>
|
||||
<text term="from" suffix=" "/>
|
||||
<text variable="URL"/>
|
||||
</group>
|
||||
</group>
|
||||
</macro>
|
||||
<macro name="title">
|
||||
<choose>
|
||||
<if type="book">
|
||||
<text variable="title" text-decoration="underline"/>
|
||||
</if>
|
||||
<else>
|
||||
<text variable="title" quotes="true"/>
|
||||
</else>
|
||||
</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>
|
||||
</citation>
|
||||
<bibliography subsequent-author-substitute="---">
|
||||
<sort algorithm="author-date"/>
|
||||
<et-al min-authors="4" use-first="1"/>
|
||||
<bibliography>
|
||||
<option name="hanging-indent" value="true"/>
|
||||
<option name="et-al-min" value="4"/>
|
||||
<option name="et-al-use-first" value="1"/>
|
||||
<sort>
|
||||
<key macro="author"/>
|
||||
<key variable="title"/>
|
||||
</sort>
|
||||
<layout>
|
||||
<list>
|
||||
<heading>
|
||||
<text term-name="references"/>
|
||||
</heading>
|
||||
</list>
|
||||
<item>
|
||||
<choose>
|
||||
<type name="book">
|
||||
<author suffix="."/>
|
||||
<titles font-style="italic" prefix=" " suffix="."/>
|
||||
<group prefix=" " suffix="." delimiter=", ">
|
||||
<edition/>
|
||||
<group delimiter=": ">
|
||||
<publisher><place/></publisher>
|
||||
<publisher><name/></publisher>
|
||||
</group>
|
||||
<date/>
|
||||
<text macro="author" suffix="."/>
|
||||
<text macro="title" prefix=" " suffix="."/>
|
||||
<choose>
|
||||
<if type="book">
|
||||
<text macro="editor-translator" prefix=" " suffix="."/>
|
||||
<text macro="publisher-year" prefix=" " suffix="."/>
|
||||
</if>
|
||||
<else-if type="chapter">
|
||||
<group class="container">
|
||||
<text variable="container-title" text-decoration="underline" prefix=" " suffix="."/>
|
||||
<text macro="editor-translator" prefix=" " suffix="."/>
|
||||
<text macro="publisher-year" prefix=" " suffix="."/>
|
||||
</group>
|
||||
<text variable="page" prefix=" " suffix="."/>
|
||||
</else-if>
|
||||
<else>
|
||||
<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>
|
||||
<access prefix=" " suffix="."/>
|
||||
</type>
|
||||
<type name="chapter">
|
||||
<author suffix="."/>
|
||||
<titles prefix=" “" suffix=".”"/>
|
||||
<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=" “" suffix=".”"/>
|
||||
<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>
|
||||
<text variable="page"/>
|
||||
</group>
|
||||
</else>
|
||||
</choose>
|
||||
<text prefix=" " macro="access"/>
|
||||
</layout>
|
||||
</bibliography>
|
||||
</style>');
|
||||
|
|
Loading…
Reference in New Issue
Block a user