moebius#173: Fix up "about:" page

https://github.com/MoonchildProductions/moebius/issues/173
This commit is contained in:
janekptacijarabaci 2018-04-13 20:55:39 +02:00 committed by Roy Tam
commit 5371575837
4 changed files with 26 additions and 13 deletions

View file

@ -5,14 +5,24 @@
// get release notes and vendor URL from prefs
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var releaseNotesURL = formatter.formatURLPref("app.releaseNotesURL");
var releaseNotesURL;
try {
releaseNotesURL = formatter.formatURLPref("app.releaseNotesURL");
} catch(e) {
releaseNotesURL = "about:blank";
}
if (releaseNotesURL != "about:blank") {
var relnotes = document.getElementById("releaseNotesURL");
relnotes.setAttribute("href", releaseNotesURL);
relnotes.parentNode.removeAttribute("hidden");
}
var vendorURL = formatter.formatURLPref("app.vendorURL");
var vendorURL;
try {
vendorURL = formatter.formatURLPref("app.vendorURL");
} catch(e) {
vendorURL = "about:blank";
}
if (vendorURL != "about:blank") {
var vendor = document.getElementById("vendorURL");
vendor.setAttribute("href", vendorURL);
@ -25,8 +35,15 @@ var versionNum = Components.classes["@mozilla.org/xre/app-info;1"]
var version = document.getElementById("version");
version.textContent += " " + versionNum;
// insert the buildid of the XUL application
var BuildIDVal = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo)
.appBuildID;
var buildID = document.getElementById("buildID");
buildID.textContent += " " + BuildIDVal.slice(0,-6);
// append user agent
var ua = navigator.userAgent;
if (ua) {
document.getElementById("buildID").textContent += " " + ua;
document.getElementById("userAgent").textContent += " " + ua;
}

View file

@ -24,7 +24,6 @@
<div id="aboutLogoContainer">
<a id="vendorURL">
<img src="about:logo" alt="&brandShortName;"/>
<p id="version">&about.version;</p>
</a>
</div>
@ -33,7 +32,9 @@
<li>&about.license.beforeTheLink;<a href="about:license">&about.license.linkTitle;</a>&about.license.afterTheLink;</li>
<li hidden="true">&about.relnotes.beforeTheLink;<a id="releaseNotesURL">&about.relnotes.linkTitle;</a>&about.relnotes.afterTheLink;</li>
<li>&about.buildconfig.beforeTheLink;<a href="about:buildconfig">&about.buildconfig.linkTitle;</a>&about.buildconfig.afterTheLink;</li>
<li id="version">&about.version;</li>
<li id="buildID">&about.buildIdentifier;</li>
<li id="userAgent">&about.userAgent;</li>
<script type="application/javascript" src="chrome://global/content/about.js"/>
</ul>

View file

@ -1,13 +1,13 @@
<!-- 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/. -->
<!ENTITY about.version "version">
<!ENTITY about.version "Version">
<!-- LOCALIZATION NOTE (about.credits.beforeLink): note that there is no space between this phrase and the linked about.credits.linkTitle phrase, so if your locale needs a space between words, add it at the end of this entity. -->
<!ENTITY about.credits.beforeLink "See a list of ">
<!ENTITY about.credits.linkTitle "contributors">
<!-- LOCALIZATION NOTE (about.credits.afterLink): note that there is no space between the linked about.credits.linkTitle phrase and this phrase, so if your locale needs a space between words, add it at the start of this entity. -->
<!ENTITY about.credits.afterLink " to the Mozilla Project.">
<!ENTITY about.credits.afterLink " to the project.">
<!-- LOCALIZATION NOTE (about.license.beforeTheLink): note that there is no space between this phrase and the linked about.license.linkTitle phrase, so if your locale needs a space between words, add it at the end of this entity. -->
<!ENTITY about.license.beforeTheLink "Read the ">
@ -28,3 +28,4 @@
<!ENTITY about.buildconfig.afterTheLink " used for this version.">
<!ENTITY about.buildIdentifier "Build identifier: ">
<!ENTITY about.userAgent "User-agent:">

View file

@ -26,8 +26,8 @@ body {
}
#aboutLogoContainer {
border: 1px solid ThreeDLightShadow;
width: 300px;
margin: 0 auto;
margin-bottom: 2em;
}
@ -35,12 +35,6 @@ img {
border: 0;
}
#version {
font-weight: bold;
color: #909090;
margin: -24px 0 9px 17px;
}
ul {
margin: 0;
margin-inline-start: 1.5em;