-
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): Added onboarding feature. Closes #299.
Added introjs and angular-introjs dependencies. Created component for info button that invokes introjs onboarding tour. Created inital tour for bristlebird citizen science project.
- Loading branch information
Showing
8 changed files
with
200 additions
and
53 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
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 |
---|---|---|
@@ -1,61 +1,75 @@ | ||
<cs-backgrounds backgrounds="['1.jpg','2.jpg','3.jpg','4.jpg',]" change-on="currentSampleNum"></cs-backgrounds> | ||
|
||
<div class="citizen-science bristlebird"> | ||
|
||
<h2>Eastern Bristlebird Search</h2> | ||
<cs-backgrounds backgrounds="['1.jpg','2.jpg','3.jpg','4.jpg',]" change-on="currentSampleNum"></cs-backgrounds> | ||
|
||
<div class="cs-main-container"> | ||
<div class="main wrapper clearfix"> | ||
<div class="citizen-science bristlebird"> | ||
|
||
<div class="citsci-debug"> | ||
<p>Currently viewing: Sample {{ currentSample }}</p> | ||
<p>Audio id: {{ samples[currentSample].recordingId }}</p> | ||
<p>Start Offset: {{ samples[currentSample].startOffset }}</p> | ||
</div> | ||
<h2>Eastern Bristlebird Search <onboarding steps="onboardingSteps"></onboarding></h2> | ||
|
||
<div class="audio-outer"> | ||
<div class="audio-inner"> | ||
<div class="spectrogram-wrapper"> | ||
<img id="spectrogram" class="spectrogram" ng-src="{{media.available.image.png.url}}"> | ||
<div position-line media="media" audio-data="model.audioElement" image-id="'spectrogram'"></div> | ||
</div> | ||
<audio id="citsci-sample" ng-audio="model.audioElement" controls> | ||
<source ng-repeat="key in media.available.audioOrder" | ||
ng-src="{{media.available.audio[key].url}}" src="" | ||
type="{{media.available.audio[key].mimeType}}"> | ||
Your browser does not support the audio element. | ||
</audio> | ||
<div class="cs-main-container"> | ||
|
||
<div class="main wrapper clearfix"> | ||
|
||
<div class="citsci-debug"> | ||
<p>Currently viewing: Sample {{ currentSample }}</p> | ||
<p>Audio id: {{ samples[currentSample].recordingId }}</p> | ||
<p>Start Offset: {{ samples[currentSample].startOffset }}</p> | ||
</div> | ||
</div> | ||
|
||
<nav class="cs-progress"> | ||
|
||
<dataset-progress items="samples" selected="currentSampleNum"></dataset-progress> | ||
|
||
<div class="autoplay progressCell"> | ||
<toggle-switch model="model.audioElement.autoPlay" disabled="disabled" mode="push-toggle" | ||
title="Enable/disable autoplay"> | ||
<toggle-switch-state switch-state="on"> | ||
<span class="glyphicon glyphicon-play-circle"></span> | ||
</toggle-switch-state> | ||
<toggle-switch-state switch-state="off"> | ||
<span class="glyphicon glyphicon-play-circle"></span> | ||
</toggle-switch-state> | ||
</toggle-switch> | ||
|
||
<div class="audio-outer"> | ||
<div class="audio-inner"> | ||
<div class="spectrogram-wrapper"> | ||
<img id="spectrogram" class="spectrogram" ng-src="{{media.available.image.png.url}}"> | ||
<div position-line media="media" audio-data="model.audioElement" image-id="'spectrogram'"></div> | ||
</div> | ||
<audio id="citsci-sample" ng-audio="model.audioElement" controls> | ||
<source ng-repeat="key in media.available.audioOrder" | ||
ng-src="{{media.available.audio[key].url}}" src="" | ||
type="{{media.available.audio[key].mimeType}}"> | ||
Your browser does not support the audio element. | ||
</audio> | ||
</div> | ||
</div> | ||
|
||
</nav> | ||
<div class="row"> | ||
|
||
<div class="col-md-6"> | ||
|
||
<nav class="cs-progress"> | ||
|
||
<dataset-progress items="samples" selected="currentSampleNum"></dataset-progress> | ||
|
||
<citizen-science-labels labels="labels" | ||
samples="samples" | ||
current-sample-num="currentSampleNum" | ||
cs-project="csProject"></citizen-science-labels> | ||
<div class="autoplay progressCell"> | ||
<toggle-switch model="model.audioElement.autoPlay" disabled="disabled" mode="push-toggle" | ||
title="Enable/disable autoplay"> | ||
<toggle-switch-state switch-state="on"> | ||
<span class="glyphicon glyphicon-play-circle"></span> | ||
</toggle-switch-state> | ||
<toggle-switch-state switch-state="off"> | ||
<span class="glyphicon glyphicon-play-circle"></span> | ||
</toggle-switch-state> | ||
</toggle-switch> | ||
</div> | ||
|
||
<citizen-science-examples labels="labels"></citizen-science-examples> | ||
</nav> | ||
|
||
<citizen-science-labels labels="labels" | ||
samples="samples" | ||
current-sample-num="currentSampleNum" | ||
cs-project="csProject"></citizen-science-labels> | ||
|
||
|
||
</div> <!-- #main --> | ||
</div> <!-- #main-container --> | ||
</div> | ||
<div class="col-md-6"> | ||
|
||
<citizen-science-examples labels="labels"></citizen-science-examples> | ||
|
||
</div> | ||
|
||
|
||
</div> | ||
|
||
</div> <!-- #main --> | ||
</div> <!-- #main-container --> | ||
|
||
</div> | ||
</div> |
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,24 @@ | ||
.info-launch { | ||
cursor: pointer; | ||
opacity: 0.8; | ||
|
||
&:before { | ||
/* questionmark: f059 | ||
information: f05a */ | ||
content: "\f05a"; | ||
font-family: FontAwesome; | ||
|
||
} | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
|
||
} | ||
|
||
h1, h2, h3 { | ||
.info-launch { | ||
float: right; | ||
} | ||
} | ||
|
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,6 @@ | ||
<span class="info-launch" | ||
title="Launch the tour" | ||
ng-click="launchTour()" | ||
ng-intro-options="introOptions" | ||
ng-intro-method="launchTour" | ||
></span> |
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,69 @@ | ||
/** | ||
* Wrapper for the angular-introjs directive with info-button and consistent styling | ||
*/ | ||
|
||
angular.module("bawApp.components.onboarding", ["bawApp.citizenScience.common"]) | ||
.component("onboarding", { | ||
templateUrl: "onboarding/infoButton.tpl.html", | ||
bindings: { | ||
steps: "=steps", | ||
options: "=options" | ||
}, | ||
controller: [ | ||
"$scope", | ||
function ($scope) { | ||
|
||
//var self = this; | ||
|
||
$scope.CompletedEvent = function (scope) { | ||
console.log("Completed Event called"); | ||
}; | ||
|
||
$scope.ExitEvent = function (scope) { | ||
console.log("Exit Event called"); | ||
}; | ||
|
||
$scope.ChangeEvent = function (targetElement, scope) { | ||
console.log("Change Event called"); | ||
console.log(targetElement); //The target element | ||
console.log(this); //The IntroJS object | ||
}; | ||
|
||
$scope.BeforeChangeEvent = function (targetElement, scope) { | ||
console.log("Before Change Event called"); | ||
console.log(targetElement); | ||
}; | ||
|
||
$scope.AfterChangeEvent = function (targetElement, scope) { | ||
console.log("After Change Event called"); | ||
console.log(targetElement); | ||
}; | ||
|
||
this.introOptionsDefaults = { | ||
steps: [], | ||
showStepNumbers: false, | ||
exitOnOverlayClick: true, | ||
exitOnEsc: true, | ||
nextLabel: "<strong>NEXT!</strong>", | ||
prevLabel: "<span style='color:green'>Previous</span>", | ||
skipLabel: "Exit", | ||
doneLabel: "Thanks" | ||
}; | ||
|
||
|
||
$scope.introOptions = Object.assign({}, this.introOptionsDefaults, this.options); | ||
|
||
if (Array.isArray(this.steps)) { | ||
|
||
this.steps = this.steps.map(function (step) { | ||
if (typeof step.element === "string") { | ||
step.element = document.querySelector(step.element); | ||
} | ||
return step; | ||
}); | ||
|
||
$scope.introOptions.steps = this.steps; | ||
} | ||
|
||
}] | ||
}); |