Add an error message when using the Add Note button with beta disabled

Closes #67
This commit is contained in:
Adomas Venčkauskas 2021-02-26 13:54:09 +02:00 committed by Dan Stillman
parent 3aa79f40d7
commit 02fc8bf39f
2 changed files with 10 additions and 0 deletions

View file

@ -658,6 +658,15 @@ Zotero.Integration.Interface.prototype.addEditCitation = async function (docFiel
* @return {Promise}
*/
Zotero.Integration.Interface.prototype.addNote = async function () {
if (!Zotero.isPDFBuild) {
let ps = Services.prompt;
let errorMessage = Zotero.getString('integration.error.noteEditorDisabled', ZOTERO_CONFIG.CLIENT_NAME);
let index = ps.confirm(null, Zotero.getString('integration.error.title'), errorMessage);
if (index == 1) {
Zotero.Utilities.Internal.openPreferences("zotero-prefpane-general");
}
throw new Zotero.Exception.UserCancelled('Cannot add notes with note editor disabled');
}
await this._session.init(false, false);
if ((!await this._doc.canInsertField(this._session.data.prefs['fieldType']))) {

View file

@ -909,6 +909,7 @@ integration.error.rosettaWord.title = Outdated Word Configuration
integration.error.rosettaWord1643 = %S can now be used with current versions of Word on Apple Silicon Macs.\n\nFor maximum performance, upgrade to the latest version of Word.
integration.error.rosettaWord1644 = %S can now be used with Word running natively on Apple Silicon Macs.\n\nFor maximum performance, select Word in Finder, go to File → Get Info, disable “Open using Rosetta”, and restart Word.
integration.error.viewTroubleshootingInfo = Would you like to view troubleshooting instructions?
integration.error.noteEditorDisabled = To enable note citing you must opt-in into the new %S PDF reader and note editor features.
integration.replace = Replace this Zotero field?
integration.missingItem.single = The highlighted citation no longer exists in your Zotero database. Do you want to select a substitute item?