Bug 615239 - Add 'Get Help' SUMO link to Start Page [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Fri, 28 Jan 2011 08:48:17 -0500
changeset 67323 0d0244cdb0843498bc5918b0c44bb5969413768f
parent 67322 53781acb5bdbc95987312adc09c62973db0bddbd
child 67324 0d27e5f5308c5b260cdb1fda2e85c47006a39e82
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 [r=vingtetun]
mobile/app/mobile.js
mobile/chrome/content/aboutHome.xhtml
mobile/locales/en-US/chrome/aboutHome.dtd
mobile/themes/core/aboutHome.css
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -422,16 +422,17 @@ pref("plugin.disable", true);
 pref("dom.ipc.plugins.enabled", true);
 
 // product URLs
 // The breakpad report server to link to in about:crashes
 pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/");
 pref("app.releaseNotesURL", "http://www.mozilla.com/%LOCALE%/mobile/%VERSION%/releasenotes/");
 pref("app.sync.tutorialURL", "https://www.mozilla.com/%LOCALE%/mobile/sync/");
 pref("app.support.baseURL", "http://mobile.support.mozilla.com/");
+pref("app.feedbackURL", "http://input.mozilla.com/feedback/");
 pref("app.privacyURL", "https://www.mozilla.com/%LOCALE%/legal/privacy/firefox/mobile/");
 pref("app.creditsURL", "http://www.mozilla.com/%LOCALE%/mobile/credits/");
 #if MOZ_UPDATE_CHANNEL == beta
 pref("app.featuresURL", "http://www.mozilla.com/%LOCALE%/mobile/beta/features/");
 pref("app.faqURL", "http://www.mozilla.com/%LOCALE%/mobile/beta/faq/");
 #else
 pref("app.featuresURL", "http://www.mozilla.com/%LOCALE%/mobile/features/");
 pref("app.faqURL", "http://www.mozilla.com/%LOCALE%/mobile/faq/");
--- a/mobile/chrome/content/aboutHome.xhtml
+++ b/mobile/chrome/content/aboutHome.xhtml
@@ -78,47 +78,70 @@
 
     <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="about">
-      <img src="chrome://browser/skin/images/mozilla-32.png"/> <a href="http://www.firefox.com/m/feedback/">&aboutHome.giveFeedback;</a>
+    <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>
     </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() {
+      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);
+          }
+        });
+      } 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();
     }
 
--- a/mobile/locales/en-US/chrome/aboutHome.dtd
+++ b/mobile/locales/en-US/chrome/aboutHome.dtd
@@ -1,8 +1,10 @@
 <!ENTITY aboutHome.header                       "<span>&brandShortName; </span><span id='header-suffix'>Start</span>">
 <!ENTITY aboutHome.recentTabs                   "Your tabs from last time">
 <!ENTITY aboutHome.remoteTabs                   "Tabs from your other computers">
 <!ENTITY aboutHome.recommendedAddons2           "Add-ons for your &brandShortName;">
 <!ENTITY aboutHome.giveFeedback                 "Give Feedback">
+<!ENTITY aboutHome.getHelp                      "Get Help">
+<!ENTITY aboutHome.footerWidth                  "10em">
 <!ENTITY aboutHome.openAllTabs                  "Open all in tabs">
 <!ENTITY aboutHome.noTabs                       "No tabs from last time">
 <!ENTITY aboutHome.noAddons                     "No recommended add-ons">
--- a/mobile/themes/core/aboutHome.css
+++ b/mobile/themes/core/aboutHome.css
@@ -52,50 +52,50 @@ html {
   margin-top: -24px;
   margin-right: -34px;
 }
 
 #header {
   font-weight: bold;
   color: white;
   background: transparent -moz-linear-gradient(top, rgba(57,89,117,1) 0%, rgba(30,66,98,1) 50%, rgba(24,54,82,1) 90%);
-  -moz-border-radius: 6px;
+  border-radius: 6px;
   padding: 12px;
   padding-bottom: 14px;
   margin-bottom: 12px;
   margin-top: 20px;
-  -moz-box-shadow: inset rgba(0, 0, 0, 0.2) 0 -3px 0px, rgba(0, 0, 0, 0.1) 0px 2px 0px;
+  box-shadow: inset rgba(0, 0, 0, 0.2) 0 -3px 0px, rgba(0, 0, 0, 0.1) 0px 2px 0px;
 }
 
 #header-suffix {
   color: rgb(112,136,156);
 }
 
 .section-box {
   background-color: white;
   padding: 0;
   margin-bottom: 8px;
-  -moz-border-radius: 8px;
+  border-radius: 8px;
   border: 1px solid rgba(0,0,0,0.3);
-  -moz-box-shadow: 
+  box-shadow: 
     inset rgba(255, 255, 255, 0.5) 0 1px 0px,
     inset rgba(0, 0, 0, 0.1) 0 -3px 0px,
     rgba(0, 0, 0, 0.1) 0px 2px 0px;
   width: 100%;
   overflow: hidden;
 }
 
 .section-box > h1 {
   font-size: 18px;
   font-weight: normal;
   color: black;
   background: transparent -moz-linear-gradient(top, rgba(235,235,235,0.2) 0%, rgba(235,235,235,1) 90%);
   margin: 0;
   padding: 4px 12px 8px 12px;
-  -moz-border-radius: 8px 8px 0 0;
+  border-radius: 8px 8px 0 0;
 }
 
 .section-box > div {
   border-bottom: 1px solid rgba(0,0,0,0.1);
   padding: 8px;
   padding-bottom: 12px;
   position: relative;
 }
@@ -168,19 +168,19 @@ body[dir="rtl"] #newAddons > div:not(.lo
   opacity: 0.5;
 }
 
 .section-row {
   color: black;
   background: transparent -moz-linear-gradient(top, rgba(235,235,235,0.2) 0%, rgba(235,235,235,1) 90%);
   padding: 8px;
   padding-bottom: 12px;
-  -moz-border-radius: 8px;
+  border-radius: 8px;
   border: 1px solid rgba(0,0,0,0.3);
-  -moz-box-shadow: 
+  box-shadow: 
     inset rgba(255, 255, 255, 0.5) 0 1px 0px,
     inset rgba(0, 0, 0, 0.1) 0 -3px 0px,
     rgba(0, 0, 0, 0.1) 0px 2px 0px;
   margin: 24px auto;
 }
 
 .section-row > div {
   position: relative;
@@ -207,18 +207,28 @@ body[dir="rtl"] {
   display: block;
   margin: 0 auto;
 }
 
 .no-items {
   text-align: center;
 }
 
-#about {
+#footer-wrapper {
   font-size: 18px;
+  margin-top: 24px;
   text-align: center;
-  margin-top: 24px;
 }
 
-#about > img {
-  vertical-align: middle;
-  margin: 4px;
+#feedback {
+  display: inline-block;
+  padding: 8px;
+  margin: 0;
+  border-radius: 8px 0 0 8px;
 }
+
+#support {
+  display: inline-block;
+  padding: 8px;
+  margin: 0;
+  border-left: none;
+  border-radius: 0 8px 8px 0;
+}