-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(onboarding): autoplay for onboarding
If the user has seen all the steps of onboarding or if they have exited early, onboarding will not autoplay. This is recorded using local storage - so it will be true for the device, not the user. Because the onboarding service/component may potentially be shared by different pages, it records when the user has seen each step, and checks to see whether the user has previouslyseen (or exited before seeing) all the steps currently loaded. Another screen that involvesonboarding with different steps will still autoplay. For onboarding to work, it needs to know when all the elements that are in the tour have finished loading. Some of those elements may not exist before xhr responses have been received. The spectrogram image may exist but not be displayed properly while it is loading. To allow for this, the onboarding service can be registered with messages that it must wait for before being considered "ready". These ready messages are sent in the success handler of a http request. For the spectrogram, a new directive was created that broadcasts an event when the spectrogram has finished loading. The info button - used to manually launch the tour - now draws attention to itself after the tour is ready and when it closes. If the tour autoplays and is closed, the button draws attention to itself to show how to reopen it if needed. This is done through css animation. An change was also made to allow more than one event handler for the same event, e.g. many onExit handlers. This allows event handlers to be registered with the service from anywhere independently. In this case, it was needed since the animation on the button is triggered on exit, and the label examples are also closed on exit.
- Loading branch information
Showing
10 changed files
with
255 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ angular.module("bawApp.components.citizenScienceTextLabels", | |
order: 5 | ||
} | ||
|
||
]); | ||
], "questions"); | ||
} | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
angular.module("bawApp.spectrogram", []) | ||
.directive("spectrogram", ["$rootScope", function ($rootScope) { | ||
return { | ||
restrict: "A", | ||
link: function ($scope, element, attributes) { | ||
element.bind("load", function() { | ||
$rootScope.$broadcast("spectrogram-loaded", $scope); | ||
|
||
}); | ||
element.bind("error", function(){ | ||
console.log("spectrogram could not be loaded"); | ||
}); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<span class="info-launch" | ||
ng-class="status" | ||
title="Launch the tour" | ||
ng-click="launchTour()" | ||
</span> |
Oops, something went wrong.