Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/mozapps/update/content/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  history.js   Sprache: JAVA

 
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* 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/. */


var gUpdateHistory = {
  _view: null,

  /**
   * Initialize the User Interface
   */

  async onLoad() {
    this._view = document.getElementById("historyItems");

    var um = Cc["@mozilla.org/updates/update-manager;1"].getService(
      Ci.nsIUpdateManager
    );
    const updateHistory = await um.getHistory();
    if (updateHistory.length) {
      while (this._view.hasChildNodes()) {
        this._view.firstChild.remove();
      }

      for (const update of updateHistory) {
        if (!update || !update.name) {
          continue;
        }

        // Don't display updates that are downloading since they don't have
        // valid statusText for the UI (bug 485493).
        if (!update.statusText) {
          continue;
        }

        var element = document.createXULElement("richlistitem");
        element.className = "update";

        const topLine = document.createXULElement("hbox");
        const nameLabel = document.createXULElement("label");
        nameLabel.className = "update-name";
        document.l10n.setAttributes(nameLabel, "update-full-build-name", {
          name: update.name,
          buildID: update.buildID,
        });
        topLine.appendChild(nameLabel);

        if (update.detailsURL) {
          const detailsLink = document.createXULElement("label", {
            is: "text-link",
          });
          detailsLink.href = update.detailsURL;
          document.l10n.setAttributes(detailsLink, "update-details");
          topLine.appendChild(detailsLink);
        }

        const installedOnLabel = document.createXULElement("label");
        installedOnLabel.className = "update-installedOn-label";
        document.l10n.setAttributes(installedOnLabel, "update-installed-on", {
          date: this._formatDate(update.installDate),
        });

        const statusLabel = document.createXULElement("label");
        statusLabel.className = "update-status-label";
        document.l10n.setAttributes(statusLabel, "update-status", {
          status: update.statusText,
        });

        element.append(topLine, installedOnLabel, statusLabel);
        this._view.appendChild(element);
      }
    }
    var cancelbutton = document.getElementById("history").getButton("cancel");
    cancelbutton.focus();
  },

  /**
   * Formats a date into human readable form
   * @param   seconds
   *          A date in seconds since 1970 epoch
   * @returns A human readable date string
   */

  _formatDate(seconds) {
    var date = new Date(seconds);
    const dtOptions = {
      year: "numeric",
      month: "long",
      day: "numeric",
      hour: "numeric",
      minute: "numeric",
      second: "numeric",
    };
    return date.toLocaleString(undefined, dtOptions);
  },
};

Messung V0.5
C=94 H=87 G=90

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.