Bug 995436 - Use different sponsored panel text for Release and non-Release [r=adw]

Package both text and hide the one that shouldn't be shown.
This commit is contained in:
Maxim Zhilyaev 2014-04-26 13:39:58 -07:00
Родитель 9bce236b0b
Коммит 34d736b7ba
4 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -19,6 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "Rect",
"resource://gre/modules/Geometry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
"resource://gre/modules/UpdateChannel.jsm");
let {
links: gLinks,

Просмотреть файл

@ -20,7 +20,8 @@
title="&newtab.pageTitle;">
<xul:panel id="sponsored-panel" orient="vertical" type="arrow">
<xul:description>&newtab.panel.message;</xul:description>
<xul:description id="sponsored-panel-release-descr">&newtab.sponsored.release.message;</xul:description>
<xul:description id="sponsored-panel-trial-descr">&newtab.sponsored.trial.message;</xul:description>
<xul:label class="text-link"
href="https://support.mozilla.org/kb/how-do-sponsored-tiles-work"
value="&newtab.panel.link.text;" />

Просмотреть файл

@ -28,6 +28,12 @@ let gPage = {
this._sponsoredPanel = document.getElementById("sponsored-panel");
let link = this._sponsoredPanel.querySelector(".text-link");
link.addEventListener("click", () => this._sponsoredPanel.hidePopup());
if (UpdateChannel.get().startsWith("release")) {
document.getElementById("sponsored-panel-trial-descr").style.display = "none";
}
else {
document.getElementById("sponsored-panel-release-descr").style.display = "none";
}
// Check if the new tab feature is enabled.
let enabled = gAllPages.enabled;

Просмотреть файл

@ -8,5 +8,6 @@
<!ENTITY newtab.undo.undoButton "Undo.">
<!ENTITY newtab.undo.restoreButton "Restore All.">
<!ENTITY newtab.undo.closeTooltip "Hide">
<!ENTITY newtab.panel.message "This site is being suggested because it has sponsored Mozilla, helping us promote openness, innovation and opportunity on the Web.">
<!ENTITY newtab.sponsored.release.message "This Sponsor site was suggested because we hoped youd find it interesting and because it supports Mozillas mission.">
<!ENTITY newtab.sponsored.trial.message "This Trial Sponsor site was suggested because we hoped youd find it interesting and because it supports Mozillas mission.">
<!ENTITY newtab.panel.link.text "Learn more…">