mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
copy dashboard to the output folder and load from the file system, instead of using embedded resources
This commit is contained in:
parent
799eebc9ed
commit
4dd9477bcd
137 changed files with 1424 additions and 1438 deletions
106
dashboard-ui/scripts/IndexPage.js
Normal file
106
dashboard-ui/scripts/IndexPage.js
Normal file
|
@ -0,0 +1,106 @@
|
|||
var IndexPage = {
|
||||
|
||||
onPageShow: function () {
|
||||
IndexPage.loadLibrary(Dashboard.getCurrentUserId(), this);
|
||||
},
|
||||
|
||||
loadLibrary: function (userId, page) {
|
||||
|
||||
if (!userId) {
|
||||
return;
|
||||
}
|
||||
|
||||
page = $(page);
|
||||
|
||||
var options = {
|
||||
|
||||
limit: 5,
|
||||
sortBy: "DateCreated",
|
||||
sortOrder: "Descending",
|
||||
filters: "IsRecentlyAdded,IsNotFolder",
|
||||
ImageTypes: "Primary,Backdrop,Thumb",
|
||||
recursive: true
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
$('#divWhatsNew', page).html(Dashboard.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
preferBackdrop: true,
|
||||
showTitle: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
options = {
|
||||
|
||||
limit: 5,
|
||||
sortBy: "DatePlayed",
|
||||
sortOrder: "Descending",
|
||||
filters: "IsResumable",
|
||||
recursive: true
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
$('#divResumableItems', page).html(Dashboard.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
preferBackdrop: true,
|
||||
showTitle: true
|
||||
}));
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#divResumable', page).show();
|
||||
} else {
|
||||
$('#divResumable', page).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
options = {
|
||||
|
||||
sortBy: "SortName"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
$('#divCollections', page).html(Dashboard.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
showTitle: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
IndexPage.loadMyLibrary(userId, page);
|
||||
},
|
||||
|
||||
loadMyLibrary: function (userId, page) {
|
||||
|
||||
var items = [{
|
||||
Name: "Recently Played",
|
||||
IsFolder: true
|
||||
}, {
|
||||
Name: "Favorites",
|
||||
IsFolder: true
|
||||
}, {
|
||||
Name: "Genres",
|
||||
IsFolder: true
|
||||
}, {
|
||||
Name: "Studios",
|
||||
IsFolder: true
|
||||
}, {
|
||||
Name: "Performers",
|
||||
IsFolder: true
|
||||
}, {
|
||||
Name: "Directors",
|
||||
IsFolder: true
|
||||
}];
|
||||
|
||||
$('#divMyLibrary', page).html(Dashboard.getPosterViewHtml({
|
||||
items: items,
|
||||
showTitle: true
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#indexPage", IndexPage.onPageShow);
|
Loading…
Add table
Add a link
Reference in a new issue