1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added people pages

This commit is contained in:
Luke Pulverenti 2013-04-11 23:50:47 -04:00
parent 3d459a618d
commit cc98266437
19 changed files with 766 additions and 15 deletions

View file

@ -51,11 +51,9 @@
var height = 300;
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
html += "<img class='posterDetailViewImage' src='" + ApiClient.getImageUrl(item.Id, {
type: "Primary",
html += "<img class='posterDetailViewImage' src='" + LibraryBrowser.getPrimaryImageUrl(item, {
height: height,
width: width,
tag: item.ImageTags.Primary
width: width
}) + "' />";
@ -77,6 +75,10 @@
html += "<img class='posterDetailViewImage' style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/video.png' />";
}
else if (item.Type == "Person") {
html += "<img class='posterDetailViewImage' style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/person.png' />";
}
else {
html += "<img class='posterDetailViewImage' style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/collection.png' />";
@ -163,6 +165,29 @@
return item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id;
},
getPrimaryImageUrl: function (item, options) {
options = options || {};
options.type = "Primary";
options.tag = item.ImageTags.Primary;
if (item.Type == "Studio") {
return ApiClient.getStudioImageUrl(item.Name, options);
}
if (item.Type == "Person") {
return ApiClient.getPersonImageUrl(item.Name, options);
}
if (item.Type == "Genre") {
return ApiClient.getGenreImageUrl(item.Name, options);
}
return ApiClient.getImageUrl(item.Id, options);
},
getPosterViewHtml: function (options) {

View file

@ -48,13 +48,56 @@
});
}
$(document).on('pagebeforeshow', "#movieGenresPage", function () {
$(document).on('pageinit', "#movieGenresPage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#movieGenresPage", function () {
reloadItems(this);
}).on('pageshow', "#movieGenresPage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
});
})(jQuery, document);

View file

@ -1 +1,103 @@

(function ($, document) {
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDetaultPageSize(),
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getPeople(Dashboard.getCurrentUserId(), query).done(function (result) {
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true);
}
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
useAverageAspectRatio: true,
countNameSingular: "Movie",
countNamePlural: "Movies"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
var elem = $('#items', page).html(html).trigger('create');
$('select', elem).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}
$(document).on('pageinit', "#moviePeoplePage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#moviePeoplePage", function () {
reloadItems(this);
}).on('pageshow', "#moviePeoplePage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
});
})(jQuery, document);

View file

@ -48,12 +48,56 @@
});
}
$(document).on('pagebeforeshow', "#movieStudiosPage", function () {
$(document).on('pageinit', "#movieStudiosPage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#movieStudiosPage", function () {
reloadItems(this);
}).on('pageshow', "#movieStudiosPage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
});

View file

@ -48,13 +48,65 @@
});
}
$(document).on('pagebeforeshow', "#tvGenresPage", function () {
$(document).on('pageinit', "#tvGenresPage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#tvGenresPage", function () {
reloadItems(this);
}).on('pageshow', "#tvGenresPage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.Filters || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
});
})(jQuery, document);

View file

@ -0,0 +1,112 @@
(function ($, document) {
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
IncludeItemTypes: "Series",
Recursive: true,
Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData",
Limit: LibraryBrowser.getDetaultPageSize(),
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getPeople(Dashboard.getCurrentUserId(), query).done(function (result) {
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true);
}
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
useAverageAspectRatio: true,
countNameSingular: "Show",
countNamePlural: "Shows"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
var elem = $('#items', page).html(html).trigger('create');
$('select', elem).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}
$(document).on('pageinit', "#tvPeoplePage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#tvPeoplePage", function () {
reloadItems(this);
}).on('pageshow', "#tvPeoplePage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.Filters || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
});
})(jQuery, document);

View file

@ -48,13 +48,65 @@
});
}
$(document).on('pagebeforeshow', "#tvStudiosPage", function () {
$(document).on('pageinit', "#tvStudiosPage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pagebeforeshow', "#tvStudiosPage", function () {
reloadItems(this);
}).on('pageshow', "#tvStudiosPage", function () {
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.Filters || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
});
})(jQuery, document);