2.3.5 last.fm fix, volume shortcuts

This commit is contained in:
Trevor Squillario 2012-12-03 18:19:21 -05:00
parent c12537e061
commit 8643f01647
13 changed files with 223 additions and 97 deletions

View file

@ -4,6 +4,9 @@ Imagine you can stream all your music from home, to any device, where ever you a
MiniSub is an HTML5 Web Player for the Subsonic streaming server. MiniSub is an HTML5 Web Player for the Subsonic streaming server.
***Please submit all bug reports & feature requests via the GitHub page***
https://github.com/tsquillario/MiniSub/issues
Features Features
* HTML5 Audio with Flash fallback (provided by the SoundManager2 library) * HTML5 Audio with Flash fallback (provided by the SoundManager2 library)
* Flexible Layout (will scale to whatever size your browser window is) * Flexible Layout (will scale to whatever size your browser window is)

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

View file

@ -217,6 +217,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>
@ -271,7 +272,7 @@
<span>Local Storage</span><br /> <span>Local Storage</span><br />
<div class="clear"></div> <div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="SaveTrackPosition" name="SaveTrackPosition" value="1" title="Saves Play Queue & Track Position Periodically (Uses HTML5: localStorage)"/></div> <div class="inputwrap"><input type="checkbox" id="SaveTrackPosition" name="SaveTrackPosition" value="1" title="Saves Play Queue & Track Position Periodically (Uses HTML5: localStorage)"/></div>
<label for="SaveTrackPosition">Save Current Position</label> <label for="SaveTrackPosition">Save Progress</label>
</fieldset> </fieldset>
</div> </div>
</div> </div>
@ -295,6 +296,11 @@
<span class="changes">- </span> <span class="changes">- </span>
</li> </li>
--> -->
<li class="log"><span class="version">12/3/2012 - 2.3.5</span>
<span class="changes">- Added keyboard volume controls back. Use the plus (=/+) and minus (-/_) keys</span>
<span class="changes">- Change Save Current Position to Save Progress, added an indicator next to volume</span>
<span class="changes">- Fixed Last.fm scrobble feature, this works again!</span>
</li>
<li class="log"><span class="version">11/27/2012 - 2.3.4</span> <li class="log"><span class="version">11/27/2012 - 2.3.4</span>
<span class="changes">- Basic Breadcrumb navigation implemented</span> <span class="changes">- Basic Breadcrumb navigation implemented</span>
</li> </li>
@ -474,6 +480,7 @@
<a href="#" id="action_Mute" class="mute first" title="Mute"></a> <a href="#" id="action_Mute" class="mute first" title="Mute"></a>
<a href="#" id="action_UnMute" class="unmute first" title="Unmute" style="display: none;"></a> <a href="#" id="action_UnMute" class="unmute first" title="Unmute" style="display: none;"></a>
<div class="jp-volume-bar"><div class="jp-volume-bar-value"></div></div><a href="#" id="action_VolumeMax" class="volume" title="Max Volume"></a> <div class="jp-volume-bar"><div class="jp-volume-bar-value"></div></div><a href="#" id="action_VolumeMax" class="volume" title="Max Volume"></a>
<a href="#" id="action_SaveProgress" class="lock" title="Progress Saved" style="display: none;"></a>
</li> </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>

View file

