closes #572, 'Multiple sources" does not work
This commit is contained in:
parent
f01fd20826
commit
85fb1f7cf3
|
@ -42,21 +42,22 @@ var Zotero_Citation_Dialog = new function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleMultipleSources() {
|
function toggleMultipleSources() {
|
||||||
|
_multipleSourcesOn = !_multipleSourcesOn;
|
||||||
if(_multipleSourcesOn) {
|
if(_multipleSourcesOn) {
|
||||||
document.getElementById("multiple-sources").hidden = true;
|
|
||||||
document.getElementById("add-citation-dialog").width = "600";
|
|
||||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources");
|
|
||||||
window.sizeToContent();
|
|
||||||
window.moveTo((window.screenX+75), window.screenY);
|
|
||||||
} else {
|
|
||||||
document.getElementById("multiple-sources").hidden = undefined;
|
document.getElementById("multiple-sources").hidden = undefined;
|
||||||
document.getElementById("add-citation-dialog").width = "750";
|
document.getElementById("add-citation-dialog").width = "750";
|
||||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.singleSource");
|
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.singleSource");
|
||||||
window.sizeToContent();
|
window.sizeToContent();
|
||||||
window.moveTo((window.screenX-75), window.screenY);
|
window.moveTo((window.screenX-75), window.screenY);
|
||||||
|
Zotero.debug("Calling treeItemSelected");
|
||||||
|
treeItemSelected();
|
||||||
|
} else {
|
||||||
|
document.getElementById("multiple-sources").hidden = true;
|
||||||
|
document.getElementById("add-citation-dialog").width = "600";
|
||||||
|
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources");
|
||||||
|
window.sizeToContent();
|
||||||
|
window.moveTo((window.screenX+75), window.screenY);
|
||||||
}
|
}
|
||||||
|
|
||||||
_multipleSourcesOn = !_multipleSourcesOn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function treeItemSelected() {
|
function treeItemSelected() {
|
||||||
|
@ -64,6 +65,8 @@ var Zotero_Citation_Dialog = new function () {
|
||||||
// get selected item (from selectItemsDialog.js)
|
// get selected item (from selectItemsDialog.js)
|
||||||
var item = getSelectedItems(true);
|
var item = getSelectedItems(true);
|
||||||
|
|
||||||
|
Zotero.debug(item);
|
||||||
|
|
||||||
// if item has already been added, disable add button
|
// if item has already been added, disable add button
|
||||||
document.getElementById("citation-add").disabled = (!item.length || _itemLocators[item[0]] != undefined ? true : false);
|
document.getElementById("citation-add").disabled = (!item.length || _itemLocators[item[0]] != undefined ? true : false);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +114,7 @@ var Zotero_Citation_Dialog = new function () {
|
||||||
|
|
||||||
// flag
|
// flag
|
||||||
_itemLocators[itemID] = document.getElementById("tree-locator").value;
|
_itemLocators[itemID] = document.getElementById("tree-locator").value;
|
||||||
_itemLocatorTypes[itemID] = document.getElementById("tree-locator-type").selectedIndex;
|
_itemLocatorTypes[itemID] = document.getElementById("tree-locator-type").selectedItem.value;
|
||||||
document.getElementById("tree-locator").value = "";
|
document.getElementById("tree-locator").value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<menuitem value="l" label="&zotero.citation.line;"/>
|
<menuitem value="l" label="&zotero.citation.line;"/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menulist>
|
</menulist>
|
||||||
<textbox id="item-locator"/>
|
<textbox id="item-locator" disabled="true"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
|
@ -426,8 +426,8 @@ Zotero.CSL._locatorTerms = {
|
||||||
* create a citation (in-text or footnote)
|
* create a citation (in-text or footnote)
|
||||||
*/
|
*/
|
||||||
Zotero.CSL.prototype.createCitation = function(citation, format) {
|
Zotero.CSL.prototype.createCitation = function(citation, format) {
|
||||||
if(citation.citationType >= 3) { // indicates ibid
|
|
||||||
var string = new Zotero.CSL.FormattedString(this, format);
|
var string = new Zotero.CSL.FormattedString(this, format);
|
||||||
|
if(citation.citationType >= 3) { // indicates ibid
|
||||||
var term = this._getTerm("ibid");
|
var term = this._getTerm("ibid");
|
||||||
string.append(term[0].toUpperCase()+term.substr(1));
|
string.append(term[0].toUpperCase()+term.substr(1));
|
||||||
|
|
||||||
|
@ -464,13 +464,14 @@ Zotero.CSL.prototype.createCitation = function(citation, format) {
|
||||||
locator = citation.locators[i];
|
locator = citation.locators[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
string = this._getCitation(Zotero.Items.get(citation.itemIDs[i]),
|
var citationString = this._getCitation(Zotero.Items.get(citation.itemIDs[i]),
|
||||||
(citation.citationType[i] == 1 ? "first" : "subsequent"),
|
(citation.citationType[i] == 1 ? "first" : "subsequent"),
|
||||||
locatorType, locator, format, this._cit);
|
locatorType, locator, format, this._cit);
|
||||||
|
string.concat(citationString);
|
||||||
|
|
||||||
if(this._cit.format && this._cit.format.delimiter && i != lasti) {
|
if(this._cit.format && this._cit.format.delimiter && i != lasti) {
|
||||||
// add delimiter if one exists, and this isn't the last element
|
// add delimiter if one exists, and this isn't the last element
|
||||||
string += this._cit.format.delimiter;
|
string.append(this._cit.format.delimiter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -596,8 +596,9 @@ Zotero.Integration.Citation.prototype.setData = function(itemIDs, locators, loca
|
||||||
|
|
||||||
this.locatorString = "";
|
this.locatorString = "";
|
||||||
for(var i in locators) {
|
for(var i in locators) {
|
||||||
this.locatorString += locatorTypes[i]+locators[i].replace("|", "");
|
this.locatorString += "|"+locatorTypes[i]+locators[i].replace("|", "");
|
||||||
}
|
}
|
||||||
|
if(this.locatorString) this.locatorString = this.locatorString.substr(1);
|
||||||
|
|
||||||
this.serialization = this.itemIDString+"_"+this.locatorString;
|
this.serialization = this.itemIDString+"_"+this.locatorString;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user