diff --git a/content/pubpeer.ts b/content/pubpeer.ts index cd78afa..d0947ed 100644 --- a/content/pubpeer.ts +++ b/content/pubpeer.ts @@ -183,13 +183,17 @@ $patch$(Zotero.Integration.Session.prototype, 'addCitation', original => async f await original.apply(this, arguments) try { const ids = citation.citationItems.map(item => item.id) + const style = Zotero.Styles.get('apa') + const cslEngine = style.getCiteProc('en') + if (ids.length) { Zotero.Items.getAsync(ids).then(items => { let feedback: Feedback for (const item of items) { if (feedback = Zotero.PubPeer.feedback[getDOI(item)]) { if (!feedback.shown[this.sessionID]) { - flash('ALERT: PubPeer feedback', `This article "${item.getField('title')}" has comments on PubPeer: ${feedback.url}`) + const text = Zotero.Cite.makeFormattedBibliographyOrCitationList(cslEngine, items, 'text') + flash('ALERT: PubPeer feedback', `This article "${item.getField('title')}" has comments on PubPeer: ${feedback.url}\n\n${text}`) feedback.shown[this.sessionID] = true } } diff --git a/typings/zotero.d.ts b/typings/zotero.d.ts index 0498c92..118f337 100644 --- a/typings/zotero.d.ts +++ b/typings/zotero.d.ts @@ -4,6 +4,8 @@ declare global { interface IZotero { PubPeer: PubPeer + Styles: any + Cite: any ProgressWindow: any Integration: any debug: any