2.1.6 Lots of nice things

This commit is contained in:
Trevor Squillario 2012-10-09 18:43:45 -04:00
parent 549fe25b7f
commit aefc7d04ba
15 changed files with 966 additions and 438 deletions

BIN
images/movie_gd_16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

View file

@ -38,18 +38,18 @@
<a href="#" id="logo" target="_blank"></a> <a href="#" id="logo" target="_blank"></a>
<div id="nav"> <div id="nav">
<ul class="tabs"> <ul class="tabs">
<li><a href="#tabLibrary" class="first" title="Library"><img src="images/headphones_gd_16x14.png" /></a></li> <li><a href="#tabLibrary" id="action_tabLibrary" class="first" title="Library"><img src="images/headphones_gd_16x14.png" /></a></li>
<li><a href="#tabCurrent" title="Current Playlist"><img src="images/play_alt_gd_16x16.png" /></a></li> <li><a href="#tabCurrent" id="action_tabCurrent" title="Current Playlist"><img src="images/play_alt_gd_16x16.png" /></a></li>
<li><a href="#tabPlaylists" title="Playlists"><img src="images/list_gd_16x14.png" /></a></li> <li><a href="#tabPlaylists" id="action_tabPlaylists" title="Playlists"><img src="images/list_gd_16x14.png" /></a></li>
<li><a href="#tabPodcasts" title="Podcasts"><img src="images/rss_16x16.png" /></a></li> <li><a href="#tabPodcasts" id="action_tabPodcasts" title="Podcasts"><img src="images/rss_16x16.png" /></a></li>
<li><a href="#tabPreferences" class="last" title="Preferences"><img src="images/cog_16x16.png" /></a></li> <li><a href="#tabPreferences" id="action_tabPreferences" class="last" title="Preferences"><img src="images/cog_16x16.png" /></a></li>
</ul> </ul>
<div class="toploading"></div> <div id="toploading"></div>
</div> </div>
<div id="content"> <div id="content">
<div id="tabLibrary" class="tabcontent"> <div id="tabLibrary" class="tabcontent">
<div class="actions floatleft"> <div class="actions floatleft">
<a href="#" class="button" id="action_RefreshArtists" title="Refresh Artist List"><img src="images/reload_9x11.png" /></a> <a href="#" class="button" id="action_RefreshArtists" title="Refresh Artist List"><img class="pad" src="images/reload_9x11.png" /></a>
<a href="#" class="button" id="action_DecreaseWidth" title="Decrease Width"><img src="images/minus_8x2.png" /></a> <a href="#" class="button" id="action_DecreaseWidth" title="Decrease Width"><img src="images/minus_8x2.png" /></a>
<a href="#" class="button" id="action_IncreaseWidth" title="Increase Width"><img src="images/plus_8x8.png" /></a> <a href="#" class="button" id="action_IncreaseWidth" title="Increase Width"><img src="images/plus_8x8.png" /></a>
</div> </div>
@ -68,7 +68,7 @@
<option value="song">Song</option> <option value="song">Song</option>
<option value="album">Album</option> <option value="album">Album</option>
</select> </select>
<a href="#" class="button" id="action_Search" title="Search"><img src="images/magnifying_glass_alt_12x12.png" /></a> <a href="#" class="button" id="action_Search" title="Search"><img class="pad" src="images/magnifying_glass_alt_12x12.png" /></a>
</div> </div>
<div id="Albums" class="lgsection floatleft"> <div id="Albums" class="lgsection floatleft">
<div class="loading"></div> <div class="loading"></div>
@ -107,6 +107,7 @@
<a href="#" class="button" id="action_CurrentSelectNone" title="Select None">None</a> <a href="#" class="button" id="action_CurrentSelectNone" title="Select None">None</a>
<a href="#" class="button" id="action_AddCurrentToPlaylist" title="Add Selected To Playlist">+ Playlist</a> <a href="#" class="button" id="action_AddCurrentToPlaylist" title="Add Selected To Playlist">+ Playlist</a>
<div id="submenu_AddCurrentToPlaylist" class="submenu shadow" style="display: none;"></div> <div id="submenu_AddCurrentToPlaylist" class="submenu shadow" style="display: none;"></div>
<a href="#" class="button" id="action_AutoPilot" title="Autopilot"><img class="pad" src="images/steering_wheel_gd_12x12.png" /></a>
</div> </div>
<div id="CurrentPlaylist" class="fullsection floatleft noselect"> <div id="CurrentPlaylist" class="fullsection floatleft noselect">
<table id="CurrentPlaylistContainer" class="simplelist songlist" cellspacing="1"> <table id="CurrentPlaylistContainer" class="simplelist songlist" cellspacing="1">
@ -114,16 +115,17 @@
<tbody></tbody> <tbody></tbody>
</table> </table>
</div> </div>
<div id="status"></div>
</div> </div>
<div id="tabPlaylists" class="tabcontent"> <div id="tabPlaylists" class="tabcontent">
<div class="actions floatleft"> <div class="actions floatleft">
<a href="#" class="button" id="action_RefreshPlaylists" title="Refresh Playlists"><img src="images/reload_9x11.png" /></a> <a href="#" class="button" id="action_RefreshPlaylists" title="Refresh Playlists"><img class="pad" src="images/reload_9x11.png" /></a>
</div> </div>
<div class="subactions floatleft"> <div class="subactions floatleft">
<a href="#" class="button" id="action_NewPlaylist" onclick="newPlaylist(); return false;" title="New Playlist">+ New</a> <a href="#" class="button" id="action_NewPlaylist" onclick="newPlaylist(); return false;" title="New Playlist">+ New</a>
<a href="#" class="button" id="action_DeletePlaylist" title="Delete Selected Playlist">Delete</a> <a href="#" class="button" id="action_DeletePlaylist" title="Delete Selected Playlist">Delete</a>
<a href="#" class="button" id="action_SavePlaylist" title="Save Playlist">Save</a> <a href="#" class="button" id="action_SavePlaylist" title="Save Playlist">Save</a>
<a href="#" class="button" id="action_ShufflePlaylist" title="Shuffle Playlist"><img src="images/fork_11x12.png" /></a> <a href="#" class="button" id="action_ShufflePlaylist" title="Shuffle Playlist"><img class="pad" src="images/fork_11x12.png" /></a>
<a href="#" class="button" id="action_RemoveSongs" title="Remove selected song(s) from playlist">Remove Song(s)</a> <a href="#" class="button" id="action_RemoveSongs" title="Remove selected song(s) from playlist">Remove Song(s)</a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
@ -147,7 +149,7 @@
</div> </div>
<div id="tabPodcasts" class="tabcontent"> <div id="tabPodcasts" class="tabcontent">
<div class="actions floatleft"> <div class="actions floatleft">
<a href="#" class="button" id="action_RefreshPodcasts" title="Refresh Podcasts"><img src="images/reload_9x11.png" /></a> <a href="#" class="button" id="action_RefreshPodcasts" title="Refresh Podcasts"><img class="pad" src="images/reload_9x11.png" /></a>
</div> </div>
<div class="subactions floatleft"> <div class="subactions floatleft">
</div> </div>
@ -191,6 +193,7 @@
<li><em>Spacebar</em> Play/Pause</li> <li><em>Spacebar</em> Play/Pause</li>
<li><em>&rarr;</em> Next Track</li> <li><em>&rarr;</em> Next Track</li>
<li><em>&larr;</em> Previous Track</li> <li><em>&larr;</em> Previous Track</li>
<li><em>-/_</em> Volume Down <em>=/+</em> Volume Up</li>
<li><span></span></li> <li><span></span></li>
</ul> </ul>
</div> </div>
@ -215,16 +218,7 @@
<div class="subsection floatleft"> <div class="subsection floatleft">
<div class="checkboxes"> <div class="checkboxes">
<fieldset> <fieldset>
<legend>Notifications [Beta]</legend> <legend class="aligncenter">Display</legend>
<div class="inputwrap"><input type="checkbox" id="Notification_Song" name="Notification_Song" value="1" title="Enable Notifications When Tracks Change"/></div>
<label for="Notification_Song">Song Change</label>
<div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="Notification_NowPlaying" name="Notification_NowPlaying" value="1" title="Enable Notifications When Other Users Play Songs"/></div>
<label for="Notification_Song">Now Playing</label>
</fieldset>
<div class="clear"></div>
<fieldset>
<legend>Display</legend>
<div class="inputwrap"><input type="checkbox" id="HideAZ" name="HideAZ" value="1" title="Hide A-Z at Bottom of Artists"/></div> <div class="inputwrap"><input type="checkbox" id="HideAZ" name="HideAZ" value="1" title="Hide A-Z at Bottom of Artists"/></div>
<label for="HideAZ">Hide A-Z</label> <label for="HideAZ">Hide A-Z</label>
<div class="clear"></div> <div class="clear"></div>
@ -233,17 +227,33 @@
</fieldset> </fieldset>
<div class="clear"></div> <div class="clear"></div>
<fieldset> <fieldset>
<legend>Advanced</legend> <legend class="aligncenter">Advanced</legend>
<div class="inputwrap"><input type="checkbox" id="Debug" name="Debug" value="1" title="Enable Debug Mode (Events will be logged to the Javascript Console)"/></div> <div class="inputwrap"><input type="checkbox" id="Debug" name="Debug" value="1" title="Enable Debug Mode (Events will be logged to the Javascript Console)"/></div>
<label for="Debug">Debug Mode</label> <label for="Debug">Debug Mode</label>
<div class="clear"></div> <div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="ForceFlash" name="ForceFlash" value="1" title="Force Flash (Option doesn't work with Chrome App)"/></div> <div class="inputwrap"><input type="checkbox" id="ForceFlash" name="ForceFlash" value="1" title="Force Flash (Option doesn't work with Chrome App)"/></div>
<label for="ForceFlash">Force Flash</label> <label for="ForceFlash">Force Flash</label>
</fieldset> </fieldset>
<div class="clear"></div>
<fieldset>
<legend class="aligncenter">HTML5 [Beta]</legend>
<span>Notifications</span><br />
<div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="Notification_Song" name="Notification_Song" value="1" title="Enable Notifications When Tracks Change"/></div>
<label for="Notification_Song">Song Change</label>
<div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="Notification_NowPlaying" name="Notification_NowPlaying" value="1" title="Enable Notifications When Other Users Play Songs"/></div>
<label for="Notification_Song">Now Playing</label>
<div class="clear"></div>
<span>Local Storage</span><br />
<div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="SaveTrackPosition" name="SaveTrackPosition" value="1" title="Saves Current Playlist & Track Position Periodically (Uses HTML5: localStorage)"/></div>
<label for="SaveTrackPosition">Save Current Position</label>
</fieldset>
</div> </div>
</div> </div>
<div id="donate" class="subsection floatleft"> <div id="donate" class="subsection floatleft">
<h3 class="title">Buy me a beer! I'd like that :)</h3> <h3 class="title">Buy me a <span class="beer">beer</span>! I'd like that :)</h3>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="VMTENRSJWQ234"> <input type="hidden" name="hosted_button_id" value="VMTENRSJWQ234">
@ -259,9 +269,22 @@
<ul id="ChangeLog" class="preferences"> <ul id="ChangeLog" class="preferences">
<!-- <!--
<li class="log"><span class="version"></span> <li class="log"><span class="version"></span>
<span class="changes"></span> <span class="changes">- </span>
</li> </li>
--> -->
<li class="log"><span class="version">10/8/2012 - 2.1.5</span>
<span class="changes">- Added song count and total time to Current Playlist</span>
<span class="changes">- Migrated to version 2 of Chrome App manifest.json</span>
<span class="changes">- Added to manifest.json > "content_security_policy": "script-src 'self' https://*/; object-src 'self'"</span>
</li>
<li class="log"><span class="version">10/7/2012 - 2.1.2</span>
<span class="changes">- Current Playlist will stay focused on the current track (Thanks <a href="https://github.com/tsquillario/MiniSub/issues/42" target="_blank">Concept211</a>)</span>
<span class="changes">- Option to save track position & the Current Playlist automatically, will persist on a browser refresh/close</span>
<span class="changes">- Added Autopilot feature to start playing random songs with one click, this will continue to load more songs</span>
<span class="changes">- Made it easier to skip to a certain position in the current song (Hover over the progress bar)</span>
<span class="changes">- Tab change fades in for a little eye candy</span>
<span class="changes">- Volume controls! Use the plus (=/+) and minus (-/_) keys</span>
</li>
<li class="log"><span class="version">9/30/2012 - 2.1</span> <li class="log"><span class="version">9/30/2012 - 2.1</span>
<span class="changes">Moved ratings to stars (5 star ratings will reappear eventually)</span> <span class="changes">Moved ratings to stars (5 star ratings will reappear eventually)</span>
</li> </li>
@ -360,8 +383,7 @@
<ul class="preferences"> <ul class="preferences">
<li>MiniSub on GitHub - <a href="https://github.com/tsquillario/MiniSub" target="_blank">https://github.com/tsquillario/MiniSub</a></li> <li>MiniSub on GitHub - <a href="https://github.com/tsquillario/MiniSub" target="_blank">https://github.com/tsquillario/MiniSub</a></li>
<li>MiniSub Chrome App - <a href="https://chrome.google.com/webstore/detail/jccdpflnecheidefpofmlblgebobbloc" target="_blank">Chrome Web Store</a></li> <li>MiniSub Chrome App - <a href="https://chrome.google.com/webstore/detail/jccdpflnecheidefpofmlblgebobbloc" target="_blank">Chrome Web Store</a></li>
<li><a href="https://twitter.com/tsquillario" class="twitter-follow-button" data-show-count="false">Follow @tsquillario</a> <li><a href="https://twitter.com/tsquillario" target="_blank">Follow @tsquillario</a>
<script> !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script></li>
</ul> </ul>
<h3 class="title">Thanks</h3> <h3 class="title">Thanks</h3>
<ul class="preferences"> <ul class="preferences">
@ -395,13 +417,19 @@
</div> </div>
<div id="songdetails"> <div id="songdetails">
<div id="coverart"><a id="coverartimage" href="images/albumdefault_120.jpg"><img src="images/albumdefault_56.jpg" alt=""/></a></div> <div id="coverart"><a id="coverartimage" href="images/albumdefault_120.jpg"><img src="images/albumdefault_56.jpg" alt=""/></a></div>
<ul> <ul id="songdetailstext">
<li id="songdetails_song" class="song" title=""></li> <li id="songdetails_song" class="song" title=""></li>
<li id="songdetails_artist" class="album" title=""></li> <li id="songdetails_artist" class="album" title=""></li>
</ul> </ul>
<div class="rate"><a id="songdetails_rate" class="rate" href="" title="Add To Favorites"></a></div> <div class="rate"><a id="songdetails_rate" class="rate" href="" title="Add To Favorites"></a></div>
<div class="vertshade"></div> <div class="vertshade"></div>
</div> </div>
<div id="submenu_CurrentPlaylist" class="submenu shadow" style="display: none;">
<table id="CurrentPlaylistPreviewContainer" class="simplelist songlist">
<thead></thead>
<tbody></tbody>
</table>
</div>
</div> </div>
<div class="playeractionssmall"><a href="#" class="button" id="action_ToggleSideBar" title="Toggle Side Bar"><img src="images/arrow_right_gl_12x12.png" /></a></div> <div class="playeractionssmall"><a href="#" class="button" id="action_ToggleSideBar" title="Toggle Side Bar"><img src="images/arrow_right_gl_12x12.png" /></a></div>
<div id="playermiddle"> <div id="playermiddle">

