# HG changeset patch # User Ian Neal # Date 1622316240 -3600 # Parent 6373eaa5098c34bd1958be9a56e204c9cbbd3ec6 Bug 1712498 - Use SeaMonkey's configured web search rather than separate one. r=frg a=frg diff --git a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties --- a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties +++ b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties @@ -1613,18 +1613,16 @@ pref.outgoing.colorCodes.help = Allows pref.outputWindowURL.label = Output Window pref.outputWindowURL.help = You probably don't want to change this. The chat view loads this URL to display the actual messages, header, etc., and the file must correctly define certain items or you'll get JavaScript errors and a blank chat window! pref.profilePath.label = Profile path pref.profilePath.help = This is the base location for ChatZilla-related files. By default, ChatZilla loads scripts from the "scripts" subdirectory, and stores log files in the "logs" subdirectory. pref.proxy.typeOverride.label = Proxy Type pref.proxy.typeOverride.help = Override the normal proxy choice by specifying "http" to use your browser's HTTP Proxy or "none" to force no proxy to be used (not even the SOCKS proxy). Note that this usually only works when the browser is set to use a manual proxy configuration. pref.reconnect.label = Reconnect when disconnected unexpectedly pref.reconnect.help = When your connection is lost unexpectedly, ChatZilla can automatically reconnect to the server for you. -pref.websearch.url.label = Web search URL -pref.websearch.url.help = The URL to use when running a web search; your search terms will be appended to this URL. You can include the optional parameter %s to insert your search terms in a specific part of the URL instead (e.g. "http://www.searchwebsite.com/search?q=%s"). If this field is left blank, your browser's search engine will be used (or Google, if Chatzilla is not running as a browser plugin). pref.showModeSymbols.label = Show user mode symbols pref.showModeSymbols.help = The userlist can either show mode symbols ("@" for op, "%" for half-op, "+" for voice), or it can show colored dots (green for op, dark blue for half-op, cyan for voice, and black for normal). Turn this preference on to show mode symbols instead of colored dots. pref.sortUsersByMode.label = Sort users by mode pref.sortUsersByMode.help = Causes the userlist to be sorted by mode, op first, then half-op (if supported on the server), then voice, followed by everyone else. pref.sound.enabled.label = Enabled pref.sound.enabled.help = Tick this preference to allow sound, or untick to turn off all sounds. Provides nothing more than a global toggle. pref.sound.overlapDelay.label = Overlap Delay pref.sound.overlapDelay.help = Sets the period of time during which the same event will not trigger the sound to be played. For example, the default value of 2000ms (2 seconds) means if two stalk matches occur within 2 seconds of each other, only the first will cause the sound to be played. diff --git a/suite/extensions/irc/xul/content/commands.js b/suite/extensions/irc/xul/content/commands.js --- a/suite/extensions/irc/xul/content/commands.js +++ b/suite/extensions/irc/xul/content/commands.js @@ -4606,35 +4606,14 @@ function cmdURLs(e) display(getMsg(MSG_URLS_ITEM, [i + 1, urls[i]])); client.urlLogger = logger; } } function cmdWebSearch(e) { - var searchText = e.selectedText; - var searchURL; - const SEARCH_SVC = "@mozilla.org/browser/search-service;1"; - var nibss = getService(SEARCH_SVC, "nsIBrowserSearchService"); - var engine = nibss.currentEngine; - - if (client.prefs["websearch.url"]) - { - searchText = encodeURIComponent(searchText).replace(/%20/g, "+"); - var baseURL = client.prefs["websearch.url"]; - - if (baseURL.indexOf("%s") != -1) - searchURL = baseURL.replace(/%s/g, searchText); - else - searchURL = baseURL + searchText; - } - else if (engine) - { - searchURL = engine.getSubmission(searchText).uri.asciiSpec; - } - else - { - searchText = encodeURIComponent(searchText).replace(/%20/g, "+"); - searchURL = "https://www.google.com/search?q=" + searchText; - } - dispatch(client.prefs["messages.click"], {url: searchURL}); + let submission = Services.search.currentEngine + .getSubmission(e.selectedText); + let newTabPref = Services.prefs.getBoolPref("browser.search.opentabforcontextsearch"); + dispatch(newTabPref ? "goto-url-newtab" : "goto-url-newwin", + {url: submission.uri.asciiSpec}); } diff --git a/suite/extensions/irc/xul/content/prefs.js b/suite/extensions/irc/xul/content/prefs.js --- a/suite/extensions/irc/xul/content/prefs.js +++ b/suite/extensions/irc/xul/content/prefs.js @@ -195,17 +195,16 @@ function initPrefs() ["nickname", defaultNick, ".ident"], ["nicknameList", [], "lists.nicknameList"], ["notify.aggressive", true, "global"], ["outgoing.colorCodes", true, "global"], ["outputWindowURL", "chrome://chatzilla/content/output-window.html", "hidden"], ["proxy.typeOverride", "", ".connect"], ["reconnect", true, ".connect"], - ["websearch.url", "", "global"], ["showModeSymbols", false, "appearance.userlist"], ["sortUsersByMode", true, "appearance.userlist"], // Chat == "Activity" activity. // Event == "Superfluous" activity. // Stalk == "Attention" activity. // Start == When view it opened. ["sound.channel.chat", "", ".soundEvts"], ["sound.channel.event", "", ".soundEvts"],