tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

turn-off-scheduled-backups.mjs (2839B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 import { html } from "chrome://global/content/vendor/lit.all.mjs";
      6 import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
      7 
      8 /**
      9 * The widget for showing available options when users want to turn on
     10 * scheduled backups.
     11 */
     12 export default class TurnOffScheduledBackups extends MozLitElement {
     13  static get queries() {
     14    return {
     15      cancelButtonEl: "#backup-turn-off-scheduled-cancel-button",
     16      confirmButtonEl: "#backup-turn-off-scheduled-confirm-button",
     17    };
     18  }
     19 
     20  close() {
     21    this.dispatchEvent(
     22      new CustomEvent("dialogCancel", {
     23        bubbles: true,
     24        composed: true,
     25      })
     26    );
     27  }
     28 
     29  handleConfirm() {
     30    this.dispatchEvent(
     31      new CustomEvent("BackupUI:DisableScheduledBackups", {
     32        bubbles: true,
     33      })
     34    );
     35  }
     36 
     37  contentTemplate() {
     38    return html`
     39      <div
     40        id="backup-turn-off-scheduled-wrapper"
     41        aria-labelledby="backup-turn-off-scheduled-header"
     42        aria-describedby="backup-turn-off-scheduled-description"
     43      >
     44        <h1
     45          id="backup-turn-off-scheduled-header"
     46          class="heading-medium"
     47          data-l10n-id="turn-off-scheduled-backups-header"
     48        ></h1>
     49        <main id="backup-turn-off-scheduled-content">
     50          <div id="backup-turn-off-scheduled-description">
     51            <span
     52              id="backup-turn-off-scheduled-description-span"
     53              data-l10n-id="turn-off-scheduled-backups-description"
     54            ></span>
     55            <a
     56              id="backup-turn-off-scheduled-learn-more-link"
     57              is="moz-support-link"
     58              support-page="firefox-backup"
     59              data-l10n-id="turn-off-scheduled-backups-support-link"
     60              utm-content="turn-off-backup"
     61            ></a>
     62          </div>
     63        </main>
     64 
     65        <moz-button-group id="backup-turn-off-scheduled-button-group">
     66          <moz-button
     67            id="backup-turn-off-scheduled-cancel-button"
     68            @click=${this.close}
     69            data-l10n-id="turn-off-scheduled-backups-cancel-button"
     70          ></moz-button>
     71          <moz-button
     72            id="backup-turn-off-scheduled-confirm-button"
     73            @click=${this.handleConfirm}
     74            type="primary"
     75            data-l10n-id="turn-off-scheduled-backups-confirm-button"
     76          ></moz-button>
     77        </moz-button-group>
     78      </div>
     79    `;
     80  }
     81 
     82  render() {
     83    return html`
     84      <link
     85        rel="stylesheet"
     86        href="chrome://browser/content/backup/turn-off-scheduled-backups.css"
     87      />
     88      ${this.contentTemplate()}
     89    `;
     90  }
     91 }
     92 
     93 customElements.define("turn-off-scheduled-backups", TurnOffScheduledBackups);