mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
18b193d23d
2 changed files with 91 additions and 7 deletions
35
dashboard-ui/playlist.html
Normal file
35
dashboard-ui/playlist.html
Normal 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>
|
|
@ -3,22 +3,26 @@
|
||||||
function playlist() {
|
function playlist() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
if (typeof(self.queue) == 'undefined') {
|
||||||
self.queue = [];
|
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;
|
||||||
|
@ -26,3 +30,48 @@
|
||||||
|
|
||||||
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);
|
Loading…
Add table
Add a link
Reference in a new issue