From 98da51e1260707e0f3ff2e02727a37de5c301b23 Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Thu, 30 Dec 1999 11:16:07 +0000 Subject: [PATCH] Add a search preference panel --- suite/common/pref/pref-search.js | 94 +++++++++++++++++++ suite/common/pref/pref-search.xul | 79 ++++++++++++++++ suite/common/pref/preftree.xul | 6 ++ .../en-US/chrome/common/pref/pref-search.dtd | 12 +++ .../en-US/chrome/common/pref/preftree.dtd | 1 + .../prefwindow/resources/content/MANIFEST | 2 + .../prefwindow/resources/content/Makefile.in | 2 + .../prefwindow/resources/content/makefile.win | 2 + .../resources/content/pref-search.js | 94 +++++++++++++++++++ .../resources/content/pref-search.xul | 79 ++++++++++++++++ .../prefwindow/resources/content/preftree.xul | 6 ++ .../resources/locale/en-US/MANIFEST | 1 + .../resources/locale/en-US/Makefile.in | 1 + .../resources/locale/en-US/makefile.win | 1 + .../resources/locale/en-US/pref-search.dtd | 12 +++ .../resources/locale/en-US/preftree.dtd | 1 + 16 files changed, 393 insertions(+) create mode 100755 suite/common/pref/pref-search.js create mode 100755 suite/common/pref/pref-search.xul create mode 100755 suite/locales/en-US/chrome/common/pref/pref-search.dtd create mode 100755 xpfe/components/prefwindow/resources/content/pref-search.js create mode 100755 xpfe/components/prefwindow/resources/content/pref-search.xul create mode 100755 xpfe/components/prefwindow/resources/locale/en-US/pref-search.dtd diff --git a/suite/common/pref/pref-search.js b/suite/common/pref/pref-search.js new file mode 100755 index 000000000000..06fae1e2b1db --- /dev/null +++ b/suite/common/pref/pref-search.js @@ -0,0 +1,94 @@ +/* + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998-1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): Robert John Churchill (rjc@netscape.com) + */ + + var pref = null; + try + { + pref = Components.classes["component://netscape/preferences"]; + if (pref) pref = pref.getService(); + if (pref) pref = pref.QueryInterface(Components.interfaces.nsIPref); + } + catch(ex) + { + dump("failed to get prefs service!\n"); + pref = null; + } + + + +function InitSingleEngineList() +{ + dump("InitSingleEngineList called.\n"); + + var defaultEngineURI = null; + try + { + if (pref) + { + var defaultEngineURI = pref.CopyCharPref("browser.search.defaultengine"); + } + } + catch(ex) + { + defaultEngineURI = null; + } + + if ((!defaultEngineURI) || (defaultEngineURI == "")) return; + + var engineList = document.getElementById("engineList"); + if (!engineList) return; + var numEngines = engineList.length; + if (numEngines < 1) return; + + for (var x=0; x + + + + + + + + + + + + + + + + + + + + + &legendHeader; + + + + + + &browserSearchButtonText.label; + + + + + + + + + + + + + + &enablePowerSearch.label; + + + + + + diff --git a/suite/common/pref/preftree.xul b/suite/common/pref/preftree.xul index c7a20904c3b2..8811349795cf 100644 --- a/suite/common/pref/preftree.xul +++ b/suite/common/pref/preftree.xul @@ -117,6 +117,12 @@ + + + + + + diff --git a/suite/locales/en-US/chrome/common/pref/pref-search.dtd b/suite/locales/en-US/chrome/common/pref/pref-search.dtd new file mode 100755 index 000000000000..e06609b07fb2 --- /dev/null +++ b/suite/locales/en-US/chrome/common/pref/pref-search.dtd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/suite/locales/en-US/chrome/common/pref/preftree.dtd b/suite/locales/en-US/chrome/common/pref/preftree.dtd index d3ac7e3a0a4a..48d3dda4ceeb 100644 --- a/suite/locales/en-US/chrome/common/pref/preftree.dtd +++ b/suite/locales/en-US/chrome/common/pref/preftree.dtd @@ -9,6 +9,7 @@ + diff --git a/xpfe/components/prefwindow/resources/content/MANIFEST b/xpfe/components/prefwindow/resources/content/MANIFEST index fd314477206e..735087e66da4 100644 --- a/xpfe/components/prefwindow/resources/content/MANIFEST +++ b/xpfe/components/prefwindow/resources/content/MANIFEST @@ -14,6 +14,8 @@ pref-offline.xul pref-proxies.xul pref-proxy-manual.xul pref-publish.xul +pref-search.js +pref-search.xul pref-smart_browsing.xul pref-smartupdate.xul PrefsWindow.js diff --git a/xpfe/components/prefwindow/resources/content/Makefile.in b/xpfe/components/prefwindow/resources/content/Makefile.in index b0b7609bf84b..dc5a5d593970 100644 --- a/xpfe/components/prefwindow/resources/content/Makefile.in +++ b/xpfe/components/prefwindow/resources/content/Makefile.in @@ -46,6 +46,8 @@ EXPORT_RESOURCE_CONTENT = \ $(srcdir)/pref-proxy-manual.xul \ $(srcdir)/pref-publish.xul \ $(srcdir)/pref-mousewheel.xul \ + $(srcdir)/pref-search.js \ + $(srcdir)/pref-search.xul \ $(srcdir)/pref-smart_browsing.xul \ $(srcdir)/pref-smartupdate.xul \ $(srcdir)/fontScalingOverlay.xul \ diff --git a/xpfe/components/prefwindow/resources/content/makefile.win b/xpfe/components/prefwindow/resources/content/makefile.win index 92dc3fb7038e..d27226626921 100644 --- a/xpfe/components/prefwindow/resources/content/makefile.win +++ b/xpfe/components/prefwindow/resources/content/makefile.win @@ -40,6 +40,8 @@ install:: $(MAKE_INSTALL) pref-proxies.xul $(DIST)\bin\chrome\pref\content\default $(MAKE_INSTALL) pref-proxy-manual.xul $(DIST)\bin\chrome\pref\content\default $(MAKE_INSTALL) pref-publish.xul $(DIST)\bin\chrome\pref\content\default + $(MAKE_INSTALL) pref-search.js $(DIST)\bin\chrome\pref\content\default + $(MAKE_INSTALL) pref-search.xul $(DIST)\bin\chrome\pref\content\default $(MAKE_INSTALL) pref-smart_browsing.xul $(DIST)\bin\chrome\pref\content\default $(MAKE_INSTALL) pref-smartupdate.xul $(DIST)\bin\chrome\pref\content\default $(MAKE_INSTALL) PrefsWindow.js $(DIST)\bin\chrome\pref\content\default diff --git a/xpfe/components/prefwindow/resources/content/pref-search.js b/xpfe/components/prefwindow/resources/content/pref-search.js new file mode 100755 index 000000000000..06fae1e2b1db --- /dev/null +++ b/xpfe/components/prefwindow/resources/content/pref-search.js @@ -0,0 +1,94 @@ +/* + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998-1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): Robert John Churchill (rjc@netscape.com) + */ + + var pref = null; + try + { + pref = Components.classes["component://netscape/preferences"]; + if (pref) pref = pref.getService(); + if (pref) pref = pref.QueryInterface(Components.interfaces.nsIPref); + } + catch(ex) + { + dump("failed to get prefs service!\n"); + pref = null; + } + + + +function InitSingleEngineList() +{ + dump("InitSingleEngineList called.\n"); + + var defaultEngineURI = null; + try + { + if (pref) + { + var defaultEngineURI = pref.CopyCharPref("browser.search.defaultengine"); + } + } + catch(ex) + { + defaultEngineURI = null; + } + + if ((!defaultEngineURI) || (defaultEngineURI == "")) return; + + var engineList = document.getElementById("engineList"); + if (!engineList) return; + var numEngines = engineList.length; + if (numEngines < 1) return; + + for (var x=0; x + + + + + + + + + + + + + + + + + + + + + &legendHeader; + + + + + + &browserSearchButtonText.label; + + + + + + + + + + + + + + &enablePowerSearch.label; + + + + + + diff --git a/xpfe/components/prefwindow/resources/content/preftree.xul b/xpfe/components/prefwindow/resources/content/preftree.xul index c7a20904c3b2..8811349795cf 100644 --- a/xpfe/components/prefwindow/resources/content/preftree.xul +++ b/xpfe/components/prefwindow/resources/content/preftree.xul @@ -117,6 +117,12 @@ + + + + + + diff --git a/xpfe/components/prefwindow/resources/locale/en-US/MANIFEST b/xpfe/components/prefwindow/resources/locale/en-US/MANIFEST index c80e986f8c46..572a5c05c661 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/MANIFEST +++ b/xpfe/components/prefwindow/resources/locale/en-US/MANIFEST @@ -14,6 +14,7 @@ pref-offline.dtd pref-proxies.dtd pref-proxy-manual.dtd pref-publish.dtd +pref-search.dtd pref-smart_browsing.dtd pref-smartupdate.dtd PrefsWindow.dtd diff --git a/xpfe/components/prefwindow/resources/locale/en-US/Makefile.in b/xpfe/components/prefwindow/resources/locale/en-US/Makefile.in index d7643fbd01e4..3284a7dbc622 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/Makefile.in +++ b/xpfe/components/prefwindow/resources/locale/en-US/Makefile.in @@ -44,6 +44,7 @@ EXPORT_RESOURCE_CONTENT = \ $(srcdir)/pref-proxies.dtd \ $(srcdir)/pref-proxy-manual.dtd \ $(srcdir)/pref-publish.dtd \ + $(srcdir)/pref-search.dtd \ $(srcdir)/pref-smart_browsing.dtd \ $(srcdir)/pref-smartupdate.dtd \ $(srcdir)/pref-mousewheel.dtd \ diff --git a/xpfe/components/prefwindow/resources/locale/en-US/makefile.win b/xpfe/components/prefwindow/resources/locale/en-US/makefile.win index 0ab49e81b765..4ce702c22bb0 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/makefile.win +++ b/xpfe/components/prefwindow/resources/locale/en-US/makefile.win @@ -40,6 +40,7 @@ install:: $(MAKE_INSTALL) pref-proxies.dtd $(DIST)\bin\chrome\pref\locale\en-US $(MAKE_INSTALL) pref-proxy-manual.dtd $(DIST)\bin\chrome\pref\locale\en-US $(MAKE_INSTALL) pref-publish.dtd $(DIST)\bin\chrome\pref\locale\en-US + $(MAKE_INSTALL) pref-search.dtd $(DIST)\bin\chrome\pref\locale\en-US $(MAKE_INSTALL) pref-smart_browsing.dtd $(DIST)\bin\chrome\pref\locale\en-US $(MAKE_INSTALL) pref-smartupdate.dtd $(DIST)\bin\chrome\pref\locale\en-US $(MAKE_INSTALL) PrefsWindow.dtd $(DIST)\bin\chrome\pref\locale\en-US diff --git a/xpfe/components/prefwindow/resources/locale/en-US/pref-search.dtd b/xpfe/components/prefwindow/resources/locale/en-US/pref-search.dtd new file mode 100755 index 000000000000..e06609b07fb2 --- /dev/null +++ b/xpfe/components/prefwindow/resources/locale/en-US/pref-search.dtd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd b/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd index d3ac7e3a0a4a..48d3dda4ceeb 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd +++ b/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd @@ -9,6 +9,7 @@ +