-1

I'm writing a GreaseMonkey script, as part of which I'd like to sort a list by dragging its items. I'm using mootools, but the component for sortable lists doesn't work in the GM sandboxed environment. Can you recommend a smallish library/piece of code to do list sorting in the most lightweight fashion? I want it to be independant of any large framework and don't feel like implementing it myself.

Crescent Fresh
  • 111,976
  • 25
  • 153
  • 138
VoY
  • 5,211
  • 2
  • 35
  • 45

3 Answers3

1

If you need to debug a library such as mootools, instead of @require-ing it, just copy/paste the entire source into your own script. Then you can debug it the same as your own code.

On another note, this script includes the ability to drag-and-drop it's own window around the screen, with no additional library. Maybe you could analyze it and borrow code?

Lil Devil
  • 608
  • 4
  • 10
0

Use this Javascript QuickSort implementation

Josh Stodola
  • 79,922
  • 46
  • 179
  • 226
  • That's not really what I wanna do, I need to sort lists in an arbitrary way by dragging the items. – VoY Dec 15 '09 at 12:20
0

I'm not sure if there are any particular issues with just MooTools, but in general you may include external scripts into a GreaseMonkey script.

This has been addressed in previous questions like this one or this, as well as on the GreaseSpot wiki.

Community
  • 1
  • 1
stpe
  • 3,551
  • 3
  • 30
  • 38
  • There are issues with the component I need from mootools-more... unfortunately it doesn't work and the way GM reports errors makes it near impossible to debug, as it doesn't tell me the number of the offending line. – VoY Dec 15 '09 at 12:21