@ -9,7 +9,7 @@ var password;
var passwordenc; var passwordenc;
var server; var server;
var smwidth; var smwidth;
var currentVersion = '2.3.4'; var currentVersion = '2.3.5';
function getCookie(value) { function getCookie(value) {
if ($.cookie(value)) { if ($.cookie(value)) {
@ -83,11 +83,11 @@ if (getCookie('passwordenc')) {
password = 'enc:' + HexEncode(getCookie('password')); password = 'enc:' + HexEncode(getCookie('password'));
} }
} }
var auth = makeBaseAuth(username, password);
if (getCookie('password')) { if (getCookie('password')) {
setCookie('passwordenc', 'enc:' + HexEncode(getCookie('password'))); setCookie('passwordenc', 'enc:' + HexEncode(getCookie('password')));
setCookie('password', null); setCookie('password', null);
} }
var auth = makeBaseAuth(username, password.substring(4, password.length).hexDecode());
var apiVersion = '1.6.0'; var apiVersion = '1.6.0';
function loadTabContent(tab) { function loadTabContent(tab) {

View file

@ -1,6 +1,15 @@
/* Ajax Global Setup */
// Inject Basic Auth
$.ajaxSetup({
beforeSend: function (req) {
req.setRequestHeader('Authorization', auth);
}
//headers: { "Authorization": "Basic " + auth }
});
function ping() { function ping() {
$.ajax({ $.ajax({
url: baseURL + '/ping.view?u=' + username + '&p=' + password + '&v=1.6.0&c=' + applicationName + '&f=json', url: baseURL + '/ping.view?v=1.6.0&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -26,11 +35,11 @@ function loadArtists(id, refresh) {
} }
var url; var url;
if (id == "all") { if (id == "all") {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json'; url = baseURL + '/getIndexes.view?v=' + apiVersion + '&c=' + applicationName + '&f=json';
} else if (id) { } else if (id) {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&musicFolderId=' + id; url = baseURL + '/getIndexes.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&musicFolderId=' + id;
} else { } else {
url = baseURL + '/getIndexes.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json'; url = baseURL + '/getIndexes.view?v=' + apiVersion + '&c=' + applicationName + '&f=json';
} }
if (debug) { console.log(url); } if (debug) { console.log(url); }
var content = $('#ArtistContainer').html(); var content = $('#ArtistContainer').html();
@ -139,7 +148,7 @@ function loadArtists(id, refresh) {
} }
function getMusicFolders() { function getMusicFolders() {
$.ajax({ $.ajax({
url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getMusicFolders.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -210,7 +219,7 @@ function loadAutoPlaylists(refresh) {
} }
function getAlbums(id, action, appendto) { function getAlbums(id, action, appendto) {
$.ajax({ $.ajax({
url: baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id, url: baseURL + '/getMusicDirectory.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -248,7 +257,7 @@ function getAlbums(id, action, appendto) {
}); });
toggleAlbumListNextPrev('#status_Library', false, '', ''); toggleAlbumListNextPrev('#status_Library', false, '', '');
if (appendto == '#CurrentPlaylistContainer') { if (appendto == '#CurrentPlaylistContainer') {
updateMessage(children.length + ' Song(s) Added'); updateMessage(children.length + ' Song(s) Added', true);
} }
if (appendto == '#AlbumContainer tbody' && isDir == true) { if (appendto == '#AlbumContainer tbody' && isDir == true) {
header = generateAlbumHeaderHTML(); header = generateAlbumHeaderHTML();
@ -266,6 +275,55 @@ function getAlbums(id, action, appendto) {
} }
}); });
} }
/* Currently not being used */
function getArtist(id, action, appendto) {
$.ajax({
url: baseURL + '/getArtist.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET',
dataType: 'json',
timeout: 10000,
success: function (data) {
if (action == '') {
$('#AlbumContainer tbody').empty();
}
if (action === 'autoplay') {
$('#CurrentPlaylistContainer tbody').empty();
}
if (action == 'link') {
$('#AlbumContainer tbody').empty();
$('#action_tabLibrary').trigger('click');
}
if (data["subsonic-response"].artist !== undefined) {
// There is a bug in the API that doesn't return a JSON array for one artist
var children = [];
if (data["subsonic-response"].artist.album.length > 0) {
children = data["subsonic-response"].artist.album;
} else {
children[0] = data["subsonic-response"].artist.album;
}
var rowcolor;
var header;
$.each(children, function (i, child) {
var html = generateRowHTML(child, appendto);
$(html).appendTo(appendto).hide().fadeIn('fast');
});
toggleAlbumListNextPrev('#status_Library', false, '', '');
if (appendto == '#CurrentPlaylistContainer') {
updateMessage(children.length + ' Song(s) Added', true);
}
if (appendto == '#AlbumContainer tbody') {
header = generateAlbumHeaderHTML();
$('#songActions a.button').addClass('disabled');
}
$("#AlbumContainer thead").html(header);
if (action == 'autoplay') {
autoPlay();
}
}
}
});
}
function getAlbumListBy(id, offset) { function getAlbumListBy(id, offset) {
var size, url; var size, url;
if (getCookie('AutoAlbumSize')) { if (getCookie('AutoAlbumSize')) {
@ -274,9 +332,9 @@ function getAlbumListBy(id, offset) {
size = 15; size = 15;
} }
if (offset > 0) { if (offset > 0) {
url = baseURL + '/getAlbumList.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + '&type=' + id + '&offset=' + offset url = baseURL + '/getAlbumList.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + '&type=' + id + '&offset=' + offset
} else { } else {
url = baseURL + '/getAlbumList.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + '&type=' + id url = baseURL + '/getAlbumList.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + '&type=' + id
} }
$.ajax({ $.ajax({
url: url, url: url,
@ -312,7 +370,7 @@ function getAlbumListBy(id, offset) {
$('#songActions a.button').addClass('disabled'); $('#songActions a.button').addClass('disabled');
toggleAlbumListNextPrev('#status_Library', true, id, offset); toggleAlbumListNextPrev('#status_Library', true, id, offset);
} else { } else {
updateMessage('Albums failed to load, no music :('); updateMessage('Albums failed to load, no music :(', true);
$('#AlbumContainer tbody').empty(); $('#AlbumContainer tbody').empty();
} }
} }
@ -359,7 +417,7 @@ 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=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + genreParams + folderParams, url: baseURL + '/getRandomSongs.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size + genreParams + folderParams,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -396,7 +454,7 @@ function getRandomSongList(action, appendto, genre, folder) {
updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer')); updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer'));
} }
if (appendto === '#CurrentPlaylistContainer tbody') { if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added'); updateMessage(items.length + ' Song(s) Added', true);
updateStatus('#status_Current', countCurrentPlaylist('#CurrentPlaylistContainer')); updateStatus('#status_Current', countCurrentPlaylist('#CurrentPlaylistContainer'));
} }
if (action == 'autoplay' || action == 'autoplayappend') { if (action == 'autoplay' || action == 'autoplayappend') {
@ -418,7 +476,7 @@ function getStarred(action, appendto, type) {
size = 25; size = 25;
} }
$.ajax({ $.ajax({
url: baseURL + '/getStarred.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size, url: baseURL + '/getStarred.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=' + size,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -492,7 +550,7 @@ function getStarred(action, appendto, type) {
updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer')); updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer'));
} }
if (appendto == '#CurrentPlaylistContainer tbody') { if (appendto == '#CurrentPlaylistContainer tbody') {
updateMessage(items.length + ' Song(s) Added'); updateMessage(items.length + ' Song(s) Added', true);
} }
if (action == 'autoplay') { if (action == 'autoplay') {
autoPlay(); autoPlay();
@ -509,7 +567,7 @@ 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=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getNowPlaying.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -546,7 +604,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?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=50&id=' + msg.coverArt; coverartSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=50&id=' + msg.coverArt;
} }
if (getCookie('Notification_NowPlaying')) { if (getCookie('Notification_NowPlaying')) {
var sid = msg.username + '-' + msg.id; var sid = msg.username + '-' + msg.id;
@ -567,7 +625,7 @@ function stopUpdateNowPlaying() {
function search(type, query) { function search(type, query) {
$.ajax({ $.ajax({
url: baseURL + '/search2.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&query=' + query, url: baseURL + '/search2.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&query=' + query,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -627,7 +685,7 @@ function loadFolders(refresh) {
if (content === "") { if (content === "") {
// Load Folders // Load Folders
$.ajax({ $.ajax({
url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getMusicFolders.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -660,7 +718,7 @@ function loadPlaylists(refresh) {
if (content === "") { if (content === "") {
// Load Playlists // Load Playlists
$.ajax({ $.ajax({
url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getPlaylists.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -698,13 +756,13 @@ function savePlaylist(playlistid) {
if (songs.length > 0) { if (songs.length > 0) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songId: songs }, data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songId: songs },
success: function () { success: function () {
getPlaylist(playlistid); getPlaylist(playlistid);
updateMessage('Playlist Updated!'); updateMessage('Playlist Updated!', true);
}, },
traditional: true // Fixes POST with an array in JQuery 1.4 traditional: true // Fixes POST with an array in JQuery 1.4
}); });
@ -712,7 +770,7 @@ function savePlaylist(playlistid) {
} }
function getPlaylist(id, action, appendto) { function getPlaylist(id, action, appendto) {
$.ajax({ $.ajax({
url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id, url: baseURL + '/getPlaylist.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -750,7 +808,7 @@ function getPlaylist(id, action, appendto) {
updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer')); updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer'));
} }
if (appendto === '#CurrentPlaylistContainer tbody') { if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(children.length + ' Song(s) Added'); updateMessage(children.length + ' Song(s) Added', true);
} }
if (action === 'autoplay') { if (action === 'autoplay') {
autoPlay(); autoPlay();
@ -767,7 +825,7 @@ function getPlaylist(id, action, appendto) {
function loadPlaylistsForMenu(menu) { function loadPlaylistsForMenu(menu) {
$('#' + menu).empty(); $('#' + menu).empty();
$.ajax({ $.ajax({
url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getPlaylists.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -791,7 +849,7 @@ 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 != null && reply != '') { if (reply != 'null' && reply != null && reply != '') {
$.ajax({ $.ajax({
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&name=' + reply, url: baseURL + '/createPlaylist.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&name=' + reply,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -803,7 +861,7 @@ function newPlaylist() {
} }
function deletePlaylist(id) { function deletePlaylist(id) {
$.ajax({ $.ajax({
url: baseURL + '/deletePlaylist.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id, url: baseURL + '/deletePlaylist.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + id,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -829,7 +887,7 @@ 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=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + playlistid, url: baseURL + '/getPlaylist.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + playlistid,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -860,22 +918,24 @@ function addToPlaylist(playlistid, from) {
if (checkVersion(runningVersion, minimumVersion)) { // is 1.8.0 or newer if (checkVersion(runningVersion, minimumVersion)) { // is 1.8.0 or newer
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/updatePlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/updatePlaylist.view',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songIdToAdd: selected }, data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songIdToAdd: selected },
success: function () { success: function (data) {
// Add logic to show an error if the playlist update fails
// if (data["subsonic-response"].playlist.entry !== undefined) {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
}); });
updateMessage('Playlist Updated!'); updateMessage(count + ' Song(s) Added to Playlist', true);
}, },
traditional: true // Fixes POST with an array in JQuery 1.4 traditional: true // Fixes POST with an array in JQuery 1.4
}); });
} else { } else {
$.ajax({ // Depreciated: 11/5/2012 $.ajax({ // Depreciated: 11/5/2012
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songId: currentsongs }, data: { v: apiVersion, c: applicationName, f: "json", playlistId: playlistid, songId: currentsongs },
@ -883,7 +943,7 @@ function addToPlaylist(playlistid, from) {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
}); });
updateMessage('Playlist Updated!'); updateMessage(count + ' Song(s) Added to Playlist', true);
}, },
traditional: true // Fixes POST with an array in JQuery 1.4 traditional: true // Fixes POST with an array in JQuery 1.4
}); });
@ -896,7 +956,7 @@ function addToPlaylist(playlistid, from) {
if (reply) { if (reply) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + password, url: baseURL + '/createPlaylist.view',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: apiVersion, c: applicationName, f: "json", name: "" + reply + "", songId: selected }, data: { v: apiVersion, c: applicationName, f: "json", name: "" + reply + "", songId: selected },
@ -904,7 +964,7 @@ function addToPlaylist(playlistid, from) {
$('table.songlist tr.song').each(function () { $('table.songlist tr.song').each(function () {
$(this).removeClass('selected'); $(this).removeClass('selected');
}); });
updateMessage('Playlist Created!'); updateMessage('Playlist Created!', true);
}, },
traditional: true // Fixes POST with an array in JQuery 1.4 traditional: true // Fixes POST with an array in JQuery 1.4
}); });
@ -931,7 +991,7 @@ function addToCurrent(addAll) {
}); });
} }
$('#CurrentPlaylistContainer tbody tr.song').removeClass('selected'); $('#CurrentPlaylistContainer tbody tr.song').removeClass('selected');
updateMessage(count + ' Song(s) Added'); updateMessage(count + ' Song(s) Added', true);
} }
} }
function countCurrentPlaylist(container) { function countCurrentPlaylist(container) {
@ -999,6 +1059,7 @@ function saveTrackPosition() {
albumid: albumid, albumid: albumid,
position: position position: position
}; };
$('#action_SaveProgress').show();
setCookie('CurrentSong', JSON.stringify(currentSong)); setCookie('CurrentSong', JSON.stringify(currentSong));
saveCurrentPlaylist(); saveCurrentPlaylist();
} }
@ -1014,7 +1075,7 @@ function downloadItem(id, type) {
reqDownload = 'playlistUtf8Hex=' + id; reqDownload = 'playlistUtf8Hex=' + id;
} }
if (reqDownload) { if (reqDownload) {
url = baseURL + '/download.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&' + reqDownload; url = baseURL + '/download.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&' + reqDownload;
window.location = url; window.location = url;
} }
} }
@ -1029,7 +1090,7 @@ function loadPodcasts(refresh) {
if (content === "") { if (content === "") {
// Load Podcasts // Load Podcasts
$.ajax({ $.ajax({
url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getPodcasts.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -1063,7 +1124,7 @@ function loadPodcasts(refresh) {
} }
function getPodcast(id, action, appendto) { function getPodcast(id, action, appendto) {
$.ajax({ $.ajax({
url: baseURL + '/getPodcasts.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getPodcasts.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -1114,7 +1175,7 @@ function getPodcast(id, action, appendto) {
updateStatus('#status_Podcasts', countCurrentPlaylist('#PodcastContainer')); updateStatus('#status_Podcasts', countCurrentPlaylist('#PodcastContainer'));
} }
if (appendto === '#CurrentPlaylistContainer tbody') { if (appendto === '#CurrentPlaylistContainer tbody') {
updateMessage(count + ' Song(s) Added'); updateMessage(count + ' Song(s) Added', true);
} }
if (action === 'autoplay') { if (action === 'autoplay') {
autoPlay(); autoPlay();
@ -1136,7 +1197,7 @@ function loadVideos(refresh) {
if (content == "") { if (content == "") {
// Load Videos // Load Videos
$.ajax({ $.ajax({
url: baseURL + '/getVideos.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json', url: baseURL + '/getVideos.view?v=' + apiVersion + '&c=' + applicationName + '&f=json',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -1156,7 +1217,7 @@ function loadVideos(refresh) {
} else { } else {
rowcolor = 'odd'; rowcolor = 'odd';
} }
var videoURL = baseURL + '/stream.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + video.id; var videoURL = baseURL + '/stream.view?v=' + apiVersion + '&c=' + applicationName + '&id=' + video.id;
html = '<tr class=\"row video\" childid=\"' + video.id + '\" parentid=\"' + video.parent + '\" bitrate=\"' + video.bitRate + '\" userrating=\"\">'; html = '<tr class=\"row video\" childid=\"' + video.id + '\" parentid=\"' + video.parent + '\" bitrate=\"' + video.bitRate + '\" userrating=\"\">';
html += '<td class=\"itemactions\">'; html += '<td class=\"itemactions\">';
//html += '<a class=\"add\" href=\"\" title=\"Add To Play Queue\"></a>'; //html += '<a class=\"add\" href=\"\" title=\"Add To Play Queue\"></a>';
@ -1171,7 +1232,7 @@ function loadVideos(refresh) {
if (video.coverArt === undefined) { if (video.coverArt === undefined) {
coverartSrc = 'images/albumdefault_25.jpg'; coverartSrc = 'images/albumdefault_25.jpg';
} else { } else {
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=25&id=' + video.coverArt; coverartSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=25&id=' + video.coverArt;
} }
var time = secondsToTime(video.duration); var time = secondsToTime(video.duration);
html += '<td class=\"album\"><img src=\"' + coverartSrc + '\" />' + video.album + '</td>'; html += '<td class=\"album\"><img src=\"' + coverartSrc + '\" />' + video.album + '</td>';

View file

@ -4,7 +4,7 @@ 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=' + apiVersion + '&c=' + applicationName + '&f=json&since=' + starttime, url: baseURL + '/getChatMessages.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&since=' + starttime,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -49,7 +49,7 @@ function stopUpdateChatMessages() {
function addChatMessage(msg) { function addChatMessage(msg) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseURL + '/addChatMessage.view?u=' + username + '&p=' + password, url: baseURL + '/addChatMessage.view',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
data: { v: apiVersion, c: applicationName, f: "json", message: msg }, data: { v: apiVersion, c: applicationName, f: "json", message: msg },

View file

@ -1,5 +1,5 @@
function generateRowHTML(child, appendto) { function generateRowHTML(child, appendto) {
var html, isDir, starred, duration, artist, i; var html, isDir, starred, duration, artist, artistId, i;
isDir = child.isDir; isDir = child.isDir;
if (child.starred !== undefined) { starred = true; } else { starred = false; } if (child.starred !== undefined) { starred = true; } else { starred = false; }
if (child.duration !== undefined) { duration = child.duration; } else { duration = ''; } if (child.duration !== undefined) { duration = child.duration; } else { duration = ''; }
@ -33,7 +33,7 @@ function generateAlbumHTML(childid, parentid, coverart, title, artist, rating, s
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?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>'; html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?v=' + apiVersion + '&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>';
@ -72,13 +72,14 @@ function generateSongHTML(childid, parentid, track, title, description, artist,
html += '<td class=\"title\">' + title + '</td>'; html += '<td class=\"title\">' + title + '</td>';
} }
html += '<td class=\"artist\">' + artist + '</td>'; html += '<td class=\"artist\">' + artist + '</td>';
//html += '<td class=\"artist\"><a href="#">' + artist + '</a></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?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=25&id=' + coverart; coverartSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=25&id=' + coverart;
} }
html += '<td class=\"album\" data-order-by=\"' + album + '\"><a href="#" class=\"albumlink\"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>'; html += '<td class=\"album\" data-order-by=\"' + album + '\"><a href="#"><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

@ -5,10 +5,10 @@ function getSongData(el, songid, albumid, position, loadonly) {
var minimumVersion = parseVersionString('1.8.0'); var minimumVersion = parseVersionString('1.8.0');
if (checkVersion(runningVersion, minimumVersion)) { if (checkVersion(runningVersion, minimumVersion)) {
if (debug) { console.log('apiVersion at or above 1.8.0 using getSong.view'); } if (debug) { console.log('apiVersion at or above 1.8.0 using getSong.view'); }
ajaxUrl = baseURL + '/getSong.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid; ajaxUrl = baseURL + '/getSong.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid;
} else { } else {
if (debug) { console.log('apiVersion below 1.8.0 using getMusicDirectory.view'); } if (debug) { console.log('apiVersion below 1.8.0 using getMusicDirectory.view'); }
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + albumid; // Deprecated: apiVersion 1.8.0 ajaxUrl = baseURL + '/getMusicDirectory.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + albumid; // Deprecated: apiVersion 1.8.0
} }
if (debug) { console.log(ajaxUrl) } if (debug) { console.log(ajaxUrl) }
$.ajax({ $.ajax({
@ -87,8 +87,8 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
coverartSrc = 'images/albumdefault_60.jpg'; coverartSrc = 'images/albumdefault_60.jpg';
coverartFullSrc = ''; coverartFullSrc = '';
} else { } else {
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&size=60&id=' + coverart; coverartSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=60&id=' + coverart;
coverartFullSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + coverart; coverartFullSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + coverart;
} }
$('#coverartimage').attr('href', coverartFullSrc); $('#coverartimage').attr('href', coverartFullSrc);
$('#coverartimage img').attr('src', coverartSrc); $('#coverartimage img').attr('src', coverartSrc);
@ -101,6 +101,7 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
audioSolution = "flash,html"; audioSolution = "flash,html";
} }
$("#playdeck").jPlayer("destroy"); $("#playdeck").jPlayer("destroy");
$.jPlayer.timeFormat.showHour = true;
$("#playdeck").jPlayer({ $("#playdeck").jPlayer({
swfPath: "js/jplayer", swfPath: "js/jplayer",
wmode: "window", wmode: "window",
@ -124,11 +125,11 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
ready: function () { ready: function () {
if (suffix == 'oga') { if (suffix == 'oga') {
$(this).jPlayer("setMedia", { $(this).jPlayer("setMedia", {
oga: baseURL + '/stream.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt, oga: baseURL + '/stream.view?v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
}); });
} else if (suffix == 'mp3') { } else if (suffix == 'mp3') {
$(this).jPlayer("setMedia", { $(this).jPlayer("setMedia", {
mp3: baseURL + '/stream.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt, mp3: baseURL + '/stream.view?v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
}); });
} }
if (!loadonly) { if (!loadonly) {
@ -138,10 +139,18 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
$(this).jPlayer("pause", position); $(this).jPlayer("pause", position);
} }
}, },
volumechange: function(event) { // The $.jPlayer.event.ended event timeupdate: function(event) {
// Scrobble song once percentage is reached
var p = event.jPlayer.status.currentPercentAbsolute;
if (!scrobbled && p > 30) {
if (debug) { console.log('LAST.FM SCROBBLE - Percent Played: ' + p); }
scrobbleSong(true);
}
},
volumechange: function(event) {
setCookie('Volume', event.jPlayer.options.volume); setCookie('Volume', event.jPlayer.options.volume);
}, },
ended: function() { // The $.jPlayer.event.ended event ended: function() {
var next = $('#CurrentPlaylistContainer tr.playing').next(); var next = $('#CurrentPlaylistContainer tr.playing').next();
if (!changeTrack(next)) { if (!changeTrack(next)) {
if (getCookie('AutoPilot')) { if (getCookie('AutoPilot')) {
@ -173,7 +182,7 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
var solution = data.solutions[i]; var solution = data.solutions[i];
if (data[solution].used) { if (data[solution].used) {
spechtml += "<strong>" + solution + "</strong> is"; spechtml += "<strong>" + solution + "</strong> is";
spechtml += " being used with<strong>"; spechtml += " currently being used with<strong>";
for (format in data[solution].support) { for (format in data[solution].support) {
if (data[solution].support[format]) { if (data[solution].support[format]) {
spechtml += " " + format; spechtml += " " + format;
@ -233,7 +242,7 @@ function playVideo(id, bitrate) {
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=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&submission=" + submission, url: baseURL + '/scrobble.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&submission=" + submission,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
@ -246,12 +255,12 @@ function scrobbleSong(submission) {
} }
function rateSong(songid, rating) { function rateSong(songid, rating) {
$.ajax({ $.ajax({
url: baseURL + '/setRating.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&rating=" + rating, url: baseURL + '/setRating.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&rating=" + rating,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function () { success: function () {
updateMessage('Rating Updated!'); updateMessage('Rating Updated!', true);
} }
}); });
} }
@ -259,9 +268,9 @@ function starItem(itemid, starred) {
var url; var url;
if (itemid !== undefined) { if (itemid !== undefined) {
if (starred) { if (starred) {
url = baseURL + '/star.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid; url = baseURL + '/star.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid;
} else { } else {
url = baseURL + '/unstar.view?u=' + username + '&p=' + password + '&v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid; url = baseURL + '/unstar.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid;
} }
$.ajax({ $.ajax({
url: url, url: url,
@ -269,7 +278,7 @@ function starItem(itemid, starred) {
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function () { success: function () {
updateMessage('Favorite Updated!'); updateMessage('Favorite Updated!', true);
} }
}); });
} }

View file

@ -120,16 +120,22 @@ function secondsToTime(secs) {
return time; return time;
} }
var msgIndex = 1; var msgIndex = 1;
function updateMessage(msg) { function updateMessage(msg, autohide) {
if (msg != '') { if (msg != '') {
var id = msgIndex; var id = msgIndex;
$('#messages').append('<span id=\"msg_' + id + '\" class="message">' + msg + '</span>'); $('#messages').append('<span id=\"msg_' + id + '\" class="message">' + msg + '</span>');
$('#messages').fadeIn(); $('#messages').fadeIn();
setTimeout(function () {
var el = '#msg_' + id; var el = '#msg_' + id;
if (autohide) {
setTimeout(function () {
$(el).fadeOut(function () { $(this).remove(); }); $(el).fadeOut(function () { $(this).remove(); });
}, }, 10000);
5000); } else {
$(el).click(function () {
$(el).fadeOut(function () { $(this).remove(); });
return false;
});
}
msgIndex++; msgIndex++;
} }
} }

View file

@ -12,6 +12,11 @@
if (getCookie('HideAZ')) { if (getCookie('HideAZ')) {
$('#BottomContainer').hide(); $('#BottomContainer').hide();
} }
if (getCookie('SaveTrackPosition')) {
$('#SaveTrackPosition').attr('checked', true);
} else {
$('#SaveTrackPosition').attr('checked', false);
}
$('ul#ChangeLog li.log').each(function (i, el) { $('ul#ChangeLog li.log').each(function (i, el) {
if (i > 3) { if (i > 3) {
$(el).hide(); $(el).hide();

View file

@ -45,18 +45,13 @@
} else { } else {
$('#ForceFlash').attr('checked', false); $('#ForceFlash').attr('checked', false);
} }
if (getCookie('SaveTrackPosition')) {
$('#SaveTrackPosition').attr('checked', true);
} else {
$('#SaveTrackPosition').attr('checked', false);
}
if (getCookie('AutoPilot')) { if (getCookie('AutoPilot')) {
setCookie('AutoPilot', null) setCookie('AutoPilot', null)
} }
// Version check // Version check
if (getCookie('CurrentVersion')) { if (getCookie('CurrentVersion')) {
if (checkVersionNewer(parseVersionString(getCookie('CurrentVersion')), parseVersionString(currentVersion))) { if (checkVersionNewer(parseVersionString(getCookie('CurrentVersion')), parseVersionString(currentVersion))) {
updateMessage('MiniSub updated to v' + currentVersion); updateMessage('MiniSub updated to v' + currentVersion, false);
setCookie('CurrentVersion', currentVersion); setCookie('CurrentVersion', currentVersion);
} }
} else { } else {
@ -106,7 +101,7 @@
return false; return false;
}); });
// Ajax Loading Screen // Show/Hide Loading
$("#toploading").ajaxStart(function () { $("#toploading").ajaxStart(function () {
$(this).show(); $(this).show();
}); });
@ -119,8 +114,7 @@
var source = e.target.id; var source = e.target.id;
if (source != 'Search' && source != 'ChatMsg' && source != 'AutoPlaylists') { if (source != 'Search' && source != 'ChatMsg' && source != 'AutoPlaylists') {
var unicode = e.charCode ? e.charCode : e.keyCode; var unicode = e.charCode ? e.charCode : e.keyCode;
// a-z if (unicode >= 65 && unicode <= 90 && $('#tabLibrary').is(':visible')) { // a-z
if (unicode >= 65 && unicode <= 90 && $('#tabLibrary').is(':visible')) {
var key = findKeyForCode(unicode); var key = findKeyForCode(unicode);
if (key == 'x' || key == 'y' || key == 'z') { if (key == 'x' || key == 'y' || key == 'z') {
key = 'x-z'; key = 'x-z';
@ -129,23 +123,42 @@
if ($(el).length > 0) { if ($(el).length > 0) {
$('#Artists').stop().scrollTo(el, 400); $('#Artists').stop().scrollTo(el, 400);
} }
// right arrow } else if (unicode == 39 || unicode == 176) { // right arrow
} else if (unicode == 39 || unicode == 176) {
var next = $('#CurrentPlaylistContainer tr.playing').next(); var next = $('#CurrentPlaylistContainer tr.playing').next();
if (!next.length) next = $('#CurrentPlaylistContainer li').first(); if (!next.length) next = $('#CurrentPlaylistContainer li').first();
changeTrack(next); changeTrack(next);
// back arrow } else if (unicode == 37 || unicode == 177) { // back arrow
} else if (unicode == 37 || unicode == 177) {
var prev = $('#CurrentPlaylistContainer tr.playing').prev(); var prev = $('#CurrentPlaylistContainer tr.playing').prev();
if (!prev.length) prev = $('#CurrentPlaylistContainer tr').last(); if (!prev.length) prev = $('#CurrentPlaylistContainer tr').last();
changeTrack(prev); changeTrack(prev);
// spacebar } else if (unicode == 32 || unicode == 179 || unicode == 0179) { // spacebar
} else if (unicode == 32 || unicode == 179 || unicode == 0179) {
playPauseSong(); playPauseSong();
return false; return false;
} else if (unicode == 36 && $('#tabLibrary').is(':visible')) { } else if (unicode == 36 && $('#tabLibrary').is(':visible')) { // home
$('#Artists').stop().scrollTo('#MusicFolders', 400); $('#Artists').stop().scrollTo('#MusicFolders', 400);
} }
if (unicode == 189) { // dash - volume down
var volume = getCookie('Volume') ? parseFloat(getCookie('Volume')) : 1;
if (volume <= 1 && volume > 0 && source == '') {
volume += -.1;
$("#playdeck").jPlayer({
volume: volume
});
setCookie('Volume', volume);
//updateMessage('Volume: ' + Math.round(volume * 100) + '%');
}
}
if (unicode == 187) { // equals - volume up
var volume = getCookie('Volume') ? parseFloat(getCookie('Volume')) : 1;
if (volume < 1 && volume >= 0 && source == '') {
volume += .1;
$("#playdeck").jPlayer({
volume: volume
});
setCookie('Volume', volume);
//updateMessage('Volume: ' + Math.round(volume * 100) + '%');
}
}
} }
}); });
@ -288,7 +301,7 @@
$(track).clone().appendTo('#CurrentPlaylistContainer'); $(track).clone().appendTo('#CurrentPlaylistContainer');
count++; count++;
} }
updateMessage(count + ' Song(s) Added'); updateMessage(count + ' Song(s) Added', true);
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');
@ -329,7 +342,7 @@
$(this).addClass('rate'); $(this).addClass('rate');
return false; return false;
}); });
$('table.songlist tr.song a.albumlink').live('click', function (event) { $('table.songlist tr.song td.album a').live('click', function (event) {
var parentid = $(this).parent().parent().attr('parentid'); var parentid = $(this).parent().parent().attr('parentid');
if (parentid != '' && parentid !== undefined) { if (parentid != '' && parentid !== undefined) {
$('#AutoAlbumContainer li').removeClass('selected'); $('#AutoAlbumContainer li').removeClass('selected');
@ -338,6 +351,17 @@
} }
return false; return false;
}); });
/*
$('table.songlist tr.song td.artist a').live('click', function (event) {
var artistid = $(this).parent().parent().attr('artistid');
if (artistid != '' && artistid !== undefined) {
$('#AutoAlbumContainer li').removeClass('selected');
$('#ArtistContainer li').removeClass('selected');
getArtist(artistid, 'link', '#AlbumContainer tbody');
}
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;
@ -596,7 +620,7 @@
$(this).addClass('selected'); $(this).addClass('selected');
count++; count++;
}); });
updateMessage(count + ' Song(s) Selected'); updateMessage(count + ' Song(s) Selected', true);
} }
return false; return false;
}); });
@ -633,7 +657,7 @@
} }
} }
$(this).attr("title", msg); $(this).attr("title", msg);
updateMessage(msg); updateMessage(msg, true);
return false; return false;
}); });

View file

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "MiniSub", "name": "MiniSub",
"description": "MiniSub - HTML5 Mini Player for Subsonic", "description": "MiniSub - HTML5 Mini Player for Subsonic",
"version": "2.3.4", "version": "2.3.5",
"app": { "app": {
"launch": { "launch": {
"local_path": "index.html" "local_path": "index.html"

View file

@ -253,6 +253,7 @@ a#logo:hover
border-radius: 4px 4px 4px 4px; border-radius: 4px 4px 4px 4px;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
opacity: 0.8; opacity: 0.8;
cursor: pointer;
} }
.status .status
{ {
@ -595,7 +596,7 @@ table.songlist tr.row td.album
padding: 0; padding: 0;
line-height: 31px; line-height: 31px;
} }
table.songlist tr.row td.album a table.songlist tr.row a
{ {
color: #829FC0; color: #829FC0;
text-decoration: none; text-decoration: none;
@ -604,7 +605,7 @@ table.songlist tr.row td.album a
white-space: nowrap; white-space: nowrap;
font-size: 12px; font-size: 12px;
} }
table.songlist tr.row td.album a:hover table.songlist tr.row a:hover
{ {
text-decoration: underline; text-decoration: underline;
} }
@ -1125,6 +1126,15 @@ table.songlist tr.selected td.album a
{ {
background: url('../images/loop_alt4_gl_16x12.png') 0 center no-repeat; background: url('../images/loop_alt4_gl_16x12.png') 0 center no-repeat;
} }
#songdetails a.lock
{
float: left;
margin: 2px;
height: 12px;
width: 9px;
display: block;
background: url('../images/lock_stroke_gl_9x12.png') 0 center no-repeat;
}
#songdetails a.first #songdetails a.first
{ {
margin: 2px 2px 2px 0; margin: 2px 2px 2px 0;