volume, stop

This commit is contained in:
2015-11-16 15:24:28 +01:00
parent c0df1a1aed
commit 830bb50f14
10 changed files with 171 additions and 13 deletions
+31
View File
@@ -9,13 +9,16 @@ var Radio = function() {
var channels;
var $navigation;
var $controlPanel;
return {
init: function(channels_) {
channels = channels_;
$navigation = $('#navigation');
$controlPanel = $('#controls');
initTiles();
initClickOfControls();
console.log('Radio initialized with ' + channels.length + ' channels');
}
};
@@ -81,5 +84,33 @@ var Radio = function() {
});
});
}
/* private */
function initClickOfControls() {
$controlPanel.find('a').click(function(e) {
e.preventDefault();
var stream = $(this).attr('href');
console.log('Action: ' + stream);
$.ajax({
url: stream,
context: document.body,
statusCode: {
200: function() {
console.log('ok');
},
404: function() {
console.log('Resource not found');
},
500: function() {
console.log('Something went wrong');
}
}
}).done(function() {
});
});
}
}();