ready4testing

This commit is contained in:
2015-11-02 13:46:34 +01:00
parent 08cd6febee
commit 39ab69f570
53 changed files with 23846 additions and 20 deletions
+22
View File
@@ -30,6 +30,7 @@ var Radio = function() {
var channel = channels[idx];
var $tile = $tileTemplate.clone();
$tile.attr('data-id', idx);
fillTileWithChannel($tile, channel);
addClickToTile($tile);
@@ -55,8 +56,29 @@ var Radio = function() {
$tile.click(function(e) {
e.preventDefault();
$navigation.find('.tile').removeClass('nowplaying');
var stream = $tile.attr('href');
var idx = $tile.attr('data-id');
console.log('Stream: ' + stream);
$.ajax({
url: '/action/play/'+idx+'/',
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() {
$tile.addClass('nowplaying');
});
});
}