Bug 1371538 - Should add the Screenshots tour in the onBoarding overlay, r=flod,rexboy

MozReview-Commit-ID: D7YKZyV2Bm2

--HG--
extra : rebase_source : 85ca8034039364fa3573666e2cc007b6205f90af
This commit is contained in:
Fischer.json 2017-08-25 12:11:26 +08:00
Родитель 447889ecb5
Коммит f645278af1
8 изменённых файлов: 69 добавлений и 10 удалений

1
browser/extensions/onboarding/bootstrap.js поставляемый
Просмотреть файл

@ -34,6 +34,7 @@ const PREF_WHITELIST = [
"onboarding-tour-library",
"onboarding-tour-performance",
"onboarding-tour-private-browsing",
"onboarding-tour-screenshots",
"onboarding-tour-singlesearch",
"onboarding-tour-sync",
].forEach(tourId => PREF_WHITELIST.push([`browser.onboarding.tour.${tourId}.completed`, PREF_BOOL]));

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 25 KiB

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

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="92px" height="92px" viewBox="0 0 92 92" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Tip / Icon / Screenshots</title><desc>Created with Sketch.</desc><defs></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Screenshots" fill-rule="nonzero" fill="#0C0C0D"><g id="Icon-/-Screenshot-/-Web"><path fill="#0A84FF" d="M23.0526905,5.75 C16.7062659,5.75 11.5614723,10.8982866 11.5614723,17.2490201 L23.0526905,17.2490201 L23.0526905,5.75 Z M57.5263453,5.75 L46.035127,5.75 L46.035127,17.2490201 L57.5263453,17.2490201 L57.5263453,5.75 Z M80.5087818,5.75 L80.5087818,17.2490201 L92,17.2490201 C92,10.8982866 86.8552063,5.75 80.5087818,5.75 Z M40.2895179,5.75 L28.7982997,5.75 L28.7982997,17.2490201 L40.2895179,17.2490201 L40.2895179,5.75 Z M74.7631726,5.75 L63.2719544,5.75 L63.2719544,17.2490201 L74.7631726,17.2490201 L74.7631726,5.75 Z M80.5087818,34.4975502 L92,34.4975502 L92,22.9985301 L80.5087818,22.9985301 L80.5087818,34.4975502 Z M80.5087818,68.9946104 C86.8552063,68.9946104 92,63.8463237 92,57.4955903 L80.5087818,57.4955903 L80.5087818,68.9946104 Z M80.5087818,51.7460803 L92,51.7460803 L92,40.2470602 L80.5087818,40.2470602 L80.5087818,51.7460803 Z M77.9749681,39.286892 C74.3364854,34.0846734 67.1729138,32.8182928 61.9734467,36.4581331 L39.9390357,52.734996 L28.631677,44.8006721 C28.7205927,44.2448747 28.7762328,43.6842562 28.7982997,43.1218152 C28.7892628,38.6172543 26.6604054,34.3800822 23.0526905,31.6860398 L23.0526905,22.9985301 L11.5614723,22.9985301 L11.5614723,29.0355156 C5.79583786,30.1835386 1.31120668,34.7313256 0.240775953,40.5156383 C-0.829654779,46.2999509 1.73019662,52.1531434 6.70268981,55.2910372 C11.675183,58.4289309 18.0565494,58.2180974 22.811375,54.7588235 L29.9474215,59.7551477 L21.9035687,65.4011666 C16.3310302,62.0167647 9.17796578,62.8225007 4.49677041,67.3619045 C-0.184424965,71.9013083 -1.21401,79.0303725 1.99130168,84.710299 C5.19661336,90.3902255 11.8290284,93.1895755 18.1311131,91.5224455 C24.4331979,89.8553154 28.8167193,84.1418505 28.7982997,77.6188754 C28.7959008,76.6687877 28.699673,75.721263 28.5110192,74.7901165 L77.9749681,39.286892 Z M14.4342769,50.3087028 C10.4677615,50.3087028 7.25226545,47.0910236 7.25226545,43.1218152 C7.25226545,39.1526068 10.4677615,35.9349277 14.4342769,35.9349277 C18.4007922,35.9349277 21.6162883,39.1526068 21.6162883,43.1218152 C21.6162883,47.0910236 18.4007922,50.3087028 14.4342769,50.3087028 Z M14.4342769,84.805763 C10.4677615,84.805763 7.25226545,81.5880838 7.25226545,77.6188754 C7.25226545,73.649667 10.4677615,70.4319879 14.4342769,70.4319879 C18.4007922,70.4319879 21.6162883,73.649667 21.6162883,77.6188754 C21.6162883,81.5880838 18.4007922,84.805763 14.4342769,84.805763 Z M45.4605661,70.8402031 L62.7950688,84.0640762 C67.9945359,87.7039165 75.1581075,86.4375358 78.7965902,81.2353172 L55.457926,63.8200513 L45.4605661,70.8402031 Z" id="Shape"></path></g></g></g></svg>

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

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

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="92px" height="92px" viewBox="0 0 92 92" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Tip / Icon / Screenshots</title><desc>Created with Sketch.</desc><defs></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Screenshots" fill-rule="nonzero" fill="#0C0C0D"><g id="Icon-/-Screenshot-/-Web"><path d="M23.0526905,5.75 C16.7062659,5.75 11.5614723,10.8982866 11.5614723,17.2490201 L23.0526905,17.2490201 L23.0526905,5.75 Z M57.5263453,5.75 L46.035127,5.75 L46.035127,17.2490201 L57.5263453,17.2490201 L57.5263453,5.75 Z M80.5087818,5.75 L80.5087818,17.2490201 L92,17.2490201 C92,10.8982866 86.8552063,5.75 80.5087818,5.75 Z M40.2895179,5.75 L28.7982997,5.75 L28.7982997,17.2490201 L40.2895179,17.2490201 L40.2895179,5.75 Z M74.7631726,5.75 L63.2719544,5.75 L63.2719544,17.2490201 L74.7631726,17.2490201 L74.7631726,5.75 Z M80.5087818,34.4975502 L92,34.4975502 L92,22.9985301 L80.5087818,22.9985301 L80.5087818,34.4975502 Z M80.5087818,68.9946104 C86.8552063,68.9946104 92,63.8463237 92,57.4955903 L80.5087818,57.4955903 L80.5087818,68.9946104 Z M80.5087818,51.7460803 L92,51.7460803 L92,40.2470602 L80.5087818,40.2470602 L80.5087818,51.7460803 Z M77.9749681,39.286892 C74.3364854,34.0846734 67.1729138,32.8182928 61.9734467,36.4581331 L39.9390357,52.734996 L28.631677,44.8006721 C28.7205927,44.2448747 28.7762328,43.6842562 28.7982997,43.1218152 C28.7892628,38.6172543 26.6604054,34.3800822 23.0526905,31.6860398 L23.0526905,22.9985301 L11.5614723,22.9985301 L11.5614723,29.0355156 C5.79583786,30.1835386 1.31120668,34.7313256 0.240775953,40.5156383 C-0.829654779,46.2999509 1.73019662,52.1531434 6.70268981,55.2910372 C11.675183,58.4289309 18.0565494,58.2180974 22.811375,54.7588235 L29.9474215,59.7551477 L21.9035687,65.4011666 C16.3310302,62.0167647 9.17796578,62.8225007 4.49677041,67.3619045 C-0.184424965,71.9013083 -1.21401,79.0303725 1.99130168,84.710299 C5.19661336,90.3902255 11.8290284,93.1895755 18.1311131,91.5224455 C24.4331979,89.8553154 28.8167193,84.1418505 28.7982997,77.6188754 C28.7959008,76.6687877 28.699673,75.721263 28.5110192,74.7901165 L77.9749681,39.286892 Z M14.4342769,50.3087028 C10.4677615,50.3087028 7.25226545,47.0910236 7.25226545,43.1218152 C7.25226545,39.1526068 10.4677615,35.9349277 14.4342769,35.9349277 C18.4007922,35.9349277 21.6162883,39.1526068 21.6162883,43.1218152 C21.6162883,47.0910236 18.4007922,50.3087028 14.4342769,50.3087028 Z M14.4342769,84.805763 C10.4677615,84.805763 7.25226545,81.5880838 7.25226545,77.6188754 C7.25226545,73.649667 10.4677615,70.4319879 14.4342769,70.4319879 C18.4007922,70.4319879 21.6162883,73.649667 21.6162883,77.6188754 C21.6162883,81.5880838 18.4007922,84.805763 14.4342769,84.805763 Z M45.4605661,70.8402031 L62.7950688,84.0640762 C67.9945359,87.7039165 75.1581075,86.4375358 78.7965902,81.2353172 L55.457926,63.8200513 L45.4605661,70.8402031 Z" id="Shape"></path></g></g></g></svg>

