Skip to content

Commit

Permalink
feat(audioButtons): move components to directory under app, replacing…
Browse files Browse the repository at this point in the history
… existing volume directive
  • Loading branch information
peichins committed Sep 7, 2017
1 parent 5b80107 commit ed0fc18
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 236 deletions.
2 changes: 1 addition & 1 deletion src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ angular.module("baw",

"bawApp.models",

"audio-control",
"bawApp.audioControls",
"draggabilly",

"bawApp.d3", /* our d3 controls */
Expand Down
53 changes: 0 additions & 53 deletions src/app/audioControl/volumeControl.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/audioControl/volumeControl.tpl.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//noinspection CssInvalidHtmlTagReference
volume-control {
volume-slider {

width: 150px;

Expand Down
4 changes: 4 additions & 0 deletions src/app/audioControls/audioControls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
angular.module("bawApp.audioControls",[
"bawApp.audioControls.playButton",
"bawApp.audioControls.volumeSlider"
]);
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
var audioButtons = audioButtons || angular.module("bawApp.components.audioButtons", []);


audioButtons.component("playButton", {
templateUrl: "components/directives/audioButtons/playButton.tpl.html",
angular.module("bawApp.audioControls.playButton", [])
.component("playButton", {
templateUrl: "audioControls/playButton.tpl.html",
controller: [
"$scope",
function ($scope) {
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions src/app/audioControls/volumeSlider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
angular.module("bawApp.audioControls.volumeSlider", [])
.component("volumeSlider", {
templateUrl: "audioControls/volumeSlider.tpl.html",
controller: [
"$scope",
function ($scope) {

var self = this;

/**
* toggles the value for muted on the audio model
*/
$scope.toggleMute = function () {
self.audioElementModel.muted = !self.audioElementModel.muted;
};

}],
bindings: {
audioElementModel: "="
}
});

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="volume-control">

<div class="input-group-btn">
<button id="volumeControl-mute"
class="btn btn-default"
Expand All @@ -15,4 +15,3 @@
max="1" min="0" step="0.01"
ng-disabled="$ctrl.audioElementModel.muted"
title="{{ 'Volume ' + ($ctrl.audioElementModel.volume * 100 | number:0) }}">
</div>
4 changes: 3 additions & 1 deletion src/app/citizenScience/bristlebird/listen.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ <h2>Eastern Bristlebird Search
</toggle-switch>
</div>

<volume-slider audio-element-model="audioElementModel"></volume-slider>
<volume-slider class="input-group btn-group form-group form-group-without-feedback" audio-element-model="audioElementModel"></volume-slider>


</nav>


<citizen-science-labels labels="labels"
samples="samples"
current-sample-num="currentSampleNum"
Expand Down
4 changes: 2 additions & 2 deletions src/app/listen/listen.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ <h1 id="chunkInfo" class="row">
</div>

<!-- form-group form-group-without-feedback required here due to a bug with ngFormGroup -->
<volume-control model="model.audioElement"
class="input-group btn-group form-group form-group-without-feedback"></volume-control>
<volume-slider audio-element-model="model.audioElement"
class="input-group btn-group form-group form-group-without-feedback"></volume-slider>

<toggle-switch model="model.audioElement.autoPlay" disabled="disabled" mode="push-toggle"
title="Enable/disable autoplay">
Expand Down
131 changes: 0 additions & 131 deletions src/components/directives/audioButtons/_volumeControl.scss

This file was deleted.

26 changes: 0 additions & 26 deletions src/components/directives/audioButtons/volumeSlider.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/components/directives/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ angular.module("bawApp.directives",
"bawApp.directives.ngAudio",
"bawApp.directives.inputRange",
"bawApp.directives.toggleSwitch",
"bawApp.directives.ngForm",
"bawApp.components.audioButtons"
"bawApp.directives.ngForm"
]);

0 comments on commit ed0fc18

Please sign in to comment.