View file

@ -9,6 +9,7 @@ var password;
var passwordenc; var passwordenc;
var server; var server;
var smwidth; var smwidth;
var volume = 50;
//Sound manager //Sound manager
soundManager.url = 'js/sm/swf'; soundManager.url = 'js/sm/swf';
@ -81,6 +82,8 @@ function loadTabContent(tab) {
if (debug) { console.log("TAG CURRENT"); } if (debug) { console.log("TAG CURRENT"); }
var header = generateSongHeaderHTML(); var header = generateSongHeaderHTML();
$("#CurrentPlaylistContainer thead").html(header); $("#CurrentPlaylistContainer thead").html(header);
window.location.hash = '#tabCurrent';
updateStatus(countCurrentPlaylist('#CurrentPlaylistContainer'));
break; break;
case '#tabPlaylists': case '#tabPlaylists':
if (debug) { console.log("TAG PLAYLIST"); } if (debug) { console.log("TAG PLAYLIST"); }
@ -92,6 +95,10 @@ function loadTabContent(tab) {
if (debug) { console.log("TAG PODCAST"); } if (debug) { console.log("TAG PODCAST"); }
loadPodcasts(); loadPodcasts();
break; break;
case '#tabVideos':
if (debug) { console.log("TAG VIDEOS"); }
loadVideos(true);
break;
case '#tabPreferences': case '#tabPreferences':
getGenres(); getGenres();
break; break;

View file

@ -1,8 +1,8 @@
function ping() { function ping() {
$.ajax({ $.ajax({
url: baseURL + '/ping.view?u=' + username + '&p=' + password + '&v=1.6.0&c=' + applicationName + '&f=jsonp', url: baseURL + '/ping.view?u=' + username + '&p=' + password + '&v=1.6.0&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].status == 'ok') { if (data["subsonic-response"].status == 'ok') {
@ -19,11 +19,11 @@ function loadArtists(id, refresh) {
} }
var url; var url;
if (id == "all") { if (id == "all") {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp'; url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json';
} else if (id) { } else if (id) {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&musicFolderId=' + id; url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&musicFolderId=' + id;
} else { } else {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp'; url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json';
} }
if (debug) { console.log(url); } if (debug) { console.log(url); }
var content = $('#ArtistContainer').html(); var content = $('#ArtistContainer').html();
@ -32,7 +32,7 @@ function loadArtists(id, refresh) {
$.ajax({ $.ajax({
url: url, url: url,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
done: function () { if (debug) { console.log("DONE!"); } }, done: function () { if (debug) { console.log("DONE!"); } },
error: function () { if (debug) { console.log("ERROR!"); } }, error: function () { if (debug) { console.log("ERROR!"); } },
@ -111,9 +111,9 @@ function loadArtists(id, refresh) {
} }
function getMusicFolders() { function getMusicFolders() {
$.ajax({ $.ajax({
url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].musicFolders.musicFolder !== undefined) { if (data["subsonic-response"].musicFolders.musicFolder !== undefined) {
@ -180,19 +180,22 @@ function loadAutoPlaylists(refresh) {
} }
} }
function getAlbums(id, action, appendto) { function getAlbums(id, action, appendto) {
$('.first').trigger('click');
$.ajax({ $.ajax({
url: baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, url: baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (action === '') { if (action == '') {
$('#AlbumRows').empty(); $('#AlbumRows').empty();
} }
if (action === 'autoplay') { if (action === 'autoplay') {
$('#CurrentPlaylistContainer tbody').empty(); $('#CurrentPlaylistContainer tbody').empty();
} }
if (action == 'link') {
$('#AlbumRows').empty();
$('#action_tabLibrary').trigger('click');
}
if (data["subsonic-response"].directory.child !== undefined) { if (data["subsonic-response"].directory.child !== undefined) {
// There is a bug in the API that doesn't return a JSON array for one artist // There is a bug in the API that doesn't return a JSON array for one artist
var children = []; var children = [];
@ -240,9 +243,9 @@ function getAlbumListBy(id) {
size = $.cookie('AutoAlbumSize'); size = $.cookie('AutoAlbumSize');
} }
$.ajax({ $.ajax({
url: baseURL + '/getAlbumList.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&size=' + size + '&type=' + id, url: baseURL + '/getAlbumList.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=' + size + '&type=' + id,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].albumList.album !== undefined) { if (data["subsonic-response"].albumList.album !== undefined) {
@ -282,15 +285,15 @@ function getAlbumListBy(id) {
function getRandomSongList(action, appendto, genre, folder) { function getRandomSongList(action, appendto, genre, folder) {
var size, gstring; var size, gstring;
gstring = ''; gstring = '';
if ($.cookie('AutoPlaylistSize') === null) { if ($.cookie('AutoPlaylistSize')) {
size = 25;
} else {
size = $.cookie('AutoPlaylistSize'); size = $.cookie('AutoPlaylistSize');
} else {
size = 25;
} }
if (genre !== undefined) { if (genre !== undefined && genre != '') {
gstring = '&genre=' + genre; gstring = '&genre=' + genre;
} }
if (genre === 'Random') { if (genre == 'Random') {
gstring = ''; gstring = '';
} }
if (folder !== undefined) { if (folder !== undefined) {
@ -300,16 +303,18 @@ function getRandomSongList(action, appendto, genre, folder) {
getStarred(action, appendto, 'song'); getStarred(action, appendto, 'song');
} else { } else {
$.ajax({ $.ajax({
url: baseURL + '/getRandomSongs.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&size=' + size + gstring, url: baseURL + '/getRandomSongs.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=' + size + gstring,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].randomSongs.song !== undefined) { if (data["subsonic-response"].randomSongs.song !== undefined) {
if (appendto === '#TrackContainer') { if (appendto == '#TrackContainer tbody') {
$("#TrackContainer").empty(); $("#TrackContainer tbody").empty();
var header = generateSongHeaderHTML();
$("#TrackContainer thead").html(header);
} }
if (action === 'autoplay') { if (action == 'autoplay') {
$("#TrackContainer").empty(); $("#TrackContainer").empty();
$(appendto).empty(); $(appendto).empty();
} }
@ -332,17 +337,18 @@ function getRandomSongList(action, appendto, genre, folder) {
var track, starred; var track, starred;
if (item.starred !== undefined) { starred = true; } else { starred = false; } if (item.starred !== undefined) { starred = true; } else { starred = false; }
if (item.track === undefined) { track = "&nbsp;"; } else { track = item.track; } if (item.track === undefined) { track = "&nbsp;"; } else { track = item.track; }
var time = secondsToTime(item.duration); html = generateSongHTML(rowcolor, item.id, item.parent, track, item.title, '', item.artist, item.album, item.coverArt, item.userRating, starred, item.duration);
html = generateSongHTML(rowcolor, item.id, item.parent, track, item.title, item.artist, item.album, item.coverArt, item.userRating, starred, time);
$(html).appendTo(appendto); $(html).appendTo(appendto);
}); });
if (appendto === '#TrackContainer') { if (appendto === '#TrackContainer tbody') {
updateMessage(items.length + ' Song(s)'); updateMessage(countCurrentPlaylist('#TrackContainer'));
} }
if (appendto === '#CurrentPlaylistContainer') { if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added'); updateMessage(items.length + ' Song(s) Added');
} }
if (action === 'autoplay') { if (action == '' && genre == '' && folder == '') {
nextPlay();
} else if (action == 'autoplay') {
autoPlay(); autoPlay();
} }
} else { } else {
@ -354,23 +360,25 @@ function getRandomSongList(action, appendto, genre, folder) {
} }
function getStarred(action, appendto, type) { function getStarred(action, appendto, type) {
var size; var size;
if ($.cookie('AutoPlaylistSize') === null) { if ($.cookie('AutoPlaylistSize')) {
size = 25;
} else {
size = $.cookie('AutoPlaylistSize'); size = $.cookie('AutoPlaylistSize');
} else {
size = 25;
} }
$.ajax({ $.ajax({
url: baseURL + '/getStarred.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&size=' + size, url: baseURL + '/getStarred.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=' + size,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].starred !== undefined) { if (data["subsonic-response"].starred !== undefined) {
if (appendto === '#TrackContainer') { if (appendto === '#TrackContainer tbody') {
$("#TrackContainer").empty(); $("#TrackContainer tbody").empty();
var header = generateSongHeaderHTML();
$("#TrackContainer thead").html(header);
} }
if (action === 'autoplay') { if (action === 'autoplay') {
$("#TrackContainer").empty(); $("#TrackContainer tbody").empty();
$(appendto).empty(); $(appendto).empty();
} }
// There is a bug in the API that doesn't return a JSON array for one artist // There is a bug in the API that doesn't return a JSON array for one artist
@ -433,13 +441,13 @@ function getStarred(action, appendto, type) {
} }
$(html).appendTo(appendto); $(html).appendTo(appendto);
}); });
if (appendto === '#TrackContainer') { if (appendto == '#TrackContainer tbody') {
updateMessage(items.length + ' Song(s)'); updateMessage(countCurrentPlaylist('#TrackContainer'));
} }
if (appendto === '#CurrentPlaylistContainer') { if (appendto == '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added'); updateMessage(items.length + ' Song(s) Added');
} }
if (action === 'autoplay') { if (action == 'autoplay') {
autoPlay(); autoPlay();
} }
} else { } else {
@ -454,9 +462,9 @@ function updateNowPlaying(showPopup) {
updaterNowPlaying = $.periodic({ period: 4000, decay: 1.5, max_period: 30000 }, function () { updaterNowPlaying = $.periodic({ period: 4000, decay: 1.5, max_period: 30000 }, function () {
$.ajax({ $.ajax({
periodic: this, periodic: this,
url: baseURL + '/getNowPlaying.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getNowPlaying.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].nowPlaying.entry === undefined) { if (data["subsonic-response"].nowPlaying.entry === undefined) {
@ -491,7 +499,7 @@ function updateNowPlaying(showPopup) {
if (msg.coverArt === undefined) { if (msg.coverArt === undefined) {
coverartSrc = 'images/albumdefault_50.jpg'; coverartSrc = 'images/albumdefault_50.jpg';
} else { } else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=50&id=' + msg.coverArt; coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=50&id=' + msg.coverArt;
} }
if ($.cookie('Notification_NowPlaying')) { if ($.cookie('Notification_NowPlaying')) {
var sid = msg.username + '-' + msg.id; var sid = msg.username + '-' + msg.id;
@ -512,9 +520,9 @@ function stopUpdateNowPlaying() {
function search(type, query) { function search(type, query) {
$.ajax({ $.ajax({
url: baseURL + '/search2.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&query=' + query, url: baseURL + '/search2.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&query=' + query,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].searchResult2 !== "") { if (data["subsonic-response"].searchResult2 !== "") {
@ -557,8 +565,7 @@ function search(type, query) {
var track, starred; var track, starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; } if (child.starred !== undefined) { starred = true; } else { starred = false; }
if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; } if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; }
var time = secondsToTime(child.duration); albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, starred, time);
} }
$(albumhtml).appendTo("#AlbumRows"); $(albumhtml).appendTo("#AlbumRows");
}); });
@ -576,9 +583,9 @@ function loadFolders(refresh) {
if (content === "") { if (content === "") {
// Load Folders // Load Folders
$.ajax({ $.ajax({
url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var musicFolders = []; var musicFolders = [];
@ -609,12 +616,13 @@ function loadPlaylists(refresh) {
if (content === "") { if (content === "") {
// Load Playlists // Load Playlists
$.ajax({ $.ajax({
url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var playlists = []; var playlists = [];
if (data["subsonic-response"].playlists.playlist !== undefined) {
if (data["subsonic-response"].playlists.playlist.length > 0) { if (data["subsonic-response"].playlists.playlist.length > 0) {
playlists = data["subsonic-response"].playlists.playlist; playlists = data["subsonic-response"].playlists.playlist;
} else { } else {
@ -634,15 +642,16 @@ function loadPlaylists(refresh) {
resizeSMSection(0); resizeSMSection(0);
} }
} }
}
}); });
} }
} }
function loadPlaylistsForMenu(menu) { function loadPlaylistsForMenu(menu) {
$('#' + menu).empty(); $('#' + menu).empty();
$.ajax({ $.ajax({
url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var playlists = []; var playlists = [];
@ -653,20 +662,10 @@ function loadPlaylistsForMenu(menu) {
playlists[0] = data["subsonic-response"].playlists.playlist; playlists[0] = data["subsonic-response"].playlists.playlist;
} }
} }
if (menu === 'submenu_AddCurrentToPlaylist') { $("<a href=\"#\" childid=\"new\">+ New</a><br />").appendTo("#" + menu);
$("<a href=\"#\" onclick=\"javascript:addToPlaylist('new', 'current'); return false;\">+ New</a><br />").appendTo("#" + menu);
} else {
$("<a href=\"#\" onclick=\"javascript:addToPlaylist('new', ''); return false;\">+ New</a><br />").appendTo("#" + menu);
}
$.each(playlists, function (i, playlist) { $.each(playlists, function (i, playlist) {
if (menu === 'submenu_AddCurrentToPlaylist') { $('<a href=\"#\" childid=\"' + playlist.id + '\">' + playlist.name + '</a><br />').appendTo("#" + menu);
$("<a href=\"#\" onclick=\"javascript:addToPlaylist('" + playlist.id + "', 'current'); return false;\">" + playlist.name + "</a><br />").appendTo("#" + menu);
} else {
$("<a href=\"#\" onclick=\"javascript:addToPlaylist('" + playlist.id + "', ''); return false;\">" + playlist.name + "</a><br />").appendTo("#" + menu);
}
}); });
//$("<a href=\"#\" onclick=\"javascript:addToPlaylist('new'); return false;\">+ New Playlist</a><br />").appendTo("#submenu");
} }
}); });
} }
@ -674,9 +673,9 @@ function newPlaylist() {
var reply = prompt("Choose a name for your new playlist.", ""); var reply = prompt("Choose a name for your new playlist.", "");
if (reply != null || reply != "") { if (reply != null || reply != "") {
$.ajax({ $.ajax({
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&name=' + reply, url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&name=' + reply,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
loadPlaylists(true); loadPlaylists(true);
@ -686,9 +685,9 @@ function newPlaylist() {
} }
function deletePlaylist(id) { function deletePlaylist(id) {
$.ajax({ $.ajax({
url: baseURL + '/deletePlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, url: baseURL + '/deletePlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
loadPlaylists(true); loadPlaylists(true);
@ -712,9 +711,9 @@ function addToPlaylist(playlistid, from) {
// Get songs from playlist // Get songs from playlist
var currentsongs = []; var currentsongs = [];
$.ajax({ $.ajax({
url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + playlistid, url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + playlistid,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
// There is a bug in the API that doesn't return a JSON array for one artist // There is a bug in the API that doesn't return a JSON array for one artist
@ -744,9 +743,9 @@ function addToPlaylist(playlistid, from) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/updatePlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/updatePlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", playlistId: playlistid, songIdToAdd: selected }, data: { v: version, c: applicationName, f: "json", playlistId: playlistid, songIdToAdd: selected },
success: function () { success: function () {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
@ -759,9 +758,9 @@ function addToPlaylist(playlistid, from) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", playlistId: playlistid, songId: currentsongs }, data: { v: version, c: applicationName, f: "json", playlistId: playlistid, songId: currentsongs },
success: function () { success: function () {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
@ -780,9 +779,9 @@ function addToPlaylist(playlistid, from) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", name: "" + reply + "", songId: selected }, data: { v: version, c: applicationName, f: "json", name: "" + reply + "", songId: selected },
success: function () { success: function () {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
@ -807,14 +806,66 @@ function addToCurrent(addAll) {
if (addAll) { if (addAll) {
$('#AlbumContainer tr.song').each(function (index) { $('#AlbumContainer tr.song').each(function (index) {
$(this).clone().appendTo('#CurrentPlaylistContainer tbody'); $(this).clone().appendTo('#CurrentPlaylistContainer tbody');
updateMessage(count + ' Song(s) Added');
}); });
} else { } else {
$('#AlbumContainer tr.selected').each(function (index) { $('#AlbumContainer tr.selected').each(function (index) {
$(this).clone().appendTo('#CurrentPlaylistContainer tbody'); $(this).clone().appendTo('#CurrentPlaylistContainer tbody');
updateMessage(count + ' Song(s) Added');
}); });
} }
updateMessage(count + ' Song(s) Added');
}
}
function countCurrentPlaylist(container) {
var total = $(container + ' tr.song').size();
if (total > 0) {
var time = 0;
$(container + ' tr.song').each(function (index) {
var duration = $(this).attr('duration');
if (duration !== undefined && duration != '') {
time += parseInt(duration);
}
});
return total + ' song(s), ' + secondsToTime(time) + ' total time';
} else {
return '';
}
}
function saveCurrentPlaylist() {
if (browserStorageCheck) {
var html = localStorage.getItem('CurrentPlaylist');
var current = $('#CurrentPlaylistContainer tbody').html();
if (current != '' && current != html) {
try {
localStorage.setItem('CurrentPlaylist', current);
if (debug) { console.log('Saving Current Playlist: ' + current.length + ' characters'); }
} catch (e) {
if (e == QUOTA_EXCEEDED_ERR) {
alert('Quota exceeded!');
}
}
}
} else {
if (debug) { console.log('HTML5::loadStorage not supported on your browser' + html.length + ' characters'); }
}
}
function deleteCurrentPlaylist() {
if (browserStorageCheck) {
localStorage.removeItem('CurrentPlaylist');
$.cookie('CurrentSong', null);
if (debug) { console.log('Removing Current Playlist'); }
} else {
if (debug) { console.log('HTML5::loadStorage not supported on your browser' + html.length + ' characters'); }
}
}
function loadCurrentPlaylist() {
if (browserStorageCheck) {
var html = localStorage.getItem('CurrentPlaylist');
if (html != '' && html !== undefined && html !== null) {
$('#CurrentPlaylistContainer tbody').html(html);
if (debug) { console.log('Load Current Playlist From localStorage: ' + html.length + ' characters'); }
}
} else {
if (debug) { console.log('HTML5::loadStorage not supported on your browser' + html.length + ' characters'); }
} }
} }
function downloadItem(id, type) { function downloadItem(id, type) {
@ -826,7 +877,7 @@ function downloadItem(id, type) {
reqDownload = 'playlistUtf8Hex=' + id; reqDownload = 'playlistUtf8Hex=' + id;
} }
if (reqDownload) { if (reqDownload) {
url = baseURL + '/download.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&' + reqDownload; url = baseURL + '/download.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&' + reqDownload;
window.location = url; window.location = url;
} }
} }
@ -839,9 +890,9 @@ function savePlaylist(playlistid) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", playlistId: playlistid, songId: songs }, data: { v: version, c: applicationName, f: "json", playlistId: playlistid, songId: songs },
success: function () { success: function () {
getPlaylist(playlistid); getPlaylist(playlistid);
updateMessage('Playlist Updated!'); updateMessage('Playlist Updated!');
@ -852,9 +903,9 @@ function savePlaylist(playlistid) {
} }
function getPlaylist(id, action, appendto) { function getPlaylist(id, action, appendto) {
$.ajax({ $.ajax({
url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].playlist.entry !== undefined) { if (data["subsonic-response"].playlist.entry !== undefined) {
@ -887,12 +938,11 @@ function getPlaylist(id, action, appendto) {
var track, starred; var track, starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; } if (child.starred !== undefined) { starred = true; } else { starred = false; }
if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; } if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; }
var time = secondsToTime(child.duration); html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, starred, time);
$(html).appendTo(appendto); $(html).appendTo(appendto);
}); });
if (appendto === '#TrackContainer tbody') { if (appendto === '#TrackContainer tbody') {
updateMessage(count + ' Song(s)'); updateMessage(countCurrentPlaylist('#TrackContainer'));
} }
if (appendto === '#CurrentPlaylistContainer tbody') { if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(children.length + ' Song(s) Added'); updateMessage(children.length + ' Song(s) Added');
@ -918,12 +968,13 @@ function loadPodcasts(refresh) {
if (content === "") { if (content === "") {
// Load Podcasts // Load Podcasts
$.ajax({ $.ajax({
url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var podcasts = []; var podcasts = [];
if (data["subsonic-response"].podcasts.channel !== undefined) {
if (data["subsonic-response"].podcasts.channel.length > 0) { if (data["subsonic-response"].podcasts.channel.length > 0) {
podcasts = data["subsonic-response"].podcasts.channel; podcasts = data["subsonic-response"].podcasts.channel;
} else { } else {
@ -945,14 +996,15 @@ function loadPodcasts(refresh) {
resizeSMSection(0); resizeSMSection(0);
} }
} }
}
}); });
} }
} }
function getPodcast(id, action, appendto) { function getPodcast(id, action, appendto) {
$.ajax({ $.ajax({
url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp', url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var podcasts = []; var podcasts = [];
@ -995,8 +1047,10 @@ function getPodcast(id, action, appendto) {
var description = 'Published: ' + date + '\n\n'; var description = 'Published: ' + date + '\n\n';
description += child.description; description += child.description;
var starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
var time = secondsToTime(child.duration); var time = secondsToTime(child.duration);
html = generatePodcastHTML(rowcolor, child.streamId, child.parent, child.track, child.title, description, child.artist, child.album, child.coverArt, child.userRating, time); html = generateSongHTML(rowcolor, child.streamId, child.parent, child.track, child.title, description, child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
$(html).appendTo(appendto); $(html).appendTo(appendto);
count++; count++;
}); });
@ -1017,12 +1071,59 @@ function getPodcast(id, action, appendto) {
} }
}); });
} }
function parseDate(date) { function loadVideos(refresh) {
// input: "2012-09-23 20:00:00.0" if (debug) { console.log("LOAD PODCASTS"); }
var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; if (refresh) {
var parts = date.split(" "); $('#VideoContainer').empty();
var dateParts = parts[0].split("-"); }
var month = parseInt(dateParts[1], 10) - 1; var content = $('#VideoContainer').html();
var date = months[month] + " " + dateParts[2] + ", " + dateParts[0]; if (content == "") {
return date; // Load Videos
$.ajax({
url: baseURL + '/getVideos.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json',
method: 'GET',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].videos != '') {
var videos = [];
if (data["subsonic-response"].videos.length > 0) {
videos = data["subsonic-response"].videos;
} else {
videos[0] = data["subsonic-response"].videos.video;
}
var rowcolor;
$.each(videos, function (i, video) {
var html;
if (i % 2 === 0) {
rowcolor = 'even';
} else {
rowcolor = 'odd';
}
html = '<tr class=\"song ' + rowcolor + '\" childid=\"' + video.id + '\" parentid=\"' + video.parent + '\" userrating=\"\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>';
html += '<a class=\"remove\" href=\"\" title=\"Remove\"></a>';
html += '<a class=\"play\" href=\"\" title=\"Play\"></a>';
html += '<a class=\"download\" href=\"\" title=\"Download\"></a>';
html += '</td>';
html += '<td class=\"track\"></td>';
html += '<td class=\"title\">' + video.title + '</td>';
html += '<td class=\"artist\"></td>';
var coverartSrc;
if (video.coverArt === undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=25&id=' + video.coverArt;
}
var time = secondsToTime(video.duration);
html += '<td class=\"album\"><img src=\"' + coverartSrc + '\" />' + video.album + '</td>';
html += '<td class=\"time\">' + time + '</td>';
html += '</tr>';
$(html).appendTo("#VideoContainer");
});
}
}
});
}
} }

View file

@ -4,9 +4,9 @@ function updateChatMessages() {
updater = $.periodic({ period: 1000, decay: 1.5, max_period: 1800000 }, function () { updater = $.periodic({ period: 1000, decay: 1.5, max_period: 1800000 }, function () {
$.ajax({ $.ajax({
periodic: this, periodic: this,
url: baseURL + '/getChatMessages.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&since=' + starttime, url: baseURL + '/getChatMessages.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&since=' + starttime,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
if (data["subsonic-response"].chatMessages.chatMessage === undefined) { if (data["subsonic-response"].chatMessages.chatMessage === undefined) {
@ -50,9 +50,9 @@ function addChatMessage(msg) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/addChatMessage.view?u=' + username + '&p=' + password, url: baseURL + '/addChatMessage.view?u=' + username + '&p=' + password,
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", message: msg }, data: { v: version, c: applicationName, f: "json", message: msg },
success: function () { success: function () {
updater.reset(); updater.reset();
}, },

View file

@ -7,8 +7,7 @@ function generateRowHTML(child, appendto, rowcolor) {
} else { } else {
var track; var track;
if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; } if (child.track === undefined) { track = "&nbsp;"; } else { track = child.track; }
var time = secondsToTime(child.duration); albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, starred, time);
} }
return albumhtml; return albumhtml;
} }
@ -32,7 +31,7 @@ function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist,
if (coverart == undefined) { if (coverart == undefined) {
html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>'; html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>';
} else { } else {
html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=50&id=' + coverart + '\" /></td>'; html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>';
} }
html += '<td class=\"album\">' + title + '</td>'; html += '<td class=\"album\">' + title + '</td>';
html += '<td class=\"artist\">' + artist + '</td>'; html += '<td class=\"artist\">' + artist + '</td>';
@ -44,9 +43,10 @@ function generateSongHeaderHTML() {
html = '<tr><th></th><th>Track</th><th>Title</th><th>Artist</th><th>Album</th><th class=\"alignright\">Time</th></tr>'; html = '<tr><th></th><th>Track</th><th>Title</th><th>Artist</th><th>Album</th><th class=\"alignright\">Time</th></tr>';
return html; return html;
} }
function generateSongHTML(rowcolor, childid, parentid, track, title, artist, album, coverart, rating, starred, time) { function generateSongHTML(rowcolor, childid, parentid, track, title, description, artist, album, coverart, rating, starred, duration) {
var time = secondsToTime(duration);
var html; var html;
html = '<tr class=\"song ' + rowcolor + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" userrating=\"' + rating + '\">'; html = '<tr class=\"song ' + rowcolor + '\" id=\"' + childid + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" duration=\"' + duration + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>'; html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>';
html += '<a class=\"remove\" href=\"\" title=\"Remove\"></a>'; html += '<a class=\"remove\" href=\"\" title=\"Remove\"></a>';
html += '<a class=\"play\" href=\"\" title=\"Play\"></a>'; html += '<a class=\"play\" href=\"\" title=\"Play\"></a>';
@ -58,42 +58,19 @@ function generateSongHTML(rowcolor, childid, parentid, track, title, artist, alb
} }
html += '</td>'; html += '</td>';
html += '<td class=\"track\">' + track + '</td>'; html += '<td class=\"track\">' + track + '</td>';
if (description != '' && description != null) {
html += '<td class=\"title\" title=\"' + toHTML.on(description) + '\">' + title + '</td>';
} else {
html += '<td class=\"title\">' + title + '</td>'; html += '<td class=\"title\">' + title + '</td>';
}
html += '<td class=\"artist\">' + artist + '</td>'; html += '<td class=\"artist\">' + artist + '</td>';
var coverartSrc; var coverartSrc;
if (coverart == undefined) { if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg'; coverartSrc = 'images/albumdefault_25.jpg';
} else { } else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=25&id=' + coverart; coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=25&id=' + coverart;
} }
html += '<td class=\"album\"><a href="javascript:getAlbums(\'' + parentid + '\',\'\',\'#AlbumRows\')"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>'; html += '<td class=\"album\"><a href="#" class=\"albumlink\"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>';
html += '<td class=\"time\">' + time + '</td>';
html += '</tr>';
return html;
}
function generatePodcastHTML(rowcolor, childid, parentid, track, title, description, artist, album, coverart, rating, time) {
var html;
html = '<tr class=\"song ' + rowcolor + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>';
html += '<a class=\"remove\" href=\"\" title=\"Remove\"></a>';
html += '<a class=\"play\" href=\"\" title=\"Play\"></a>';
html += '<a class=\"download\" href=\"\" title=\"Download\"></a>';
if (rating === 5) {
html += '<a class=\"favorite\" href=\"\" title=\"Favorite\"></a>';
} else {
html += '<a class=\"rate\" href=\"\" title=\"Add To Favorites\"></a>';
}
html += '</td>';
html += '<td class=\"track\">' + track + '</td>';
html += '<td class=\"title\" title=\"' + description + '\">' + title + '</td>';
html += '<td class=\"artist\">' + artist + '</td>';
var coverartSrc;
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=25&id=' + coverart;
}
html += '<td class=\"album\"><a href="javascript:getAlbums(\'' + parentid + '\',\'\',\'#AlbumRows\')"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>';
html += '<td class=\"time\">' + time + '</td>'; html += '<td class=\"time\">' + time + '</td>';
html += '</tr>'; html += '</tr>';
return html; return html;

View file

@ -1,14 +1,14 @@
var scrobbled = false; var scrobbled = false;
function playSong(el, songid, albumid) { function playSong(el, songid, albumid, position, loadonly) {
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + albumid; ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + albumid;
if (debug) { console.log(ajaxUrl) } if (debug) { console.log(ajaxUrl) }
$.ajax({ $.ajax({
url: ajaxUrl, url: ajaxUrl,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (data) { success: function (data) {
var title, artist, album, rating; var title, artist, album, rating, starred;
if (data["subsonic-response"].directory.child !== undefined) { if (data["subsonic-response"].directory.child !== undefined) {
// There is a bug in the API that doesn't return a JSON array for one artist // There is a bug in the API that doesn't return a JSON array for one artist
var children = []; var children = [];
@ -24,10 +24,11 @@ function playSong(el, songid, albumid) {
album = child.album; album = child.album;
coverart = child.coverArt; coverart = child.coverArt;
rating = child.userRating; rating = child.userRating;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
} }
}); });
} }
if (rating == 5) { if (starred) {
$('#songdetails_rate').attr('class', 'favorite'); $('#songdetails_rate').attr('class', 'favorite');
} else { } else {
$('#songdetails_rate').attr('class', 'rate'); $('#songdetails_rate').attr('class', 'rate');
@ -40,16 +41,17 @@ function playSong(el, songid, albumid) {
$('#songdetails_artist').attr('title', artist + ' - ' + album); $('#songdetails_artist').attr('title', artist + ' - ' + album);
var coverartSrc, coverartFullSrc; var coverartSrc, coverartFullSrc;
if (coverart == undefined) { if (coverart == undefined) {
coverartSrc = 'images/albumdefault_50.jpg'; coverartSrc = 'images/albumdefault_56.jpg';
coverartFullSrc = ''; coverartFullSrc = '';
} else { } else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=50&id=' + coverart; coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=56&id=' + coverart;
coverartFullSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + coverart; coverartFullSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&id=' + coverart;
} }
$('#coverartimage').attr('href', coverartFullSrc); $('#coverartimage').attr('href', coverartFullSrc);
$('#coverartimage img').attr('src', coverartSrc); $('#coverartimage img').attr('src', coverartSrc);
$('#playermiddle').css('visibility', 'visible'); $('#playermiddle').css('visibility', 'visible');
$('#songdetails').css('visibility', 'visible'); $('#songdetails').css('visibility', 'visible');
if (!loadonly) { // Sometimes we only want to load the track and not play
// SoundManager Initialize // SoundManager Initialize
var salt = Math.floor(Math.random() * 100000); var salt = Math.floor(Math.random() * 100000);
soundManager.onready(function () { soundManager.onready(function () {
@ -71,6 +73,7 @@ function playSong(el, songid, albumid) {
var scrubber = $('#audio_wrapper0').find(".scrubber"); var scrubber = $('#audio_wrapper0').find(".scrubber");
var loaded = $('#audio_wrapper0').find(".loaded"); var loaded = $('#audio_wrapper0').find(".loaded");
loaded.css('width', (scrubber.get(0).offsetWidth * percent) + 'px'); loaded.css('width', (scrubber.get(0).offsetWidth * percent) + 'px');
loaded.attr('title', Math.round(percent * 100) + '% loaded');
}, },
whileplaying: function () { whileplaying: function () {
//if (debug) { console.log('position:' + this.position + ' duration:' + this.duration); } //if (debug) { console.log('position:' + this.position + ' duration:' + this.duration); }
@ -106,6 +109,12 @@ function playSong(el, songid, albumid) {
position: position position: position
}); });
}); });
scrubber.mouseover(function (e) {
$('.audiojs .scrubber').stop().animate({ height: '8px' });
});
scrubber.mouseout(function (e) {
$('.audiojs .scrubber').stop().animate({ height: '4px' });
});
}, },
onpause: function () { onpause: function () {
if (debug) { console.log('Pause Event: ' + ' playState:' + this.playState + ', readyState:' + this.readyState + ', position:' + this.position + ', duration:' + this.duration + ', durationEstimate:' + this.durationEstimate + ', isBuffering:' + this.isBuffering); } if (debug) { console.log('Pause Event: ' + ' playState:' + this.playState + ', readyState:' + this.readyState + ', position:' + this.position + ', duration:' + this.duration + ', durationEstimate:' + this.durationEstimate + ', isBuffering:' + this.isBuffering); }
@ -118,14 +127,35 @@ function playSong(el, songid, albumid) {
}, },
onfinish: function () { onfinish: function () {
var next = $('#CurrentPlaylistContainer tr.playing').next(); var next = $('#CurrentPlaylistContainer tr.playing').next();
changeTrack(next); if (!changeTrack(next)) {
if ($.cookie('AutoPilot')) {
//var genre = $(this).data('genre');
//var folder = $(this).data('folder');
getRandomSongList('', '#CurrentPlaylistContainer tbody', '', '');
}
}
},
ontimeout: function (status) {
if (debug) { console.log('The status is ' + status.success + ', the error type is ' + status.error.type); }
} }
}); });
if (position == 0) {
soundManager.play('audio'); soundManager.play('audio');
} else {
var p = position;
//soundManager.play('audio', { position: p });
seekAndPlay('audio', p);
}
var submenu = $('div#submenu_CurrentPlaylist');
if (submenu.is(":visible")) {
submenu.fadeOut();
}
}); });
$('table.songlist tr.song').removeClass('playing'); $('table.songlist tr.song').removeClass('playing');
if (el != null) {
$(el).addClass('playing'); $(el).addClass('playing');
}
$('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png'); $('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png');
$('#PlayTrack').addClass('playing'); $('#PlayTrack').addClass('playing');
scrobbleSong(false); scrobbleSong(false);
@ -140,14 +170,36 @@ function playSong(el, songid, albumid) {
setTitle(toHTML.un(artist) + ' - ' + toHTML.un(title)); setTitle(toHTML.un(artist) + ' - ' + toHTML.un(title));
} }
} }
}
}); });
} }
function seekAndPlay(soundID, soundPosition) {
var s = soundManager.getSoundById(soundID);
if (!s) {
return false;
}
if (s.readyState === 0) { // hasn't started loading yet...
// load the whole sound, and play when it's done
s.load({
onload: function () {
this.play({
position: soundPosition
});
}
});
} else if (s.readyState === 3) {
// sound has already loaded, ready to go
s.play({
position: soundPosition
});
}
}
function scrobbleSong(submission) { function scrobbleSong(submission) {
var songid = $('#songdetails_song').attr('childid'); var songid = $('#songdetails_song').attr('childid');
$.ajax({ $.ajax({
url: baseURL + '/scrobble.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + songid + "&submission=" + submission, url: baseURL + '/scrobble.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + songid + "&submission=" + submission,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function () { success: function () {
if (submission) { if (submission) {
@ -158,9 +210,9 @@ function scrobbleSong(submission) {
} }
function rateSong(songid, rating) { function rateSong(songid, rating) {
$.ajax({ $.ajax({
url: baseURL + '/setRating.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + songid + "&rating=" + rating, url: baseURL + '/setRating.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + songid + "&rating=" + rating,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function () { success: function () {
updateMessage('Rating Updated!'); updateMessage('Rating Updated!');
@ -169,20 +221,22 @@ function rateSong(songid, rating) {
} }
function starItem(itemid, starred) { function starItem(itemid, starred) {
var url; var url;
if (itemid !== undefined) {
if (starred) { if (starred) {
url = baseURL + '/star.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + itemid; url = baseURL + '/star.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + itemid;
} else { } else {
url = baseURL + '/unstar.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + itemid; url = baseURL + '/unstar.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + itemid;
} }
$.ajax({ $.ajax({
url: url, url: url,
method: 'GET', method: 'GET',
dataType: 'jsonp', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function () { success: function () {
updateMessage('Favorite Updated!'); updateMessage('Favorite Updated!');
} }
}); });
}
} }
function playPauseSong() { function playPauseSong() {
var el = '#PlayTrack'; var el = '#PlayTrack';
@ -196,6 +250,18 @@ function playPauseSong() {
$(el).removeClass('paused'); $(el).removeClass('paused');
$(el).addClass('playing'); $(el).addClass('playing');
soundManager.resume('audio'); soundManager.resume('audio');
} else {
var el = $('#songdetails_song');
var songid = el.attr('childid');
if (songid != '') {
if ($.cookie("CurrentSong")) {
var currentSong = JSON.parse($.cookie("CurrentSong"));
playSong($('#' + songid), currentSong.songid, currentSong.albumid, currentSong.position, false);
var playing = $('#' + songid);
if (playing != undefined) {
$('#CurrentPlaylist').scrollTo(playing, 400);
}
}
} else { } else {
// Start playing song // Start playing song
var play = $('#CurrentPlaylistContainer tr.selected').first(); var play = $('#CurrentPlaylistContainer tr.selected').first();
@ -207,20 +273,69 @@ function playPauseSong() {
changeTrack(first); changeTrack(first);
} }
} }
}
} }
function changeTrack(next) { function changeTrack(next) {
var songid = $(next).attr('childid'); var songid = $(next).attr('childid');
if (songid !== undefined) { if (songid !== undefined) {
var albumid = $(next).attr('parentid'); var albumid = $(next).attr('parentid');
playSong(next, songid, albumid); playSong(next, songid, albumid, 0, false);
$('#CurrentPlaylist').scrollTo($('#' + songid), 400); //Scroll to object
if (debug) { console.log('Changing Track: songid:' + songid + ', albumid:' + albumid); }
return true; return true;
} else { } else {
return false; return false;
} }
} }
function autoPlay() { function autoPlay() {
var firstsong = $('#CurrentPlaylistContainer tr.song:first'); if (debug) { console.log('Auto Play'); }
var songid = $(firstsong).attr('childid'); var song = $('#CurrentPlaylistContainer tr.playing');
var albumid = $(firstsong).attr('parentid'); nextSong = $('#CurrentPlaylistContainer tr.playing').next();
playSong(firstsong, songid, albumid); if (song.length == 0) {
song = $('#CurrentPlaylistContainer tr.song:first');
play = true;
} else if (song.length == 1) {
play = false;
//$('#NextTrack').click();
}
var songid = $(song).attr('childid');
var albumid = $(song).attr('parentid');
playSong(song, songid, albumid, 0, false);
}
function nextPlay() {
if (debug) { console.log('Next Play'); }
var song = $('#CurrentPlaylistContainer tr.playing');
var nextSong = $('#CurrentPlaylistContainer tr.playing').next();
if (song.length == 0) {
song = $('#CurrentPlaylistContainer tr.song:first');
var songid = $(song).attr('childid');
var albumid = $(song).attr('parentid');
playSong(song, songid, albumid, 0, false);
} else if (nextSong.length == 1) {
song = $('#CurrentPlaylistContainer tr.playing').next();
var songid = $(song).attr('childid');
var albumid = $(song).attr('parentid');
playSong(song, songid, albumid, 0, false);
} else {
//song = $('#CurrentPlaylistContainer tr.playing').next();
}
}
function saveTrackPosition() {
var el = $('#songdetails_song');
var songid = el.attr('childid');
if (songid !== undefined) {
var albumid = el.attr('parentid');
var sm = soundManager.getSoundById('audio');
var position = sm.position;
if (position != null && position >= 5000) {
var currentSong = {
songid: songid,
albumid: albumid,
position: position
};
$.cookie('CurrentSong', JSON.stringify(currentSong));
saveCurrentPlaylist();
}
}
if (debug) { console.log('Saving Track Position: songid:' + songid + ', albumid:' + albumid + ', position:' + position); }
} }

View file

@ -62,36 +62,63 @@ function popOut()
{ {
window.open(hostURL, "External Player", "status = 1, height = 735, width = 840, resizable = 0"); window.open(hostURL, "External Player", "status = 1, height = 735, width = 840, resizable = 0");
} }
function secondsToTime(d) { function secondsToTime(secs) {
/* Old way, does not calculate hours correctly /*
var hours = Math.floor(secs / (60 * 60)); Version 1
var divisor_for_minutes = secs % (60 * 60);
var minutes = Math.floor(divisor_for_minutes / 60);
var divisor_for_seconds = divisor_for_minutes % 60;
var seconds = Math.ceil(divisor_for_seconds);
if (seconds < 10) {
seconds = '0' + seconds;
}
var obj = {
"h": hours,
"m": minutes,
"s": seconds
};
return obj;
*/
d = Number(d); d = Number(d);
var h = Math.floor(d / 3600); var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60); var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60); var s = Math.floor(d % 3600 % 60);
return ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s); return ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
*/
// secs = 4729
var times = new Array(3600, 60, 1);
var time = '';
var tmp;
for (var i = 0; i < times.length; i++) {
tmp = Math.floor(secs / times[i]);
// 0: 4729/3600 = 1
// 1: 1129/60 = 18
// 2: 49/1 = 49
if (tmp < 1) {
tmp = '00';
}
else if (tmp < 10) {
tmp = '0' + tmp;
}
if (i == 0 && tmp == '00') {
} else {
time += tmp;
if (i < 2) {
time += ':';
}
}
secs = secs % times[i];
}
return time;
} }
var msgIndex = 1;
function updateMessage(msg) { function updateMessage(msg) {
$('#messages').text(msg); if (msg != '') {
var id = msgIndex;
$('#messages').append('<span id=\"msg_' + id + '\" class="message">' + msg + '</span>');
$('#messages').fadeIn(); $('#messages').fadeIn();
setTimeout(function () { $('#messages').fadeOut(); }, 5000); setTimeout(function () {
var el = '#msg_' + id;
$(el).fadeOut( function() { $(this).remove(); });
},
5000);
msgIndex++;
}
}
function updateStatus(msg) {
$('#status').html(msg);
if ($('#tabLibrary').not(':visible')) {
if ($('#status').html() != '') {
$('#status').fadeIn();
}
}
} }
// Convert to unicode support // Convert to unicode support
var toHTML = { var toHTML = {
@ -159,6 +186,7 @@ function scrollTitle(text) {
} }
// To stop timer, clearTimeout(timer); // To stop timer, clearTimeout(timer);
} }
// HTML5
function requestPermissionIfRequired() { function requestPermissionIfRequired() {
if (!hasNotificationPermission() && (window.webkitNotifications)) { if (!hasNotificationPermission() && (window.webkitNotifications)) {
window.webkitNotifications.requestPermission(); window.webkitNotifications.requestPermission();
@ -191,6 +219,13 @@ function closeAllNotifications() {
notifications[notification].cancel(); notifications[notification].cancel();
} }
} }
function browserStorageCheck() {
if (typeof (localStorage) == 'undefined') {
return false;
} else {
return true;
}
}
function parseVersionString(str) { function parseVersionString(str) {
if (typeof (str) != 'string') { return false; } if (typeof (str) != 'string') { return false; }
var x = str.split('.'); var x = str.split('.');
@ -231,3 +266,12 @@ function switchTheme(theme) {
break; break;
} }
} }
function parseDate(date) {
// input: "2012-09-23 20:00:00.0"
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var parts = date.split(" ");
var dateParts = parts[0].split("-");
var month = parseInt(dateParts[1], 10) - 1;
var date = months[month] + " " + dateParts[2] + ", " + dateParts[0];
return date;
}

View file

@ -1,4 +1,5 @@
$(window).load(function () { $(window).load(function () {
if ($.cookie('defaultsmwidth')) { if ($.cookie('defaultsmwidth')) {
var width = $.cookie('defaultsmwidth'); var width = $.cookie('defaultsmwidth');
smwidth = width; smwidth = width;
@ -17,6 +18,21 @@
$(el).hide(); $(el).hide();
} }
}); });
if ($.cookie('SaveTrackPosition')) {
window.setInterval(function () {
if ($.cookie('SaveTrackPosition')) {
var sm = soundManager.getSoundById('audio');
if (sm !== undefined) {
saveTrackPosition();
}
}
}, 5000);
}
if ($.cookie('CurrentSong')) {
var currentSong = JSON.parse($.cookie("CurrentSong"));
playSong(null, currentSong.songid, currentSong.albumid, currentSong.position, true);
loadCurrentPlaylist();
}
resizeContent(); resizeContent();
}); });
window.onbeforeunload = function () { window.onbeforeunload = function () {
@ -27,8 +43,8 @@ $(window).resize(function () {
}); });
function resizeContent() { function resizeContent() {
var screenwidth = $(window).width(); var screenwidth = $(window).width();
$('.tabcontent').css({ 'height': (($(window).height() - 109)) + 'px' }); $('.tabcontent').css({ 'height': (($(window).height() - 125)) + 'px' });
$('.smsection').css({ 'height': (($(window).height() - 152)) + 'px' }); $('.smsection').css({ 'height': (($(window).height() - 168)) + 'px' });
var smheight = $('.smsection').height(); var smheight = $('.smsection').height();
var smwidth = $('.smsection').width(); var smwidth = $('.smsection').width();
$('#BottomContainer').css({ 'top': smheight + 35 + 'px' }); $('#BottomContainer').css({ 'top': smheight + 35 + 'px' });
@ -38,16 +54,16 @@ function resizeContent() {
$('.tabcontent').css({ 'width': tabwidth + 'px' }); $('.tabcontent').css({ 'width': tabwidth + 'px' });
} }
var sbheight = $(window).height() - 152; var sbheight = $(window).height() - 152;
$('#SideBar').css({ 'height': (sbheight + 108) + 'px' }); $('#SideBar').css({ 'height': (sbheight + 107) + 'px' });
$('#ChatMsgs').css({ 'height': (sbheight - 166) + 'px' }); $('#ChatMsgs').css({ 'height': (sbheight - 166) + 'px' });
} else { } else {
var tabwidth = $(window).width() - 58; var tabwidth = $(window).width() - 58;
if (tabwidth >= 700) { if (tabwidth >= 300) {
$('.tabcontent').css({ 'width': tabwidth + 'px' }); $('.tabcontent').css({ 'width': tabwidth + 'px' });
} }
} }
var tabwidth = $('.tabcontent').width(); var tabwidth = $('.tabcontent').width();
$('#AlbumContainer, #TrackContainer, #PodcastContainer, #CurrentPlaylistContainer').css({ 'width': (tabwidth - smwidth - 30) + 'px' }); $('#AlbumContainer, #TrackContainer, #PodcastContainer, #CurrentPlaylistContainer').css({ 'width': (tabwidth - smwidth - 40) + 'px' });
$('#CurrentPlaylistContainer').css({ 'width': (tabwidth - 30) + 'px' }); $('#CurrentPlaylistContainer').css({ 'width': (tabwidth - 30) + 'px' });
$('#player').css({ 'width': tabwidth + 'px' }); $('#player').css({ 'width': tabwidth + 'px' });
} }

View file

@ -46,6 +46,14 @@
} else { } else {
$('#ForceFlash').attr('checked', false); $('#ForceFlash').attr('checked', false);
} }
if ($.cookie('SaveTrackPosition')) {
$('#SaveTrackPosition').attr('checked', true);
} else {
$('#SaveTrackPosition').attr('checked', false);
}
if ($.cookie('AutoPilot')) {
$.cookie('AutoPilot', null)
}
// Tabs // Tabs
$('.tabcontent').hide(); //Hide all content $('.tabcontent').hide(); //Hide all content
@ -88,15 +96,15 @@
$(".tabcontent").hide(); //Hide all tab content $(".tabcontent").hide(); //Hide all tab content
var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).show(); //Fade in the active ID content $(activeTab).fadeIn('fast'); //Fade in the active ID content
loadTabContent(activeTab); loadTabContent(activeTab);
}); });
// Ajax Loading Screen // Ajax Loading Screen
$(".toploading").ajaxStart(function () { $("#toploading").ajaxStart(function () {
$(this).show(); $(this).show();
}); });
$(".toploading").ajaxStop(function () { $("#toploading").ajaxStop(function () {
$(this).hide(); $(this).hide();
}); });
@ -128,6 +136,20 @@
} else if (unicode == 36 && $('#tabLibrary').is(':visible')) { } else if (unicode == 36 && $('#tabLibrary').is(':visible')) {
$('#Artists').stop().scrollTo('#auto', 400); $('#Artists').stop().scrollTo('#auto', 400);
} }
if (unicode == 189) { // dash
if (volume <= 100 && volume > 0 && source == '') {
volume += -10;
soundManager.setVolume('audio', volume);
updateMessage('Volume: ' + volume + '%');
}
}
if (unicode == 187) { // equals
if (volume < 100 && volume >= 0 && source == '') {
volume += 10;
soundManager.setVolume('audio', volume);
updateMessage('Volume: ' + volume + '%');
}
}
} }
}); });
@ -230,7 +252,7 @@
//$(this).addClass('playing').siblings().removeClass('playing'); //$(this).addClass('playing').siblings().removeClass('playing');
var songid = $(this).attr('childid'); var songid = $(this).attr('childid');
var albumid = $(this).attr('parentid'); var albumid = $(this).attr('parentid');
playSong(this, songid, albumid); playSong(this, songid, albumid, 0, false);
}); });
$('table.songlist tr.song a.play').live('click', function (event) { $('table.songlist tr.song a.play').live('click', function (event) {
var songid = $(this).parent().parent().attr('childid'); var songid = $(this).parent().parent().attr('childid');
@ -251,9 +273,9 @@
var firstsong = $('#CurrentPlaylistContainer tr.song:first'); var firstsong = $('#CurrentPlaylistContainer tr.song:first');
songid = $(firstsong).attr('childid'); songid = $(firstsong).attr('childid');
albumid = $(firstsong).attr('parentid'); albumid = $(firstsong).attr('parentid');
playSong(firstsong, songid, albumid); playSong(firstsong, songid, albumid, 0, false);
} else { } else {
playSong($(this).parent().parent(), songid, albumid); playSong($(this).parent().parent(), songid, albumid, 0, false);
} }
return false; return false;
}); });
@ -289,6 +311,13 @@
$(this).addClass('rate'); $(this).addClass('rate');
return false; return false;
}); });
$('table.songlist tr.song a.albumlink').live('click', function (event) {
var parentid = $(this).parent().parent().attr('parentid');
if (parentid != '' && parentid !== undefined) {
getAlbums(parentid, 'link', '#AlbumRows');
}
return false;
});
$('li.index').live('click', function (e) { $('li.index').live('click', function (e) {
$('#Artists').stop().scrollTo('#auto', 400); $('#Artists').stop().scrollTo('#auto', 400);
return false; return false;
@ -310,13 +339,23 @@
} }
return false; return false;
}); });
$("#submenu_AddToPlaylist a").live("click", function (event) {
var id = $(this).attr('childid');
if (id == 'new') {
addToPlaylist('new', '');
} else if (id != '' && id !== undefined) {
addToPlaylist(id, '');
}
return false;
});
var submenu_active = false; var submenu_active = false;
$('div.submenu').mouseenter(function () { $('div.submenu').mouseenter(function () {
submenu_active = true; submenu_active = true;
}); });
$('div.submenu').mouseleave(function () { $('div.submenu').mouseleave(function () {
submenu_active = false; submenu_active = false;
setTimeout(function () { if (submenu_active == false) $('div.submenu').fadeOut(); }, 400); $('div.submenu').hide();
//setTimeout(function () { if (submenu_active == false) $('div.submenu').stop().fadeOut(); }, 400);
}); });
$('a#action_AddToCurrent').click(function () { $('a#action_AddToCurrent').click(function () {
addToCurrent(false); addToCurrent(false);
@ -339,7 +378,7 @@
if ($.cookie('MusicFolders')) { if ($.cookie('MusicFolders')) {
loadArtists($.cookie('MusicFolders'), true); loadArtists($.cookie('MusicFolders'), true);
} else { } else {
loadArtists(); loadArtists(null, true);
} }
return false; return false;
}); });
@ -378,12 +417,18 @@
}); });
// Current Playlist Click Events // Current Playlist Click Events
$('#action_Shuffle').live('click', function () { $('#action_Shuffle').live('click', function () {
$('#CurrentPlaylistContainer tbody tr.song').shuffle(); //$('#CurrentPlaylistContainer tbody tr.song').shuffle();
$('#CurrentPlaylistContainer tbody tr.song:not(#CurrentPlaylistContainer tbody tr.playing)').shuffle();
refreshRowColor('#CurrentPlaylistContainer tbody'); refreshRowColor('#CurrentPlaylistContainer tbody');
var songid = $('#CurrentPlaylistContainer tbody tr.playing').attr('childid');
if (songid !== undefined) {
$('#CurrentPlaylist').scrollTo($('#' + songid), 400);
}
return false; return false;
}); });
$('#action_Empty').live('click', function () { $('#action_Empty').live('click', function () {
$('#CurrentPlaylistContainer tbody').empty(); $('#CurrentPlaylistContainer tbody').empty();
deleteCurrentPlaylist();
return false; return false;
}); });
$('a#action_AddCurrentToPlaylist').click(function () { $('a#action_AddCurrentToPlaylist').click(function () {
@ -400,6 +445,79 @@
submenu.css({ "left": (pos.left) + "px", "top": (pos.top + height + 14) + "px" }).fadeIn(400); submenu.css({ "left": (pos.left) + "px", "top": (pos.top + height + 14) + "px" }).fadeIn(400);
} }
}); });
$("#submenu_AddCurrentToPlaylist a").live("click", function (event) {
var id = $(this).attr('childid');
if (id == 'new') {
addToPlaylist('new', 'current');
} else if (id != '' && id !== undefined) {
addToPlaylist(id, 'current');
}
return false;
});
$('#songdetails').click(function (e) {
var source = e.target.nodeName;
var hash = window.location.hash;
if (source != 'IMG' && hash != '#tabCurrent') {
$('#action_tabCurrent').click();
}
});
$('#songdetails').mouseover(function () {
$(this).addClass('hover');
/*
var total = $("#CurrentPlaylistContainer tr.song").size();
if (total > 0) {
var submenu = $('div#submenu_CurrentPlaylist');
//get the position of the placeholder element
pos = $(this).offset();
width = $(this).width();
height = $(this).height();
//show the menu directly over the placeholder
submenu.css({ "left": (pos.left - 1) + "px", "top": (pos.top - height - 152) + "px" }).show();
var html = '';
var rowcolor;
var i = 0;
var playing = false;
$("#CurrentPlaylistContainer tr.song").each(function (e) {
if (i < 10) {
if (i % 2 === 0) {
rowcolor = 'even';
} else {
rowcolor = 'odd';
}
var value = $(this).find("td.title").html();
if ($(this).hasClass('playing')) {
html += '<tr class=\"song playing ' + rowcolor + '\"><td></td><td>' + value + '</td></tr>';
playing = true;
} else {
html += '<tr class=\"song ' + rowcolor + '\"><td></td><td>' + value + '</td></tr>';
}
} else {
return false;
}
i++;
});
$('#CurrentPlaylistPreviewContainer tbody').html(html);
if (playing) {
$('#submenu_CurrentPlaylist').scrollTo($('#CurrentPlaylistPreviewContainer tr.playing'), 400);
}
}
*/
});
$('#songdetails').mouseout(function () {
$(this).removeClass('hover')
//$('div.submenu').hide();
});
$('#CurrentPlaylist').mouseenter(function () {
var html = $('#status').html();
if (html != '') {
$('#status').fadeIn();
}
});
$('#CurrentPlaylist').mouseleave(function () {
$('#status').stop().fadeOut();
});
$('#action_CurrentSelectAll').click(function () { $('#action_CurrentSelectAll').click(function () {
var count = 0; var count = 0;
$('#CurrentPlaylist tr.song').each(function () { $('#CurrentPlaylist tr.song').each(function () {
@ -415,6 +533,23 @@
}); });
return false; return false;
}); });
$('#action_AutoPilot').click(function () {
var msg;
if ($.cookie('AutoPilot')) {
$.cookie('AutoPilot', null);
msg = 'Autopilot Off';
$('#action_AutoPilot').removeClass('selected');
} else {
$('#CurrentPlaylistContainer tbody').empty();
getRandomSongList('', '#CurrentPlaylistContainer tbody', '', '');
$.cookie('AutoPilot', true, { expires: 365 });
$('#action_AutoPilot').addClass('selected');
msg = 'Autopilot On';
}
$(this).attr("title", msg);
updateMessage(msg);
return false;
});
// Playlist Click Events // Playlist Click Events
$('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () { $('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () {
@ -422,18 +557,18 @@
$(this).addClass('selected'); $(this).addClass('selected');
var genre = $(this).data('genre'); var genre = $(this).data('genre');
var folder = $(this).data('folder'); var folder = $(this).data('folder');
getRandomSongList('', '#TrackContainer', genre, folder); getRandomSongList('', '#TrackContainer tbody', genre, folder);
}); });
$('#AutoPlaylistContainer li.item a.play, #FolderContainer li.item a.play').live('click', function () { $('#AutoPlaylistContainer li.item a.play, #FolderContainer li.item a.play').live('click', function () {
var genre = $(this).data('genre'); var genre = $(this).data('genre');
var folder = $(this).data('folder'); var folder = $(this).data('folder');
getRandomSongList('autoplay', '#CurrentPlaylistContainer', genre, folder); getRandomSongList('autoplay', '#CurrentPlaylistContainer tbody', genre, folder);
return false; return false;
}); });
$('#AutoPlaylistContainer li.item a.add, #FolderContainer li.item a.add').live('click', function () { $('#AutoPlaylistContainer li.item a.add, #FolderContainer li.item a.add').live('click', function () {
var genre = $(this).data('genre'); var genre = $(this).data('genre');
var folder = $(this).data('folder'); var folder = $(this).data('folder');
getRandomSongList('', '#CurrentPlaylistContainer', genre, folder); getRandomSongList('', '#CurrentPlaylistContainer tbody', genre, folder);
return false; return false;
}); });
$('#PlaylistContainer li.item').live('click', function () { $('#PlaylistContainer li.item').live('click', function () {
@ -543,10 +678,11 @@
}); });
$('#songdetails a.rate').live('click', function (event) { $('#songdetails a.rate').live('click', function (event) {
var itemid = $('#songdetails_song').attr('childid'); var itemid = $('#songdetails_song').attr('childid');
//rateSong(itemid, 5); if (itemid !== undefined) {
starItem(itemid, true); starItem(itemid, true);
$(this).removeClass('rate'); $(this).removeClass('rate');
$(this).addClass('favorite'); $(this).addClass('favorite');
}
return false; return false;
}); });
$('#songdetails a.favorite').live('click', function (event) { $('#songdetails a.favorite').live('click', function (event) {
@ -676,6 +812,20 @@
} }
location.reload(true); location.reload(true);
}); });
$('#SaveTrackPosition').live('click', function () {
if ($('#SaveTrackPosition').is(':checked')) {
$.cookie('SaveTrackPosition', '1', { expires: 365 });
var sm = soundManager.getSoundById('audio');
if (sm !== undefined) {
saveTrackPosition();
}
} else {
$.cookie('SaveTrackPosition', null);
$.cookie('CurrentSong', null);
deleteCurrentPlaylist();
}
//location.reload(true);
});
$('input#Password').keydown(function (e) { $('input#Password').keydown(function (e) {
var unicode = e.charCode ? e.charCode : e.keyCode; var unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode == 13) { if (unicode == 13) {

View file

@ -1,8 +1,8 @@
{ {
"manifest_version": 1, "manifest_version": 2,
"name": "MiniSub", "name": "MiniSub (Beta)",
"description": "MiniSub - HTML5 Mini Player for Subsonic", "description": "MiniSub - HTML5 Mini Player for Subsonic",
"version": "2.1", "version": "2.1.6",
"app": { "app": {
"launch": { "launch": {
"local_path": "index.html" "local_path": "index.html"
@ -14,6 +14,8 @@
}, },
"permissions": [ "permissions": [
"unlimited_storage", "unlimited_storage",
"notifications" "notifications",
"http://*/*",
"https://*/*"
] ]
} }

View file

@ -94,12 +94,11 @@ h3.title {
{ {
border-bottom: 1px solid #232323; border-bottom: 1px solid #232323;
} }
#messages #messages .message
{ {
color: #d6d469; color: #d6d469;
background: #2e2e2e; background: #2e2e2e;
border: solid 1px #5a5a5a; border: 1px solid #5a5a5a;
border-top: none;
} }
#player #player
{ {
@ -113,6 +112,14 @@ h3.title {
.vertshade { .vertshade {
background-image: -webkit-gradient( linear, left top, right top, from(rgba(46, 46, 46, 0)), to(rgba(46, 46, 46, 1))); background-image: -webkit-gradient( linear, left top, right top, from(rgba(46, 46, 46, 0)), to(rgba(46, 46, 46, 1)));
} }
#songdetails
{
border: solid 1px #2E2E2E;
}
#songdetails.hover
{
border: solid 1px #212121;
}
#songdetails ul { #songdetails ul {
color: #F2F2F2; color: #F2F2F2;
} }
@ -139,6 +146,12 @@ a.button:active {
color: #000; color: #000;
border-color: #444; border-color: #444;
} }
a.selected {
color: #939393;
border-color: #5a5a5a;
-moz-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) -webkit-box-shadow:0 2px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
ul.simplelist li ul.simplelist li
{ {
border-bottom: 1px solid #272727; border-bottom: 1px solid #272727;
@ -171,6 +184,10 @@ ul.simplelist li.selected
border-top: 1px solid #F2F2F2; border-top: 1px solid #F2F2F2;
background: #2a2a2a; background: #2a2a2a;
} }
#BottomContainer #BottomIndex li a
{
color: #f2f2f2;
}
table.songlist th { table.songlist th {
color: #F2F2F2; color: #F2F2F2;
} }
@ -207,7 +224,12 @@ table.songlist tr.selected
background: #3a3a3a; background: #3a3a3a;
} }
table.songlist tr.playing { table.songlist tr.playing {
background: #1d1d1d; background: #161616;
}
#submenu_CurrentPlaylist
{
background: #2E2E2E;
border: solid 1px #212121;
} }
ul.preferences li em ul.preferences li em
{ {

View file

@ -35,6 +35,7 @@ h3.title
.even { background: #f4f4f4; } .even { background: #f4f4f4; }
.red { color: #E64F4C; } .red { color: #E64F4C; }
.italic { font-style: italic; } .italic { font-style: italic; }
.beer { font-size: 17px; }
#container { #container {
text-align: left; text-align: left;
@ -55,7 +56,7 @@ a#logo
width: 54px; width: 54px;
height: 36px; height: 36px;
background: url('../images/subsonic_36.png') no-repeat 6px 4px; background: url('../images/subsonic_36.png') no-repeat 6px 4px;
cursor:hand; cursor: pointer;
} }
a#logo:hover a#logo:hover
{ {
@ -148,7 +149,7 @@ a#logo:hover
.tabcontent .tabcontent
{ {
min-height: 400px; min-height: 400px;
min-width: 700px; min-width: 900px;
margin-left: 53px; margin-left: 53px;
} }
.smsection .smsection
@ -207,7 +208,7 @@ a#logo:hover
width: 100%; width: 100%;
background: url('../images/ajax-loader.gif') no-repeat center center #f4f4f4; background: url('../images/ajax-loader.gif') no-repeat center center #f4f4f4;
} }
.toploading #toploading
{ {
display: none; display: none;
height: 35px; height: 35px;
@ -219,17 +220,39 @@ a#logo:hover
#messages #messages
{ {
display: none; display: none;
color: #4B95E5; width: 200px;
float: right;
font-size: 12px; font-size: 12px;
padding: 5px;
position: absolute; position: absolute;
z-index: 99; z-index: 99;
top: 0; top: 0;
right: 58px; left: 790px;
}
#messages .message
{
color: #4B95E5;
float: right;
clear: both;
padding: 5px;
margin: 2px 0 2px 0;
background: #fff; background: #fff;
border: 1px solid #A6CBF3; border: 1px solid #A6CBF3;
border-top: none; }
#status
{
display: none;
width: 180px;
overflow: hidden;
font-size: 12px;
text-align: center;
position: absolute;
z-index: 99;
bottom: 86px;
right: 4px;
background: #f2f2f2;
padding: 2px 5px;
border-top: 1px solid #CBCBCB;
border-left: 1px solid #CBCBCB;
opacity: .7;
} }
/* Library Style */ /* Library Style */
ul.simplelist ul.simplelist
@ -245,6 +268,10 @@ ul.simplelist li
padding: 8px; padding: 8px;
border-bottom: 1px solid #f2f2f2; border-bottom: 1px solid #f2f2f2;
} }
#AutoAlbumContainer li.item
{
padding: 6px 8px;
}
ul.simplelist li .name ul.simplelist li .name
{ {
} }
@ -348,6 +375,7 @@ table.songlist
{ {
margin: 5px; margin: 5px;
border-collapse: collapse; border-collapse: collapse;
width: 100%;
} }
table.songlist th table.songlist th
{ {
@ -387,7 +415,7 @@ table.songlist tr.album td.albumart
} }
table.songlist tr.album td.albumart img table.songlist tr.album td.albumart img
{ {
margin: 5px 10px 0 10px; margin: 3px 10px 0 10px;
padding: 2px; padding: 2px;
border: 1px solid #DEDEDE; border: 1px solid #DEDEDE;
} }
@ -464,8 +492,10 @@ table.songlist tr.song td
} }
table.songlist tr.song td.itemactions table.songlist tr.song td.itemactions
{ {
width: 80px; width: 85px;
padding-left: 27px; padding-left: 26px;
display: block;
height: 18px;
} }
table.songlist tr.song td.track table.songlist tr.song td.track
{ {
@ -645,7 +675,7 @@ background-color: #8dbdd8;
background: #fff; background: #fff;
position: fixed; position: fixed;
height: 43px; height: 43px;
width: 182px; width: 178px;
} }
#BottomContainer ul #BottomContainer ul
{ {
@ -679,7 +709,7 @@ background-color: #8dbdd8;
.subactions .subactions
{ {
height: 29px; height: 29px;
width: 620px; width: 660px;
margin: 4px 0 0 0; margin: 4px 0 0 0;
padding: 0 0 0 5px; padding: 0 0 0 5px;
} }
@ -717,12 +747,20 @@ background-color: #8dbdd8;
width: 220px; width: 220px;
text-align: right; text-align: right;
} }
#submenu_CurrentPlaylist
{
width: 400px;
height: 200px;
overflow-y: auto;
overflow-x: hidden;
border: solid 1px gainsboro;
}
#SideBar #SideBar
{ {
display: none; display: none;
width: 200px; width: 200px;
position: fixed; position: fixed;
top: 38px; top: 37px;
right: 4px; right: 4px;
background: none repeat scroll 0 0 #FFFFFF; background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #CBCBCB; border: 1px solid #CBCBCB;
@ -835,16 +873,17 @@ background-color: #8dbdd8;
} }
.audiojs .scrubber .audiojs .scrubber
{ {
height: 2px; height: 4px;
margin: 28px 5px 0px 5px; margin: 36px 5px 0px 5px;
float: none; float: none;
width: auto; width: auto;
position: relative; position: relative;
background: #5A5A5A; background: #5A5A5A;
border-top: 1px solid #3F3F3F; border-top: 0px;
border-left: 0px; border-left: 0px;
border-bottom: 0px; border-bottom: 0px;
overflow: hidden; overflow: hidden;
cursor: pointer;
} }
.audiojs .progress .audiojs .progress
{ {
@ -887,12 +926,12 @@ background-color: #8dbdd8;
} }
.playeractions .playeractions
{ {
margin: 5px 20px 0 20px; margin: 16px 12px 0 20px;
width: 160px; width: 160px;
} }
.playeractionssmall .playeractionssmall
{ {
margin: 14px 8px 0 14px; margin: 25px 8px 0 14px;
width: 50px; width: 50px;
float: right; float: right;
} }
@ -903,25 +942,31 @@ background-color: #8dbdd8;
} }
#coverart #coverart
{ {
width: 50px; width: 56px;
height: 50px; height: 56px;
overflow: hidden; overflow: hidden;
margin: 2px 8px 0 0; margin: 2px 8px 0 0;
float: left; float: left;
padding: 2px; padding: 2px;
border: 1px solid #DEDEDE; border: 1px solid #DEDEDE;
} }
#songdetails.hover
{
border: solid 1px gainsboro;
}
#songdetails #songdetails
{ {
width: 280px; width: 288px;
margin: 0 8px; margin: 2px 6px;
float: left; float: left;
visibility: hidden; cursor: pointer;
padding: 3px;
border: 1px solid #fff;
} }
#songdetails ul #songdetails ul
{ {
list-style-type: none; list-style-type: none;
margin: 4px 0; margin: 6px 0;
padding: 0; padding: 0;
height: 52px; height: 52px;
width: 185px; width: 185px;
@ -955,7 +1000,7 @@ background-color: #8dbdd8;
#songdetails a.rate #songdetails a.rate
{ {
float: left; float: left;
height: 60px; height: 64px;
width: 30px; width: 30px;
display: block; display: block;
background: url('../images/star_wo_12x12.png') 10px center no-repeat; background: url('../images/star_wo_12x12.png') 10px center no-repeat;
@ -967,7 +1012,7 @@ background-color: #8dbdd8;
#songdetails a.favorite #songdetails a.favorite
{ {
float: left; float: left;
height: 60px; height: 64px;
width: 30px; width: 30px;
display: block; display: block;
background: url('../images/star_yo_12x12.png') 10px center no-repeat; background: url('../images/star_yo_12x12.png') 10px center no-repeat;
@ -976,8 +1021,8 @@ background-color: #8dbdd8;
position: relative; position: relative;
top: 0; top: 0;
left: 229px; left: 229px;
width: 20px; width: 28px;
height: 60px; height: 62px;
background-image: -webkit-gradient( linear, left top, right top, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 1))); background-image: -webkit-gradient( linear, left top, right top, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 1)));
} }
ul.preferences ul.preferences
@ -1006,6 +1051,7 @@ ul.preferences li em
font-style: normal; font-style: normal;
left: -3px; left: -3px;
padding: 3px 9px 3px; padding: 3px 9px 3px;
margin: 0 0 0 5px;
position: relative; position: relative;
} }
ul.preferences li.log ul.preferences li.log
@ -1070,6 +1116,14 @@ a.button:active {
color: #000; color: #000;
border-color: #444; border-color: #444;
} }
a.selected {
color: #333;
border-color: #999;
-moz-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) -webkit-box-shadow:0 2px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
a.button img.pad { margin: 1px 0 -1px 0; }
.shadow .shadow
{ {
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
@ -1124,6 +1178,7 @@ select#SearchType
select#MusicFolders select#MusicFolders
{ {
width: 94%; width: 94%;
margin: 0 5px;
} }
.submit .submit
{ {
@ -1160,7 +1215,18 @@ fieldset
border: 1px solid #EEE; border: 1px solid #EEE;
margin-bottom: 5px; margin-bottom: 5px;
} }
fieldset span
{
font-size: 13px;
font-variant: small-caps;
font-weight: bold;
margin: 5px 0;
display: block;
float: left;
}
legend legend
{ {
font-size: 12px; font-size: 14px;
font-variant: small-caps;
font-weight: bold;
} }