suite/base/content/sanitize.xul
author Geoff Lankow <geoff@darktrojan.net>
Thu, 18 Oct 2018 16:18:45 +1300
changeset 68480 52978d6762592e11d9e3c7ff69d39f47bc7990ed
parent 64574 0838548ddc02bfc89f3515137746ab94e13bddd4
child 70713 985a367b6423f28e297d4c55d0256e741e91d225
permissions -rw-r--r--
Bug 1498041 - Turn on ESLint in mail/base/test

<?xml version="1.0"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<?xml-stylesheet href="chrome://global/skin/"?>

<!DOCTYPE prefwindow [
  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
  %brandDTD;
  <!ENTITY % sanitizeDTD SYSTEM "chrome://communicator/locale/sanitize.dtd">
  %sanitizeDTD;
]>

<dialog id="SanitizeDialog"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        dlgbuttons="accept,cancel"
        title="&sanitizeDialog.title;"
        onload="onLoad();"
        ondialogcancel="Sanitizer.clearSettings();"
        buttonlabelaccept="&sanitizeButton.label;">

  <script type="application/javascript">
  <![CDATA[
    ChromeUtils.import("resource:///modules/Sanitizer.jsm");

    function onLoad()
    {
      var preferences = document.getElementById("sanitizePreferences").childNodes;
      for (var pref of preferences) {
        var name = pref.getAttribute("name");
        pref.checked = Sanitizer.willClearItem(name);
        Sanitizer.canClearItem(name, function canClearCallback(aItem, aCanClear, aPrefItem) {
          if (!aCanClear)
            aPrefItem.disabled = true;
        }, pref);
      }
    }

    function onCommand(aEvent)
    {
      var item = aEvent.target.getAttribute("name");
      Sanitizer.setClearItem(item, aEvent.target.checked);

      var found = false;
      var preferences = document.getElementById("sanitizePreferences").childNodes;
      for (var pref of preferences) {
        if (pref.checked && !pref.disabled) {
          found = true;
          break;
        }
      }
      document.documentElement.getButton("accept").disabled = !found;
    }
  ]]>
  </script>

  <description>&sanitizeItems.label;</description>

  <vbox id="sanitizePreferences" align="start" oncommand="onCommand(event);">
    <checkbox label="&itemHistory.label;"
              accesskey="&itemHistory.accesskey;"
              name="history"/>
    <checkbox label="&itemUrlBar.label;"
              accesskey="&itemUrlBar.accesskey;"
              name="urlbar"/>
    <checkbox label="&itemDownloads.label;"
              accesskey="&itemDownloads.accesskey;"
              name="downloads"/>
    <checkbox label="&itemFormSearchHistory.label;"
              accesskey="&itemFormSearchHistory.accesskey;"
              name="formdata"/>
    <checkbox label="&itemCache.label;"
              accesskey="&itemCache.accesskey;"
              name="cache"/>
    <checkbox label="&itemCookies.label;"
              accesskey="&itemCookies.accesskey;"
              name="cookies"/>
    <checkbox label="&itemOfflineApps.label;"
              accesskey="&itemOfflineApps.accesskey;"
              name="offlineApps"/>
    <checkbox label="&itemPasswords.label;"
              accesskey="&itemPasswords.accesskey;"
              name="passwords"/>
    <checkbox label="&itemSessions.label;"
              accesskey="&itemSessions.accesskey;"
              name="sessions"/>

  </vbox>
</dialog>