После

Ширина:  |  Высота:  |  Размер: 2.9 KiB

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

@ -434,6 +434,23 @@
background-image: url("img/icons_performance-colored.svg");
}
#onboarding-tour-screenshots,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-screenshots] #onboarding-notification-tour-title::before {
background-image: url("img/icons_screenshots.svg");
}
#onboarding-tour-screenshots.onboarding-active,
#onboarding-tour-screenshots:hover {
background-image: url("img/icons_screenshots-colored.svg");
}
a#onboarding-tour-screenshots-button,
a#onboarding-tour-screenshots-button:hover,
a#onboarding-tour-screenshots-button:visited {
color: #fff;
text-decoration: none;
}
/* Tour Notifications */
#onboarding-notification-bar {
--onboarding-notification-bar-background-color: rgba(255, 255, 255, 0.97);

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

@ -295,6 +295,36 @@ var onboardingTourset = {
return div;
},
},
"screenshots": {
id: "onboarding-tour-screenshots",
tourNameId: "onboarding.tour-screenshots",
getNotificationStrings(bundle) {
return {
title: bundle.GetStringFromName("onboarding.notification.onboarding-tour-screenshots.title"),
message: bundle.formatStringFromName("onboarding.notification.onboarding-tour-screenshots.message", [BRAND_SHORT_NAME], 1),
button: bundle.GetStringFromName("onboarding.button.learnMore"),
};
},
getPage(win, bundle) {
let div = win.document.createElement("div");
// Screenshot tour opens the screenshot page directly, see below a#onboarding-tour-screenshots-button.
// The screenshots page should be responsible for highlighting the Screenshots button
div.innerHTML = `
<section class="onboarding-tour-description">
<h1 data-l10n-id="onboarding.tour-screenshots.title"></h1>
<p data-l10n-id="onboarding.tour-screenshots.description"></p>
</section>
<section class="onboarding-tour-content">
<img src="resource://onboarding/img/figure_screenshots.svg" role="presentation"/>
</section>
<aside class="onboarding-tour-button-container">
<a id="onboarding-tour-screenshots-button" class="onboarding-tour-action-button" data-l10n-id="onboarding.tour-screenshots.button"
href="https://screenshots.firefox.com/#tour" target="_blank"></a>
</aside>
`;
return div;
},
},
};
/**
@ -442,7 +472,7 @@ class Onboarding {
* Find a tour that should be selected. It is either a first tour that was not
* yet complete or the first one in the tab list.
*/
get selectedTour() {
get _firstUncompleteTour() {
return this._tours.find(tour => !this.isTourCompleted(tour.id)) ||
this._tours[0];
}
@ -458,7 +488,7 @@ class Onboarding {
switch (id) {
case "onboarding-overlay-button":
this.showOverlay();
this.gotoPage(this.selectedTour.id);
this.gotoPage(this._firstUncompleteTour.id);
break;
case "onboarding-overlay-close-btn":
// If the clicking target is directly on the outer-most overlay,
@ -525,7 +555,6 @@ class Onboarding {
this.handleClick(target);
event.preventDefault();
}
return;
}
@ -646,10 +675,10 @@ class Onboarding {
[...doc.body.children].forEach(
child => child.id !== "onboarding-overlay" &&
child.setAttribute("aria-hidden", true));
// When dialog is opened with the keyboard, focus on the selected or
// first tour item.
// When dialog is opened with the keyboard, focus on the 1st uncomplete tour
// because it will be the selected tour
if (this._overlayIcon.dataset.keyboardFocus) {
doc.getElementById(this.selectedTour.id).focus();
doc.getElementById(this._firstUncompleteTour.id).focus();
} else {
// When dialog is opened with mouse, focus on the dialog itself to avoid
// visible keyboard focus styling.

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

@ -116,3 +116,14 @@ onboarding.tour-performance.description=Its a whole new %1$S, built for faste
onboarding.notification.onboarding-tour-performance.title=Browse with the best of em.
# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-performance.message): %S is brandShortName.
onboarding.notification.onboarding-tour-performance.message=Prepare yourself for the fastest, smoothest, most reliable %S yet.
# LOCALIZATION NOTE (onboarding.tour-screenshots): "Screenshots" is the name of the Firefox Screenshots feature and should not be localized.
onboarding.tour-screenshots=Screenshots
onboarding.tour-screenshots.title=Take better screenshots.
# LOCALIZATION NOTE(onboarding.tour-screenshots.description): %S is brandShortName.
onboarding.tour-screenshots.description=Take, save and share screenshots — without leaving %S. Capture a region or an entire page as you browse. Then save to the web for easy access and sharing.
# LOCALIZATION NOTE (onboarding.tour-screenshots.button): "Screenshots" is the name of the Firefox Screenshots feature and should not be localized.
onboarding.tour-screenshots.button=Open Screenshots Website
onboarding.notification.onboarding-tour-screenshots.title=Take better screenshots.
# LOCALIZATION NOTE(onboarding.notification.onboarding-tour-screenshots.message): %S is brandShortName.
onboarding.notification.onboarding-tour-screenshots.message=Take, save and share screenshots — without leaving %S.

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

@ -9,8 +9,7 @@ const URLs = [ABOUT_HOME_URL, ABOUT_NEWTAB_URL];
const TOUR_IDs = [
"onboarding-tour-performance",
"onboarding-tour-private-browsing",
// TODO: should enable in bug 1371538
// "onboarding-tour-screenshots",
"onboarding-tour-screenshots",
"onboarding-tour-addons",
"onboarding-tour-customize",
"onboarding-tour-default-browser",
@ -18,8 +17,7 @@ const TOUR_IDs = [
const UPDATE_TOUR_IDs = [
"onboarding-tour-performance",
"onboarding-tour-library",
// TODO: should enable in bug 1371538
// "onboarding-tour-screenshots",
"onboarding-tour-screenshots",
"onboarding-tour-singlesearch",
"onboarding-tour-customize",
"onboarding-tour-sync",