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

added paging buttons

This commit is contained in:
Luke Pulverenti 2013-04-15 18:03:05 -04:00
parent 549b78e51d
commit 58e5eea325
15 changed files with 198 additions and 50 deletions

View file

@ -43,6 +43,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -54,6 +54,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -42,6 +42,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });

View file

@ -511,7 +511,15 @@
var recordsEnd = Math.min(query.StartIndex + query.Limit, totalRecordCount); var recordsEnd = Math.min(query.StartIndex + query.Limit, totalRecordCount);
html += isTop ? '<div class="listPaging topListPaging">' : '<div class="listPaging">'; html += isTop ? '<div class="listPaging topListPaging">' : '<div class="listPaging">';
html += 'Results ' + (query.StartIndex + 1) + '-' + recordsEnd + ' of ' + totalRecordCount + ', page ' + dropdownHtml + ' of ' + pageCount;
html += '<span style="margin-right: 10px;">';
html += (query.StartIndex + 1) + '-' + recordsEnd + ' of ' + totalRecordCount + ', page ' + dropdownHtml + ' of ' + pageCount;
html += '</span>';
html += '<button data-icon="arrow-left" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (query.StartIndex ? '' : 'disabled') + '>Previous Page</button>';
html += '<button data-icon="arrow-right" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (query.StartIndex + query.Limit > totalRecordCount ? 'disabled' : '') + '>Next Page</button>';
html += '</div>'; html += '</div>';
return html; return html;
@ -902,74 +910,74 @@
} }
}, },
getGamePosterViewHtml: function (options) { getGamePosterViewHtml: function (options) {
var items = options.items; var items = options.items;
var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null; var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
var html = ""; var html = "";
for (var i = 0, length = items.length; i < length; i++) { for (var i = 0, length = items.length; i < length; i++) {
var item = items[i]; var item = items[i];
var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary; var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
var showText = options.showTitle || !hasPrimaryImage; var showText = options.showTitle || !hasPrimaryImage;
var cssClass = showText ? "posterViewItem" : "posterViewItem posterViewItemWithNoText"; var cssClass = showText ? "posterViewItem" : "posterViewItem posterViewItemWithNoText";
html += "<div class='" + cssClass + "'><a href='" + LibraryBrowser.getHref(item) + "'>"; html += "<div class='" + cssClass + "'><a href='" + LibraryBrowser.getHref(item) + "'>";
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
html += "<img src='" + ApiClient.getImageUrl(item.Id, { html += "<img src='" + ApiClient.getImageUrl(item.Id, {
type: "Backdrop", type: "Backdrop",
height: 198, height: 198,
width: 352, width: 352,
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}) + "' />"; }) + "' />";
} else if (hasPrimaryImage) { } else if (hasPrimaryImage) {
var height = 300; var height = 300;
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
html += "<img src='" + ApiClient.getImageUrl(item.Id, { html += "<img src='" + ApiClient.getImageUrl(item.Id, {
type: "Primary", type: "Primary",
height: height, height: height,
width: width, width: width,
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}) + "' />"; }) + "' />";
} else if (item.BackdropImageTags && item.BackdropImageTags.length) { } else if (item.BackdropImageTags && item.BackdropImageTags.length) {
html += "<img src='" + ApiClient.getImageUrl(item.Id, { html += "<img src='" + ApiClient.getImageUrl(item.Id, {
type: "Backdrop", type: "Backdrop",
height: 198, height: 198,
width: 352, width: 352,
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}) + "' />"; }) + "' />";
} }
else { else {
html += "<img style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/game.png' />"; html += "<img style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/game.png' />";
} }
if (showText) { if (showText) {
html += "<div class='posterViewItemText'>"; html += "<div class='posterViewItemText'>";
html += item.Name; html += item.Name;
html += "</div>"; html += "</div>";
} }
if (options.showNewIndicator !== false) { if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item); html += LibraryBrowser.getNewIndicatorHtml(item);
} }
html += "</a></div>"; html += "</a></div>";
} }
return html; return html;
} }
}; };

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -45,6 +45,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -53,6 +53,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -45,6 +45,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -53,6 +53,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -44,6 +44,16 @@
reloadItems(page); reloadItems(page);
}); });
$('.btnNextPage', elem).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', elem).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }