mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
some very basic folder browsing
This commit is contained in:
parent
26b3cd0bab
commit
d4f35b2811
6 changed files with 127 additions and 52 deletions
|
@ -2,12 +2,15 @@
|
|||
|
||||
onPageShow: function () {
|
||||
|
||||
ItemDetailPage.reload();
|
||||
},
|
||||
|
||||
reload: function() {
|
||||
var id = getParameterByName('id');
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(ItemDetailPage.renderItem);
|
||||
|
||||
},
|
||||
|
||||
renderItem: function (item) {
|
||||
|
|
|
@ -1 +1,46 @@
|
|||
|
||||
var ItemListPage = {
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
ItemListPage.reload();
|
||||
},
|
||||
|
||||
reload: function () {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var parentId = getParameterByName('parentId');
|
||||
|
||||
var query = {};
|
||||
|
||||
if (parentId) {
|
||||
query.parentId = parentId;
|
||||
|
||||
ApiClient.getItem(userId, parentId).done(ItemListPage.renderTitle);
|
||||
}
|
||||
|
||||
ApiClient.getItems(userId, query).done(ItemListPage.renderItems);
|
||||
},
|
||||
|
||||
renderItems: function(result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
var renderOptions = {
|
||||
|
||||
items: items
|
||||
};
|
||||
|
||||
var html = Dashboard.getPosterViewHtml(renderOptions);
|
||||
|
||||
$('#listItems', $.mobile.activePage).html(html);
|
||||
},
|
||||
|
||||
renderTitle: function (item) {
|
||||
|
||||
|
||||
$('#itemName', $.mobile.activePage).html(item.Name);
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#itemListPage", ItemListPage.onPageShow);
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
var background = Dashboard.getRandomMetroColor();
|
||||
|
||||
html += '<div class="posterViewItem">';
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
|
||||
if (user.HasPassword) {
|
||||
html += "<a id='" + linkId + "' data-userid='" + user.Id + "' data-username='" + user.Name + "' href='#popupLogin' data-rel='popup' onclick='LoginPage.authenticatingLinkId=this.id;' \">";
|
||||
|
@ -83,10 +83,8 @@
|
|||
html += '<img style="background:' + background + ';" src="css/images/logindefault.png"/>';
|
||||
}
|
||||
|
||||
html += '<div class="posterViewItemText posterViewItemPrimaryText">' + user.Name + '</div>';
|
||||
html += '<div class="posterViewItemText">';
|
||||
|
||||
html += '<div>' + user.Name + '</div>';
|
||||
html += '<div>';
|
||||
var lastSeen = LoginPage.getLastSeenText(user.LastActivityDate);
|
||||
if (lastSeen != "") {
|
||||
html += lastSeen;
|
||||
|
@ -96,7 +94,6 @@
|
|||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</a>';
|
||||
|
||||
html += '</div>';
|
||||
|
|
|
@ -414,9 +414,13 @@ var Dashboard = {
|
|||
|
||||
var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
|
||||
|
||||
var href = item.IsFolder ? "#" : "itemDetails.html?id=" + item.Id;
|
||||
var href = item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemDetails.html?id=" + item.Id;
|
||||
|
||||
html += "<div class='posterViewItem'><a href='" + href + "'>";
|
||||
var showText = options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season' && item.Type !== 'Trailer');
|
||||
|
||||
var cssClass = showText ? "posterViewItem" : "posterViewItem posterViewItemWithNoText";
|
||||
|
||||
html += "<div class='" + cssClass + "'><a href='" + href + "'>";
|
||||
|
||||
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
|
@ -443,10 +447,10 @@ var Dashboard = {
|
|||
html += "<img style='background:" + Dashboard.getRandomMetroColor() + ";' src='css/images/defaultCollectionImage.png' />";
|
||||
}
|
||||
|
||||
if (options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season')) {
|
||||
if (showText) {
|
||||
html += "<div class='posterViewItemText'>";
|
||||
html += "<div>" + item.Name + "</div>";
|
||||
html += "</div>"
|
||||
html += item.Name;
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
html += "</a></div>";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue