Bug 1099462 - Set the Getting Started URL for Loop. r=MattN

This commit is contained in:
Jared Wein 2014-11-21 15:54:38 -05:00
parent 29e6dcb577
commit 693fac26ff
4 changed files with 10 additions and 7 deletions

View File

@ -1645,7 +1645,7 @@ pref("loop.enabled", true);
pref("loop.server", "https://loop.services.mozilla.com/v0");
pref("loop.seenToS", "unseen");
pref("loop.gettingStarted.seen", false);
pref("loop.gettingStarted.url", "https://bugzilla.mozilla.org/show_bug.cgi?id=1099462");
pref("loop.gettingStarted.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/hello/start");
pref("loop.learnMoreUrl", "https://www.firefox.com/hello/");
pref("loop.legal.ToS_url", "https://hello.firefox.com/legal/terms/");
pref("loop.legal.privacy_url", "https://www.mozilla.org/privacy/");

View File

@ -1421,9 +1421,12 @@ this.MozLoopService = {
*/
openGettingStartedTour: Task.async(function(aSrc = null) {
try {
let url = new URL(Services.prefs.getCharPref("loop.gettingStarted.url"));
let urlStr = Services.prefs.getCharPref("loop.gettingStarted.url");
let url = new URL(Services.urlFormatter.formatURL(urlStr));
if (aSrc) {
url.searchParams.set("source", aSrc);
url.searchParams.set("utm_source", "firefox-browser");
url.searchParams.set("utm_medium", "firefox-browser");
url.searchParams.set("utm_campaign", aSrc);
}
let win = Services.wm.getMostRecentWindow("navigator:browser");
win.switchToTabHavingURI(url, true, {replaceQueryString: true});

View File

@ -166,7 +166,7 @@ loop.panel = (function(_, mozL10n) {
var GettingStartedView = React.createClass({displayName: 'GettingStartedView',
handleButtonClick: function() {
navigator.mozLoop.openGettingStartedTour();
navigator.mozLoop.openGettingStartedTour("getting-started");
navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
var event = new CustomEvent("GettingStartedSeen");
window.dispatchEvent(event);
@ -286,7 +286,7 @@ loop.panel = (function(_, mozL10n) {
},
openGettingStartedTour: function() {
navigator.mozLoop.openGettingStartedTour("settingsMenu");
navigator.mozLoop.openGettingStartedTour("settings-menu");
},
render: function() {

View File

@ -166,7 +166,7 @@ loop.panel = (function(_, mozL10n) {
var GettingStartedView = React.createClass({
handleButtonClick: function() {
navigator.mozLoop.openGettingStartedTour();
navigator.mozLoop.openGettingStartedTour("getting-started");
navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
var event = new CustomEvent("GettingStartedSeen");
window.dispatchEvent(event);
@ -286,7 +286,7 @@ loop.panel = (function(_, mozL10n) {
},
openGettingStartedTour: function() {
navigator.mozLoop.openGettingStartedTour("settingsMenu");
navigator.mozLoop.openGettingStartedTour("settings-menu");
},
render: function() {