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.
views:
101answers:
3The question is, does that work in greasemonkey? ;)
Crescent Fresh
2009-12-14 15:52:21
Why wouldn't it?
Josh Stodola
2009-12-14 17:00:48
That's not really what I wanna do, I need to sort lists in an arbitrary way by dragging the items.
VoY
2009-12-15 12:20:38
A:
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.
stefpet
2009-12-14 16:16:08
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
2009-12-15 12:21:33
+1
A:
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
2010-01-31 00:27:30