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>
<div id="nav">
<ul class="tabs">
<li><a href="#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="#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="#tabPreferences" class="last" title="Preferences"><img src="images/cog_16x16.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" id="action_tabCurrent" title="Current Playlist"><img src="images/play_alt_gd_16x16.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" id="action_tabPodcasts" title="Podcasts"><img src="images/rss_16x16.png" /></a></li>
<li><a href="#tabPreferences" id="action_tabPreferences" class="last" title="Preferences"><img src="images/cog_16x16.png" /></a></li>
</ul>
<div class="toploading"></div>
<div id="toploading"></div>
</div>
<div id="content">
<div id="tabLibrary" class="tabcontent">
<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_IncreaseWidth" title="Increase Width"><img src="images/plus_8x8.png" /></a>
</div>
@ -68,7 +68,7 @@
<option value="song">Song</option>
<option value="album">Album</option>
</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 id="Albums" class="lgsection floatleft">
<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_AddCurrentToPlaylist" title="Add Selected To Playlist">+ Playlist</a>
<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 id="CurrentPlaylist" class="fullsection floatleft noselect">
<table id="CurrentPlaylistContainer" class="simplelist songlist" cellspacing="1">
@ -114,16 +115,17 @@
<tbody></tbody>
</table>
</div>
<div id="status"></div>
</div>
<div id="tabPlaylists" class="tabcontent">
<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 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_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_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>
</div>
<div class="clear"></div>
@ -147,7 +149,7 @@
</div>
<div id="tabPodcasts" class="tabcontent">
<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 class="subactions floatleft">
</div>
@ -191,6 +193,7 @@
<li><em>Spacebar</em> Play/Pause</li>
<li><em>&rarr;</em> Next Track</li>
<li><em>&larr;</em> Previous Track</li>
<li><em>-/_</em> Volume Down <em>=/+</em> Volume Up</li>
<li><span></span></li>
</ul>
</div>
@ -215,16 +218,7 @@
<div class="subsection floatleft">
<div class="checkboxes">
<fieldset>
<legend>Notifications [Beta]</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>
<legend class="aligncenter">Display</legend>
<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>
<div class="clear"></div>
@ -233,17 +227,33 @@
</fieldset>
<div class="clear"></div>
<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>
<label for="Debug">Debug Mode</label>
<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>
<label for="ForceFlash">Force Flash</label>
</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 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">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="VMTENRSJWQ234">
@ -259,9 +269,22 @@
<ul id="ChangeLog" class="preferences">
<!--
<li class="log"><span class="version"></span>
<span class="changes"></span>
<span class="changes">- </span>
</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>
<span class="changes">Moved ratings to stars (5 star ratings will reappear eventually)</span>
</li>
@ -360,8 +383,7 @@
<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 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>
<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>
<li><a href="https://twitter.com/tsquillario" target="_blank">Follow @tsquillario</a>
</ul>
<h3 class="title">Thanks</h3>
<ul class="preferences">
@ -395,13 +417,19 @@
</div>
<div id="songdetails">
<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_artist" class="album" title=""></li>
</ul>
<div class="rate"><a id="songdetails_rate" class="rate" href="" title="Add To Favorites"></a></div>
<div class="vertshade"></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 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">

View file

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

View file

