2.2.2 Re-enable drag and drop, ogg support, misc bug fixes
This commit is contained in:
parent
2ea9027235
commit
1265cb8449
10 changed files with 107 additions and 75 deletions
11
index.html
11
index.html
|
@ -1,7 +1,8 @@
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
|
||||||
<title>Subsonic - MiniSub</title>
|
<title>Subsonic - MiniSub</title>
|
||||||
<link href="images/subsonic_32x32.ico" rel="shortcut icon" />
|
<link href="images/subsonic_32x32.ico" rel="shortcut icon" />
|
||||||
<link rel="icon" href="images/subsonic_48x48.png" sizes="48x48"/>
|
<link rel="icon" href="images/subsonic_48x48.png" sizes="48x48"/>
|
||||||
|
@ -187,7 +188,8 @@
|
||||||
<label for="Password">Password <span class="red">*</span></label><br />
|
<label for="Password">Password <span class="red">*</span></label><br />
|
||||||
<input type="password" id="Password" name="Password" class="large"/><br />
|
<input type="password" id="Password" name="Password" class="large"/><br />
|
||||||
<label for="Server">Server <span class="red">*</span></label><br />
|
<label for="Server">Server <span class="red">*</span></label><br />
|
||||||
<input type="text" id="Server" name="Server" class="xlarge" title="Subsonic Server URL Ex: http://host:port/subsonic"/><br />
|
<input type="text" id="Server" name="Server" class="xlarge" title="Subsonic Server URL Ex: http://host:port/subsonic"/>
|
||||||
|
<!--<a href="#" class="button" id="action_RequestURL" title="Request Permission for Server URL">Enable URL</a><br />-->
|
||||||
<label for="SubsonicVersion">Subsonic API: <span id="SubsonicVersion"></span></label><br />
|
<label for="SubsonicVersion">Subsonic API: <span id="SubsonicVersion"></span></label><br />
|
||||||
</div>
|
</div>
|
||||||
<div class="subsection floatleft">
|
<div class="subsection floatleft">
|
||||||
|
@ -277,6 +279,11 @@
|
||||||
<span class="changes">- </span>
|
<span class="changes">- </span>
|
||||||
</li>
|
</li>
|
||||||
-->
|
-->
|
||||||
|
<li class="log"><span class="version">10/25/2012 - 2.2.2</span>
|
||||||
|
<span class="changes">- Re-enabled Drag and Drop sorting on Current Playlist</span>
|
||||||
|
<span class="changes">- Started passing the contentType directly (hopefully supporting Ogg, as well as others depending on your browser)</span>
|
||||||
|
<span class="changes">- Taking a lot of crap for the "Access your data on all websites", sorry I have no other choice! (<a href="https://groups.google.com/a/chromium.org/d/msg/chromium-apps/Q1M1HoLpOCo/hFBCS07acCMJ" target="_blank">Chromium Apps Forum Post</a>)</span>
|
||||||
|
</li>
|
||||||
<li class="log"><span class="version">10/15/2012 - 2.2.0</span>
|
<li class="log"><span class="version">10/15/2012 - 2.2.0</span>
|
||||||
<span class="changes">- Column sorting for all headers in all tables! (Thanks to <a href="https://github.com/joequery/Stupid-Table-Plugin" target="_blank">joequery</a>)</span>
|
<span class="changes">- Column sorting for all headers in all tables! (Thanks to <a href="https://github.com/joequery/Stupid-Table-Plugin" target="_blank">joequery</a>)</span>
|
||||||
<span class="changes">- Fancy Webkit styled scrollbars for those of you with browsers that don't suck (Works with Dark theme)</span>
|
<span class="changes">- Fancy Webkit styled scrollbars for those of you with browsers that don't suck (Works with Dark theme)</span>
|
||||||
|
|
|
@ -10,7 +10,7 @@ var passwordenc;
|
||||||
var server;
|
var server;
|
||||||
var smwidth;
|
var smwidth;
|
||||||
var volume = 50;
|
var volume = 50;
|
||||||
var currentVersion = '2.2.1';
|
var currentVersion = '2.2.2';
|
||||||
|
|
||||||
function getCookie(value) {
|
function getCookie(value) {
|
||||||
if ($.cookie(value)) {
|
if ($.cookie(value)) {
|
||||||
|
|
|
@ -309,6 +309,7 @@ function toggleAlbumListNextPrev(el, on, type, offset) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getRandomSongList(action, appendto, genre, folder) {
|
function getRandomSongList(action, appendto, genre, folder) {
|
||||||
|
if (debug) { console.log('action:' + action + ', appendto:' + appendto + ', genre:' + genre + ', folder:' + folder); }
|
||||||
var size, gstring;
|
var size, gstring;
|
||||||
gstring = '';
|
gstring = '';
|
||||||
if (getCookie('AutoPlaylistSize')) {
|
if (getCookie('AutoPlaylistSize')) {
|
||||||
|
@ -316,14 +317,13 @@ function getRandomSongList(action, appendto, genre, folder) {
|
||||||
} else {
|
} else {
|
||||||
size = 25;
|
size = 25;
|
||||||
}
|
}
|
||||||
if (genre !== undefined && genre != '') {
|
if (genre != '' && genre != 'Random') {
|
||||||
gstring = '&genre=' + genre;
|
gstring = '&genre=' + genre;
|
||||||
}
|
}
|
||||||
if (genre == 'Random') {
|
if (typeof folder == 'number' && folder == 0) {
|
||||||
gstring = '';
|
gstring = '&musicFolderId=' + folder;
|
||||||
}
|
} else if (folder != '') {
|
||||||
if (folder !== undefined && folder != '') {
|
gstring = '&musicFolderId=' + folder;
|
||||||
gstring = '&musicFolderId=' + folder;
|
|
||||||
}
|
}
|
||||||
if (genre == 'Starred') {
|
if (genre == 'Starred') {
|
||||||
getStarred(action, appendto, 'song');
|
getStarred(action, appendto, 'song');
|
||||||
|
@ -372,10 +372,9 @@ function getRandomSongList(action, appendto, genre, folder) {
|
||||||
}
|
}
|
||||||
if (appendto === '#CurrentPlaylistContainer tbody') {
|
if (appendto === '#CurrentPlaylistContainer tbody') {
|
||||||
updateMessage(items.length + ' Song(s) Added');
|
updateMessage(items.length + ' Song(s) Added');
|
||||||
|
updateStatus('#status_Current', countCurrentPlaylist('#CurrentPlaylistContainer'));
|
||||||
}
|
}
|
||||||
if (action == '' && genre == '' && folder == '') {
|
if (action == 'autoplay' || action == 'autoplayappend') {
|
||||||
nextPlay();
|
|
||||||
} else if (action == 'autoplay') {
|
|
||||||
autoPlay();
|
autoPlay();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -526,7 +525,7 @@ function updateNowPlaying(showPopup) {
|
||||||
if (msg.coverArt === undefined) {
|
if (msg.coverArt === undefined) {
|
||||||
coverartSrc = 'images/albumdefault_50.jpg';
|
coverartSrc = 'images/albumdefault_50.jpg';
|
||||||
} else {
|
} else {
|
||||||
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=50&id=' + msg.coverArt;
|
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&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;
|
||||||
|
@ -1165,7 +1164,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?v=' + version + '&c=' + applicationName + '&f=json&size=25&id=' + video.coverArt;
|
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&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>';
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
function generateRowHTML(child, appendto, rowcolor) {
|
function generateRowHTML(child, appendto, rowcolor) {
|
||||||
var albumhtml, isDir, starred, duration, i;
|
var html, isDir, starred, duration, artist, 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 = ''; }
|
||||||
|
if (child.artist !== undefined) { artist = child.artist; } else { artist = ''; }
|
||||||
if (isDir === true) {
|
if (isDir === true) {
|
||||||
albumhtml = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, child.artist, child.userRating, starred);
|
html = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, artist, child.userRating, starred);
|
||||||
} else {
|
} else {
|
||||||
var track;
|
var track;
|
||||||
if (child.track === undefined) { track = " "; } else { track = child.track; }
|
if (child.track === undefined) { track = " "; } else { track = child.track; }
|
||||||
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', child.artist, child.album, child.coverArt, child.userRating, starred, duration);
|
html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', artist, child.album, child.coverArt, child.userRating, starred, duration);
|
||||||
}
|
}
|
||||||
return albumhtml;
|
return html;
|
||||||
}
|
}
|
||||||
function generateAlbumHeaderHTML() {
|
function generateAlbumHeaderHTML() {
|
||||||
var html;
|
var html;
|
||||||
|
@ -32,7 +33,7 @@ function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist,
|
||||||
if (coverart == undefined) {
|
if (coverart == undefined) {
|
||||||
html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>';
|
html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>';
|
||||||
} else {
|
} else {
|
||||||
html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>';
|
html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>';
|
||||||
}
|
}
|
||||||
html += '<td class=\"album\">' + title + '</td>';
|
html += '<td class=\"album\">' + title + '</td>';
|
||||||
html += '<td class=\"artist\">' + artist + '</td>';
|
html += '<td class=\"artist\">' + artist + '</td>';
|
||||||
|
@ -74,7 +75,7 @@ function generateSongHTML(rowcolor, childid, parentid, track, title, description
|
||||||
if (coverart == undefined) {
|
if (coverart == undefined) {
|
||||||
coverartSrc = 'images/albumdefault_25.jpg';
|
coverartSrc = 'images/albumdefault_25.jpg';
|
||||||
} else {
|
} else {
|
||||||
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=25&id=' + coverart;
|
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&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="#" class=\"albumlink\"><img src=\"' + coverartSrc + '\" />' + album + '</a></td>';
|
||||||
html += '<td class=\"time\">' + time + '</td>';
|
html += '<td class=\"time\">' + time + '</td>';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var scrobbled = false;
|
var scrobbled = false;
|
||||||
|
var timerid = 0;
|
||||||
function playSong(el, songid, albumid, position, loadonly) {
|
function playSong(el, songid, albumid, position, loadonly) {
|
||||||
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + albumid;
|
ajaxUrl = baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + albumid;
|
||||||
if (debug) { console.log(ajaxUrl) }
|
if (debug) { console.log(ajaxUrl) }
|
||||||
|
@ -8,7 +9,7 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var title, artist, album, rating, starred;
|
var title, artist, album, rating, starred, contenttype;
|
||||||
if (data["subsonic-response"].directory.child !== undefined) {
|
if (data["subsonic-response"].directory.child !== undefined) {
|
||||||
// There is a bug in the API that doesn't return a JSON array for one artist
|
// There is a bug in the API that doesn't return a JSON array for one artist
|
||||||
var children = [];
|
var children = [];
|
||||||
|
@ -20,10 +21,11 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
$.each(children, function (i, child) {
|
$.each(children, function (i, child) {
|
||||||
if (child.id == songid) {
|
if (child.id == songid) {
|
||||||
title = child.title.toString();
|
title = child.title.toString();
|
||||||
artist = child.artist;
|
if (child.artist !== undefined) { artist = child.artist.toString(); } else { artist = ''; }
|
||||||
album = child.album;
|
album = child.album;
|
||||||
coverart = child.coverArt;
|
coverart = child.coverArt;
|
||||||
rating = child.userRating;
|
rating = child.userRating;
|
||||||
|
if (child.contentType !== undefined) { contenttype = child.contentType; } else { contenttype = 'audio/mp3'; }
|
||||||
if (child.starred !== undefined) { starred = true; } else { starred = false; }
|
if (child.starred !== undefined) { starred = true; } else { starred = false; }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -44,8 +46,8 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
coverartSrc = 'images/albumdefault_56.jpg';
|
coverartSrc = 'images/albumdefault_56.jpg';
|
||||||
coverartFullSrc = '';
|
coverartFullSrc = '';
|
||||||
} else {
|
} else {
|
||||||
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&size=56&id=' + coverart;
|
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=56&id=' + coverart;
|
||||||
coverartFullSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=json&id=' + coverart;
|
coverartFullSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&id=' + coverart;
|
||||||
}
|
}
|
||||||
$('#coverartimage').attr('href', coverartFullSrc);
|
$('#coverartimage').attr('href', coverartFullSrc);
|
||||||
$('#coverartimage img').attr('src', coverartSrc);
|
$('#coverartimage img').attr('src', coverartSrc);
|
||||||
|
@ -66,7 +68,7 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
id: 'audio',
|
id: 'audio',
|
||||||
url: baseURL + '/stream.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
|
url: baseURL + '/stream.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
|
||||||
stream: true,
|
stream: true,
|
||||||
type: 'audio/mp3',
|
type: contenttype,
|
||||||
multiShot: false,
|
multiShot: false,
|
||||||
whileloading: function () {
|
whileloading: function () {
|
||||||
//if (debug) { console.log('loaded:' + this.bytesLoaded + ' total:' + this.bytesTotal); }
|
//if (debug) { console.log('loaded:' + this.bytesLoaded + ' total:' + this.bytesTotal); }
|
||||||
|
@ -129,9 +131,7 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
var next = $('#CurrentPlaylistContainer tr.playing').next();
|
var next = $('#CurrentPlaylistContainer tr.playing').next();
|
||||||
if (!changeTrack(next)) {
|
if (!changeTrack(next)) {
|
||||||
if (getCookie('AutoPilot')) {
|
if (getCookie('AutoPilot')) {
|
||||||
//var genre = $(this).data('genre');
|
getRandomSongList('autoplayappend', '#CurrentPlaylistContainer tbody', '', '');
|
||||||
//var folder = $(this).data('folder');
|
|
||||||
getRandomSongList('', '#CurrentPlaylistContainer tbody', '', '');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -147,6 +147,19 @@ function playSong(el, songid, albumid, position, loadonly) {
|
||||||
seekAndPlay('audio', p);
|
seekAndPlay('audio', p);
|
||||||
soundManager.setVolume('audio', volume);
|
soundManager.setVolume('audio', volume);
|
||||||
}
|
}
|
||||||
|
if (getCookie('SaveTrackPosition')) {
|
||||||
|
if (timerid != 0) {
|
||||||
|
clearInterval(timerid);
|
||||||
|
}
|
||||||
|
timerid = window.setInterval(function () {
|
||||||
|
if (getCookie('SaveTrackPosition')) {
|
||||||
|
var sm = soundManager.getSoundById('audio');
|
||||||
|
if (sm !== undefined) {
|
||||||
|
saveTrackPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
var submenu = $('div#submenu_CurrentPlaylist');
|
var submenu = $('div#submenu_CurrentPlaylist');
|
||||||
if (submenu.is(":visible")) {
|
if (submenu.is(":visible")) {
|
||||||
submenu.fadeOut();
|
submenu.fadeOut();
|
||||||
|
@ -288,36 +301,37 @@ function changeTrack(next) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function autoPlay() {
|
function autoPlay(loadonly) {
|
||||||
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'); }
|
if (debug) { console.log('Next Play'); }
|
||||||
var song = $('#CurrentPlaylistContainer tr.playing');
|
var song = $('#CurrentPlaylistContainer tr.playing');
|
||||||
var nextSong = $('#CurrentPlaylistContainer tr.playing').next();
|
var nextSong = $('#CurrentPlaylistContainer tr.playing').next();
|
||||||
if (song.length == 0) {
|
if (song.length == 0) {
|
||||||
song = $('#CurrentPlaylistContainer tr.song:first');
|
if (loadonly) {
|
||||||
var songid = $(song).attr('childid');
|
// No songs currently playing, so get first and do not play
|
||||||
var albumid = $(song).attr('parentid');
|
song = $('#CurrentPlaylistContainer tr.song:first');
|
||||||
playSong(song, songid, albumid, 0, false);
|
var songid = $(song).attr('childid');
|
||||||
} else if (nextSong.length == 1) {
|
var albumid = $(song).attr('parentid');
|
||||||
song = $('#CurrentPlaylistContainer tr.playing').next();
|
playSong(song, songid, albumid, 0, true);
|
||||||
var songid = $(song).attr('childid');
|
} else {
|
||||||
var albumid = $(song).attr('parentid');
|
// No songs currently playing, so get first and play
|
||||||
playSong(song, songid, albumid, 0, false);
|
song = $('#CurrentPlaylistContainer tr.song:first');
|
||||||
|
var songid = $(song).attr('childid');
|
||||||
|
var albumid = $(song).attr('parentid');
|
||||||
|
playSong(song, songid, albumid, 0, false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//song = $('#CurrentPlaylistContainer tr.playing').next();
|
if (nextSong.length == 1) {
|
||||||
|
// Get next song after currently playing
|
||||||
|
song = $('#CurrentPlaylistContainer tr.playing').next();
|
||||||
|
var songid = $(song).attr('childid');
|
||||||
|
var albumid = $(song).attr('parentid');
|
||||||
|
playSong(song, songid, albumid, 0, false);
|
||||||
|
} else {
|
||||||
|
// Otherwise get
|
||||||
|
song = $('#CurrentPlaylistContainer tr.playing');
|
||||||
|
var songid = $(song).attr('childid');
|
||||||
|
var albumid = $(song).attr('parentid');
|
||||||
|
playSong(song, songid, albumid, 0, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,6 +20,8 @@ function HexEncode(n) {
|
||||||
r[t] = i[n.charCodeAt(t)];
|
r[t] = i[n.charCodeAt(t)];
|
||||||
return r.join("")
|
return r.join("")
|
||||||
}
|
}
|
||||||
|
String.prototype.hexDecode = function () { var r = ''; for (var i = 0; i < this.length; i += 2) { r += unescape('%' + this.substr(i, 2)); } return r; }
|
||||||
|
String.prototype.hexEncode = function () { var r = ''; var i = 0; var h; while (i < this.length) { h = this.charCodeAt(i++).toString(16); while (h.length < 2) { h = h; } r += h; } return r; }
|
||||||
function findKeyForCode(code) {
|
function findKeyForCode(code) {
|
||||||
var map = { 'keymap': [
|
var map = { 'keymap': [
|
||||||
{ 'key': 'a', 'code': 65 },
|
{ 'key': 'a', 'code': 65 },
|
||||||
|
@ -293,3 +295,14 @@ function parseDate(date) {
|
||||||
var date = months[month] + " " + dateParts[2] + ", " + dateParts[0];
|
var date = months[month] + " " + dateParts[2] + ", " + dateParts[0];
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
function askPermission() {
|
||||||
|
chrome.permissions.request({
|
||||||
|
origins: [getCookie('Server')]
|
||||||
|
}, function (granted) {
|
||||||
|
if (granted) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
|
@ -18,16 +18,6 @@
|
||||||
$(el).hide();
|
$(el).hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (getCookie('SaveTrackPosition')) {
|
|
||||||
window.setInterval(function () {
|
|
||||||
if (getCookie('SaveTrackPosition')) {
|
|
||||||
var sm = soundManager.getSoundById('audio');
|
|
||||||
if (sm !== undefined) {
|
|
||||||
saveTrackPosition();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
if (getCookie('CurrentSong')) {
|
if (getCookie('CurrentSong')) {
|
||||||
var currentSong = JSON.parse(getCookie("CurrentSong"));
|
var currentSong = JSON.parse(getCookie("CurrentSong"));
|
||||||
playSong(null, currentSong.songid, currentSong.albumid, currentSong.position, true);
|
playSong(null, currentSong.songid, currentSong.albumid, currentSong.position, true);
|
||||||
|
|
|
@ -65,12 +65,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Table Sorting
|
// Table Sorting
|
||||||
|
|
||||||
$('#CurrentPlaylistContainer').stupidtable();
|
$('#CurrentPlaylistContainer').stupidtable();
|
||||||
$('#TrackContainer').stupidtable();
|
$('#TrackContainer').stupidtable();
|
||||||
$('#PodcastContainer').stupidtable();
|
$('#PodcastContainer').stupidtable();
|
||||||
$('#AlbumContainer').stupidtable();
|
$('#AlbumContainer').stupidtable();
|
||||||
|
|
||||||
|
$('#action_RequestURL').click(function () {
|
||||||
|
askPermission();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
$('.tabcontent').hide(); //Hide all content
|
$('.tabcontent').hide(); //Hide all content
|
||||||
if (!getCookie('username') && !getCookie('passwordenc') && !getCookie('Server')) {
|
if (!getCookie('username') && !getCookie('passwordenc') && !getCookie('Server')) {
|
||||||
|
@ -629,7 +633,7 @@
|
||||||
msg = 'Autopilot On';
|
msg = 'Autopilot On';
|
||||||
if ($('#CurrentPlaylistContainer tbody').html() == '') {
|
if ($('#CurrentPlaylistContainer tbody').html() == '') {
|
||||||
$('#CurrentPlaylistContainer tbody').empty();
|
$('#CurrentPlaylistContainer tbody').empty();
|
||||||
getRandomSongList('', '#CurrentPlaylistContainer tbody', '', '');
|
getRandomSongList('autoplay', '#CurrentPlaylistContainer tbody', '', '');
|
||||||
$('#currentActions a.button').removeClass('disabled');
|
$('#currentActions a.button').removeClass('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -642,8 +646,8 @@
|
||||||
$('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () {
|
$('#AutoPlaylistContainer li.item, #FolderContainer li.item').live('click', function () {
|
||||||
$('#AutoPlaylistContainer li, #FolderContainer li, #PlaylistContainer li').removeClass('selected');
|
$('#AutoPlaylistContainer li, #FolderContainer li, #PlaylistContainer li').removeClass('selected');
|
||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
var genre = $(this).data('genre');
|
var genre = $(this).data('genre') !== undefined ? $(this).data('genre') : '';
|
||||||
var folder = $(this).data('folder');
|
var folder = $(this).data('folder') !== undefined ? $(this).data('folder') : '';
|
||||||
getRandomSongList('', '#TrackContainer tbody', genre, folder);
|
getRandomSongList('', '#TrackContainer tbody', genre, folder);
|
||||||
});
|
});
|
||||||
$('#AutoPlaylistContainer li.item a.play, #FolderContainer li.item a.play').live('click', function () {
|
$('#AutoPlaylistContainer li.item a.play, #FolderContainer li.item a.play').live('click', function () {
|
||||||
|
@ -909,8 +913,9 @@
|
||||||
if ($('#SaveTrackPosition').is(':checked')) {
|
if ($('#SaveTrackPosition').is(':checked')) {
|
||||||
setCookie('SaveTrackPosition', '1');
|
setCookie('SaveTrackPosition', '1');
|
||||||
var sm = soundManager.getSoundById('audio');
|
var sm = soundManager.getSoundById('audio');
|
||||||
if (sm !== undefined) {
|
if (sm) {
|
||||||
saveTrackPosition();
|
saveTrackPosition();
|
||||||
|
alert('save');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setCookie('SaveTrackPosition', null);
|
setCookie('SaveTrackPosition', null);
|
||||||
|
@ -942,7 +947,6 @@
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
// JQuery UI Sortable - Drag and drop sorting
|
// JQuery UI Sortable - Drag and drop sorting
|
||||||
var fixHelper = function (e, ui) {
|
var fixHelper = function (e, ui) {
|
||||||
ui.children().each(function () {
|
ui.children().each(function () {
|
||||||
|
@ -956,6 +960,5 @@
|
||||||
$("#TrackContainer tbody").sortable({
|
$("#TrackContainer tbody").sortable({
|
||||||
helper: fixHelper
|
helper: fixHelper
|
||||||
}).disableSelection();
|
}).disableSelection();
|
||||||
*/
|
|
||||||
}); // End document.ready
|
}); // End document.ready
|
||||||
|
|
||||||
|
|
|
@ -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.2.1",
|
"version": "2.2.2",
|
||||||
"app": {
|
"app": {
|
||||||
"launch": {
|
"launch": {
|
||||||
"local_path": "index.html"
|
"local_path": "index.html"
|
||||||
|
|
|
@ -280,6 +280,7 @@ a#logo:hover
|
||||||
{
|
{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Library Style */
|
/* Library Style */
|
||||||
ul.simplelist
|
ul.simplelist
|
||||||
{
|
{
|
||||||
|
@ -659,6 +660,10 @@ table.songlist tr.selected td:first-child
|
||||||
{
|
{
|
||||||
background: url('../images/check_8x7.png') 10px 16px no-repeat;
|
background: url('../images/check_8x7.png') 10px 16px no-repeat;
|
||||||
}
|
}
|
||||||
|
table.songlist tr.selected td.album a
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
#ArtistContainer
|
#ArtistContainer
|
||||||
{
|
{
|
||||||
min-height: 360px;
|
min-height: 360px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue