diff --git a/mobile/android/chrome/content/aboutFeedback.js b/mobile/android/chrome/content/aboutFeedback.js index d95763467804..4f48dcbe6faa 100644 --- a/mobile/android/chrome/content/aboutFeedback.js +++ b/mobile/android/chrome/content/aboutFeedback.js @@ -10,6 +10,15 @@ const FEEDBACK_PRODUCT_STRING = "Firefox for Android"; let Cc = Components.classes; let Ci = Components.interfaces; let Cu = Components.utils; +const HEARTY_ICON_MDPI = "chrome://browser/skin/images/icon_heart_mdpi.png"; +const HEARTY_ICON_HDPI = "chrome://browser/skin/images/icon_heart_hdpi.png"; +const HEARTY_ICON_XHDPI = "chrome://browser/skin/images/icon_heart_xhdpi.png"; +const HEARTY_ICON_XXHDPI = "chrome://browser/skin/images/icon_heart_xxhdpi.png"; + +const FLOATY_ICON_MDPI = "chrome://browser/skin/images/icon_floaty_mdpi.png"; +const FLOATY_ICON_HDPI = "chrome://browser/skin/images/icon_floaty_hdpi.png"; +const FLOATY_ICON_XHDPI = "chrome://browser/skin/images/icon_floaty_xhdpi.png"; +const FLOATY_ICON_XXHDPI = "chrome://browser/skin/images/icon_floaty_xxhdpi.png"; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Messaging.jsm"); @@ -32,6 +41,23 @@ function init() { switchSection("sad"); }, false); + let helpSectionIcon = FLOATY_ICON_XXHDPI; + let sadThanksIcon = HEARTY_ICON_XXHDPI; + + if (window.devicePixelRatio <= 1) { + helpSectionIcon = FLOATY_ICON_MDPI; + sadThanksIcon = HEARTY_ICON_MDPI; + } else if (window.devicePixelRatio <= 1.5) { + helpSectionIcon = FLOATY_ICON_HDPI; + sadThanksIcon = HEARTY_ICON_HDPI; + } else if (window.devicePixelRatio <= 2) { + helpSectionIcon = FLOATY_ICON_XHDPI; + sadThanksIcon = HEARTY_ICON_XHDPI; + } + + document.getElementById("sumo-icon").src = helpSectionIcon; + document.getElementById("sad-thanks-icon").src = sadThanksIcon; + window.addEventListener("unload", uninit, false); document.getElementById("open-play-store").addEventListener("click", openPlayStore, false); @@ -49,7 +75,11 @@ function init() { // Fill "Last visited site" input with most recent history entry URL. Services.obs.addObserver(function observer(aSubject, aTopic, aData) { - document.getElementById("last-url").value = aData; + document.getElementById("last-url").value = aData; + // Enable the parent div iff the URL is valid. + if (aData.length != 0) { + document.getElementById("last-url-div").style.display="block"; + } }, "Feedback:LastUrl", false); Messaging.sendRequest({ type: "Feedback:LastUrl" }); @@ -96,24 +126,15 @@ function sendFeedback(aEvent) { let sectionElement = document.getElementById(section); let descriptionElement = sectionElement.querySelector(".description"); - // Bail if the description value isn't valid. HTML5 form validation will take care - // of showing an error message for us. - if (!descriptionElement.validity.valid) - return; - let data = {}; data["happy"] = false; data["description"] = descriptionElement.value; data["product"] = FEEDBACK_PRODUCT_STRING; + let urlCheckBox = document.getElementById("last-checkbox"); let urlElement = document.getElementById("last-url"); - // Bail if the URL value isn't valid. HTML5 form validation will take care - // of showing an error message for us. - if (!urlElement.validity.valid) - return; - // Only send a URL string if the user provided one. - if (urlElement.value) { + if (urlCheckBox.checked) { data["url"] = urlElement.value; } diff --git a/mobile/android/chrome/content/aboutFeedback.xhtml b/mobile/android/chrome/content/aboutFeedback.xhtml index afe5159b6ea2..c7c0984cc03d 100644 --- a/mobile/android/chrome/content/aboutFeedback.xhtml +++ b/mobile/android/chrome/content/aboutFeedback.xhtml @@ -43,7 +43,7 @@