@ -1,8 +1,8 @@
function ping() {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].status == 'ok') {
@ -19,11 +19,11 @@ function loadArtists(id, refresh) {
}
var url;
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) {
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 {
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); }
var content = $('#ArtistContainer').html();
@ -32,7 +32,7 @@ function loadArtists(id, refresh) {
$.ajax({
url: url,
method: 'GET',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
done: function () { if (debug) { console.log("DONE!"); } },
error: function () { if (debug) { console.log("ERROR!"); } },
@ -111,9 +111,9 @@ function loadArtists(id, refresh) {
}
function getMusicFolders() {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].musicFolders.musicFolder !== undefined) {
@ -180,19 +180,22 @@ function loadAutoPlaylists(refresh) {
}
}
function getAlbums(id, action, appendto) {
$('.first').trigger('click');
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (action === '') {
if (action == '') {
$('#AlbumRows').empty();
}
if (action === 'autoplay') {
$('#CurrentPlaylistContainer tbody').empty();
}
if (action == 'link') {
$('#AlbumRows').empty();
$('#action_tabLibrary').trigger('click');
}
if (data["subsonic-response"].directory.child !== undefined) {
// There is a bug in the API that doesn't return a JSON array for one artist
var children = [];
@ -240,9 +243,9 @@ function getAlbumListBy(id) {
size = $.cookie('AutoAlbumSize');
}
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].albumList.album !== undefined) {
@ -282,15 +285,15 @@ function getAlbumListBy(id) {
function getRandomSongList(action, appendto, genre, folder) {
var size, gstring;
gstring = '';
if ($.cookie('AutoPlaylistSize') === null) {
size = 25;
} else {
if ($.cookie('AutoPlaylistSize')) {
size = $.cookie('AutoPlaylistSize');
} else {
size = 25;
}
if (genre !== undefined) {
if (genre !== undefined && genre != '') {
gstring = '&genre=' + genre;
}
if (genre === 'Random') {
if (genre == 'Random') {
gstring = '';
}
if (folder !== undefined) {
@ -300,16 +303,18 @@ function getRandomSongList(action, appendto, genre, folder) {
getStarred(action, appendto, 'song');
} else {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].randomSongs.song !== undefined) {
if (appendto === '#TrackContainer') {
$("#TrackContainer").empty();
if (appendto == '#TrackContainer tbody') {
$("#TrackContainer tbody").empty();
var header = generateSongHeaderHTML();
$("#TrackContainer thead").html(header);
}
if (action === 'autoplay') {
if (action == 'autoplay') {
$("#TrackContainer").empty();
$(appendto).empty();
}
@ -332,17 +337,18 @@ function getRandomSongList(action, appendto, genre, folder) {
var track, starred;
if (item.starred !== undefined) { starred = true; } else { starred = false; }
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, time);
html = generateSongHTML(rowcolor, item.id, item.parent, track, item.title, '', item.artist, item.album, item.coverArt, item.userRating, starred, item.duration);
$(html).appendTo(appendto);
});
if (appendto === '#TrackContainer') {
updateMessage(items.length + ' Song(s)');
if (appendto === '#TrackContainer tbody') {
updateMessage(countCurrentPlaylist('#TrackContainer'));
}
if (appendto === '#CurrentPlaylistContainer') {
if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added');
}
if (action === 'autoplay') {
if (action == '' && genre == '' && folder == '') {
nextPlay();
} else if (action == 'autoplay') {
autoPlay();
}
} else {
@ -354,23 +360,25 @@ function getRandomSongList(action, appendto, genre, folder) {
}
function getStarred(action, appendto, type) {
var size;
if ($.cookie('AutoPlaylistSize') === null) {
size = 25;
} else {
if ($.cookie('AutoPlaylistSize')) {
size = $.cookie('AutoPlaylistSize');
} else {
size = 25;
}
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].starred !== undefined) {
if (appendto === '#TrackContainer') {
$("#TrackContainer").empty();
if (appendto === '#TrackContainer tbody') {
$("#TrackContainer tbody").empty();
var header = generateSongHeaderHTML();
$("#TrackContainer thead").html(header);
}
if (action === 'autoplay') {
$("#TrackContainer").empty();
$("#TrackContainer tbody").empty();
$(appendto).empty();
}
// 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);
});
if (appendto === '#TrackContainer') {
updateMessage(items.length + ' Song(s)');
if (appendto == '#TrackContainer tbody') {
updateMessage(countCurrentPlaylist('#TrackContainer'));
}
if (appendto === '#CurrentPlaylistContainer') {
if (appendto == '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added');
}
if (action === 'autoplay') {
if (action == 'autoplay') {
autoPlay();
}
} else {
@ -454,9 +462,9 @@ function updateNowPlaying(showPopup) {
updaterNowPlaying = $.periodic({ period: 4000, decay: 1.5, max_period: 30000 }, function () {
$.ajax({
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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].nowPlaying.entry === undefined) {
@ -491,7 +499,7 @@ function updateNowPlaying(showPopup) {
if (msg.coverArt === undefined) {
coverartSrc = 'images/albumdefault_50.jpg';
} 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')) {
var sid = msg.username + '-' + msg.id;
@ -512,9 +520,9 @@ function stopUpdateNowPlaying() {
function search(type, query) {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].searchResult2 !== "") {
@ -557,8 +565,7 @@ function search(type, query) {
var track, starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
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, time);
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
}
$(albumhtml).appendTo("#AlbumRows");
});
@ -576,9 +583,9 @@ function loadFolders(refresh) {
if (content === "") {
// Load Folders
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var musicFolders = [];
@ -609,12 +616,13 @@ function loadPlaylists(refresh) {
if (content === "") {
// Load Playlists
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var playlists = [];
if (data["subsonic-response"].playlists.playlist !== undefined) {
if (data["subsonic-response"].playlists.playlist.length > 0) {
playlists = data["subsonic-response"].playlists.playlist;
} else {
@ -634,15 +642,16 @@ function loadPlaylists(refresh) {
resizeSMSection(0);
}
}
}
});
}
}
function loadPlaylistsForMenu(menu) {
$('#' + menu).empty();
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var playlists = [];
@ -653,20 +662,10 @@ function loadPlaylistsForMenu(menu) {
playlists[0] = data["subsonic-response"].playlists.playlist;
}
}
if (menu === 'submenu_AddCurrentToPlaylist') {
$("<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);
}
$("<a href=\"#\" childid=\"new\">+ New</a><br />").appendTo("#" + menu);
$.each(playlists, function (i, playlist) {
if (menu === 'submenu_AddCurrentToPlaylist') {
$("<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=\"#\" childid=\"' + playlist.id + '\">' + 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.", "");
if (reply != null || reply != "") {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
loadPlaylists(true);
@ -686,9 +685,9 @@ function newPlaylist() {
}
function deletePlaylist(id) {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
loadPlaylists(true);
@ -712,9 +711,9 @@ function addToPlaylist(playlistid, from) {
// Get songs from playlist
var currentsongs = [];
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
// 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({
type: 'GET',
url: baseURL + '/updatePlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp',
dataType: 'json',
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 () {
$('table.songlist tr.song').each(function () {
$(this).removeClass('selected');
@ -759,9 +758,9 @@ function addToPlaylist(playlistid, from) {
$.ajax({
type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp',
dataType: 'json',
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 () {
$('table.songlist tr.song').each(function () {
$(this).removeClass('selected');
@ -780,9 +779,9 @@ function addToPlaylist(playlistid, from) {
$.ajax({
type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp',
dataType: 'json',
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 () {
$('table.songlist tr.song').each(function () {
$(this).removeClass('selected');
@ -807,14 +806,66 @@ function addToCurrent(addAll) {
if (addAll) {
$('#AlbumContainer tr.song').each(function (index) {
$(this).clone().appendTo('#CurrentPlaylistContainer tbody');
updateMessage(count + ' Song(s) Added');
});
} else {
$('#AlbumContainer tr.selected').each(function (index) {
$(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) {
@ -826,7 +877,7 @@ function downloadItem(id, type) {
reqDownload = 'playlistUtf8Hex=' + id;
}
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;
}
}
@ -839,9 +890,9 @@ function savePlaylist(playlistid) {
$.ajax({
type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password,
dataType: 'jsonp',
dataType: 'json',
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 () {
getPlaylist(playlistid);
updateMessage('Playlist Updated!');
@ -852,9 +903,9 @@ function savePlaylist(playlistid) {
}
function getPlaylist(id, action, appendto) {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].playlist.entry !== undefined) {
@ -887,12 +938,11 @@ function getPlaylist(id, action, appendto) {
var track, starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
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, time);
html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
$(html).appendTo(appendto);
});
if (appendto === '#TrackContainer tbody') {
updateMessage(count + ' Song(s)');
updateMessage(countCurrentPlaylist('#TrackContainer'));
}
if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(children.length + ' Song(s) Added');
@ -918,12 +968,13 @@ function loadPodcasts(refresh) {
if (content === "") {
// Load Podcasts
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var podcasts = [];
if (data["subsonic-response"].podcasts.channel !== undefined) {
if (data["subsonic-response"].podcasts.channel.length > 0) {
podcasts = data["subsonic-response"].podcasts.channel;
} else {
@ -945,14 +996,15 @@ function loadPodcasts(refresh) {
resizeSMSection(0);
}
}
}
});
}
}
function getPodcast(id, action, appendto) {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var podcasts = [];
@ -995,8 +1047,10 @@ function getPodcast(id, action, appendto) {
var description = 'Published: ' + date + '\n\n';
description += child.description;
var starred;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
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);
count++;
});
@ -1017,12 +1071,59 @@ function getPodcast(id, action, appendto) {
}
});
}
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;
function loadVideos(refresh) {
if (debug) { console.log("LOAD PODCASTS"); }
if (refresh) {
$('#VideoContainer').empty();
}
var content = $('#VideoContainer').html();
if (content == "") {
// 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 () {
$.ajax({
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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (data["subsonic-response"].chatMessages.chatMessage === undefined) {
@ -50,9 +50,9 @@ function addChatMessage(msg) {
$.ajax({
type: 'GET',
url: baseURL + '/addChatMessage.view?u=' + username + '&p=' + password,
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
data: { v: version, c: applicationName, f: "jsonp", message: msg },
data: { v: version, c: applicationName, f: "json", message: msg },
success: function () {
updater.reset();
},

View file

@ -7,8 +7,7 @@ function generateRowHTML(child, appendto, rowcolor) {
} else {
var 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, time);
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, child.duration);
}
return albumhtml;
}
@ -32,7 +31,7 @@ function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist,
if (coverart == undefined) {
html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>';
} 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=\"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>';
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;
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 += '<a class=\"remove\" href=\"\" title=\"Remove\"></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 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=\"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;
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=\"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=\"album\"><a href="#" class=\"albumlink\"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>';
html += '<td class=\"time\">' + time + '</td>';
html += '</tr>';
return html;

View file

@ -1,14 +1,14 @@
var scrobbled = false;
function playSong(el, songid, albumid) {
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + albumid;
function playSong(el, songid, albumid, position, loadonly) {
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + albumid;
if (debug) { console.log(ajaxUrl) }
$.ajax({
url: ajaxUrl,
method: 'GET',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function (data) {
var title, artist, album, rating;
var title, artist, album, rating, starred;
if (data["subsonic-response"].directory.child !== undefined) {
// There is a bug in the API that doesn't return a JSON array for one artist
var children = [];
@ -24,10 +24,11 @@ function playSong(el, songid, albumid) {
album = child.album;
coverart = child.coverArt;
rating = child.userRating;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
}
});
}
if (rating == 5) {
if (starred) {
$('#songdetails_rate').attr('class', 'favorite');
} else {
$('#songdetails_rate').attr('class', 'rate');
@ -40,16 +41,17 @@ function playSong(el, songid, albumid) {
$('#songdetails_artist').attr('title', artist + ' - ' + album);
var coverartSrc, coverartFullSrc;
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_50.jpg';
coverartSrc = 'images/albumdefault_56.jpg';
coverartFullSrc = '';
} else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=50&id=' + coverart;
coverartFullSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&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=json&id=' + coverart;
}
$('#coverartimage').attr('href', coverartFullSrc);
$('#coverartimage img').attr('src', coverartSrc);
$('#playermiddle').css('visibility', 'visible');
$('#songdetails').css('visibility', 'visible');
if (!loadonly) { // Sometimes we only want to load the track and not play
// SoundManager Initialize
var salt = Math.floor(Math.random() * 100000);
soundManager.onready(function () {
@ -71,6 +73,7 @@ function playSong(el, songid, albumid) {
var scrubber = $('#audio_wrapper0').find(".scrubber");
var loaded = $('#audio_wrapper0').find(".loaded");
loaded.css('width', (scrubber.get(0).offsetWidth * percent) + 'px');
loaded.attr('title', Math.round(percent * 100) + '% loaded');
},
whileplaying: function () {
//if (debug) { console.log('position:' + this.position + ' duration:' + this.duration); }
@ -106,6 +109,12 @@ function playSong(el, songid, albumid) {
position: position
});
});
scrubber.mouseover(function (e) {
$('.audiojs .scrubber').stop().animate({ height: '8px' });
});
scrubber.mouseout(function (e) {
$('.audiojs .scrubber').stop().animate({ height: '4px' });
});
},
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); }
@ -118,14 +127,35 @@ function playSong(el, songid, albumid) {
},
onfinish: function () {
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');
} 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');
if (el != null) {
$(el).addClass('playing');
}
$('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png');
$('#PlayTrack').addClass('playing');
scrobbleSong(false);
@ -140,14 +170,36 @@ function playSong(el, songid, albumid) {
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) {
var songid = $('#songdetails_song').attr('childid');
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function () {
if (submission) {
@ -158,9 +210,9 @@ function scrobbleSong(submission) {
}
function rateSong(songid, rating) {
$.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',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function () {
updateMessage('Rating Updated!');
@ -169,20 +221,22 @@ function rateSong(songid, rating) {
}
function starItem(itemid, starred) {
var url;
if (itemid !== undefined) {
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 {
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({
url: url,
method: 'GET',
dataType: 'jsonp',
dataType: 'json',
timeout: 10000,
success: function () {
updateMessage('Favorite Updated!');
}
});
}
}
function playPauseSong() {
var el = '#PlayTrack';
@ -196,6 +250,18 @@ function playPauseSong() {
$(el).removeClass('paused');
$(el).addClass('playing');
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 {
// Start playing song
var play = $('#CurrentPlaylistContainer tr.selected').first();
@ -207,20 +273,69 @@ function playPauseSong() {
changeTrack(first);
}
}
}
}
function changeTrack(next) {
var songid = $(next).attr('childid');
if (songid !== undefined) {
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;
} else {
return false;
}
}
function autoPlay() {
var firstsong = $('#CurrentPlaylistContainer tr.song:first');
var songid = $(firstsong).attr('childid');
var albumid = $(firstsong).attr('parentid');
playSong(firstsong, songid, albumid);
if (debug) { console.log('Auto Play'); }
var song = $('#CurrentPlaylistContainer tr.playing');
nextSong = $('#CurrentPlaylistContainer tr.playing').next();
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");
}
function secondsToTime(d) {
/* Old way, does not calculate hours correctly
var hours = Math.floor(secs / (60 * 60));
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;
*/
function secondsToTime(secs) {
/*
Version 1
d = Number(d);
var h = Math.floor(d / 3600);
var m = 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);
*/
// 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) {
$('#messages').text(msg);
if (msg != '') {
var id = msgIndex;
$('#messages').append('<span id=\"msg_' + id + '\" class="message">' + msg + '</span>');
$('#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
var toHTML = {
@ -159,6 +186,7 @@ function scrollTitle(text) {
}
// To stop timer, clearTimeout(timer);
}
// HTML5
function requestPermissionIfRequired() {
if (!hasNotificationPermission() && (window.webkitNotifications)) {
window.webkitNotifications.requestPermission();
@ -191,6 +219,13 @@ function closeAllNotifications() {
notifications[notification].cancel();
}
}
function browserStorageCheck() {
if (typeof (localStorage) == 'undefined') {
return false;
} else {
return true;
}
}
function parseVersionString(str) {
if (typeof (str) != 'string') { return false; }
var x = str.split('.');
@ -231,3 +266,12 @@ function switchTheme(theme) {
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 () {
if ($.cookie('defaultsmwidth')) {
var width = $.cookie('defaultsmwidth');
smwidth = width;
@ -17,6 +18,21 @@
$(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();
});
window.onbeforeunload = function () {
@ -27,8 +43,8 @@ $(window).resize(function () {
});
function resizeContent() {
var screenwidth = $(window).width();
$('.tabcontent').css({ 'height': (($(window).height() - 109)) + 'px' });
$('.smsection').css({ 'height': (($(window).height() - 152)) + 'px' });
$('.tabcontent').css({ 'height': (($(window).height() - 125)) + 'px' });
$('.smsection').css({ 'height': (($(window).height() - 168)) + 'px' });
var smheight = $('.smsection').height();
var smwidth = $('.smsection').width();
$('#BottomContainer').css({ 'top': smheight + 35 + 'px' });
@ -38,16 +54,16 @@ function resizeContent() {
$('.tabcontent').css({ 'width': tabwidth + 'px' });
}
var sbheight = $(window).height() - 152;
$('#SideBar').css({ 'height': (sbheight + 108) + 'px' });
$('#SideBar').css({ 'height': (sbheight + 107) + 'px' });
$('#ChatMsgs').css({ 'height': (sbheight - 166) + 'px' });
} else {
var tabwidth = $(window).width() - 58;
if (tabwidth >= 700) {
if (tabwidth >= 300) {
$('.tabcontent').css({ 'width': tabwidth + 'px' });
}
}
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' });
$('#player').css({ 'width': tabwidth + 'px' });
}

View file

@ -46,6 +46,14 @@
} else {
$('#ForceFlash').attr('checked', false);
}
if ($.cookie('SaveTrackPosition')) {
$('#SaveTrackPosition').attr('checked', true);
} else {
$('#SaveTrackPosition').attr('checked', false);
}
if ($.cookie('AutoPilot')) {
$.cookie('AutoPilot', null)
}
// Tabs
$('.tabcontent').hide(); //Hide all content
@ -88,15 +96,15 @@
$(".tabcontent").hide(); //Hide all 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);
});
// Ajax Loading Screen
$(".toploading").ajaxStart(function () {
$("#toploading").ajaxStart(function () {
$(this).show();
});
$(".toploading").ajaxStop(function () {
$("#toploading").ajaxStop(function () {
$(this).hide();
});
@ -128,6 +136,20 @@
} else if (unicode == 36 && $('#tabLibrary').is(':visible')) {
$('#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');
var songid = $(this).attr('childid');
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) {
var songid = $(this).parent().parent().attr('childid');
@ -251,9 +273,9 @@
var firstsong = $('#CurrentPlaylistContainer tr.song:first');
songid = $(firstsong).attr('childid');
albumid = $(firstsong).attr('parentid');
playSong(firstsong, songid, albumid);
playSong(firstsong, songid, albumid, 0, false);
} else {
playSong($(this).parent().parent(), songid, albumid);
playSong($(this).parent().parent(), songid, albumid, 0, false);
}
return false;
});
@ -289,6 +311,13 @@
$(this).addClass('rate');
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) {
$('#Artists').stop().scrollTo('#auto', 400);
return false;
@ -310,13 +339,23 @@
}
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;
$('div.submenu').mouseenter(function () {
submenu_active = true;
});
$('div.submenu').mouseleave(function () {
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 () {
addToCurrent(false);
@ -339,7 +378,7 @@
if ($.cookie('MusicFolders')) {
loadArtists($.cookie('MusicFolders'), true);
} else {
loadArtists();
loadArtists(null, true);
}
return false;
});
@ -378,12 +417,18 @@
});
// Current Playlist Click Events
$('#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');
var songid = $('#CurrentPlaylistContainer tbody tr.playing').attr('childid');
if (songid !== undefined) {
$('#CurrentPlaylist').scrollTo($('#' + songid), 400);
}
return false;
});
$('#action_Empty').live('click', function () {
$('#CurrentPlaylistContainer tbody').empty();
deleteCurrentPlaylist();
return false;
});
$('a#action_AddCurrentToPlaylist').click(function () {
@ -400,6 +445,79 @@
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 () {
var count = 0;
$('#CurrentPlaylist tr.song').each(function () {
@ -415,6 +533,23 @@
});
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
$('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () {
@ -422,18 +557,18 @@
$(this).addClass('selected');
var genre = $(this).data('genre');
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 () {
var genre = $(this).data('genre');
var folder = $(this).data('folder');
getRandomSongList('autoplay', '#CurrentPlaylistContainer', genre, folder);
getRandomSongList('autoplay', '#CurrentPlaylistContainer tbody', genre, folder);
return false;
});
$('#AutoPlaylistContainer li.item a.add, #FolderContainer li.item a.add').live('click', function () {
var genre = $(this).data('genre');
var folder = $(this).data('folder');
getRandomSongList('', '#CurrentPlaylistContainer', genre, folder);
getRandomSongList('', '#CurrentPlaylistContainer tbody', genre, folder);
return false;
});
$('#PlaylistContainer li.item').live('click', function () {
@ -543,10 +678,11 @@
});
$('#songdetails a.rate').live('click', function (event) {
var itemid = $('#songdetails_song').attr('childid');
//rateSong(itemid, 5);
if (itemid !== undefined) {
starItem(itemid, true);
$(this).removeClass('rate');
$(this).addClass('favorite');
}
return false;
});
$('#songdetails a.favorite').live('click', function (event) {
@ -676,6 +812,20 @@
}
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) {
var unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode == 13) {

View file

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

View file

@ -94,12 +94,11 @@ h3.title {
{
border-bottom: 1px solid #232323;
}
#messages
#messages .message
{
color: #d6d469;
background: #2e2e2e;
border: solid 1px #5a5a5a;
border-top: none;
border: 1px solid #5a5a5a;
}
#player
{
@ -113,6 +112,14 @@ h3.title {
.vertshade {
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 {
color: #F2F2F2;
}
@ -139,6 +146,12 @@ a.button:active {
color: #000;
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
{
border-bottom: 1px solid #272727;
@ -171,6 +184,10 @@ ul.simplelist li.selected
border-top: 1px solid #F2F2F2;
background: #2a2a2a;
}
#BottomContainer #BottomIndex li a
{
color: #f2f2f2;
}
table.songlist th {
color: #F2F2F2;
}
@ -207,7 +224,12 @@ table.songlist tr.selected
background: #3a3a3a;
}
table.songlist tr.playing {
background: #1d1d1d;
background: #161616;
}
#submenu_CurrentPlaylist
{
background: #2E2E2E;
border: solid 1px #212121;
}
ul.preferences li em
{

View file

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