Sjeiti / TinySort

TinySort is a small script that sorts HTML elements. It sorts by text- or attribute value, or by that of one of it's children.
http://tinysort.sjeiti.com/
MIT License
454 stars 68 forks source link

Automatic sort order #182

Closed Dr-Ash closed 1 year ago

Dr-Ash commented 2 years ago

Hello,

I think a very useful functionality for tinySort would be another order value ex: auto, that detects automatically order direction (store it somewhere, and reverts it ?)

Sjeiti commented 2 years ago

Hi,

I'm afraid the complexity of trying to detect the sort order could easily double the current filesize.

The order in the following list could be anything, and it is only three entries:

<ul>
  <li value="1">á</li>
  <li><span>b<span></li>
  <li data-order="2">d<span>c<span></li>
<ul>

I'd be willing to checkout an idea or pull-request though.