Bug 615239 - Add 'Get Help' SUMO link to Start Page (followup) [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Fri, 28 Jan 2011 09:41:11 -0500
changeset 67325 2a801e693780914f57b7addb2261fa17b66b641b
parent 67324 0d27e5f5308c5b260cdb1fda2e85c47006a39e82
child 67326 68b5825397ba173e2bacb622fb313d1beb5e616a
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs615239
Bug 615239 - Add 'Get Help' SUMO link to Start Page (followup) [r=vingtetun]
mobile/chrome/content/aboutHome.xhtml
--- a/mobile/chrome/content/aboutHome.xhtml
+++ b/mobile/chrome/content/aboutHome.xhtml
@@ -79,69 +79,54 @@
     <div id="newAddons" class="section-box">
       <h1>&aboutHome.recommendedAddons2;</h1>
       <div id="loadingAddons" class="loading">
         <img src="chrome://browser/skin/images/throbber.png"/>
       </div>
     </div>
 
     <div id="footer-wrapper">
-      <span id="feedback" style="width: &aboutHome.footerWidth;" class="section-row" onclick="openLink(this);" role="button">&aboutHome.giveFeedback;</span><span id="support" style="width: &aboutHome.footerWidth;" class="section-row" onclick="openLink(this);" role="button">&aboutHome.getHelp;</span>
+      <span id="feedback" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.feedbackURL" onclick="openLink(this);" role="button">&aboutHome.giveFeedback;</span><span id="support" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.support.baseURL" onclick="openLink(this);" role="button">&aboutHome.getHelp;</span>
     </div>
   </div>
 
   <!-- l10n hack -->
   <div style="display: none">
     <span id="text-openalltabs">&aboutHome.openAllTabs;</span>
     <span id="text-notabs">&aboutHome.noTabs;</span>
     <span id="text-noaddons">&aboutHome.noAddons;</span>
   </div>
 
   <script type="application/javascript;version=1.8"><![CDATA[
     let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
     let gChromeWin = null;
 
-    let links = [
-      {id: "support", pref: "app.support.baseURL"},
-      {id: "feedback", pref: "app.feedbackURL"}
-    ];
-
-    function setupLinks() {
+    function openLink(aElement) {
       try {
         let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
-        links.forEach(function(link) {
-          let element = document.getElementById(link.id);
-          if (element) {
-            let url = formatter.formatURLPref(link.pref);
-            element.setAttribute("href", url);
-          }
-        });
+        let url = formatter.formatURLPref(aElement.getAttribute("pref"));
+        openTabs([url]);
       } catch (ex) {}
     }
 
-    function openLink(aElement) {
-      openTabs([aElement.getAttribute("href")]);
-    }
-
     function getChromeWin() {
       if (!gChromeWin) {
         gChromeWin = window
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIWebNavigation)
                     .QueryInterface(Ci.nsIDocShellTreeItem)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow)
                     .QueryInterface(Ci.nsIDOMChromeWindow);
       }
       return gChromeWin;
     }
 
     function init() {
-      setupLinks();
       initTabs();
       initAddons();
     }
 
     function uninit() {
       uninitAddons();
     }