Bug 133117 Allow context search results to open in new tab r=IanN sr=me

This commit is contained in:
neil%parkwaycc.co.uk 2006-08-11 11:19:03 +00:00
Родитель a9e1bcbff9
Коммит 50334b1133
10 изменённых файлов: 40 добавлений и 15 удалений

Просмотреть файл

@ -374,6 +374,10 @@
<li><strong>Open the Search tab in the Sidebar when search results are
available</strong>: Select this to have &brandShortName; open the
Sidebar and show your search results.</li>
<li><strong>Open tab instead of window for a context menu web
search</strong>: Select this to have &brandShortName; show your search
results in a new tab rather than a new window when you search on
selected words in a web page.</li>
</ul>
</li>
<li><strong>Sidebar Search Tab Preference</strong>:

Просмотреть файл

@ -381,8 +381,8 @@
<h2 id="fast_searches">Fast Searches</h2>
<p>There are three ways to search quickly: from the Location Bar, from Sidebar,
and from the Net Search page.</p>
<p>There are four ways to search quickly: from the Location Bar, from Sidebar,
from the Net Search page, and by selecting words in a web page.</p>
<h3 id="searching_from_the_location_bar">Searching from the Location Bar</h3>
@ -482,9 +482,10 @@
[your selected words]</q> for the menu.</li>
</ol>
<p>&brandShortName; opens a new window and uses your default search engine to
search for your selected words. To learn how to change the search engine used
to search for your selected words, see
<p>&brandShortName; opens a new window or tab (depending on your preferences)
and uses your default search engine to search for your selected words. To
learn how to change the search engine used to search for your selected words
and the way your search results are displayed, see
<a href="cs_nav_prefs_navigator.xhtml#internet_search">Navigator Preferences
- Internet Search</a>.</p>

Просмотреть файл

@ -108,6 +108,7 @@ pref("browser.download.lastLocation", true);
// various default search settings
pref("browser.search.defaulturl", "chrome://navigator-region/locale/region.properties");
pref("browser.search.opensidebarsearchpanel", true);
pref("browser.search.opentabforcontextsearch", false);
pref("browser.search.last_search_category", "NC:SearchCategory?category=urn:search:category:1");
pref("browser.search.mode", 0);
// basic search popup constraint: minimum sherlock plugin version displayed

Просмотреть файл

@ -189,7 +189,7 @@
<menuseparator id="context-sep-selectall"/>
<menuitem id="context-searchselect"
accesskey="&search.accesskey;"
oncommand="OpenSearch('internet', gContextMenu.searchSelected(), true);"/>
oncommand="OpenSearch('internet', gContextMenu.searchSelected(), true, event.shiftKey);"/>
<menuseparator id="frame-sep"/>
<menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
<menupopup id="frame_popup">

Просмотреть файл

@ -45,7 +45,7 @@
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["engineList","openSidebarPanel","sidebarSearchMode"];
var _elementIDs = ["engineList","openSidebarPanel","openContextSearchTab","sidebarSearchMode"];
]]>
</script>
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-search.js"/>
@ -74,6 +74,8 @@
<caption label="&searchResults.label;"/>
<checkbox id="openSidebarPanel" label="&openSidebarSearchPanel.label;" accesskey="&openSidebarSearchPanel.accesskey;"
prefstring="browser.search.opensidebarsearchpanel"/>
<checkbox id="openContextSearchTab" label="&openContextSearchTab.label;" accesskey="&openContextSearchTab.accesskey;"
prefstring="browser.search.opentabforcontextsearch"/>
</groupbox>
<groupbox>

Просмотреть файл

@ -374,6 +374,10 @@
<li><strong>Open the Search tab in the Sidebar when search results are
available</strong>: Select this to have &brandShortName; open the
Sidebar and show your search results.</li>
<li><strong>Open tab instead of window for a context menu web
search</strong>: Select this to have &brandShortName; show your search
results in a new tab rather than a new window when you search on
selected words in a web page.</li>
</ul>
</li>
<li><strong>Sidebar Search Tab Preference</strong>:

Просмотреть файл

@ -381,8 +381,8 @@
<h2 id="fast_searches">Fast Searches</h2>
<p>There are three ways to search quickly: from the Location Bar, from Sidebar,
and from the Net Search page.</p>
<p>There are four ways to search quickly: from the Location Bar, from Sidebar,
from the Net Search page, and by selecting words in a web page.</p>
<h3 id="searching_from_the_location_bar">Searching from the Location Bar</h3>
@ -482,9 +482,10 @@
[your selected words]</q> for the menu.</li>
</ol>
<p>&brandShortName; opens a new window and uses your default search engine to
search for your selected words. To learn how to change the search engine used
to search for your selected words, see
<p>&brandShortName; opens a new window or tab (depending on your preferences)
and uses your default search engine to search for your selected words. To
learn how to change the search engine used to search for your selected words
and the way your search results are displayed, see
<a href="cs_nav_prefs_navigator.xhtml#internet_search">Navigator Preferences
- Internet Search</a>.</p>

Просмотреть файл

@ -10,6 +10,9 @@
<!ENTITY openSidebarSearchPanel.label "Open the Search tab in the Sidebar when a search is invoked">
<!ENTITY openSidebarSearchPanel.accesskey "O">
<!ENTITY openContextSearchTab.label "Open a tab instead of a window for a context menu web search">
<!ENTITY openContextSearchTab.accesskey "t">
<!ENTITY searchResults.label "Search Results">
<!ENTITY sidebarSearchTabPref.label "Sidebar Search Tab Preference">

Просмотреть файл

@ -108,6 +108,7 @@ pref("browser.download.lastLocation", true);
// various default search settings
pref("browser.search.defaulturl", "chrome://navigator-region/locale/region.properties");
pref("browser.search.opensidebarsearchpanel", true);
pref("browser.search.opentabforcontextsearch", false);
pref("browser.search.last_search_category", "NC:SearchCategory?category=urn:search:category:1");
pref("browser.search.mode", 0);
// basic search popup constraint: minimum sherlock plugin version displayed

Просмотреть файл

@ -1079,7 +1079,7 @@ function QualifySearchTerm()
return "";
}
function OpenSearch(tabName, searchStr, newWindowFlag)
function OpenSearch(tabName, searchStr, newWindowOrTabFlag, reverseBackgroundPref)
{
//This function needs to be split up someday.
@ -1136,10 +1136,18 @@ function OpenSearch(tabName, searchStr, newWindowFlag)
} catch (ex) {
}
if (!newWindowFlag)
if (!newWindowOrTabFlag)
loadURI(defaultSearchURL);
else
else if (!pref.getBoolPref("browser.search.opentabforcontextsearch"))
window.open(defaultSearchURL, "_blank");
else {
var newTab = gBrowser.addTab(defaultSearchURL);
var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground");
if (reverseBackgroundPref)
loadInBackground = !loadInBackground;
if (!loadInBackground)
gBrowser.selectedTab = newTab;
}
}
}
}