From 3752705ad33ea290df516e9480b0e96e6ff5b1fc Mon Sep 17 00:00:00 2001 From: gasolin Date: Tue, 18 Jul 2017 14:35:51 +0800 Subject: [PATCH] Bug 1371540 - Should add the Library tour in the onBoarding overlay;r=flod,mossop,rexboy MozReview-Commit-ID: xPtSZfrzS4 --HG-- extra : rebase_source : 4aadfa9744e28b2e96d48d6c5f65429c2e99e5fa --- browser/extensions/onboarding/bootstrap.js | 3 +- .../content/onboarding-tour-agent.js | 3 ++ .../onboarding/content/onboarding.css | 10 +++++++ .../onboarding/content/onboarding.js | 29 ++++++++++++++++++- .../locales/en-US/onboarding.properties | 13 +++++++-- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/browser/extensions/onboarding/bootstrap.js b/browser/extensions/onboarding/bootstrap.js index d7bc2d845388..fdcf26ff5304 100644 --- a/browser/extensions/onboarding/bootstrap.js +++ b/browser/extensions/onboarding/bootstrap.js @@ -30,8 +30,9 @@ const PREF_WHITELIST = [ "onboarding-tour-private-browsing", "onboarding-tour-addons", "onboarding-tour-customize", - "onboarding-tour-search", "onboarding-tour-default-browser", + "onboarding-tour-library", + "onboarding-tour-search", "onboarding-tour-sync", ].forEach(tourId => PREF_WHITELIST.push(`browser.onboarding.tour.${tourId}.completed`)); diff --git a/browser/extensions/onboarding/content/onboarding-tour-agent.js b/browser/extensions/onboarding/content/onboarding-tour-agent.js index 1298edd4b5d5..d396d81b846c 100644 --- a/browser/extensions/onboarding/content/onboarding-tour-agent.js +++ b/browser/extensions/onboarding/content/onboarding-tour-agent.js @@ -29,6 +29,9 @@ document.getElementById("onboarding-overlay") } }); break; + case "onboarding-tour-library-button": + Mozilla.UITour.showHighlight("library"); + break; case "onboarding-tour-private-browsing-button": Mozilla.UITour.showHighlight("privateWindow"); break; diff --git a/browser/extensions/onboarding/content/onboarding.css b/browser/extensions/onboarding/content/onboarding.css index e77179751af8..13144654223a 100644 --- a/browser/extensions/onboarding/content/onboarding.css +++ b/browser/extensions/onboarding/content/onboarding.css @@ -386,6 +386,16 @@ background-image: url("img/icons_sync-notification.svg"); } +#onboarding-tour-library { + background-image: url("img/icons_search.svg"); +} + +#onboarding-tour-library.onboarding-active, +#onboarding-tour-library:hover, +#onboarding-notification-bar[data-target-tour-id=onboarding-tour-library] #onboarding-notification-tour-icon { + background-image: url("img/icons_search-colored.svg"); +} + /* Tour Notifications */ #onboarding-notification-bar { position: fixed; diff --git a/browser/extensions/onboarding/content/onboarding.js b/browser/extensions/onboarding/content/onboarding.js index 3a5bc21d0105..d07d8f326055 100644 --- a/browser/extensions/onboarding/content/onboarding.js +++ b/browser/extensions/onboarding/content/onboarding.js @@ -22,7 +22,7 @@ const BRAND_SHORT_NAME = Services.strings const PROMPT_COUNT_PREF = "browser.onboarding.notification.prompt-count"; /** - * Add any number of tours, following the format + * Add any number of tours, key is the tourId, value should follow the format below * "tourId": { // The short tour id which could be saved in pref * // The unique tour id * id: "onboarding-tour-addons", @@ -223,6 +223,33 @@ var onboardingTourset = { return div; }, }, + "library": { + id: "onboarding-tour-library", + tourNameId: "onboarding.tour-library", + getNotificationStrings(bundle) { + return { + title: bundle.GetStringFromName("onboarding.notification.onboarding-tour-library.title"), + message: bundle.formatStringFromName("onboarding.notification.onboarding-tour-library.message", [BRAND_SHORT_NAME], 1), + button: bundle.GetStringFromName("onboarding.button.learnMore"), + }; + }, + getPage(win) { + let div = win.document.createElement("div"); + div.innerHTML = ` +
+

+

+
+
+ +
+ + `; + return div; + }, + }, }; /** diff --git a/browser/extensions/onboarding/locales/en-US/onboarding.properties b/browser/extensions/onboarding/locales/en-US/onboarding.properties index 922866f26ac5..b4aec83c844a 100644 --- a/browser/extensions/onboarding/locales/en-US/onboarding.properties +++ b/browser/extensions/onboarding/locales/en-US/onboarding.properties @@ -62,9 +62,9 @@ onboarding.tour-default-browser.win7.button=Make %S Your Default Browser onboarding.tour-default-browser.is-default.message=You’ve got this! # LOCALIZATION NOTE(onboarding.tour-default-browser.is-default.2nd-message): Label displayed when Firefox is already set as default browser. %S is brandShortName onboarding.tour-default-browser.is-default.2nd-message=%S is already your default browser. -# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-default-browser.title): This string will be used in the notification message for the default browser tour. %S is brandShortName. +# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-default-browser.title): This string will be used in the notification title for the default browser tour. %S is brandShortName. onboarding.notification.onboarding-tour-default-browser.title=Make %S your go-to browser. -# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-default-browser.message): %1$S is brandShortName +# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-default-browser.message): This string will be used in the notification message for the default browser tour. %1$S is brandShortName onboarding.notification.onboarding-tour-default-browser.message=It doesn’t take much to get the most from %1$S. Just set %1$S as your default browser and put control, customization, and protection on autopilot. onboarding.tour-sync2=Sync @@ -86,3 +86,12 @@ onboarding.tour-sync.button=Next onboarding.tour-sync.email-input.placeholder=Email onboarding.notification.onboarding-tour-sync.title=Pick up where you left off. onboarding.notification.onboarding-tour-sync.message=Still sending yourself links to save or read on your phone? Do it the easy way: get Sync and have the things you save here show up on all of your devices. + +onboarding.tour-library=Library +onboarding.tour-library.title=Keep it together. +# LOCALIZATION NOTE (onboarding.tour-library.description): This string will be used in the library tour description. %1$S is brandShortName +onboarding.tour-library.description=Check out the new %1$S library in the redesigned toolbar. The library puts the things you’ve seen and saved to %1$S - your browsing history, bookmarks, Pocket lists, and synced tabs - in one convenient place. +onboarding.tour-library.button=Show Library in Menu +onboarding.notification.onboarding-tour-library.title=Keep it together. +# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-library.message): This string will be used in the notification message for the library tour. %S is brandShortName +onboarding.notification.onboarding-tour-library.message=The new %S library puts the great things you’ve discovered on the web in one convenient place.