Bug Tracker

Opened 14 years ago

Last modified 12 years ago

#901 closed feature

Sorting the plugins page by plugin name — at Initial Version

Reported by: Andrea Ercolino Owned by:
Priority: minor Milestone:
Component: site Version: 1.1
Keywords: plugins page Cc:
Blocked by: Blocking:

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.

Change History (0)

Note: See TracTickets for help on using tickets.