2.0.7 Prerelease - Genre Playlists
This commit is contained in:
parent
9c5f0e37c5
commit
2b5aae9c2f
5 changed files with 87 additions and 37 deletions
14
index.html
14
index.html
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
@ -129,13 +129,8 @@
|
|||
<div class="loading"></div>
|
||||
<div id="Playlists" class="smsection floatleft noselect">
|
||||
<div class="padder">
|
||||
<ul id="AutoPlaylistContainer" class="simplelist mainlist">
|
||||
<li class="index" id="autoplaylist">Genre Playlists</li>
|
||||
<li class="item" data-genre="Random"><span>Random</span><div class="floatright"><a class="play" title="Play" href="" data-genre="Random"></a></div><div class="floatright"><a class="add" title="Add To Current Playlist" href="" data-genre="Random"></a></div></li>
|
||||
<li class="item" data-genre="Alternative"><span>Alternative</span><div class="floatright"><a class="play" title="Play" href="" data-genre="Alternative"></a></div><div class="floatright"><a class="add" title="Add To Current Playlist" href="" data-genre="Alternative"></a></div></li>
|
||||
<li class="item" data-genre="Electronic"><span>Electronic</span><div class="floatright"><a class="play" title="Play" href="" data-genre="Electronic"></a></div><div class="floatright"><a class="add" title="Add To Current Playlist" href="" data-genre="Electronic"></a></div></li>
|
||||
<li class="item" data-genre="Hip-Hop"><span>Hip-Hop</span><div class="floatright"><a class="play" title="Play" href="" data-genre="Hip-Hop"></a></div><div class="floatright"><a class="add" title="Add To Current Playlist" href="" data-genre="Hip-Hop"></a></div></li>
|
||||
</ul>
|
||||
<ul class="simplelist"><li class="index">Genre Playlists</li></ul>
|
||||
<ul id="AutoPlaylistContainer" class="simplelist mainlist"></ul>
|
||||
<ul class="simplelist"><li class="index">Folder Playlists</li></ul>
|
||||
<ul id="FolderContainer" class="simplelist mainlist"></ul>
|
||||
<ul class="simplelist"><li class="index">Saved Playlists</li></ul>
|
||||
|
@ -199,6 +194,9 @@
|
|||
<div class="clear"></div>
|
||||
<div class="subsection floatleft">
|
||||
<h3 class="title">Options</h3>
|
||||
<label for="GenrePlaylists">Genres</label><br />
|
||||
<select id="Genres" name="Genres" class="large"></select><br />
|
||||
<input type="text" id="GenrePlaylists" name="GenrePlaylists" class="large" title="Comma separated list of genres for Auto Playlists"/><br />
|
||||
<label for="AutoAlbumSize">Auto Album Size (Default 15)</label><br />
|
||||
<input type="text" id="AutoAlbumSize" name="AutoAlbumSize" class="large" title="Number of Albums to Get on the Music Library tab"/><br />
|
||||
<label for="AutoPlaylistSize">Auto Playlist Size (Default 25)</label><br />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Global Variables
|
||||
// Global Variables
|
||||
var debug = false;
|
||||
var audio = null;
|
||||
var hostURL = location.href;
|
||||
|
@ -85,13 +85,15 @@ function loadTabContent(tab) {
|
|||
case '#tabPlaylists':
|
||||
if (debug) { console.log("TAG PLAYLIST"); }
|
||||
loadPlaylists();
|
||||
loadFolders();
|
||||
loadFolders();
|
||||
loadGenres();
|
||||
break;
|
||||
case '#tabPodcasts':
|
||||
if (debug) { console.log("TAG PODCAST"); }
|
||||
loadPodcasts();
|
||||
break;
|
||||
case '#tabPreferences':
|
||||
getGenres();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -130,6 +130,39 @@ function getMusicFolders() {
|
|||
}
|
||||
});
|
||||
}
|
||||
function getGenres() {
|
||||
var genres = 'Acid Rock,Acoustic,Alt Country,Alt/Indie,Alternative & Punk,Alternative Metal,Alternative,AlternRock,Awesome,Bluegrass,Blues,Blues-Rock,Classic Hard Rock,Classic Rock,Comedy,Country,Country-Rock,Dance,Dance-Rock,Deep Funk,Easy Listening,Electronic,Electronica,Electronica/Dance,Folk,Folk/Rock,Funk,Grunge,Hard Rock,Heavy Metal,Holiday,House,Improg,Indie Rock,Indie,International,Irish,Jam Band,Jam,Jazz Fusion,Jazz,Latin,Live Albums,Metal,Music,Oldies,Other,Pop,Pop/Rock,Post Rock,Progressive Rock,Psychedelic Rock,Psychedelic,Punk,R&B,Rap & Hip-Hop,Reggae,Rock & Roll,Rock,Rock/Pop,Roots,Ska,Soft Rock,Soul,Southern Rock,Thrash Metal,Unknown,Vocal,World';
|
||||
var genresArr = genres.split(',');
|
||||
var options = [];
|
||||
options.push('<option value="">[Select Genre]</option>');
|
||||
$.each(genresArr, function (i, genre) {
|
||||
options.push('<option value="' + genre + '">' + genre + '</option>');
|
||||
});
|
||||
$('#Genres').html(options.join(''));
|
||||
}
|
||||
function loadGenres(refresh) {
|
||||
if (debug) { console.log("LOAD GENRES"); }
|
||||
if (refresh) {
|
||||
$('#AutoPlaylistContainer').empty();
|
||||
}
|
||||
var content = $('#AutoPlaylistContainer').html();
|
||||
if (content === "") {
|
||||
var genres = $.cookie('GenrePlaylists');
|
||||
if (genres) {
|
||||
var genresArr = genres.split(',');
|
||||
//<li class="item" data-genre="Alternative"><span>Alternative</span><div class="floatright"><a class="play" title="Play" href="" data-genre="Alternative"></a></div><div class="floatright"><a class="add" title="Add To Current Playlist" href="" data-genre="Alternative"></a></div></li>
|
||||
$.each(genresArr, function (i, genre) {
|
||||
var html = "";
|
||||
html += '<li class=\"item\" data-genre=\"' + genre + '\">';
|
||||
html += '<span>' + genre + '</span>';
|
||||
html += '<div class=\"floatright\"><a class=\"play\" href=\"\" data-genre=\"' + genre + '\" title=\"Play\"></a></div>';
|
||||
html += '<div class=\"floatright\"><a class=\"add\" href=\"\" data-genre=\"' + genre + '\" title=\"Add To Current Playlist\"></a></div>';
|
||||
html += '</li>';
|
||||
$(html).appendTo("#AutoPlaylistContainer");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function getAlbums(id, action, appendto) {
|
||||
$('.first').trigger('click');
|
||||
$.ajax({
|
||||
|
@ -442,7 +475,6 @@ function loadFolders(refresh) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function loadPlaylists(refresh) {
|
||||
if (debug) { console.log("LOAD PLAYLISTS"); }
|
||||
if (refresh) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
//User config staff
|
||||
$('#Username').val($.cookie('username'));
|
||||
//$('#Password').val($.cookie('passwordenc'));
|
||||
$('#GenrePlaylists').val($.cookie('GenrePlaylists'));
|
||||
$('#AutoAlbumSize').val($.cookie('AutoAlbumSize'));
|
||||
$('#AutoPlaylistSize').val($.cookie('AutoPlaylistSize'));
|
||||
$('#Server').val($.cookie('Server'));
|
||||
|
@ -401,24 +402,24 @@ $(document).ready(function () {
|
|||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// Playlist Click Events
|
||||
$('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () {
|
||||
$('#AutoPlaylistContainer li').removeClass('selected');
|
||||
$('#PlaylistContainer li').removeClass('selected');
|
||||
$('#AutoPlaylistContainer li, #FolderContainer li, #PlaylistContainer li').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
var genre = $(this).data('genre');
|
||||
var folder = $(this).data('folder');
|
||||
var folder = $(this).data('folder');
|
||||
getRandomSongList('', '#TrackContainer', genre, folder);
|
||||
});
|
||||
$('#AutoPlaylistContainer li.item a.play, #FolderContainer li.item a.play').live('click', function () {
|
||||
var genre = $(this).data('genre');
|
||||
var folder = $(this).data('folder');
|
||||
var genre = $(this).data('genre');
|
||||
var folder = $(this).data('folder');
|
||||
getRandomSongList('autoplay', '#CurrentPlaylistContainer', genre, folder);
|
||||
return false;
|
||||
});
|
||||
$('#AutoPlaylistContainer li.item a.add, #FolderContainer li.item a.add').live('click', function () {
|
||||
var genre = $(this).data('genre');
|
||||
var folder = $(this).data('folder');
|
||||
var genre = $(this).data('genre');
|
||||
var folder = $(this).data('folder');
|
||||
getRandomSongList('', '#CurrentPlaylistContainer', genre, folder);
|
||||
return false;
|
||||
});
|
||||
|
@ -443,7 +444,7 @@ $(document).ready(function () {
|
|||
});
|
||||
$('#action_RefreshPlaylists').click(function () {
|
||||
loadPlaylists(true);
|
||||
loadFolders(true);
|
||||
loadFolders(true);
|
||||
return false;
|
||||
});
|
||||
$('#action_DeletePlaylist').click(function () {
|
||||
|
@ -464,6 +465,20 @@ $(document).ready(function () {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$('#action_RemoveSongs').click(function () {
|
||||
if ($('#TrackContainer tr.selected').length > 0) {
|
||||
$('#TrackContainer tr.selected').each(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#action_ShufflePlaylist').live('click', function () {
|
||||
$('#TrackContainer tbody tr.song').shuffle();
|
||||
refreshRowColor('#TrackContainer tbody');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Podcast Click Events
|
||||
$('#ChannelsContainer li.item').live('click', function () {
|
||||
$('#AutoChannelsContainer li').removeClass('selected');
|
||||
|
@ -488,20 +503,6 @@ $(document).ready(function () {
|
|||
loadPodcasts(true);
|
||||
return false;
|
||||
});
|
||||
// Current Playlist Click Events
|
||||
$('#action_RemoveSongs').click(function () {
|
||||
if ($('#TrackContainer tr.selected').length > 0) {
|
||||
$('#TrackContainer tr.selected').each(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#action_ShufflePlaylist').live('click', function () {
|
||||
$('#TrackContainer tbody tr.song').shuffle();
|
||||
refreshRowColor('#TrackContainer tbody');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Player Click Events
|
||||
$('#PlayTrack').live('click', function () {
|
||||
|
@ -578,10 +579,12 @@ $(document).ready(function () {
|
|||
if (password != "") {
|
||||
$.cookie('passwordenc', 'enc:' + HexEncode(password), { expires: 365 });
|
||||
}
|
||||
var GenrePlaylists = $('#GenrePlaylists').val();
|
||||
if (GenrePlaylists != '') { $.cookie('GenrePlaylists', GenrePlaylists, { expires: 365 }); }
|
||||
var AutoAlbumSize = $('#AutoAlbumSize').val();
|
||||
if (AutoAlbumSize != '') { $.cookie('AutoAlbumSize', AutoAlbumSize, { expires: 365 }); }
|
||||
var AutoPlaylistSize = $('#AutoPlaylistSize').val();
|
||||
$.cookie('AutoAlbumSize', AutoAlbumSize, { expires: 365 });
|
||||
$.cookie('AutoPlaylistSize', AutoPlaylistSize, { expires: 365 });
|
||||
if (AutoPlaylistSize != '') { $.cookie('AutoPlaylistSize', AutoPlaylistSize, { expires: 365 }); }
|
||||
var server = $('#Server').val();
|
||||
if (server != "") {
|
||||
$.cookie('Server', server, { expires: 365 });
|
||||
|
@ -592,6 +595,17 @@ $(document).ready(function () {
|
|||
}
|
||||
location.reload(true);
|
||||
});
|
||||
$('#Genres').live('change', function () {
|
||||
var genre = $(this).val();
|
||||
var currentGenres = $('#GenrePlaylists').val();
|
||||
var newGenres;
|
||||
if (currentGenres == '') {
|
||||
newGenres = genre;
|
||||
} else {
|
||||
newGenres = currentGenres + ', ' + genre;
|
||||
}
|
||||
$('#GenrePlaylists').val(newGenres);
|
||||
});
|
||||
$('#HideAZ').live('click', function () {
|
||||
if ($('#HideAZ').is(':checked')) {
|
||||
$.cookie('HideAZ', '1', { expires: 365 });
|
||||
|
@ -686,5 +700,5 @@ $(document).ready(function () {
|
|||
}
|
||||
}).disableSelection();
|
||||
|
||||
}); // End document.ready
|
||||
}); // End document.ready
|
||||
|
||||
|
|
|
@ -1114,6 +1114,10 @@ select
|
|||
margin: 5px;
|
||||
border: 1px solid #d6d6d6;
|
||||
}
|
||||
select.large
|
||||
{
|
||||
width: 192px;
|
||||
}
|
||||
select#SearchType
|
||||
{
|
||||
margin: 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue