diff options
Diffstat (limited to 'browser/installer/windows/nsis/content')
6 files changed, 233 insertions, 0 deletions
diff --git a/browser/installer/windows/nsis/content/installing.html b/browser/installer/windows/nsis/content/installing.html new file mode 100644 index 0000000000..e7b4450065 --- /dev/null +++ b/browser/installer/windows/nsis/content/installing.html @@ -0,0 +1,43 @@ +<!doctype html> + +<!-- 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/. --> + +<html> +<head> + +<meta charset="UTF-8"> +<meta http-equiv="X-UA-Compatible" content="IE=8"> + +<link rel="stylesheet" href="stub_common.css"> +<link rel="stylesheet" href="installing_page.css"> + +<script src="stub_common.js"></script> +<script src="installing.js"></script> + +</head> +<body> + +<img id="background" src="bgstub.jpg" alt="" role="presentation"> + +<div id="text_column"> + <div id="text_column_container"> + <h1 id="header"></h1> + <div id="content"></div> + </div> +</div> + +<div id="installing"> + <div id="label" tabindex="0"></div> + <div id="progress_background"> + <div id="progress_bar" role="progressbar" aria-labelledby="label" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" tabindex="0"></div> + </div> +</div> + +<div id="blurb"></div> + +<div id="footer"></div> + +</body> +</html> diff --git a/browser/installer/windows/nsis/content/installing.js b/browser/installer/windows/nsis/content/installing.js new file mode 100644 index 0000000000..869c76c324 --- /dev/null +++ b/browser/installer/windows/nsis/content/installing.js @@ -0,0 +1,58 @@ +// 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(); +}); diff --git a/browser/installer/windows/nsis/content/profile_cleanup.html b/browser/installer/windows/nsis/content/profile_cleanup.html new file mode 100644 index 0000000000..4f20aaecba --- /dev/null +++ b/browser/installer/windows/nsis/content/profile_cleanup.html @@ -0,0 +1,42 @@ +<!doctype html> + +<!-- 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/. --> + +<html> +<head> + +<meta charset="UTF-8"> +<meta http-equiv="X-UA-Compatible" content="IE=8"> + +<link rel="stylesheet" href="stub_common.css"> +<link rel="stylesheet" href="profile_cleanup_page.css"> + +<script src="stub_common.js"></script> +<script src="profile_cleanup.js"></script> + +</head> +<body> + +<img id="background" src="bgstub.jpg" alt="" role="presentation"> + +<form id="profileRefreshForm"> + <div id="profileRefreshContainer"> + <h1 id="header"></h1> + + <div id="refreshCheckboxContainer"> + <input id="refreshCheckbox" type="checkbox" checked /> + <label id="checkboxLabel" for="refreshCheckbox"></label> + </div> + + <div id="refreshButtonContainer"> + <button type="submit" id="refreshButton"></button> + </div> + </div> +</form> + +<div id="footer"></div> + +</body> +</html> diff --git a/browser/installer/windows/nsis/content/profile_cleanup.js b/browser/installer/windows/nsis/content/profile_cleanup.js new file mode 100644 index 0000000000..016b368b05 --- /dev/null +++ b/browser/installer/windows/nsis/content/profile_cleanup.js @@ -0,0 +1,30 @@ +// 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/. + +window.attachEvent("onload", function() { + // Set text direction. + var direction = external.getTextDirection(); + var profileRefreshForm = document.getElementById("profileRefreshForm"); + profileRefreshForm.style.direction = direction; + var checkboxLabel = document.getElementById("checkboxLabel"); + checkboxLabel.className += " checkboxLabel-" + direction; + + // Get this page's static strings. + document.getElementById("header").innerText = external.getUIString( + "cleanup_header" + ); + document.getElementById("refreshButton").innerText = external.getUIString( + "cleanup_button" + ); + checkboxLabel.innerText = external.getUIString("cleanup_checkbox"); + + // Set up the confirmation button. + profileRefreshForm.attachEvent("onsubmit", function() { + var doProfileCleanup = document.getElementById("refreshCheckbox").checked; + external.gotoInstallPage(doProfileCleanup); + return false; + }); + + document.getElementById("refreshButton").focus(); +}); diff --git a/browser/installer/windows/nsis/content/stub_common.css b/browser/installer/windows/nsis/content/stub_common.css new file mode 100644 index 0000000000..a8d15512b5 --- /dev/null +++ b/browser/installer/windows/nsis/content/stub_common.css @@ -0,0 +1,37 @@ +/* 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/. */ + +body { + height: 100%; + width: 100%; + margin: 0; + padding: 0; + overflow: hidden; + + font-family: "Segoe UI", sans-serif; +} + +/* This is an <img> rather than using background-image because IE8 + * does not support background-size. */ +#background { + min-height: 100%; + min-width: 100%; + + width: 100%; + height: auto; + + position: fixed; + top: 0; + left: 0; + + z-index: -1; +} + +body.high-contrast #background { + display: none; +} + +.no-focus-outline { + outline: none; +} diff --git a/browser/installer/windows/nsis/content/stub_common.js b/browser/installer/windows/nsis/content/stub_common.js new file mode 100644 index 0000000000..bcdf809b61 --- /dev/null +++ b/browser/installer/windows/nsis/content/stub_common.js @@ -0,0 +1,23 @@ +// 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/. + +window.attachEvent("onload", function() { + if (parseInt(external.getIsHighContrast())) { + document.body.className += " high-contrast"; + } else { + document.body.className += " normal-contrast"; + } + + document.body.style.fontFamily = external.getFontName() + ", sans-serif"; + + // All pages have the global footer (or don't, depending on the branding). + document.getElementById("footer").innerText = external.getUIString( + "global_footer" + ); + + // Disallow dragging of the "background" image. + document.getElementById("background").attachEvent("ondragstart", function() { + return false; + }); +}); |