1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Luke Pulverenti 2013-04-11 01:27:38 -04:00
commit 18b193d23d
2 changed files with 91 additions and 7 deletions

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="playlistPage" data-role="page" class="page libraryPage" data-theme="a">
<h1 class="libraryPageHeader"><a href="index.html" class="imageLink">
<img src="css/images/home.png"></a>Playlist</h1>
<div data-role="content">
<table>
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Series/Album/Year</th>
<th>Time</th>
<th>Rating</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5"></td>
</tr>
</tfoot>
<tbody id="queueTable"></tbody>
</table>
</div>
</div>
</body>
</html>

View file

@ -3,26 +3,75 @@
function playlist() { function playlist() {
var self = this; var self = this;
self.queue = []; if (typeof(self.queue) == 'undefined') {
self.queue = [];
}
self.add = function (item) { self.add = function (item) {
queue.push(item); self.queue.push(item);
}; };
self.remove = function (index) { self.remove = function (index) {
queue.splice(index, 1); self.queue.splice(index, 1);
}; };
self.play = function (index) { self.play = function (elem) {
var index = $(elem).attr("data-queue-index");
MediaPlayer.play(queue[index]); MediaPlayer.play(new Array(self.queue[index]));
queue.shift(); self.queue.shift();
}; };
return self; return self;
} }
window.Playlist = new playlist(); window.Playlist = new playlist();
})(window); })(window);
(function ($, document) {
$(document).on('pagebeforeshow', "#playlistPage", function () {
var page = this;
Dashboard.showLoadingMsg();
$.each(Playlist.queue, function(i, item){
var html = '';
var name = item.Name;
if (item.IndexNumber != null) {
name = item.IndexNumber + " - " + name;
}
if (item.ParentIndexNumber != null) {
name = item.ParentIndexNumber + "." + name;
}
//$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
if (item.SeriesName || item.Album) {
var seriesName = item.SeriesName || item.Album;
}else {
var seriesName = item.ProductionYear;
}
html += '<tr>';
html += '<td><img src="css/images/media/playCircle.png" style="height: 28px;" data-queue-index="'+i+'" onclick="Playlist.play(this)" /></td>';
html += '<td>' + name + '</td>';
html += '<td>' + seriesName + '</td>';
html += '<td>' + ticks_to_human(item.RunTimeTicks) + '</td>';
html += '<td></td>';
html += '</tr>';
$("#queueTable").append(html);
});
Dashboard.hideLoadingMsg();
});
})(jQuery, document);