Add addEditCitation command to Zotero
This commit is contained in:
parent
ec66d15a5f
commit
974a07bf73
|
@ -1050,7 +1050,7 @@ Zotero.Integration.Document.prototype.addCitation = function() {
|
||||||
Zotero.Integration.Document.prototype.editCitation = function() {
|
Zotero.Integration.Document.prototype.editCitation = function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
return this._getSession(true, false).then(function() {
|
return this._getSession(true, false).then(function() {
|
||||||
var field = me._doc.cursorInField(me._session.data.prefs['fieldType'])
|
var field = me._doc.cursorInField(me._session.data.prefs['fieldType']);
|
||||||
if(!field) {
|
if(!field) {
|
||||||
throw new Zotero.Exception.Alert("integration.error.notInCitation", [],
|
throw new Zotero.Exception.Alert("integration.error.notInCitation", [],
|
||||||
"integration.error.title");
|
"integration.error.title");
|
||||||
|
@ -1060,6 +1060,18 @@ Zotero.Integration.Document.prototype.editCitation = function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edits the citation at the cursor position if one exists, or else adds a new one.
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
Zotero.Integration.Document.prototype.addEditCitation = function() {
|
||||||
|
var me = this;
|
||||||
|
return this._getSession(false, false).then(function() {
|
||||||
|
var field = me._doc.cursorInField(me._session.data.prefs['fieldType']);
|
||||||
|
return (new Zotero.Integration.Fields(me._session, me._doc)).addEditCitation(field);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a bibliography to the current document.
|
* Adds a bibliography to the current document.
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user