home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-macos9-1.3.1.sea.bin / Mozilla1.3.1 / Chrome / comm.jar / content / communicator / pref / pref-smart_browsing.js < prev    next >
Text File  |  2003-06-08  |  3KB  |  75 lines

  1. /*
  2.  * The contents of this file are subject to the Mozilla Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/MPL/
  6.  * 
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  * 
  12.  * The Original Code is Mozilla Communicator client code, released
  13.  * August 15, 2001.
  14.  * 
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corp.  Portions created by Netscape Communications
  17.  * Corp. are Copyright (C) 2001, Netscape Communications Corp.  All
  18.  * Rights Reserved.
  19.  * 
  20.  * Contributor(s): 
  21.  *      Diego Biurrun   <diego@biurrun.de>
  22.  */
  23.  
  24. function moreInfo()
  25. {
  26.   var browserURL = null;
  27.   var regionBundle = document.getElementById("bundle_region");
  28.   var smartBrowsingURL = regionBundle.getString("smartBrowsingURL");
  29.   if (smartBrowsingURL) {
  30.     try {
  31.       var prefs = Components.classes["@mozilla.org/preferences;1"];
  32.       if (prefs) {
  33.         prefs = prefs.getService();
  34.         if (prefs)
  35.           prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
  36.       }
  37.       if (prefs) {
  38.         var url = prefs.CopyCharPref("browser.chromeURL");
  39.         if (url)
  40.           browserURL = url;
  41.       }
  42.     } catch(e) {
  43.     }
  44.     if (browserURL == null)
  45.       browserURL = "chrome://navigator/content/navigator.xul";
  46.     window.openDialog( browserURL, "_blank", "chrome,all,dialog=no", smartBrowsingURL );
  47.   }
  48. }
  49.    
  50. function showACAdvanced()
  51. {
  52.   window.openDialog("chrome://communicator/content/pref/pref-smart_browsing-ac.xul", "", 
  53.                     "modal=yes,chrome,resizable=no",
  54.                     document.getElementById("browserUrlbarAutoFill").getAttribute("value"),
  55.                     document.getElementById("browserUrlbarShowPopup").getAttribute("value"),
  56.                     document.getElementById("browserUrlbarShowSearch").getAttribute("value"),
  57.                     document.getElementById("browserUrlbarMatchOnlyTyped").getAttribute("value"));
  58. }
  59.  
  60. function receiveACPrefs(aAutoFill, aShowPopup, aShowSearch, aAutoType)
  61. {
  62.   document.getElementById("browserUrlbarAutoFill").setAttribute("value", aAutoFill);
  63.   document.getElementById("browserUrlbarShowPopup").setAttribute("value", aShowPopup);
  64.   document.getElementById("browserUrlbarShowSearch").setAttribute("value", aShowSearch);
  65.   document.getElementById("browserUrlbarMatchOnlyTyped").setAttribute("value", aAutoType);
  66. }
  67.  
  68.  
  69. function toggleAutoCompleteAdvancedButton()
  70. {
  71.   var browserAutoCompleteEnabled = document.getElementById("browserAutoCompleteEnabled");
  72.   var autoCompleteAdvancedButton = document.getElementById("autoCompleteAdvancedButton");
  73.   autoCompleteAdvancedButton.disabled = !browserAutoCompleteEnabled.checked;
  74. }
  75.