shellfox/html/error.js
Jaidyn Ann 960c8899dc Add “Troubleshooting” section & CSS to error-page
Now the lovely SPCSS theme by Susam Pal
(MIT license) is used.
https://github.com/susam/spcss
2024-03-04 22:25:39 -06:00

35 lines
2.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Most importantly: Write the passed GET error (if any) to the error-header.
let urlParams = location.toString().split("?error=");
if (urlParams && urlParams.length > 0) {
let errorText = unescape(urlParams[urlParams.length - 1]);
document.getElementById("error").innerText = browser.i18n.getMessage("errorMessage", errorText);
}
// Write locale-specific translations to the page.
document.getElementsByTagName("html")[0].setAttribute("lang", browser.i18n.getMessage("@@ui_locale"));
document.getElementById("errorPageTitle").innerText = browser.i18n.getMessage("errorPageTitle");
document.getElementById("errorTitle").innerText = browser.i18n.getMessage("errorTitle");
document.getElementById("notInstalled").innerText = browser.i18n.getMessage("errorNotInstalled");
document.getElementById("notInstalledDesc").innerHTML = browser.i18n.getMessage("errorNotInstalledDesc");
document.getElementById("installTitle").innerText = browser.i18n.getMessage("repairInstallTitle");
document.getElementById("installIntro").innerText = browser.i18n.getMessage("repairInstallIntro");
document.getElementById("installStep1").innerHTML = browser.i18n.getMessage("repairInstallStep1");
document.getElementById("installStep2").innerHTML = browser.i18n.getMessage("repairInstallStep2");
document.getElementById("installStep3").innerHTML = browser.i18n.getMessage("repairInstallStep3");
document.getElementById("installStep4").innerHTML = browser.i18n.getMessage("repairInstallStep4");
document.getElementById("installStep5").innerText = browser.i18n.getMessage("repairInstallStep5");
document.getElementById("installTerminalIntro").innerText = browser.i18n.getMessage("repairInstallTerminalIntro");
document.getElementById("troubleshootTitle").innerText = browser.i18n.getMessage("troubleshootTitle");
document.getElementById("troubleshootDesc").innerHTML = browser.i18n.getMessage("troubleshootDesc");
// Now, write our repos URLs to the links.
document.getElementById("zip_link").setAttribute("href", "https://hak.xwx.moe/jadedctrl/shellfox/archive/master.zip");
document.getElementById("tracker_link").setAttribute("href", "https://hak.xwx.moe/jadedctrl/shellfox/issues");