2.3.6 undo basic auth
This commit is contained in:
parent
8643f01647
commit
53ed1bc0d4
11 changed files with 1261 additions and 1239 deletions
19
index.html
19
index.html
|
@ -24,12 +24,12 @@
|
||||||
<script src="js/plugins/jquery.scrollTo-1.4.2-min.js" type="text/javascript"></script>
|
<script src="js/plugins/jquery.scrollTo-1.4.2-min.js" type="text/javascript"></script>
|
||||||
<script src="js/jplayer/jquery.jplayer.min.js" type="text/javascript"></script>
|
<script src="js/jplayer/jquery.jplayer.min.js" type="text/javascript"></script>
|
||||||
<script src="js/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>
|
<script src="js/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>
|
||||||
<script src="js/libs/api.js" type="text/javascript"></script>
|
|
||||||
<script src="js/libs/utils.js" type="text/javascript"></script>
|
<script src="js/libs/utils.js" type="text/javascript"></script>
|
||||||
|
<script src="js/app.js" type="text/javascript"></script>
|
||||||
|
<script src="js/libs/api.js" type="text/javascript"></script>
|
||||||
<script src="js/libs/chat.js" type="text/javascript"></script>
|
<script src="js/libs/chat.js" type="text/javascript"></script>
|
||||||
<script src="js/libs/generators.js" type="text/javascript"></script>
|
<script src="js/libs/generators.js" type="text/javascript"></script>
|
||||||
<script src="js/libs/player.js" type="text/javascript"></script>
|
<script src="js/libs/player.js" type="text/javascript"></script>
|
||||||
<script src="js/app.js" type="text/javascript"></script>
|
|
||||||
<script src="js/ui-ready.js" type="text/javascript"></script>
|
<script src="js/ui-ready.js" type="text/javascript"></script>
|
||||||
<script src="js/ui-load.js" type="text/javascript"></script>
|
<script src="js/ui-load.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -224,6 +224,7 @@
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<div class="subsection floatleft">
|
<div class="subsection floatleft">
|
||||||
<h3 class="title">Options</h3>
|
<h3 class="title">Options</h3>
|
||||||
|
<label class="red">* Refresh (F5) required</label><br />
|
||||||
<label for="Theme">Theme</label><br />
|
<label for="Theme">Theme</label><br />
|
||||||
<select id="Theme" name="Theme" class="large">
|
<select id="Theme" name="Theme" class="large">
|
||||||
<option value="default">Default</option>
|
<option value="default">Default</option>
|
||||||
|
@ -236,7 +237,7 @@
|
||||||
<input type="text" id="AutoAlbumSize" name="AutoAlbumSize" class="large" title="Number of Albums to Get on the Music Library tab"/><br />
|
<input type="text" id="AutoAlbumSize" name="AutoAlbumSize" class="large" title="Number of Albums to Get on the Music Library tab"/><br />
|
||||||
<label for="AutoPlaylistSize">Auto Playlist Size (Default 25)</label><br />
|
<label for="AutoPlaylistSize">Auto Playlist Size (Default 25)</label><br />
|
||||||
<input type="text" id="AutoPlaylistSize" name="AutoPlaylistSize" class="large" title="Number of Songs to Get on the Playlist tab"/><br />
|
<input type="text" id="AutoPlaylistSize" name="AutoPlaylistSize" class="large" title="Number of Songs to Get on the Playlist tab"/><br />
|
||||||
<label for="ApplicationName">Application Name (Default MiniSub)</label><br />
|
<label for="ApplicationName">Application Name (Default MiniSub)*</label><br />
|
||||||
<input type="text" id="ApplicationName" name="ApplicationName" class="large" title="Custom Player Name"/><br />
|
<input type="text" id="ApplicationName" name="ApplicationName" class="large" title="Custom Player Name"/><br />
|
||||||
</div>
|
</div>
|
||||||
<div class="subsection floatleft">
|
<div class="subsection floatleft">
|
||||||
|
@ -255,8 +256,11 @@
|
||||||
<div class="inputwrap"><input type="checkbox" id="Debug" name="Debug" value="1" title="Enable Debug Mode (Events will be logged to the Javascript Console)"/></div>
|
<div class="inputwrap"><input type="checkbox" id="Debug" name="Debug" value="1" title="Enable Debug Mode (Events will be logged to the Javascript Console)"/></div>
|
||||||
<label for="Debug">Debug Mode</label>
|
<label for="Debug">Debug Mode</label>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<div class="inputwrap"><input type="checkbox" id="ForceFlash" name="ForceFlash" value="1" title="Force Flash (Option doesn't work with Chrome App)"/></div>
|
<div class="inputwrap"><input type="checkbox" id="ForceFlash" name="ForceFlash" value="1" title="Force Flash Plugin for Audio (Option doesn't work with Chrome App)"/></div>
|
||||||
<label for="ForceFlash">Force Flash</label>
|
<label for="ForceFlash">Force Flash </label>
|
||||||
|
<div class="clear"></div>
|
||||||
|
<div class="inputwrap"><input type="checkbox" id="Protocol" name="Protocol" value="1" title="Enable Cross-Domain AJAX Requests (Use if MiniSub is hosted in a different domain than Subsonic)"/></div>
|
||||||
|
<label for="Protocol">Enable JSONP*</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@ -296,10 +300,15 @@
|
||||||
<span class="changes">- </span>
|
<span class="changes">- </span>
|
||||||
</li>
|
</li>
|
||||||
-->
|
-->
|
||||||
|
<li class="log"><span class="version"> - 2.3.6</span>
|
||||||
|
<span class="changes">- Added Setting to toggle JSONP (This is for cross-domain requests, aka Subsonic is hosted on a different domain than MiniSub)</span>
|
||||||
|
<span class="changes">- Switched back to URL authentication (Including coverArt)</span>
|
||||||
|
</li>
|
||||||
<li class="log"><span class="version">12/3/2012 - 2.3.5</span>
|
<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">- 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">- 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>
|
<span class="changes">- Fixed Last.fm scrobble feature, this works again!</span>
|
||||||
|
<span class="changes">- Switch to Basic Authentication</span>
|
||||||
</li>
|
</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>
|
||||||
|
|
107
js/app.js
107
js/app.js
|
@ -2,47 +2,17 @@
|
||||||
var debug = false;
|
var debug = false;
|
||||||
var audio = null;
|
var audio = null;
|
||||||
var hostURL = location.href;
|
var hostURL = location.href;
|
||||||
|
var protocol = 'json';
|
||||||
var baseURL;
|
var baseURL;
|
||||||
|
var baseParams;
|
||||||
var apiVersion;
|
var apiVersion;
|
||||||
var username;
|
var username;
|
||||||
var password;
|
var password;
|
||||||
var passwordenc;
|
var passwordenc;
|
||||||
var server;
|
var server;
|
||||||
var smwidth;
|
var smwidth;
|
||||||
var currentVersion = '2.3.5';
|
var apiVersion = '1.6.0';
|
||||||
|
var currentVersion = '2.3.6';
|
||||||
function getCookie(value) {
|
|
||||||
if ($.cookie(value)) {
|
|
||||||
return $.cookie(value);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/* jQuery.cookies.js
|
|
||||||
if (browserStorageCheck) {
|
|
||||||
var item = localStorage.getItem(value);
|
|
||||||
if (item != '' && item != undefined) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (debug) { console.log('HTML5::loadStorage not supported on your browser' + html.length + ' characters'); }
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
function setCookie(key, value) {
|
|
||||||
$.cookie(key, value, { expires: 365 });
|
|
||||||
/* jQuery.cookies.js
|
|
||||||
try {
|
|
||||||
if (debug) { console.log('Saving : ' + key + ':' + value); }
|
|
||||||
localStorage.setItem(key, value);
|
|
||||||
} catch (e) {
|
|
||||||
if (e == QUOTA_EXCEEDED_ERR) {
|
|
||||||
alert('Quota exceeded!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get URL Querystring Parameters
|
// Get URL Querystring Parameters
|
||||||
var u = getParameterByName('u');
|
var u = getParameterByName('u');
|
||||||
|
@ -64,9 +34,7 @@ if (u && p && s) {
|
||||||
}
|
}
|
||||||
window.location.href = getPathFromUrl(window.location);
|
window.location.href = getPathFromUrl(window.location);
|
||||||
}
|
}
|
||||||
if (getCookie('Server')) {
|
|
||||||
baseURL = getCookie('Server') + '/rest';
|
|
||||||
}
|
|
||||||
var applicationName;
|
var applicationName;
|
||||||
if (getCookie('ApplicationName')) {
|
if (getCookie('ApplicationName')) {
|
||||||
applicationName = getCookie('ApplicationName');
|
applicationName = getCookie('ApplicationName');
|
||||||
|
@ -87,65 +55,8 @@ 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());
|
if (getCookie('Protocol')) {
|
||||||
var apiVersion = '1.6.0';
|
protocol = 'jsonp';
|
||||||
|
|
||||||
function loadTabContent(tab) {
|
|
||||||
var tabid = '#action_' + tab.substring(1, tab.length);
|
|
||||||
$("ul.tabs li a").removeClass("active"); //Remove any "active" class
|
|
||||||
$(tabid).addClass("active"); //Add "active" class to selected tab
|
|
||||||
$(".tabcontent").hide(); //Hide all tab content
|
|
||||||
window.location.hash = tab;
|
|
||||||
switch (tab) {
|
|
||||||
case '#tabLibrary':
|
|
||||||
if (debug) { console.log("TAG LIBRARY"); }
|
|
||||||
if (getCookie('MusicFolders')) {
|
|
||||||
loadArtists(getCookie('MusicFolders'), false);
|
|
||||||
} else {
|
|
||||||
loadArtists();
|
|
||||||
}
|
|
||||||
getMusicFolders();
|
|
||||||
break;
|
|
||||||
case '#tabQueue':
|
|
||||||
if (debug) { console.log("TAG QUEUE"); }
|
|
||||||
var header = generateSongHeaderHTML();
|
|
||||||
$('#CurrentPlaylistContainer thead').html(header);
|
|
||||||
var count = $('#CurrentPlaylistContainer tbody tr.song').size();
|
|
||||||
updateStatus('#status_Current', countCurrentPlaylist('#CurrentPlaylistContainer'));
|
|
||||||
if (count > 0) {
|
|
||||||
$('#currentActions a.button').removeClass('disabled');
|
|
||||||
}
|
|
||||||
var songid = $('#CurrentPlaylistContainer tbody tr.playing').attr('childid');
|
|
||||||
if (songid !== undefined) {
|
|
||||||
$('#CurrentPlaylist').scrollTo($('#' + songid), 400);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '#tabPlaylists':
|
|
||||||
if (debug) { console.log("TAG PLAYLIST"); }
|
|
||||||
loadPlaylists();
|
|
||||||
loadFolders();
|
|
||||||
loadAutoPlaylists();
|
|
||||||
updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer'));
|
|
||||||
break;
|
|
||||||
case '#tabPodcasts':
|
|
||||||
if (debug) { console.log("TAG PODCAST"); }
|
|
||||||
loadPodcasts();
|
|
||||||
updateStatus('#status_Podcasts', countCurrentPlaylist('#PodcastContainer'));
|
|
||||||
break;
|
|
||||||
case '#tabVideos':
|
|
||||||
if (debug) { console.log("TAG VIDEOS"); }
|
|
||||||
loadVideos(true);
|
|
||||||
break;
|
|
||||||
case '#tabPreferences':
|
|
||||||
getGenres();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$(tab).fadeIn('fast'); //Fade in the active ID content
|
|
||||||
}
|
}
|
||||||
|
var auth = makeBaseAuth(username, password.substring(4, password.length).hexDecode());
|
||||||
|
baseParams = 'u=' + username + '&p=' + password + '&f=' + protocol;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2188
js/libs/api.js
2188
js/libs/api.js
File diff suppressed because it is too large
Load diff
|
@ -4,9 +4,9 @@ function updateChatMessages() {
|
||||||
updater = $.periodic({ period: 1000, decay: 1.5, max_period: 1800000 }, function () {
|
updater = $.periodic({ period: 1000, decay: 1.5, max_period: 1800000 }, function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
periodic: this,
|
periodic: this,
|
||||||
url: baseURL + '/getChatMessages.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&since=' + starttime,
|
url: baseURL + '/getChatMessages.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&since=' + starttime,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data["subsonic-response"].chatMessages.chatMessage === undefined) {
|
if (data["subsonic-response"].chatMessages.chatMessage === undefined) {
|
||||||
|
@ -49,10 +49,10 @@ function stopUpdateChatMessages() {
|
||||||
function addChatMessage(msg) {
|
function addChatMessage(msg) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: baseURL + '/addChatMessage.view',
|
url: baseURL + '/addChatMessage.view?' + baseParams,
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: { v: apiVersion, c: applicationName, f: "json", message: msg },
|
data: { v: apiVersion, c: applicationName, message: msg },
|
||||||
success: function () {
|
success: function () {
|
||||||
updater.reset();
|
updater.reset();
|
||||||
},
|
},
|
||||||
|
|
|
@ -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?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>';
|
html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&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>';
|
||||||
|
@ -77,7 +77,7 @@ function generateSongHTML(childid, parentid, track, title, description, artist,
|
||||||
if (coverart == undefined) {
|
if (coverart == undefined) {
|
||||||
coverartSrc = 'images/albumdefault_25.jpg';
|
coverartSrc = 'images/albumdefault_25.jpg';
|
||||||
} else {
|
} else {
|
||||||
coverartSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=25&id=' + coverart;
|
coverartSrc = baseURL + '/getCoverArt.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&size=25&id=' + coverart;
|
||||||
}
|
}
|
||||||
html += '<td class=\"album\" data-order-by=\"' + album + '\"><a href="#"><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>';
|
||||||
|
|
|
@ -5,16 +5,16 @@ 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?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid;
|
ajaxUrl = baseURL + '/getSong.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&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?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + albumid; // Deprecated: apiVersion 1.8.0
|
ajaxUrl = baseURL + '/getMusicDirectory.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + albumid; // Deprecated: apiVersion 1.8.0
|
||||||
}
|
}
|
||||||
if (debug) { console.log(ajaxUrl) }
|
if (debug) { console.log(ajaxUrl) }
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: ajaxUrl,
|
url: ajaxUrl,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var title, artist, album, rating, starred, contenttype, suffix;
|
var title, artist, album, rating, starred, contenttype, suffix;
|
||||||
|
@ -36,7 +36,6 @@ function getSongData(el, songid, albumid, position, loadonly) {
|
||||||
}
|
}
|
||||||
if (typeof data["subsonic-response"].directory != 'undefined') { // Deprecated: apiVersion 1.8.0
|
if (typeof data["subsonic-response"].directory != 'undefined') { // Deprecated: apiVersion 1.8.0
|
||||||
if (typeof data["subsonic-response"].directory.child != 'undefined') {
|
if (typeof 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 = [];
|
var children = [];
|
||||||
if (data["subsonic-response"].directory.child.length > 0) {
|
if (data["subsonic-response"].directory.child.length > 0) {
|
||||||
children = data["subsonic-response"].directory.child;
|
children = data["subsonic-response"].directory.child;
|
||||||
|
@ -87,8 +86,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?v=' + apiVersion + '&c=' + applicationName + '&f=json&size=60&id=' + coverart;
|
coverartSrc = baseURL + '/getCoverArt.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&size=60&id=' + coverart;
|
||||||
coverartFullSrc = baseURL + '/getCoverArt.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + coverart;
|
coverartFullSrc = baseURL + '/getCoverArt.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + coverart;
|
||||||
}
|
}
|
||||||
$('#coverartimage').attr('href', coverartFullSrc);
|
$('#coverartimage').attr('href', coverartFullSrc);
|
||||||
$('#coverartimage img').attr('src', coverartSrc);
|
$('#coverartimage img').attr('src', coverartSrc);
|
||||||
|
@ -125,11 +124,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?v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
|
oga: baseURL + '/stream.view?' + baseParams + '&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?v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
|
mp3: baseURL + '/stream.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!loadonly) {
|
if (!loadonly) {
|
||||||
|
@ -181,11 +180,11 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
|
||||||
for (i = 0; i < data.solutions.length; i++) {
|
for (i = 0; i < data.solutions.length; i++) {
|
||||||
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 class=\"codesyntax\">" + solution + "</strong> is";
|
||||||
spechtml += " currently 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 += " <strong class=\"codesyntax\">" + format + "</strong>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spechtml += "</strong> support";
|
spechtml += "</strong> support";
|
||||||
|
@ -199,7 +198,7 @@ function playSong(el, songid, albumid, title, artist, album, coverart, rating, s
|
||||||
scrobbleSong(false);
|
scrobbleSong(false);
|
||||||
scrobbled = false;
|
scrobbled = false;
|
||||||
|
|
||||||
if (getCookie('Notification_Song')) {
|
if (getCookie('Notification_Song') && !loadonly) {
|
||||||
showNotification(coverartSrc, toHTML.un(title), toHTML.un(artist + ' - ' + album), 'text', '#NextTrack');
|
showNotification(coverartSrc, toHTML.un(title), toHTML.un(artist + ' - ' + album), 'text', '#NextTrack');
|
||||||
}
|
}
|
||||||
if (getCookie('ScrollTitle')) {
|
if (getCookie('ScrollTitle')) {
|
||||||
|
@ -242,9 +241,9 @@ 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?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&submission=" + submission,
|
url: baseURL + '/scrobble.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + "&submission=" + submission,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function () {
|
success: function () {
|
||||||
if (submission) {
|
if (submission) {
|
||||||
|
@ -255,9 +254,9 @@ function scrobbleSong(submission) {
|
||||||
}
|
}
|
||||||
function rateSong(songid, rating) {
|
function rateSong(songid, rating) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: baseURL + '/setRating.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + songid + "&rating=" + rating,
|
url: baseURL + '/setRating.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + songid + "&rating=" + rating,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function () {
|
success: function () {
|
||||||
updateMessage('Rating Updated!', true);
|
updateMessage('Rating Updated!', true);
|
||||||
|
@ -268,14 +267,14 @@ function starItem(itemid, starred) {
|
||||||
var url;
|
var url;
|
||||||
if (itemid !== undefined) {
|
if (itemid !== undefined) {
|
||||||
if (starred) {
|
if (starred) {
|
||||||
url = baseURL + '/star.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid;
|
url = baseURL + '/star.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + itemid;
|
||||||
} else {
|
} else {
|
||||||
url = baseURL + '/unstar.view?v=' + apiVersion + '&c=' + applicationName + '&f=json&id=' + itemid;
|
url = baseURL + '/unstar.view?' + baseParams + '&v=' + apiVersion + '&c=' + applicationName + '&id=' + itemid;
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: protocol,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function () {
|
success: function () {
|
||||||
updateMessage('Favorite Updated!', true);
|
updateMessage('Favorite Updated!', true);
|
||||||
|
|
|
@ -1,3 +1,36 @@
|
||||||
|
|
||||||
|
function getCookie(value) {
|
||||||
|
if ($.cookie(value)) {
|
||||||
|
return $.cookie(value);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/* jQuery.cookies.js
|
||||||
|
if (browserStorageCheck) {
|
||||||
|
var item = localStorage.getItem(value);
|
||||||
|
if (item != '' && item != undefined) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (debug) { console.log('HTML5::loadStorage not supported on your browser' + html.length + ' characters'); }
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
function setCookie(key, value) {
|
||||||
|
$.cookie(key, value, { expires: 365 });
|
||||||
|
/* jQuery.cookies.js
|
||||||
|
try {
|
||||||
|
if (debug) { console.log('Saving : ' + key + ':' + value); }
|
||||||
|
localStorage.setItem(key, value);
|
||||||
|
} catch (e) {
|
||||||
|
if (e == QUOTA_EXCEEDED_ERR) {
|
||||||
|
alert('Quota exceeded!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
/* Reusable Functions */
|
/* Reusable Functions */
|
||||||
function clickButton(el) {
|
function clickButton(el) {
|
||||||
var el = $(el);
|
var el = $(el);
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
//User config staff
|
// Inject Basic Auth
|
||||||
|
/*
|
||||||
|
$.ajaxSetup({
|
||||||
|
beforeSend: function (req) {
|
||||||
|
req.setRequestHeader('Authorization', auth);
|
||||||
|
}
|
||||||
|
//headers: { "Authorization": "Basic " + auth }
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
// Fill Preferences from Cookies
|
||||||
if (getCookie('username')) { $('#Username').val(getCookie('username')); }
|
if (getCookie('username')) { $('#Username').val(getCookie('username')); }
|
||||||
//$('#Password').val(getCookie('passwordenc'));
|
//$('#Password').val(getCookie('passwordenc'));
|
||||||
if (getCookie('AutoPlaylists')) { $('#AutoPlaylists').val(getCookie('AutoPlaylists')); }
|
if (getCookie('AutoPlaylists')) { $('#AutoPlaylists').val(getCookie('AutoPlaylists')); }
|
||||||
|
@ -8,6 +17,10 @@
|
||||||
if (getCookie('Server')) { $('#Server').val(getCookie('Server')); }
|
if (getCookie('Server')) { $('#Server').val(getCookie('Server')); }
|
||||||
if (getCookie('ApplicationName')) { $('#ApplicationName').val(getCookie('ApplicationName')); }
|
if (getCookie('ApplicationName')) { $('#ApplicationName').val(getCookie('ApplicationName')); }
|
||||||
|
|
||||||
|
if (getCookie('Server')) {
|
||||||
|
baseURL = getCookie('Server') + '/rest';
|
||||||
|
}
|
||||||
|
|
||||||
// Set Preferences defaults
|
// Set Preferences defaults
|
||||||
if (getCookie('Theme')) {
|
if (getCookie('Theme')) {
|
||||||
$('#Theme').val(getCookie('Theme'));
|
$('#Theme').val(getCookie('Theme'));
|
||||||
|
@ -45,6 +58,11 @@
|
||||||
} else {
|
} else {
|
||||||
$('#ForceFlash').attr('checked', false);
|
$('#ForceFlash').attr('checked', false);
|
||||||
}
|
}
|
||||||
|
if (getCookie('Protocol')) {
|
||||||
|
$('#Protocol').attr('checked', true);
|
||||||
|
} else {
|
||||||
|
$('#Protocol').attr('checked', false);
|
||||||
|
}
|
||||||
if (getCookie('AutoPilot')) {
|
if (getCookie('AutoPilot')) {
|
||||||
setCookie('AutoPilot', null)
|
setCookie('AutoPilot', null)
|
||||||
}
|
}
|
||||||
|
@ -69,6 +87,61 @@
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function loadTabContent(tab) {
|
||||||
|
var tabid = '#action_' + tab.substring(1, tab.length);
|
||||||
|
$("ul.tabs li a").removeClass("active"); //Remove any "active" class
|
||||||
|
$(tabid).addClass("active"); //Add "active" class to selected tab
|
||||||
|
$(".tabcontent").hide(); //Hide all tab content
|
||||||
|
window.location.hash = tab;
|
||||||
|
switch (tab) {
|
||||||
|
case '#tabLibrary':
|
||||||
|
if (debug) { console.log("TAG LIBRARY"); }
|
||||||
|
if (getCookie('MusicFolders')) {
|
||||||
|
loadArtists(getCookie('MusicFolders'), false);
|
||||||
|
} else {
|
||||||
|
loadArtists();
|
||||||
|
}
|
||||||
|
getMusicFolders();
|
||||||
|
break;
|
||||||
|
case '#tabQueue':
|
||||||
|
if (debug) { console.log("TAG QUEUE"); }
|
||||||
|
var header = generateSongHeaderHTML();
|
||||||
|
$('#CurrentPlaylistContainer thead').html(header);
|
||||||
|
var count = $('#CurrentPlaylistContainer tbody tr.song').size();
|
||||||
|
updateStatus('#status_Current', countCurrentPlaylist('#CurrentPlaylistContainer'));
|
||||||
|
if (count > 0) {
|
||||||
|
$('#currentActions a.button').removeClass('disabled');
|
||||||
|
}
|
||||||
|
var songid = $('#CurrentPlaylistContainer tbody tr.playing').attr('childid');
|
||||||
|
if (songid !== undefined) {
|
||||||
|
$('#CurrentPlaylist').scrollTo($('#' + songid), 400);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '#tabPlaylists':
|
||||||
|
if (debug) { console.log("TAG PLAYLIST"); }
|
||||||
|
loadPlaylists();
|
||||||
|
loadFolders();
|
||||||
|
loadAutoPlaylists();
|
||||||
|
updateStatus('#status_Playlists', countCurrentPlaylist('#TrackContainer'));
|
||||||
|
break;
|
||||||
|
case '#tabPodcasts':
|
||||||
|
if (debug) { console.log("TAG PODCAST"); }
|
||||||
|
loadPodcasts();
|
||||||
|
updateStatus('#status_Podcasts', countCurrentPlaylist('#PodcastContainer'));
|
||||||
|
break;
|
||||||
|
case '#tabVideos':
|
||||||
|
if (debug) { console.log("TAG VIDEOS"); }
|
||||||
|
loadVideos(true);
|
||||||
|
break;
|
||||||
|
case '#tabPreferences':
|
||||||
|
getGenres();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$(tab).fadeIn('fast'); //Fade in the active ID content
|
||||||
|
}
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
$('.tabcontent').hide(); //Hide all content
|
$('.tabcontent').hide(); //Hide all content
|
||||||
if (!getCookie('username') && !getCookie('passwordenc') && !getCookie('Server')) { // Show Preferences
|
if (!getCookie('username') && !getCookie('passwordenc') && !getCookie('Server')) { // Show Preferences
|
||||||
|
@ -913,7 +986,8 @@
|
||||||
if (applicationname != "") {
|
if (applicationname != "") {
|
||||||
setCookie('ApplicationName', applicationname);
|
setCookie('ApplicationName', applicationname);
|
||||||
}
|
}
|
||||||
location.reload(true);
|
updateMessage('Preferences Saved...', true);
|
||||||
|
//location.reload(true);
|
||||||
});
|
});
|
||||||
$('#Theme').live('change', function () {
|
$('#Theme').live('change', function () {
|
||||||
var theme = $(this).val();
|
var theme = $(this).val();
|
||||||
|
@ -988,7 +1062,15 @@
|
||||||
} else {
|
} else {
|
||||||
setCookie('ForceFlash', null);
|
setCookie('ForceFlash', null);
|
||||||
}
|
}
|
||||||
location.reload(true);
|
//location.reload(true);
|
||||||
|
});
|
||||||
|
$('#Protocol').live('click', function () {
|
||||||
|
if ($('#Protocol').is(':checked')) {
|
||||||
|
setCookie('Protocol', '1');
|
||||||
|
} else {
|
||||||
|
setCookie('Protocol', null);
|
||||||
|
}
|
||||||
|
//location.reload(true);
|
||||||
});
|
});
|
||||||
$('#SaveTrackPosition').live('click', function () {
|
$('#SaveTrackPosition').live('click', function () {
|
||||||
if ($('#SaveTrackPosition').is(':checked')) {
|
if ($('#SaveTrackPosition').is(':checked')) {
|
||||||
|
@ -1018,7 +1100,7 @@
|
||||||
setCookie('Server', null);
|
setCookie('Server', null);
|
||||||
setCookie('ApplicationName', null);
|
setCookie('ApplicationName', null);
|
||||||
setCookie('HideAZ', null);
|
setCookie('HideAZ', null);
|
||||||
location.reload(true);
|
//location.reload(true);
|
||||||
});
|
});
|
||||||
$('#ChangeLogShowMore').live('click', function () {
|
$('#ChangeLogShowMore').live('click', function () {
|
||||||
$('ul#ChangeLog li.log').each(function (i, el) {
|
$('ul#ChangeLog li.log').each(function (i, el) {
|
||||||
|
|
|
@ -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.5",
|
"version": "2.3.6",
|
||||||
"app": {
|
"app": {
|
||||||
"launch": {
|
"launch": {
|
||||||
"local_path": "index.html"
|
"local_path": "index.html"
|
||||||
|
|
|
@ -309,6 +309,10 @@ fieldset
|
||||||
{
|
{
|
||||||
border: 1px solid #1d1d1d;
|
border: 1px solid #1d1d1d;
|
||||||
}
|
}
|
||||||
|
label
|
||||||
|
{
|
||||||
|
color: #D6D469;
|
||||||
|
}
|
||||||
#donate {
|
#donate {
|
||||||
background: #232323;
|
background: #232323;
|
||||||
border: 1px solid #1D1D1D;
|
border: 1px solid #1D1D1D;
|
||||||
|
|
|
@ -15,7 +15,7 @@ img
|
||||||
h3.title
|
h3.title
|
||||||
{
|
{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 14px;
|
font-size: 16px;
|
||||||
font-variant: small-caps;
|
font-variant: small-caps;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
|
@ -48,6 +48,7 @@ span.apiversion
|
||||||
.even { background: #f4f4f4; }
|
.even { background: #f4f4f4; }
|
||||||
*/
|
*/
|
||||||
.red { color: #E64F4C; }
|
.red { color: #E64F4C; }
|
||||||
|
.codesyntax { font-family: "Courier New"; }
|
||||||
.italic { font-style: italic; }
|
.italic { font-style: italic; }
|
||||||
.beer { font-size: 17px; }
|
.beer { font-size: 17px; }
|
||||||
|
|
||||||
|
@ -1365,6 +1366,7 @@ select#MusicFolders
|
||||||
label
|
label
|
||||||
{
|
{
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
.inputwrap
|
.inputwrap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue