Add addEditCitation command to Zotero
This commit is contained in:
parent
ec66d15a5f
commit
974a07bf73
1 changed files with 14 additions and 2 deletions
|
@ -1042,7 +1042,7 @@ Zotero.Integration.Document.prototype.addCitation = function() {
|
|||
return (new Zotero.Integration.Fields(me._session, me._doc)).addEditCitation(null);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edits the citation at the cursor position.
|
||||
* @return {Promise}
|
||||
|
@ -1050,7 +1050,7 @@ Zotero.Integration.Document.prototype.addCitation = function() {
|
|||
Zotero.Integration.Document.prototype.editCitation = function() {
|
||||
var me = this;
|
||||
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) {
|
||||
throw new Zotero.Exception.Alert("integration.error.notInCitation", [],
|
||||
"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.
|
||||
* @return {Promise}
|
||||
|
|
Loading…
Reference in a new issue