CC-84: Smart Playlists

- audio preview on playlist
- cleaning up some code
This commit is contained in:
James 2012-08-02 16:36:12 -04:00
parent 3b5a3e6713
commit 0d2d8218bf
14 changed files with 202 additions and 72 deletions

View file

@ -31,11 +31,16 @@ function openAudioPreview(p_event) {
p_event.stopPropagation();
var audioFileID = $(this).attr('audioFile');
var playlistID = $('#pl_id:first').attr('value');
var playlistIndex = $(this).parent().parent().attr('id');
playlistIndex = playlistIndex.substring(4); //remove the spl_
var objId = $('#obj_id:first').attr('value');
var objType = $('#obj_type:first').attr('value');
var playIndex = $(this).parent().parent().attr('id');
playIndex = playIndex.substring(4); //remove the spl_
open_playlist_preview(playlistID, playlistIndex);
if (objType == "playlist") {
open_playlist_preview(objId, playIndex);
} else if (objType == "block") {
open_block_preview(objId, playIndex);
}
}
function open_audio_preview(audioFileID, audioFileTitle, audioFileArtist) {
@ -65,6 +70,17 @@ function open_playlist_preview(p_playlistID, p_playlistIndex) {
_preview_window.focus();
}
function open_block_preview(p_blockId, p_blockIndex) {
if (p_blockIndex == undefined) //Use a resonable default.
p_blockIndex = 0;
if (_preview_window != null && !_preview_window.closed)
_preview_window.playBlock(p_blockId, p_blockIndex);
else
openPreviewWindow('audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
_preview_window.focus();
}
/**
*Opens a jPlayer window for the specified info, for either an audio file or playlist.
*If audioFile, audioFileTitle, audioFileArtist is supplied the jplayer opens for one file