mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update search
This commit is contained in:
parent
8dd2c5d717
commit
cc428aac1d
34 changed files with 814 additions and 549 deletions
41
dashboard-ui/scripts/searchpage.js
Normal file
41
dashboard-ui/scripts/searchpage.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
(function () {
|
||||
|
||||
function loadSuggestions(page) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "IsFavoriteOrLike,Random",
|
||||
IncludeItemTypes: "Movie,Series,MusicArtist",
|
||||
Limit: 20,
|
||||
Recursive: true,
|
||||
ImageTypeLimit: 0,
|
||||
EnableImages: false
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
var html = result.Items.map(function (i) {
|
||||
|
||||
var href = LibraryBrowser.getHref(i);
|
||||
|
||||
var itemHtml = '<a href="' + href + '" style="display:block;padding:.5em 0;">';
|
||||
itemHtml += i.Name;
|
||||
itemHtml += '</a>';
|
||||
return itemHtml;
|
||||
|
||||
}).join('');
|
||||
|
||||
page.querySelector('.searchSuggestions').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
pageIdOn('pageshowready', "searchPage", function () {
|
||||
|
||||
var page = this;
|
||||
loadSuggestions(page);
|
||||
|
||||
Search.showSearchPanel();
|
||||
});
|
||||
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue