mobile/android/chrome/content/about.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/chrome/content/about.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,214 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +
     1.6 +<!DOCTYPE html [
     1.7 +<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
     1.8 +%brandDTD;
     1.9 +<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
    1.10 +%globalDTD;
    1.11 +<!ENTITY % fennecDTD SYSTEM "chrome://browser/locale/about.dtd">
    1.12 +%fennecDTD;
    1.13 +]>
    1.14 +
    1.15 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
    1.16 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
    1.17 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
    1.18 +
    1.19 +<html xmlns="http://www.w3.org/1999/xhtml">
    1.20 +<head>
    1.21 +  <meta name="viewport" content="width=480; initial-scale=.6667; user-scalable=no"/>
    1.22 +  <title>&aboutPage.title;</title>
    1.23 +  <link rel="stylesheet" href="chrome://browser/skin/aboutPage.css" type="text/css"/>
    1.24 +  <link rel="icon" type="image/png" sizes="64x64" href="chrome://branding/content/favicon64.png" />
    1.25 +</head>
    1.26 +
    1.27 +<body dir="&locale.dir;">
    1.28 +  <div id="header">
    1.29 +    <div id="wordmark"></div>
    1.30 +#expand <p id="version">__MOZ_APP_VERSION__</p>
    1.31 +  </div>
    1.32 +
    1.33 +  <div id="banner">
    1.34 +    <div id="logo"/>
    1.35 +#ifdef MOZ_UPDATER
    1.36 +    <div id="updateBox">
    1.37 +      <a id="updateLink" href="" onclick="checkForUpdates();">&aboutPage.checkForUpdates.link;</a>
    1.38 +      <span id="update-message-checking">&aboutPage.checkForUpdates.checking;</span>
    1.39 +      <span id="update-message-none">&aboutPage.checkForUpdates.none;</span>
    1.40 +      <span id="update-message-found" onclick="downloadUpdate()">&aboutPage.checkForUpdates.available2;</span>
    1.41 +      <span id="update-message-downloading">&aboutPage.checkForUpdates.downloading;</span>
    1.42 +      <span id="update-message-downloaded" onclick="installUpdate()">&aboutPage.checkForUpdates.downloaded2;</span>
    1.43 +    </div>
    1.44 +#endif
    1.45 +
    1.46 +    <div id="messages">
    1.47 +      <p id="distributionAbout" hidden="true"/>
    1.48 +      <p id="distributionID" hidden="true"/>
    1.49 +      <p id="telemetry" hidden="true">
    1.50 +        &aboutPage.warningVersion;
    1.51 +#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
    1.52 +        &aboutPage.telemetryStart;<a href="http://www.mozilla.org/">&aboutPage.telemetryMozillaLink;</a>&aboutPage.telemetryEnd;
    1.53 +#endif
    1.54 +      </p>
    1.55 +    </div>
    1.56 +
    1.57 +  </div>
    1.58 +
    1.59 +    <ul id="aboutLinks">
    1.60 +      <div class="top-border"></div>
    1.61 +      <li><a id="faqURL">&aboutPage.faq.label;</a></li>
    1.62 +      <li><a id="supportURL">&aboutPage.support.label;</a></li>
    1.63 +      <li><a id="privacyURL">&aboutPage.privacyPolicy.label;</a></li>
    1.64 +      <li><a href="about:rights">&aboutPage.rights.label;</a></li>
    1.65 +      <li><a id="releaseNotesURL">&aboutPage.relNotes.label;</a></li>
    1.66 +      <li><a id="creditsURL">&aboutPage.credits.label;</a></li>
    1.67 +      <li><a href="about:license">&aboutPage.license.label;</a></li>
    1.68 +      <div class="bottom-border"></div>
    1.69 +    </ul>
    1.70 +
    1.71 +    <div id="aboutDetails">
    1.72 +      <p>&logoTrademark;</p>
    1.73 +    </div>
    1.74 +
    1.75 +    <script type="application/javascript;version=1.8"><![CDATA[
    1.76 +      let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils, Cr = Components.results;
    1.77 +      Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    1.78 +      Cu.import("resource://gre/modules/Services.jsm");
    1.79 +
    1.80 +      // Include the build date and a warning about Telemetry
    1.81 +      // if this is an "a#" (nightly or aurora) build
    1.82 +#expand const version = "__MOZ_APP_VERSION__";
    1.83 +      if (/a\d+$/.test(version)) {
    1.84 +        let buildID = Services.appinfo.appBuildID;
    1.85 +        let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8);
    1.86 +        let br = document.createElement("br");
    1.87 +        let versionPara = document.getElementById("version");
    1.88 +        versionPara.appendChild(br);
    1.89 +        let date = document.createTextNode("(" + buildDate + ")");
    1.90 +        versionPara.appendChild(date);
    1.91 +        document.getElementById("telemetry").hidden = false;
    1.92 +      }
    1.93 +
    1.94 +      // Include the Distribution information if available
    1.95 +      try {
    1.96 +        let distroId = Services.prefs.getCharPref("distribution.id");
    1.97 +        if (distroId) {
    1.98 +          let distroVersion = Services.prefs.getCharPref("distribution.version");
    1.99 +          let distroIdField = document.getElementById("distributionID");
   1.100 +          distroIdField.textContent = distroId + " - " + distroVersion;
   1.101 +          distroIdField.hidden = false;
   1.102 +
   1.103 +          let distroAbout = Services.prefs.getComplexValue("distribution.about", Ci.nsISupportsString);
   1.104 +          let distroField = document.getElementById("distributionAbout");
   1.105 +          distroField.textContent = distroAbout;
   1.106 +          distroField.hidden = false;
   1.107 +        }
   1.108 +      } catch (e) {
   1.109 +        // Pref is unset
   1.110 +      }
   1.111 +
   1.112 +      // get URLs from prefs
   1.113 +      try {
   1.114 +        let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
   1.115 +
   1.116 +        let links = [
   1.117 +          {id: "releaseNotesURL", pref: "app.releaseNotesURL"},
   1.118 +          {id: "supportURL",      pref: "app.support.baseURL"},
   1.119 +          {id: "faqURL",          pref: "app.faqURL"},
   1.120 +          {id: "privacyURL",      pref: "app.privacyURL"},
   1.121 +          {id: "creditsURL",      pref: "app.creditsURL"},
   1.122 +        ];
   1.123 +
   1.124 +        links.forEach(function (link) {
   1.125 +          let url = formatter.formatURLPref(link.pref);
   1.126 +          let element = document.getElementById(link.id);
   1.127 +          element.setAttribute("href", url);
   1.128 +        });
   1.129 +      } catch (ex) {}
   1.130 +
   1.131 +#ifdef MOZ_UPDATER
   1.132 +      let Updater = {
   1.133 +        update: null,
   1.134 +
   1.135 +        init: function() {
   1.136 +          Services.obs.addObserver(this, "Update:CheckResult", false);
   1.137 +        },
   1.138 +
   1.139 +        observe: function(aSubject, aTopic, aData) {
   1.140 +          if (aTopic == "Update:CheckResult") {
   1.141 +            showUpdateMessage(aData);
   1.142 +          }
   1.143 +        },
   1.144 +      };
   1.145 +
   1.146 +      Updater.init();
   1.147 +
   1.148 +      function checkForUpdates() {
   1.149 +        showCheckingMessage();
   1.150 +
   1.151 +        Services.androidBridge.handleGeckoMessage({ type: "Update:Check" });
   1.152 +      }
   1.153 +
   1.154 +      function downloadUpdate() {
   1.155 +        Services.androidBridge.handleGeckoMessage({ type: "Update:Download" });
   1.156 +      }
   1.157 +
   1.158 +      function installUpdate() {
   1.159 +        showCheckAction();
   1.160 +
   1.161 +        Services.androidBridge.handleGeckoMessage({ type: "Update:Install" });
   1.162 +      }
   1.163 +
   1.164 +      let updateLink = document.getElementById("updateLink");
   1.165 +      let checkingSpan = document.getElementById("update-message-checking");
   1.166 +      let noneSpan = document.getElementById("update-message-none");
   1.167 +      let foundSpan = document.getElementById("update-message-found");
   1.168 +      let downloadingSpan = document.getElementById("update-message-downloading");
   1.169 +      let downloadedSpan = document.getElementById("update-message-downloaded");
   1.170 +
   1.171 +      function showCheckAction() {
   1.172 +        checkingSpan.style.display = "none";
   1.173 +        noneSpan.style.display = "none";
   1.174 +        foundSpan.style.display = "none";
   1.175 +        downloadingSpan.style.display = "none";
   1.176 +        downloadedSpan.style.display = "none";
   1.177 +        updateLink.style.display = "block";
   1.178 +      }
   1.179 +
   1.180 +      function showCheckingMessage() {
   1.181 +        updateLink.style.display = "none";
   1.182 +        noneSpan.style.display = "none";
   1.183 +        foundSpan.style.display = "none";
   1.184 +        downloadingSpan.style.display = "none";
   1.185 +        downloadedSpan.style.display = "none";
   1.186 +        checkingSpan.style.display = "block";
   1.187 +      }
   1.188 +
   1.189 +      function showUpdateMessage(aResult) {
   1.190 +        updateLink.style.display = "none";
   1.191 +        checkingSpan.style.display = "none";
   1.192 +        noneSpan.style.display = "none";
   1.193 +        foundSpan.style.display = "none";
   1.194 +        downloadingSpan.style.display = "none";
   1.195 +        downloadedSpan.style.display = "none";
   1.196 +
   1.197 +        // the aResult values come from mobile/android/base/UpdateServiceHelper.java
   1.198 +        switch (aResult) {
   1.199 +        case "NOT_AVAILABLE":
   1.200 +          noneSpan.style.display = "block";
   1.201 +          setTimeout(showCheckAction, 2000);
   1.202 +          break;
   1.203 +        case "AVAILABLE":
   1.204 +          foundSpan.style.display = "block";
   1.205 +          break;
   1.206 +        case "DOWNLOADING":
   1.207 +          downloadingSpan.style.display = "block";
   1.208 +          break;
   1.209 +        case "DOWNLOADED":
   1.210 +          downloadedSpan.style.display = "block";
   1.211 +          break;
   1.212 +        }
   1.213 +      }
   1.214 +#endif
   1.215 +    ]]></script>
   1.216 +</body>
   1.217 +</html>

mercurial