Add "add engines" item to search bar dropdown (links to mycroft page for now, we'll want a more friendly site later)

This commit is contained in:
blakeross%telocity.com 2003-08-08 07:44:06 +00:00
Родитель 28e6a83585
Коммит 265c58430d
5 изменённых файлов: 25 добавлений и 8 удалений

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

@ -48,6 +48,8 @@
const NS_ERROR_MODULE_NETWORK = 2152398848;
const NS_NET_STATUS_READ_FROM = NS_ERROR_MODULE_NETWORK + 8;
const NS_NET_STATUS_WROTE_TO = NS_ERROR_MODULE_NETWORK + 9;
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
@ -718,9 +720,6 @@ function loadOneOrMoreURIs(aURIString)
function constructGoMenuItem(goMenu, beforeItem, url, title)
{
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var menuitem = document.createElementNS(kXULNS, "menuitem");
menuitem.setAttribute("url", url);
menuitem.setAttribute("label", title);
@ -1408,6 +1407,19 @@ function PageProxyDragGesture(aEvent)
return false;
}
function SearchBarPopupShowing(aEvent)
{
var currItem = document.getElementById("miAddEngines");
if (currItem)
aEvent.target.removeChild(currItem);
var browserBundle = document.getElementById("bundle_browser");
var menuitem = document.createElementNS(kXULNS, "menuitem");
menuitem.setAttribute("label", browserBundle.getString("addEngines"));
menuitem.id = "miAddEngines";
aEvent.target.appendChild(menuitem);
}
function SearchBarPopupCommand(aEvent)
{
var searchBar = document.getElementById("search-bar");
@ -1419,6 +1431,9 @@ function SearchBarPopupCommand(aEvent)
// Clear out the search engine icon
searchBar.firstChild.removeAttribute("src");
} else if (aEvent.target.id == "miAddEngines") {
var regionBundle = document.getElementById("bundle_browser_region");
loadURI(regionBundle.getString("searchEnginesURL"));
} else {
searchBar.setAttribute("searchmode", aEvent.target.id);
searchBar.setAttribute("autocompletesearchparam", "q");
@ -1579,8 +1594,6 @@ function toggleAffectedChrome(aHide)
function showPrintPreviewToolbar()
{
toggleAffectedChrome(true);
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var printPreviewTB = document.createElementNS(kXULNS, "toolbar");
printPreviewTB.setAttribute("printpreview", true);

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

@ -64,7 +64,7 @@
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
<stringbundle id="bundle_browser_region" src="chrome://navigator-region/locale/region.properties"/>
<stringbundle id="bundle_browser_region" src="chrome://browser-region/locale/region.properties"/>
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
</stringbundleset>
@ -281,11 +281,11 @@
<popup id="SearchBarPopup" position="after_start"
datasources="rdf:internetsearch" ref="NC:SearchEngineRoot"
oncommand="return SearchBarPopupCommand(event);">
oncommand="return SearchBarPopupCommand(event);"
onpopupshowing="SearchBarPopupShowing(event);">
<menuitem id="miSearchModeFind" class="menuitem-iconic"
label="&findOnSearchBarCmd.label;"/>
<menuseparator/>
<template>
<menuitem type="checkbox"
uri="..." value="..."

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

@ -285,3 +285,4 @@
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom Window">
#endif

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

@ -66,3 +66,4 @@ filesFolder=%S_files
saveLinkErrorMsg=The link could not be saved. The web page might have been removed or had its name changed.
saveLinkErrorTitle=Save Link
addEngines=Add engines...

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

@ -33,3 +33,5 @@ intl.content.langcode=en-US
# update notifications: new update page
update_notifications.provider.0.datasource=
searchEnginesURL=http://mycroft.mozdev.org/download.html