From 960c8899dcdce440bb67ee9423734eef037ad3b6 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:25:39 -0600 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9CTroubleshooting=E2=80=9D=20secti?= =?UTF-8?q?on=20&=20CSS=20to=20error-page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the lovely SPCSS theme by Susam Pal (MIT license) is used. https://github.com/susam/spcss --- _locales/en/messages.json | 21 +++++++++++++++++++++ _locales/eo/messages.json | 19 +++++++++++++++++++ html/error.css | 3 +++ html/error.html | 11 ++++++++++- html/error.js | 13 ++++++++++++- 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 html/error.css diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 83b70e7..e92c8b6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -209,5 +209,26 @@ "repairInstallTerminalIntro": { "message": "From a terminal, that would look something like:", "description": "Intro to a terminal-based installation description." + }, + + "troubleshootTitle": { + "message": "Troubleshooting", + "description": "Title of the Troubleshooting-paragraph of the error page." + }, + + "troubleshootDesc": { + "message": "If Shellfox’s script is installed but you still see this page — that is, the above error isn’t “Error: No such native application shellfox” — please report the issue! You can report it on the Shellfox bug-tracker, or by sending an email to xwx@posteo.org. Let’s get that fixed! Please make sure to include your operating system and Firefox version in the report.", + "description": "Contents of the Troubleshooting-paragraph of the error page." + }, + + "errorMessage": { + "message": "Error: “$ERROR$”", + "description": "The text of the header of the error page that displays the error message.", + "placeholders": { + "error": { + "content": "$1", + "example": "No such program." + } + } } } diff --git a/_locales/eo/messages.json b/_locales/eo/messages.json index ddfd52a..25ff21f 100644 --- a/_locales/eo/messages.json +++ b/_locales/eo/messages.json @@ -198,5 +198,24 @@ "repairInstallTerminalIntro": { "message": "Farita sole en terminalo, aspektus jene:" + }, + + "troubleshootTitle": { + "message": "Pluaj eraroj" + }, + + "troubleshootDesc": { + "message": "Se la skripto estas instalita sed vi ankoraŭ renkontas ĉi tiun paĝon — t.e., ke la supra eraro ne estas «Error: No such native application shellfox» — bonvolu raportu la eraron! Raporteblas ĉe la erarraportilo de Ŝelvulpo, aŭ per retletero al xwx@posteo.org. Ni riparu la problemon! Bonvolu ne forgesi noti vian operaciumon kaj Firefox-version en la raporto." + }, + + "errorMessage": { + "message": "Eraro: «$ERROR$»", + "placeholders": { + "error": { + "content": "$1", + "example": "No such program." + } + } } } + diff --git a/html/error.css b/html/error.css new file mode 100644 index 0000000..2349f0b --- /dev/null +++ b/html/error.css @@ -0,0 +1,3 @@ +/* SPCSS theme by Susam Pal, under the MIT license + * https://github.com/susam/spcss */ +body{color:#333;font-family:helvetica,arial,sans-serif;line-height:1.5;margin:0 auto;max-width:40em;padding:0 1em}h1,h2,h3,h4,h5,h6{margin:1.25em 0 .5em;line-height:1.2}a:link{color:#00e}a:visited{color:#518}a:focus,a:hover{color:#03f}a:active{color:#e00}h1 a:empty:before,h2 a:empty:before,h3 a:empty:before,h4 a:empty:before,h5 a:empty:before,h6 a:empty:before{content:"#"}h1 a:empty,h2 a:empty,h3 a:empty,h4 a:empty,h5 a:empty,h6 a:empty{visibility:hidden;padding-left:.25em}h1:hover a:empty,h2:hover a:empty,h3:hover a:empty,h4:hover a:empty,h5:hover a:empty,h6:hover a:empty{visibility:visible}img{max-width:100%}figure{margin:1em 0;text-align:center}figcaption{font-size:small}code,kbd,pre,samp{color:#009;font-family:monospace,monospace}pre kbd{color:#060}blockquote,pre{background:#eee;padding:.5em}pre{overflow:auto}blockquote{border-left:medium solid #ccc;margin:1em 0}blockquote :first-child{margin-top:0}blockquote :last-child{margin-bottom:0}table{border-collapse:collapse}td,th{border:thin solid #999;padding:.3em .4em;text-align:left}@media (prefers-color-scheme:dark){body{background:#111;color:#bbb}a:link{color:#9bf}a:visited{color:#caf}a:focus,a:hover{color:#9cf}a:active{color:#faa}code,kbd,pre,samp{color:#6cf}pre kbd{color:#9c6}blockquote,pre{background:#000}blockquote{border-color:#333}td,th{border-color:#666}} diff --git a/html/error.html b/html/error.html index 4e8da64..0c1300e 100644 --- a/html/error.html +++ b/html/error.html @@ -2,11 +2,17 @@ + + Shellfox error -

Shellfox failed to run command

+ + +

Shellfox failed to run command

+
+

It seems that Shellfox is not fully installed!

@@ -26,6 +32,9 @@ $ curl https://hak.xwx.moe/jadedctrl/shellfox/archive/master.tar.gz | tar -xzv
$ cd shellfox/
$ sudo make native-install
+ +

Troubleshooting

+

If Shellfox’s script is installed but you still see this page — that is, the above error isn’t “Error: No such native application shellfox” — please report the issue! You can report it on the Shellfox bug-tracker, or by sending an email to xwx@posteo.org. Let’s get that fixed! Please make sure to include your operating system and Firefox version in the report.

diff --git a/html/error.js b/html/error.js index 5cb8abc..aea18ce 100644 --- a/html/error.js +++ b/html/error.js @@ -1,9 +1,12 @@ +// 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 = "«" + errorText + "»"; + 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"); @@ -20,4 +23,12 @@ document.getElementById("installStep4").innerHTML = browser.i18n.getMessage("rep 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 repo’s 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"); + +