AnonIB Image Sorter

By Mr-E Fox Last update Jun 1, 2009 — Installed 368 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Script Summary:
Puts the images in each comment in order. (There is no use for this script until multiple image uploads are re-enabled)

This script has no discussions.

start the discussion

This script has no reviews.

There is no use for this script until multiple image uploads are re-enabled

It appears that images are displayed in the order that they are received. This script attempts to reorder images based on a determined "weight".

If you find a set of images that are not sorted correctly, just leave a comment here with a link to the post (or send me an email at mr0e0fox@gmail.com)

Updates:

  1. You can now undo (and then redo) the sorting on a comment-by-comment basis. Since initial sorting is stored, the changes happen nearly instantaneously.
  2. Bug in the undo functionality caused the images to be resorted in the wrong order.
  3. Yet another bug; when more than one default thumbnail is present (eg "swf.jpg") the sorting function will cause files to disappear. I've also added a variable in the beginning, which allows you to easily remove the "(Undo Sorting)" links. Just set allowUndo to false.
  4. @exclude added for the "(edit)" pop-up
    • The recursive sorting didn't work. Values like '1-4', '1-3', '1-2', and '1-1' would be left as "sorted" because the 1's would be matched, and 1, 1, 1, and 1 are in order.
    • Comments have been added
    • Major (theoretical/conceptual) efficiency fixes
  5. Fix for when the number is the at the beginning of the filename. (eg "1st_image")

Also, for those who want the want to understand how the weighting system works:
A weighting system is initialized (internally: "WeightSystem(...)")
Symbols and tiers (internally: "Tier(...)") are then added to the system

  • A "symbol" is anything that should be treated as a dividing character (ie: a space, underscore, hyphen, etc).
  • A "tier" is an object containing a weight, level, matching RegExp, and value-defining function.
    • The "weight" specifies which tiers are tried first. Multiple Tier objects can have the same weight, though, and will be sorted together.
    • The "level" specifies the order to use the tiers of equal weight. Again, multiple tier objects can have the same level. If this happens, they are used in the order in which they were added to the WeightSystem.
    • The matching RegExp is, well, a RegExp object used to see if an image's src is a valid for that tier. The results, if they're not null, are sent to the value-defining function (internally: "getValueOf(...)") to be given a numeric value. This numeric value is used to sort the srcs.

If you want more than that, you'll have to read the code for yourself (or even send me an email, of you're that interested)