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 // get release notes and vendor URL from prefs
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"] var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter); .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") { if (releaseNotesURL != "about:blank") {
var relnotes = document.getElementById("releaseNotesURL"); var relnotes = document.getElementById("releaseNotesURL");
relnotes.setAttribute("href", releaseNotesURL); relnotes.setAttribute("href", releaseNotesURL);
relnotes.parentNode.removeAttribute("hidden"); 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") { if (vendorURL != "about:blank") {
var vendor = document.getElementById("vendorURL"); var vendor = document.getElementById("vendorURL");
vendor.setAttribute("href", vendorURL); vendor.setAttribute("href", vendorURL);
@ -25,8 +35,15 @@ var versionNum = Components.classes["@mozilla.org/xre/app-info;1"]
var version = document.getElementById("version"); var version = document.getElementById("version");
version.textContent += " " + versionNum; 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 // append user agent
var ua = navigator.userAgent; var ua = navigator.userAgent;
if (ua) { if (ua) {
document.getElementById("buildID").textContent += " " + ua; document.getElementById("userAgent").textContent += " " + ua;
} }

View file

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

View file

@ -1,13 +1,13 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 - 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/. --> - 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. --> <!-- 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.beforeLink "See a list of ">
<!ENTITY about.credits.linkTitle "contributors"> <!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. --> <!-- 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. --> <!-- 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 "> <!ENTITY about.license.beforeTheLink "Read the ">
@ -28,3 +28,4 @@
<!ENTITY about.buildconfig.afterTheLink " used for this version."> <!ENTITY about.buildconfig.afterTheLink " used for this version.">
<!ENTITY about.buildIdentifier "Build identifier: "> <!ENTITY about.buildIdentifier "Build identifier: ">
<!ENTITY about.userAgent "User-agent:">

View file

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