Request: sortable tables in userlist [$5] #10

Closed
opened 2026-10-05 03:53:33 +02:00 by adam · 11 comments
Owner

I'd like to be able to sort the tables in the webadmin. In particular the userlist; an alternative would be to place the connected users first, but I think it would be easiest to use something like sort-table, which simply requires a line in the header, and applying the 'sortable' class to the table in order to be able to click the table headers.

Did you help close this issue? Go claim the $5 bounty on Bountysource.

I'd like to be able to sort the tables in the webadmin. In particular the userlist; an alternative would be to place the connected users first, but I think it would be easiest to use something like <a href="http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/expression-web/sort-table.html">sort-table</a>, which simply requires a line in the header, and applying the 'sortable' class to the table in order to be able to click the table headers. ## <bountysource-plugin> Did you help close this issue? Go claim the **[$5 bounty](https://www.bountysource.com/issues/703-request-sortable-tables-in-userlist-5?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** on [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:808845 -->
adam closed this issue 2026-10-05 03:53:33 +02:00
Author
Owner

That code there might have a license problem. It contains a X11 header, but it also contains code from other sources. (At least) this one doesn't have any license attached:
http://dean.edwards.name/weblog/2005/10/add-event/

That code there might have a license problem. It contains a X11 header, but it also contains code from other sources. (At least) this one doesn't have any license attached: http://dean.edwards.name/weblog/2005/10/add-event/ <!-- github-comment-id:1083917 -->
Author
Owner

This could be implemented with jQuery + http://www.datatables.net/ . jQuery is dual-licensed in both GPL and MIT. DataTables is dual-licensed with both GPLv2 and a 3-clause BSD license. This would be compatible with ZNC.
jQuery is 31kb gzipped Length: 93868 (92K) datatables is Length: 70944 (69K).

I am pretty sure I have seen a pull request/issue that included a JavaScript library and the decision was that we didn't want to add additional size to ZNC (I think it was for a theme). This should be simple to implement, the real question before we implement this would be, do we want to include two JavaScript files in ZNC?

This could be implemented with jQuery + http://www.datatables.net/ . jQuery is dual-licensed in both GPL and MIT. DataTables is dual-licensed with both GPLv2 and a 3-clause BSD license. This would be compatible with ZNC. jQuery is 31kb gzipped `Length: 93868 (92K)` datatables is `Length: 70944 (69K)`. I am pretty sure I have seen a pull request/issue that included a JavaScript library and the decision was that we didn't want to add additional size to ZNC (I think it was for a theme). This should be simple to implement, the real question before we implement this would be, do we want to include two JavaScript files in ZNC? <!-- github-comment-id:3697363 -->
Author
Owner

Just to put kylef's numbers into some relations: All of ZNC is 640KiB gzipped. So jQuery is 1/20th as large as all of znc (both gzipped). Unzipped, ZNC's tarball has 2030KiB. Just to sort some table?!

Just to put kylef's numbers into some relations: All of ZNC is 640KiB gzipped. So jQuery is 1/20th as large as all of znc (both gzipped). Unzipped, ZNC's tarball has 2030KiB. Just to sort some table?! <!-- github-comment-id:3699127 -->
Author
Owner

http://code.google.com/intl/de-DE/apis/libraries/ could be used for jquery/dojo/... and the size wouldn't change that much :D

i know that I provide an evil google solution, so this should be config-able anyway (on = cnd-stuff load an sortable; off = no foreign-js load at all)

http://code.google.com/intl/de-DE/apis/libraries/ could be used for jquery/dojo/... and the size wouldn't change that much :D i know that I provide an evil google solution, so this should be config-able anyway (on = cnd-stuff load an sortable; off = no foreign-js load at all) <!-- github-comment-id:3701923 -->
Author
Owner

What do you think about List.js it's a tiny (7kb) JS library with MIT license?

What do you think about [List.js](http://listjs.com/) it's a tiny (7kb) JS library with MIT license? <!-- github-comment-id:44687003 -->
Author
Owner

Actually, if to use CDN, we don't need to ship it in our tarball. So jQuery, etc. shouldn't be a problem.

@devfom well, does it work?

Actually, if to use CDN, we don't need to ship it in our tarball. So jQuery, etc. shouldn't be a problem. @devfom well, does it work? <!-- github-comment-id:44689362 -->
Author
Owner

@DarthGandalf yep, I've tried it with GlobalModules settings page, which, from my point of view, should also have sorting, and they also provide CDN.
So, what do you guys think? If you're okay with List.js I'm willing to update webadmin module so it uses sorting where it makes sense.

@DarthGandalf yep, I've tried it with GlobalModules settings page, which, from my point of view, should also have sorting, and they also provide CDN. So, what do you guys think? If you're okay with List.js I'm willing to update webadmin module so it uses sorting where it makes sense. <!-- github-comment-id:44696736 -->
Author
Owner

The name of List.js (and examples on their website) imply that it's only for lists, not tables...
I didn't look into it further.
If it works for tables fine, and preferably doesn't break tables in browsers which don't have javascript enabled (maybe it's time to drop this requirement though?), why not...

The name of List.js (and examples on their website) imply that it's only for lists, not tables... I didn't look into it further. If it works for tables fine, and preferably doesn't break tables in browsers which don't have javascript enabled (maybe it's time to drop this requirement though?), why not... <!-- github-comment-id:44788018 -->
Author
Owner

Examples on website don't cover tables case, but it does work with them as well.
Should we use CDN or embedded minimized js into source tree?

Examples on website don't cover tables case, but it does work with them as well. Should we use CDN or embedded minimized js into source tree? <!-- github-comment-id:44788677 -->
Author
Owner

I guess, CDN is easier to add.

I guess, CDN is easier to add. <!-- github-comment-id:44788992 -->
Author
Owner

"Tiny" and "7kb" in the same sentence?! Debian is going to hate you for embedding a minimized JS file, I guess (not necessarily true, but at least some raise eye brows can be expected). And the CDN talk scares me since it allows tracking znc installations and users, even in "private" networks. None of the downloads of list.js contain a license header, so have to be considered "all rights reserved" from a legal stand point. In fact, the license is only mentioned in the README and even there it's only referenced instead of being properly included. (The license there is "License (MIT) Copyright (c) 2012 Jonny Strömberg jonny.stromberg@gmail.com http://jonnystromberg.com". That doesn't explicitely allow any form of reuse and just mentioning "MIT" somewhere in there isn't really enough)

Why do JS library authors have such a hard time getting basic programming legalese right?

Meh, I should stop looking at this issue...

Edit: Oh and of course the CDN approach opens up a nice attack vector / breaks older ZNC versions of the CDN disappears.

"Tiny" and "7kb" in the same sentence?! Debian is going to hate you for embedding a minimized JS file, I guess (not necessarily true, but at least some raise eye brows can be expected). And the CDN talk scares me since it allows tracking znc installations and users, even in "private" networks. None of the downloads of list.js contain a license header, so have to be considered "all rights reserved" from a legal stand point. In fact, the license is only mentioned in the README and even there it's only referenced instead of being properly included. (The license there is "License (MIT) Copyright (c) 2012 Jonny Strömberg jonny.stromberg@gmail.com http://jonnystromberg.com". That doesn't explicitely allow any form of reuse and just mentioning "MIT" somewhere in there isn't really enough) Why do JS library authors have such a hard time getting basic programming legalese right? Meh, I should stop looking at this issue... Edit: Oh and of course the CDN approach opens up a nice attack vector / breaks older ZNC versions of the CDN disappears. <!-- github-comment-id:44790135 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#10