1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/assets/js/application.js
2013-10-17 18:21:17 +01:00

18 lines
671 B
JavaScript

var App = Ember.Application.create();
App.QueueRoute = Ember.Route.extend({
model: function() {
return Ember.$.getJSON('/api/queue');
}
});
App.ControlsController = 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' }); }
}
});