From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../installer/windows/nsis/content/installing.js | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 browser/installer/windows/nsis/content/installing.js (limited to 'browser/installer/windows/nsis/content/installing.js') diff --git a/browser/installer/windows/nsis/content/installing.js b/browser/installer/windows/nsis/content/installing.js new file mode 100644 index 0000000000..97105cf6df --- /dev/null +++ b/browser/installer/windows/nsis/content/installing.js @@ -0,0 +1,56 @@ +// 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/. + +// Length of time (milliseconds) that one blurb stays up before we switch to +// displaying the next one. +var BLURB_CYCLE_MS = 20000; + +// How frequently we should update the progress bar state, in milliseconds. +var PROGRESS_BAR_INTERVAL_MS = 250; + +window.attachEvent("onload", function () { + // Set direction on the two components of the layout. + var direction = external.getTextDirection(); + document.getElementById("text_column").style.direction = direction; + document.getElementById("installing").style.direction = direction; + + // Get this page's static strings. + var label = document.getElementById("label"); + label.innerText = external.getUIString("installing_label"); + document.getElementById("header").innerText = + external.getUIString("installing_header"); + document.getElementById("content").innerText = + external.getUIString("installing_content"); + + // Poll and update the progress bar percentage. + setInterval(function () { + var percent = external.getProgressBarPercent(); + var progressBar = document.getElementById("progress_bar"); + progressBar.setAttribute("aria-valuenow", percent); + progressBar.style.width = percent + "%"; + }, PROGRESS_BAR_INTERVAL_MS); + + // Get the blurb strings and initialize the blurb rotation. + var currentBlurb = 0; + // IE8 adds undefined to the array if there is a trailing comma in an + // array literal, so don't allow prettier to add one here. + // prettier-ignore + var blurbStrings = [ + external.getUIString("installing_blurb_0"), + external.getUIString("installing_blurb_1"), + external.getUIString("installing_blurb_2") + ]; + function rotateBlurb() { + document.getElementById("blurb").innerText = blurbStrings[currentBlurb]; + currentBlurb = (currentBlurb + 1) % blurbStrings.length; + } + rotateBlurb(); + setInterval(rotateBlurb, BLURB_CYCLE_MS); + + // Focus the label, in order to get the focus in the web page, to + // assist screen readers. On Win 7's IE8 this causes the focus rectangle + // to be immediately visible, so also hide that here. + label.className += " no-focus-outline"; + label.focus(); +}); -- cgit v1.2.3