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 / cookie / pref-cookies.xul < prev    next >
Extensible Markup Language  |  2003-06-07  |  7KB  |  152 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4.    The contents of this file are subject to the Netscape Public
  5.    License Version 1.1 (the "License"); you may not use this file
  6.    except in compliance with the License. You may obtain a copy of
  7.    the License at http://www.mozilla.org/NPL/
  8.     
  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.    March 31, 1998.
  14.    
  15.    The Initial Developer of the Original Code is Netscape
  16.    Communications Corporation. Portions created by Netscape are
  17.    Copyright (C) 1998-1999 Netscape Communications Corporation. All
  18.    Rights Reserved.
  19.    
  20.    Contributor(s):
  21.      H├Ñkan Waara <hwaara@chello.se>
  22.      Peter Annema <disttsc@bart.nl>
  23.   -->
  24.  
  25. <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
  26.  
  27. <!DOCTYPE window SYSTEM "chrome://cookie/locale/pref-cookies.dtd">
  28.  
  29. <page id="cookiesPanel" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  30.       onload="init();"
  31.       headertitle="&lHeader;">
  32.  
  33.   <script type="application/x-javascript" src="chrome://cookie/content/cookieOverlay.js"/>
  34.  
  35.   <script type="application/x-javascript">
  36.   <![CDATA[
  37.   var panel = "chrome://cookie/content/pref-cookies.xul";
  38.   var _elementIDs = ["networkCookieBehaviour", "networkWarnAboutCookies",
  39.                      "lifetimeEnabled", "lifetimeBehavior", "lifetimeDays"];
  40.  
  41.   function init()
  42.   {
  43.     parent.initPanel('chrome://cookie/content/pref-cookies.xul');
  44.     setDisables(false);
  45.  
  46.     const NS_COOKIECONSENT_CONTRACTID = '@mozilla.org/cookie-consent;1';
  47.     if (NS_COOKIECONSENT_CONTRACTID in Components.classes) {
  48.       var p3pRadioButton = document.getElementById("p3pRadioButton");
  49.       p3pRadioButton.removeAttribute("hidden");
  50.     }
  51.  
  52.   }
  53.  
  54.   const cookies_disabled = "2";
  55.   const cookies_no_third_party = "1";
  56.   const cookies_p3p = "3";
  57.   const cookies_enabled = "0";
  58.  
  59.   function setDisables(setFocus)
  60.   {
  61.     var cookieBehavior = document.getElementById("networkCookieBehaviour");
  62.  
  63.     var p3pButton = document.getElementById("p3pDialog");
  64.     p3pButton.disabled = (cookieBehavior.value != cookies_p3p);
  65.     if (parent.hPrefWindow.getPrefIsLocked(p3pButton.getAttribute("prefstring")) )
  66.       p3pButton.disabled = true;
  67.  
  68.     // if mailnews is installed then we will have networkCookieBehaviorForMailNews checkbox
  69.     if (document.getElementById('networkDisableCookieForMailNews'))
  70.     {
  71.       var networkDisableCookieForMailNews = document.getElementById("networkDisableCookieForMailNews");
  72.       networkDisableCookieForMailNews.disabled = cookieBehavior.value == cookies_disabled; 
  73.     }
  74.  
  75.     var warnCheckbox = document.getElementById("networkWarnAboutCookies");
  76.     warnCheckbox.disabled = (cookieBehavior.value == cookies_disabled);
  77.     if (parent.hPrefWindow.getPrefIsLocked(warnCheckbox.getAttribute("prefstring")) )
  78.       warnCheckbox.disabled = true;
  79.  
  80.     var lifetimeCheckbox  = document.getElementById("lifetimeEnabled");
  81.     lifetimeCheckbox.disabled = (cookieBehavior.value == cookies_disabled);
  82.     if (parent.hPrefWindow.getPrefIsLocked(lifetimeCheckbox.getAttribute("prefstring")) )
  83.       lifetimeCheckbox.disabled = true;
  84.  
  85.     var lifetimeEnabled = document.getElementById("lifetimeEnabled");
  86.     var lifetimeBehavior = document.getElementById("lifetimeBehavior");
  87.     var lifetimeDays = document.getElementById("lifetimeDays");
  88.  
  89.     lifetimeBehavior.disabled = (cookieBehavior.value == cookies_disabled) ||
  90.                                 !lifetimeEnabled.checked;
  91.     if (parent.hPrefWindow.getPrefIsLocked(lifetimeBehavior.getAttribute("prefstring")) )
  92.       lifetimeBehavior.disabled = true;
  93.  
  94.     lifetimeDays.disabled = (cookieBehavior.value == cookies_disabled) ||
  95.                             !lifetimeEnabled.checked ||
  96.                             (lifetimeBehavior.value != 1);
  97.     if (parent.hPrefWindow.getPrefIsLocked(lifetimeDays.getAttribute("prefstring")) )
  98.       lifetimeDays.disabled = true;
  99.     
  100.     if (!lifetimeDays.disabled && setFocus)
  101.       lifetimeDays.focus();
  102.   }
  103.   ]]>
  104.   </script>
  105.  
  106.     <description>&cookieDetails;</description>
  107.     <radiogroup id="networkCookieBehaviour"
  108.                 prefstring="network.cookie.cookieBehavior">
  109.       <radio value="2" label="&disableCookies.label;"
  110.              accesskey="&disableCookies.accesskey;" oncommand="setDisables(false);"/>
  111.       <radio value="1" label="&accOrgCookiesRadio.label;"
  112.              accesskey="&accOrgCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
  113.       <hbox id="p3pRadioButton" hidden="true">
  114.         <radio value="3" label="&accP3PCookiesRadio.label;"
  115.                accesskey="&accP3PCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
  116.         <button label="&viewP3P.label;" accesskey="&viewP3P.accesskey;" oncommand="viewP3P();"
  117.                 id="p3pDialog"
  118.                 prefstring="pref.advanced.cookies.disable_button.more_info"/>
  119.       </hbox>
  120.       <radio value="0" label="&accAllCookiesRadio.label;"
  121.              accesskey="&accAllCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
  122.     </radiogroup>
  123.     <separator id="networkCookieBehaviorSeparator"/>
  124.     <vbox align="start">
  125.       <checkbox id="networkWarnAboutCookies" label="&warnAboutCookies.label;" accesskey="&warnAboutCookies.accesskey;"
  126.                 prefstring="network.cookie.warnAboutCookies"/>
  127.       <checkbox id="lifetimeEnabled" label="&limitLifetime.label;" accesskey="&limitLifetime.accesskey;"
  128.                 prefstring="network.cookie.lifetime.enabled"
  129.                 oncommand="setDisables(false);"/>
  130.       <hbox class="indent">
  131.         <radiogroup id="lifetimeBehavior" prefstring="network.cookie.lifetime.behavior">
  132.           <radio value="0" label="¤t.label;" 
  133.                  accesskey="¤t.accesskey;"
  134.                  oncommand="setDisables(false);"/>
  135.           <hbox>
  136.             <radio value="1" accesskey="&days.accesskey;"
  137.                     oncommand="setDisables(true);"/>
  138.             <textbox id="lifetimeDays" pref="true" size="4"
  139.                      preftype="int" prefstring="network.cookie.lifetime.days"/>
  140.             <description>&days.label;</description>
  141.             </hbox>
  142.          </radiogroup>
  143.       </hbox>
  144.    </vbox>
  145.    <separator/>
  146.    <hbox pack="end">
  147.      <button label="&viewCookies.label;" accesskey="&viewCookies.accesskey;" oncommand="viewCookies();"
  148.              id="viewCookieButton"
  149.              prefstring="pref.advanced.cookies.disable_button.view_cookies"/>
  150.    </hbox>
  151. </page>
  152.