mobile/android/chrome/content/about.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <?xml version="1.0" encoding="UTF-8"?>
     3 <!DOCTYPE html [
     4 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
     5 %brandDTD;
     6 <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
     7 %globalDTD;
     8 <!ENTITY % fennecDTD SYSTEM "chrome://browser/locale/about.dtd">
     9 %fennecDTD;
    10 ]>
    12 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    13    - License, v. 2.0. If a copy of the MPL was not distributed with this
    14    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
    16 <html xmlns="http://www.w3.org/1999/xhtml">
    17 <head>
    18   <meta name="viewport" content="width=480; initial-scale=.6667; user-scalable=no"/>
    19   <title>&aboutPage.title;</title>
    20   <link rel="stylesheet" href="chrome://browser/skin/aboutPage.css" type="text/css"/>
    21   <link rel="icon" type="image/png" sizes="64x64" href="chrome://branding/content/favicon64.png" />
    22 </head>
    24 <body dir="&locale.dir;">
    25   <div id="header">
    26     <div id="wordmark"></div>
    27 #expand <p id="version">__MOZ_APP_VERSION__</p>
    28   </div>
    30   <div id="banner">
    31     <div id="logo"/>
    32 #ifdef MOZ_UPDATER
    33     <div id="updateBox">
    34       <a id="updateLink" href="" onclick="checkForUpdates();">&aboutPage.checkForUpdates.link;</a>
    35       <span id="update-message-checking">&aboutPage.checkForUpdates.checking;</span>
    36       <span id="update-message-none">&aboutPage.checkForUpdates.none;</span>
    37       <span id="update-message-found" onclick="downloadUpdate()">&aboutPage.checkForUpdates.available2;</span>
    38       <span id="update-message-downloading">&aboutPage.checkForUpdates.downloading;</span>
    39       <span id="update-message-downloaded" onclick="installUpdate()">&aboutPage.checkForUpdates.downloaded2;</span>
    40     </div>
    41 #endif
    43     <div id="messages">
    44       <p id="distributionAbout" hidden="true"/>
    45       <p id="distributionID" hidden="true"/>
    46       <p id="telemetry" hidden="true">
    47         &aboutPage.warningVersion;
    48 #ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
    49         &aboutPage.telemetryStart;<a href="http://www.mozilla.org/">&aboutPage.telemetryMozillaLink;</a>&aboutPage.telemetryEnd;
    50 #endif
    51       </p>
    52     </div>
    54   </div>
    56     <ul id="aboutLinks">
    57       <div class="top-border"></div>
    58       <li><a id="faqURL">&aboutPage.faq.label;</a></li>
    59       <li><a id="supportURL">&aboutPage.support.label;</a></li>
    60       <li><a id="privacyURL">&aboutPage.privacyPolicy.label;</a></li>
    61       <li><a href="about:rights">&aboutPage.rights.label;</a></li>
    62       <li><a id="releaseNotesURL">&aboutPage.relNotes.label;</a></li>
    63       <li><a id="creditsURL">&aboutPage.credits.label;</a></li>
    64       <li><a href="about:license">&aboutPage.license.label;</a></li>
    65       <div class="bottom-border"></div>
    66     </ul>
    68     <div id="aboutDetails">
    69       <p>&logoTrademark;</p>
    70     </div>
    72     <script type="application/javascript;version=1.8"><![CDATA[
    73       let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils, Cr = Components.results;
    74       Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    75       Cu.import("resource://gre/modules/Services.jsm");
    77       // Include the build date and a warning about Telemetry
    78       // if this is an "a#" (nightly or aurora) build
    79 #expand const version = "__MOZ_APP_VERSION__";
    80       if (/a\d+$/.test(version)) {
    81         let buildID = Services.appinfo.appBuildID;
    82         let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8);
    83         let br = document.createElement("br");
    84         let versionPara = document.getElementById("version");
    85         versionPara.appendChild(br);
    86         let date = document.createTextNode("(" + buildDate + ")");
    87         versionPara.appendChild(date);
    88         document.getElementById("telemetry").hidden = false;
    89       }
    91       // Include the Distribution information if available
    92       try {
    93         let distroId = Services.prefs.getCharPref("distribution.id");
    94         if (distroId) {
    95           let distroVersion = Services.prefs.getCharPref("distribution.version");
    96           let distroIdField = document.getElementById("distributionID");
    97           distroIdField.textContent = distroId + " - " + distroVersion;
    98           distroIdField.hidden = false;
   100           let distroAbout = Services.prefs.getComplexValue("distribution.about", Ci.nsISupportsString);
   101           let distroField = document.getElementById("distributionAbout");
   102           distroField.textContent = distroAbout;
   103           distroField.hidden = false;
   104         }
   105       } catch (e) {
   106         // Pref is unset
   107       }
   109       // get URLs from prefs
   110       try {
   111         let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
   113         let links = [
   114           {id: "releaseNotesURL", pref: "app.releaseNotesURL"},
   115           {id: "supportURL",      pref: "app.support.baseURL"},
   116           {id: "faqURL",          pref: "app.faqURL"},
   117           {id: "privacyURL",      pref: "app.privacyURL"},
   118           {id: "creditsURL",      pref: "app.creditsURL"},
   119         ];
   121         links.forEach(function (link) {
   122           let url = formatter.formatURLPref(link.pref);
   123           let element = document.getElementById(link.id);
   124           element.setAttribute("href", url);
   125         });
   126       } catch (ex) {}
   128 #ifdef MOZ_UPDATER
   129       let Updater = {
   130         update: null,
   132         init: function() {
   133           Services.obs.addObserver(this, "Update:CheckResult", false);
   134         },
   136         observe: function(aSubject, aTopic, aData) {
   137           if (aTopic == "Update:CheckResult") {
   138             showUpdateMessage(aData);
   139           }
   140         },
   141       };
   143       Updater.init();
   145       function checkForUpdates() {
   146         showCheckingMessage();
   148         Services.androidBridge.handleGeckoMessage({ type: "Update:Check" });
   149       }
   151       function downloadUpdate() {
   152         Services.androidBridge.handleGeckoMessage({ type: "Update:Download" });
   153       }
   155       function installUpdate() {
   156         showCheckAction();
   158         Services.androidBridge.handleGeckoMessage({ type: "Update:Install" });
   159       }
   161       let updateLink = document.getElementById("updateLink");
   162       let checkingSpan = document.getElementById("update-message-checking");
   163       let noneSpan = document.getElementById("update-message-none");
   164       let foundSpan = document.getElementById("update-message-found");
   165       let downloadingSpan = document.getElementById("update-message-downloading");
   166       let downloadedSpan = document.getElementById("update-message-downloaded");
   168       function showCheckAction() {
   169         checkingSpan.style.display = "none";
   170         noneSpan.style.display = "none";
   171         foundSpan.style.display = "none";
   172         downloadingSpan.style.display = "none";
   173         downloadedSpan.style.display = "none";
   174         updateLink.style.display = "block";
   175       }
   177       function showCheckingMessage() {
   178         updateLink.style.display = "none";
   179         noneSpan.style.display = "none";
   180         foundSpan.style.display = "none";
   181         downloadingSpan.style.display = "none";
   182         downloadedSpan.style.display = "none";
   183         checkingSpan.style.display = "block";
   184       }
   186       function showUpdateMessage(aResult) {
   187         updateLink.style.display = "none";
   188         checkingSpan.style.display = "none";
   189         noneSpan.style.display = "none";
   190         foundSpan.style.display = "none";
   191         downloadingSpan.style.display = "none";
   192         downloadedSpan.style.display = "none";
   194         // the aResult values come from mobile/android/base/UpdateServiceHelper.java
   195         switch (aResult) {
   196         case "NOT_AVAILABLE":
   197           noneSpan.style.display = "block";
   198           setTimeout(showCheckAction, 2000);
   199           break;
   200         case "AVAILABLE":
   201           foundSpan.style.display = "block";
   202           break;
   203         case "DOWNLOADING":
   204           downloadingSpan.style.display = "block";
   205           break;
   206         case "DOWNLOADED":
   207           downloadedSpan.style.display = "block";
   208           break;
   209         }
   210       }
   211 #endif
   212     ]]></script>
   213 </body>
   214 </html>

mercurial