update list pages to display current sort order

This commit is contained in:
Luke Pulverenti 2013-10-17 12:24:35 -04:00
parent 5b88da66b0
commit afe5161947
45 changed files with 137 additions and 25 deletions

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "movies"

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Poster") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -25,6 +25,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "games"

View file

@ -29,6 +29,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "games"

View file

@ -27,6 +27,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "games",

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -1099,6 +1099,26 @@
}
},
getViewSummaryHtml: function (query, checkedSortOption) {
var html = '';
if (query.SortBy) {
var id = checkedSortOption[0].id;
var sortBy = checkedSortOption.siblings('label[for=' + id + ']').text();
html += 'Sorted by ' + sortBy.trim().toLowerCase() + ' in ' + (query.SortOrder || 'ascending').toLowerCase() + ' order';
if (!checkedSortOption.hasClass('defaultSort')) {
html += '<button class="btnChangeToDefaultSort" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Remove</button>';
}
}
return html;
},
getPagingHtml: function (query, totalRecordCount) {
if (query.Limit) {
@ -2092,7 +2112,7 @@
var selectedCssClass = ' selectedViewLink';
var selectedHtml = "<span class='selectedViewIndicator'>&#9654;</span>";
var view = page.getAttribute('data-view') || getParameterByName('context');
if (counts.MovieCount || counts.TrailerCount) {

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "movies"

View file

@ -27,6 +27,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "movies"

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -59,6 +62,10 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
$('.defaultSort', page)[0].click();
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "movies"

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Poster") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -25,6 +25,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
preferBackdrop: false,

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "music"

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -45,6 +45,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getSongTableHtml(result.Items, {
showAlbum: true,
showArtist: true,

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "tv"

View file

@ -27,6 +27,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "tv"

View file

@ -28,6 +28,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -26,6 +26,9 @@
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
var checkSortOption = $('.radioSortBy:checked', page);
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
context: "tv"