Side navigation
#901 closed feature (fixed)
Opened January 31, 2007 03:25PM UTC
Closed January 24, 2009 11:42PM UTC
Sorting the plugins page by plugin name
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.
Attachments (0)
Change History (1)
Changed January 24, 2009 11:42PM UTC by comment:1
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.\ → 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. \ |
---|---|
need: | → Review |
resolution: | → fixed |
status: | new → closed |
We've have moved the plugins page to an entire plugins site at http://plugins.jquery.com/