fx-compat: Add message to Add-ons pane when no plugins installed

We'll want to update the rest of the instances of "extensions" or
"add-ons" to say "plugins" (unless we think we might support themes, in
which case we can keep "add-ons").
This commit is contained in:
Dan Stillman 2022-08-06 03:47:17 -04:00
parent cd296b1f37
commit ef33731490
3 changed files with 18 additions and 0 deletions

View file

@ -625,6 +625,22 @@ const ZoteroStandalone = new function() {
this.updateAddonsPane = function (doc) {
//var rootWindow = doc.ownerGlobal.windowRoot.ownerGlobal;
// Update message when no plugins installed
setTimeout(() => {
var emptyListMessage = doc.getElementById('empty-list-message');
emptyListMessage.innerHTML = Zotero.Utilities.htmlSpecialChars(
Zotero.getString("addons.emptyListMessage")
).replace(
/\[([^\]]+)]/,
`<a href="${ZOTERO_CONFIG.PLUGINS_URL}">$1</a>`
);
emptyListMessage.addEventListener('click', (event) => {
Zotero.launchURL(ZOTERO_CONFIG.PLUGINS_URL);
event.preventDefault();
event.stopPropagation();
});
});
// Make our own removal prompt instead of using BrowserAddonUI.promptRemoveExtension() from
// browser-addons.js
doc.ownerGlobal.promptRemoveExtension = function (addon) {

View file

@ -1407,5 +1407,6 @@ tabs.duplicate = Duplicate Tab
tabs.undoClose = Reopen Closed Tab;Reopen Closed Tabs
tabs.closeOther = Close Other Tabs
addons.emptyListMessage = Download plugins from the [Zotero plugins directory].
addons.remove.title = Remove %S?
addons.remove.text = Are you sure you want to remove %1$S from %2$S?

View file

@ -30,6 +30,7 @@ var ZOTERO_CONFIG = {
LICENSING_URL: 'https://www.zotero.org/support/licensing',
GET_INVOLVED_URL: 'https://www.zotero.org/getinvolved',
DICTIONARIES_URL: 'https://download.zotero.org/dictionaries/',
PLUGINS_URL: 'https://www.zotero.org/support/plugins',
};
if (typeof process === 'object' && process + '' === '[object process]'){