Bug Tracker

Ticket #901 (new feature)

Opened 2 years ago

Last modified 1 year ago

Sorting the plugins page by plugin name

Reported by: Andrea Ercolino Assigned to: anonymous
Type: feature Priority: minor
Milestone: Component: site
Version: 1.1 Keywords: plugins page
Cc: Needs:

Description

I've written a little jquery sorter for the plugins page (you can test it in Firebug, through the console):

var a = $("#bodyContent ul > li");
$( "#bodyContent" ).html( $( a.get().sort( function( x, y ) {
    tx = $( "> b > a", x ).text();
    tx = tx ? tx.toUpperCase() : " ";
    ty = $( "> b > a", y ).text();
    ty = ty ? ty.toUpperCase() : " ";
    return tx < ty ? -1 : tx > ty ? +1 : 0;
} ) ).wrap( "<ul></ul>" ) );

I made it sort the whole page because the HTML generated for the plugins page lacks a containment structure. In fact, plugins sections aren't really sections, neither list items are really items. Sections are only headers, between unordered lists, and list items are one item per list, ie one separate list per plugin.

It should be relatively simple for you to (1) fix the containment structure, (2) adapt the above snippet to work on sections, and (3) add a button with that code to each section.

Attachments

Note: See TracTickets for help on using tickets.