This commit is contained in:
Trevor Squillario 2012-11-11 15:33:31 -05:00
parent 8083afab0c
commit 0b4581efba
54 changed files with 3649 additions and 2357 deletions

View file

@ -1,27 +1,27 @@
function generateRowHTML(child, appendto, rowcolor) {
function generateRowHTML(child, appendto) {
var html, isDir, starred, duration, artist, i;
isDir = child.isDir;
if (child.starred !== undefined) { starred = true; } else { starred = false; }
if (child.duration !== undefined) { duration = child.duration; } else { duration = ''; }
if (child.artist !== undefined) { artist = child.artist; } else { artist = ''; }
if (isDir === true) {
html = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, artist, child.userRating, starred);
html = generateAlbumHTML(child.id, child.parent, child.coverArt, child.title, artist, child.userRating, starred, child.created);
} else {
var track;
if (child.track === undefined) { track = " "; } else { track = child.track; }
html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, '', artist, child.album, child.coverArt, child.userRating, starred, duration);
html = generateSongHTML(child.id, child.parent, track, child.title, '', artist, child.album, child.coverArt, child.userRating, starred, duration);
}
return html;
}
function generateAlbumHeaderHTML() {
var html;
html = '<tr><th></th><th></th><th class=\"type-string\">Album</th><th class=\"type-string\">Artist</th></tr>';
html = '<tr><th></th><th></th><th class=\"type-string\">Album</th><th class=\"type-string\">Artist</th><th class=\"type-string\">Created</th></tr>';
return html;
}
function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist, rating, starred) {
function generateAlbumHTML(childid, parentid, coverart, title, artist, rating, starred, created) {
var html;
html = '<tr class=\"album ' + rowcolor + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>';
html = '<tr class=\"album\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Play Queue\"></a>';
html += '<a class=\"play\" href=\"\" title=\"Play\"></a>';
html += '<a class=\"download\" href=\"\" title=\"Download\"></a>';
if (starred) {
@ -33,10 +33,11 @@ function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist,
if (coverart == undefined) {
html += '<td class=\"albumart\"><img src=\"images/albumdefault_50.jpg\" /></td>';
} else {
html += '<td class=\"albumart\"><img src=\"' + baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&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=' + apiVersion + '&c=' + applicationName + '&f=json&size=50&id=' + coverart + '\" /></td>';
}
html += '<td class=\"album\">' + title + '</td>';
html += '<td class=\"artist\">' + artist + '</td>';
html += '<td class=\"date\">' + $.format.date(new Date(created), "yyyy-MM-dd h:mm a") + '</td>';
html += '</tr>';
return html;
}
@ -45,7 +46,7 @@ function generateSongHeaderHTML() {
html = '<tr><th></th><th class=\"type-int\">Track</th><th class=\"type-string\">Title</th><th class=\"type-string\">Artist</th><th class=\"type-string\">Album</th><th class=\"alignright\">Time</th></tr>';
return html;
}
function generateSongHTML(rowcolor, childid, parentid, track, title, description, artist, album, coverart, rating, starred, duration) {
function generateSongHTML(childid, parentid, track, title, description, artist, album, coverart, rating, starred, duration) {
var time;
if (duration == '') {
time = '00:00'
@ -53,8 +54,8 @@ function generateSongHTML(rowcolor, childid, parentid, track, title, description
time = secondsToTime(duration);
}
var html;
html = '<tr class=\"song ' + rowcolor + '\" id=\"' + childid + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" duration=\"' + duration + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Current Playlist\"></a>';
html = '<tr class=\"row song\" id=\"' + childid + '\" childid=\"' + childid + '\" parentid=\"' + parentid + '\" duration=\"' + duration + '\" userrating=\"' + rating + '\">';
html += '<td class=\"itemactions\"><a class=\"add\" href=\"\" title=\"Add To Play Queue\"></a>';
html += '<a class=\"remove\" href=\"\" title=\"Remove\"></a>';
html += '<a class=\"play\" href=\"\" title=\"Play\"></a>';
html += '<a class=\"download\" href=\"\" title=\"Download\"></a>';
@ -75,7 +76,7 @@ function generateSongHTML(rowcolor, childid, parentid, track, title, description
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&v=' + version + '&c=' + applicationName + '&f=json&size=25&id=' + coverart;
coverartSrc = baseURL + '/getCoverArt.view?u=' + username + '&p=' + password + '&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=\"time\">' + time + '</td>';