diff --git a/app/modules/zotero-word-for-mac-integration b/app/modules/zotero-word-for-mac-integration index de8ab22db7..31f5d8d145 160000 --- a/app/modules/zotero-word-for-mac-integration +++ b/app/modules/zotero-word-for-mac-integration @@ -1 +1 @@ -Subproject commit de8ab22db748bef42f3730c20b9da1c0563de6c2 +Subproject commit 31f5d8d145a231713cfb27e3477e774c29942c81 diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 17c59252d6..a338244f3f 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -6125,6 +6125,43 @@ var ZoteroPane = new function() } }; + /** + * Shows a Mac Word plugin installation warning (intended to be used with Sequoia and up) + * before the installer displays the "scary" OS prompt to access other application data. + * @returns {Promise} Object with either install, dismiss or remindLater set to true. + */ + this.showMacWordPluginInstallWarning = function () { + return new Promise((resolve) => { + const panel = document.querySelector('#mac-word-plugin-install-warning'); + const action = panel.querySelector('.link'); + const close = panel.querySelector('.close-link'); + const remind = panel.querySelector('.remind-later-link'); + const dontAskAgain = panel.querySelector('.dont-ask-again-link'); + + panel.removeAttribute('collapsed'); + action.onclick = () => { + this.hideMacWordPluginInstallWarning(); + resolve({ install: true }); + }; + close.onclick = () => { + this.hideMacWordPluginInstallWarning(); + resolve({ dismiss: true }); + }; + remind.onclick = () => { + this.hideMacWordPluginInstallWarning(); + resolve({ remindLater: true }); + }; + dontAskAgain.onclick = () => { + this.hideMacWordPluginInstallWarning(); + resolve({ dontAskAgain: true }); + }; + }); + }; + + this.hideMacWordPluginInstallWarning = function () { + document.querySelector('#mac-word-plugin-install-warning').setAttribute('collapsed', true); + }; + this.showArchitectureWarning = async function () { const remindInterval = 60 * 60 * 24 * 30; const lastDisplayed = Zotero.Prefs.get('architecture.warning.lastDisplayed') ?? 0; diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 9160421da1..36c814e190 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -1081,8 +1081,8 @@ onkeyup="ZoteroPane_Local.handleKeyUp(event, this.id)" onkeypress="ZoteroPane_Local.handleKeyPress(event)"> - - + - - + - - + + + - - + + diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 3d6cd7957f..2d7d47b776 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -8,6 +8,7 @@ return-or-enter = general-remove = Remove general-add = Add general-remind-me-later = Remind Me Later +general-dont-ask-again = Don't Ask Again general-choose-file = Choose File… general-open-settings = Open Settings general-help = Help @@ -674,3 +675,6 @@ post-upgrade-done = text-action-paste-and-search = .label = Paste and Search + +mac-word-plugin-install-message = Zotero requires access to Word data to install the Word plugin. +mac-word-plugin-install-action = Install Word plugin diff --git a/scss/components/_banners.scss b/scss/components/_banners.scss index 361218c6bd..2b8ff27fa6 100644 --- a/scss/components/_banners.scss +++ b/scss/components/_banners.scss @@ -1,5 +1,5 @@ -#post-upgrade-banner, #retracted-items-banner, #sync-reminder-banner, #architecture-warning-banner { - @include macOS-normalize-controls; +.banner-container > .banner { + @include macOS-normalize-controls;; display: flex; justify-content: center; @@ -12,6 +12,31 @@ color: inherit; border: none; margin: 0; + padding-inline: 0.5em; + } + + label[is="text-link"].close-link { + text-decoration: none; + cursor: pointer; + font-size: 22px; + line-height: 26px; + margin-inline-end: -1.2em; + } + + .message { + margin-inline-end: .8em; + } + + .spacer { + flex: 1; + } + + .link { + padding-inline: 0.5em; + + &:active { + color: #4b4b4b; + } } } @@ -69,28 +94,12 @@ } } -#retracted-items-banner, #sync-reminder-banner, #architecture-warning-banner { +#retracted-items-banner, #sync-reminder-banner, #architecture-warning-banner, + #mac-word-plugin-install-warning > .banner { line-height: 2.2em; font-size: 13.5px; padding: 0 2em; font-weight: 600; - - .message { - margin-inline-end: .8em; - } - - .spacer { - flex: 1; - } - - .close-link { - text-decoration: none; - position: absolute; - cursor: pointer; - top: -2px; - inset-inline-end: 9px; - font-size: 22px; - } } #retracted-items-banner { @@ -106,18 +115,15 @@ } } +#mac-word-plugin-install-warning { + background: #ffea50; + border-bottom: #a9a9a9 .5px solid; +} + #sync-reminder-banner { background: rgb(255, 234, 80); border-bottom: #a9a9a9 .5px solid; color: black; - - .link { - padding-inline: 0.5em; - - &:active { - color: #4b4b4b; - } - } } #architecture-warning-container {