diff --git a/chrome/content/zotero/locateMenu.js b/chrome/content/zotero/locateMenu.js index f38fcd39bb..e353ccd2e6 100644 --- a/chrome/content/zotero/locateMenu.js +++ b/chrome/content/zotero/locateMenu.js @@ -589,9 +589,23 @@ var Zotero_LocateMenu = new function() { this.icon = "chrome://zotero/skin/locate-library-lookup.png"; this.canHandleItem = function (item) { return Zotero.Promise.resolve(item.isRegularItem()); }; this.handleItems = Zotero.Promise.method(function (items, event) { - // If no resolver configured, just switch to the default + // If no resolver configured, show error if (!Zotero.Prefs.get('openURL.resolver')) { - Zotero.Prefs.clear('openURL.resolver') + let ps = Services.prompt; + let buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING) + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); + let index = ps.confirmEx( + null, + Zotero.getString('locate.libraryLookup.noResolver.title'), + Zotero.getString('locate.libraryLookup.noResolver.text', Zotero.appName), + buttonFlags, + Zotero.getString('general.openPreferences'), + null, null, null, {} + ); + if (index == 0) { + Zotero.Utilities.Internal.openPreferences('zotero-prefpane-advanced'); + } + return; } var urls = []; for (let item of items) { diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js index 9d5cb77f56..f4740b4396 100644 --- a/chrome/content/zotero/preferences/preferences_general.js +++ b/chrome/content/zotero/preferences/preferences_general.js @@ -30,8 +30,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); import FilePicker from 'zotero/modules/filePicker'; Zotero_Preferences.General = { - DEFAULT_OPENURL_RESOLVER: 'https://www.worldcat.org/registry/gateway', - _openURLResolvers: null, init: function () { @@ -255,12 +253,6 @@ Zotero_Preferences.General = { var menupopup = openURLMenu.firstChild; menupopup.innerHTML = ''; - var defaultMenuItem = document.createXULElement('menuitem'); - defaultMenuItem.setAttribute('label', Zotero.getString('general.default')); - defaultMenuItem.setAttribute('value', this.DEFAULT_OPENURL_RESOLVER); - defaultMenuItem.setAttribute('type', 'checkbox'); - menupopup.appendChild(defaultMenuItem); - var customMenuItem = document.createXULElement('menuitem'); customMenuItem.setAttribute('label', Zotero.getString('general.custom')); customMenuItem.setAttribute('value', 'custom'); @@ -314,13 +306,8 @@ Zotero_Preferences.General = { } } - // Default - if (currentResolver == this.DEFAULT_OPENURL_RESOLVER) { - openURLMenu.setAttribute('label', Zotero.getString('general.default')); - defaultMenuItem.setAttribute('checked', true); - Zotero.Prefs.clear('openURL.name'); - } - else if (selectedName) { + // From directory + if (selectedName) { openURLMenu.setAttribute('label', selectedName); // If we found a match, update stored name Zotero.Prefs.set('openURL.name', selectedName); @@ -348,15 +335,8 @@ Zotero_Preferences.General = { var openURLServerField = document.getElementById('openURLServerField'); var openURLVersionMenu = document.getElementById('openURLVersionMenu'); - // Default - if (event.target.value == this.DEFAULT_OPENURL_RESOLVER) { - Zotero.Prefs.clear('openURL.name'); - Zotero.Prefs.clear('openURL.resolver'); - Zotero.Prefs.clear('openURL.version'); - openURLServerField.value = this.DEFAULT_OPENURL_RESOLVER; - } // If "Custom" selected, clear URL field - else if (event.target.value == "custom") { + if (event.target.value == "custom") { Zotero.Prefs.clear('openURL.name'); Zotero.Prefs.set('openURL.resolver', ''); Zotero.Prefs.clear('openURL.version'); diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index d130fc8868..14f7ba3c5d 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -1208,6 +1208,8 @@ locate.externalViewer.label = Open in External Viewer locate.internalViewer.label = Open in Internal Viewer locate.showFile.label = Show File locate.libraryLookup.label = Library Lookup +locate.libraryLookup.noResolver.title = No OpenURL Resolver +locate.libraryLookup.noResolver.text = You must choose an OpenURL resolver from the Advanced pane of the %S preferences. locate.manageLocateEngines = Manage Lookup Engines… locate.locateEngineDescription = Lookup engines help you find resources in your %S library on the web. Engines enabled in this list appear in the Locate drop-down in the toolbar. diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index 38ddff97f8..c6ef7adec5 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -22,7 +22,7 @@ pref("extensions.zotero.automaticScraperUpdates",true); pref("extensions.zotero.triggerProxyAuthentication", true); // Proxy auth URLs should respond successfully to HEAD requests over HTTP and HTTPS (in case of forced HTTPS requests) pref("extensions.zotero.proxyAuthenticationURLs", "https://www.acm.org,https://www.ebscohost.com,https://www.sciencedirect.com,https://ieeexplore.ieee.org,https://www.jstor.org,http://www.ovid.com,https://link.springer.com,https://www.tandfonline.com"); -pref("extensions.zotero.openURL.resolver","https://www.worldcat.org/registry/gateway"); +pref("extensions.zotero.openURL.resolver",""); pref("extensions.zotero.openURL.version","1.0"); pref("extensions.zotero.automaticSnapshots",true); pref("extensions.zotero.downloadAssociatedFiles",true);