From 60826dc9350124055b9160433bc3e336ef7afeae Mon Sep 17 00:00:00 2001 From: Kendall Werts Date: Mon, 10 Feb 2020 14:52:31 -0600 Subject: [PATCH] added second onboarding panel --- src/css/popup.css | 14 +++++++------- src/img/Account.svg | 1 + src/img/Sync.svg | 1 + src/js/popup.js | 37 ++++++++++++++++++++++++++++++++++--- src/popup.html | 16 +++++++++++++--- 5 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 src/img/Account.svg create mode 100644 src/img/Sync.svg diff --git a/src/css/popup.css b/src/css/popup.css index 2e54a23..2ffbce5 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -357,11 +357,11 @@ table { } .half-button-wrapper { - width: 100%; - flex-direction: row; - display: flex; align-items: center; + display: flex; + flex-direction: row; height: 44px; + inline-size: 100%; } .half-onboarding-button { @@ -370,18 +370,18 @@ table { border-radius: 3px; color: white; display: flex; + flex: 1 0 auto; font-size: 14px; + height: 44px; inline-size: 50%; justify-content: center; + margin-inline-end: 4px; text-decoration: none; transition: background-color 75ms; - flex: 1 0 auto; - height: 44px; - margin: 0 4px 0 0; } .grey-button { - background-color: #E3E3E3; + background-color: #e3e3e3; color: #000; } diff --git a/src/img/Account.svg b/src/img/Account.svg new file mode 100644 index 0000000..4d049d4 --- /dev/null +++ b/src/img/Account.svg @@ -0,0 +1 @@ +account \ No newline at end of file diff --git a/src/img/Sync.svg b/src/img/Sync.svg new file mode 100644 index 0000000..d52b768 --- /dev/null +++ b/src/img/Sync.svg @@ -0,0 +1 @@ +Sync \ No newline at end of file diff --git a/src/js/popup.js b/src/js/popup.js index 208b18b..8c1f4ab 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -18,6 +18,7 @@ const P_ONBOARDING_3 = "onboarding3"; const P_ONBOARDING_4 = "onboarding4"; const P_ONBOARDING_5 = "onboarding5"; const P_ONBOARDING_6 = "onboarding6"; +const P_ONBOARDING_7 = "onboarding7"; const P_CONTAINERS_LIST = "containersList"; const P_CONTAINERS_EDIT = "containersEdit"; const P_CONTAINER_INFO = "containerInfo"; @@ -100,9 +101,12 @@ const Logic = { } switch (onboarded) { - case 6: + case 7: this.showAchievementOrContainersListPanel(); break; + case 6: + this.showPanel(P_ONBOARDING_7); + break; case 5: this.showPanel(P_ONBOARDING_6); break; @@ -532,10 +536,10 @@ Logic.registerPanel(P_ONBOARDING_6, { await browser.runtime.sendMessage({ method: "resetSync" }); - Logic.showPanel(P_CONTAINERS_LIST); + Logic.showPanel(P_ONBOARDING_7); }); Logic.addEnterHandler(document.querySelector("#no-sync"), async () => { - await Logic.setOnboardingStage(6); + await Logic.setOnboardingStage(7); await browser.storage.local.set({syncEnabled: false}); await browser.runtime.sendMessage({ method: "resetSync" @@ -550,6 +554,33 @@ Logic.registerPanel(P_ONBOARDING_6, { }, }); +// P_ONBOARDING_6: Sixth page for Onboarding: new tab long-press behavior +// ---------------------------------------------------------------------------- + +Logic.registerPanel(P_ONBOARDING_7, { + panelSelector: ".onboarding-panel-7", + + // This method is called when the object is registered. + initialize() { + // Let's move to the containers list panel. + Logic.addEnterHandler(document.querySelector("#sign-in"), async () => { + browser.tabs.create({ + url: "https://accounts.firefox.com/?service=sync&utm_source=addon&utm_medium=panel&utm_campaign=container-sync", + }); + await Logic.setOnboardingStage(7); + Logic.showPanel(P_CONTAINERS_LIST); + }); + Logic.addEnterHandler(document.querySelector("#no-sign-in"), async () => { + await Logic.setOnboardingStage(7); + Logic.showPanel(P_CONTAINERS_LIST); + }); + }, + + // This method is called when the panel is shown. + prepare() { + return Promise.resolve(null); + }, +}); // P_CONTAINERS_LIST: The list of containers. The main page. // ---------------------------------------------------------------------------- diff --git a/src/popup.html b/src/popup.html index 27607a8..1497212 100644 --- a/src/popup.html +++ b/src/popup.html @@ -68,12 +68,22 @@
- Click below to start syncing + Syncing Containers is now Available!

Syncing Containers is now Available!

Turn on Sync to share container and site assignments with any computer connected to your Firefox Account.

+
+ +
+ Firefox Account is required to sync +

Firefox Account is required to sync.

+

Click Sign In to confirm that your Firefox Account is active.

+