1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00

Change 'controls' to 'transport'.

This commit is contained in:
Dan Barber 2013-10-18 13:30:56 +01:00
parent 71e689a880
commit 280564c945
2 changed files with 15 additions and 13 deletions

View File

@ -6,12 +6,14 @@ App.QueueRoute = Ember.Route.extend({
}
});
App.ControlsController = Ember.Controller.extend({
App.QueueController = Ember.ArrayController.extend();
App.TransportController = Ember.Controller.extend({
actions: {
previous: function() { return Ember.$.ajax('/api/control/previous', { type: 'PUT' }); },
play: function() { return Ember.$.ajax('/api/control/play', { type: 'PUT' }); },
pause: function() { return Ember.$.ajax('/api/control/pause', { type: 'PUT' }); },
stop: function() { return Ember.$.ajax('/api/control/stop', { type: 'PUT' }); },
next: function() { return Ember.$.ajax('/api/control/next', { type: 'PUT' }); }
sendControl: function(control) {
Ember.$.ajax('/api/control/' + control, { type: 'PUT' });
}
}
});
App.Song = DS.Model.extend();

View File

@ -10,7 +10,7 @@
<script type="text/x-handlebars" data-template-name="application">
<h1>MPD Client</h1>
{{ outlet }}
{{ render "controls" }}
{{ render "transport" }}
</script>
<script type="text/x-handlebars" data-template-name="queue">
@ -24,13 +24,13 @@
</ul>
</script>
<script type="text/x-handlebars" data-template-name="controls">
<script type="text/x-handlebars" data-template-name="transport">
<div id="controls">
<button {{ action "previous" }}>Previous</button>
<button {{ action "play" }}>Play</button>
<button {{ action "pause" }}>Pause</button>
<button {{ action "stop" }}>Stop</button>
<button {{ action "next" }}>Next</button>
<button {{ action "sendControl" "previous" }}>previous</button>
<button {{ action "sendControl" "play" }}>play</button>
<button {{ action "sendControl" "pause" }}>pause</button>
<button {{ action "sendControl" "stop" }}>stop</button>
<button {{ action "sendControl" "next" }}>next</button>
</div>
</script>