Skip to content

Commit

Permalink
remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed May 3, 2024
1 parent be3bc01 commit 924c8b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
54 changes: 0 additions & 54 deletions src/Moonglade.Web/PagedList/HtmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,60 +187,6 @@ private TagBuilder ItemSliceAndTotalText(IPagedList list, PagedListRenderOptions
return WrapInListItem(text, options, "PagedList-pageCountAndLocation", "disabled");
}

private TagBuilder PreviousEllipsis(IPagedList list, Func<int, string> generatePageUrl, PagedListRenderOptions options, int firstPageToDisplay)
{
var previous = tagBuilderFactory
.Create("a");

AppendHtml(previous, options.EllipsesFormat);

previous.Attributes.Add("rel", "prev");
previous.AddCssClass("paged-list-skip-to-previous");

foreach (var c in options.PageClasses ?? Enumerable.Empty<string>())
{
previous.AddCssClass(c);
}

if (!list.HasPreviousPage)
{
return WrapInListItem(previous, options, options.EllipsesElementClass, "disabled");
}

var targetPageNumber = firstPageToDisplay - 1;

previous.Attributes.Add("href", generatePageUrl(targetPageNumber));

return WrapInListItem(previous, options, options.EllipsesElementClass);
}

private TagBuilder NextEllipsis(IPagedList list, Func<int, string> generatePageUrl, PagedListRenderOptions options, int lastPageToDisplay)
{
var next = tagBuilderFactory
.Create("a");

AppendHtml(next, options.EllipsesFormat);

next.Attributes.Add("rel", "next");
next.AddCssClass("paged-list-skip-to-next");

foreach (var c in options.PageClasses ?? Enumerable.Empty<string>())
{
next.AddCssClass(c);
}

if (!list.HasNextPage)
{
return WrapInListItem(next, options, options.EllipsesElementClass, "disabled");
}

var targetPageNumber = lastPageToDisplay + 1;

next.Attributes.Add("href", generatePageUrl(targetPageNumber));

return WrapInListItem(next, options, options.EllipsesElementClass);
}

#endregion Private methods

public string PagedListPager(IPagedList pagedList, Func<int, string> generatePageUrl, PagedListRenderOptions options)
Expand Down
4 changes: 1 addition & 3 deletions src/Moonglade.Web/PagedList/PagedListRenderOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Encodings.Web;

namespace Moonglade.Web.PagedList;
namespace Moonglade.Web.PagedList;

public class PagedListRenderOptions
{
Expand Down

0 comments on commit 924c8b0

Please sign in to comment.