CC-2401: Shuffle option in playlists

- done
This commit is contained in:
James 2012-11-13 17:31:30 -05:00
parent 33e4d6154d
commit 2b2a1db055
5 changed files with 75 additions and 5 deletions

View file

@ -637,6 +637,26 @@ var AIRTIME = (function(AIRTIME){
$fs.addClass("closed");
}
});
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
obj_id = $('input[id="obj_id"]').val();
url = "/Playlist/shuffle";
enableLoadingIcon();
$.post(url, {format: "json", obj_id: obj_id}, function(data){
var json = $.parseJSON(data)
if (json.error !== undefined) {
alert(json.error);
}
AIRTIME.playlist.fnOpenPlaylist(json);
if (json.result == "0") {
$pl.find('.success').text('Playlist shuffled');
$pl.find('.success').show();
}
disableLoadingIcon();
});
})
$pl.on("click", "#webstream_save", function(){
//get all fields and POST to server

View file

@ -351,7 +351,7 @@ function setupUI() {
* It is only active if playlist is not empty
*/
var plContents = $('#spl_sortable').children();
var shuffleButton = $('button[id="shuffle_button"]');
var shuffleButton = $('button[id="shuffle_button"], button[id="playlist_shuffle_button"]');
if (!plContents.hasClass('spl_empty')) {
if (shuffleButton.hasClass('ui-state-disabled')) {