是否有一个轻量级库可以在greasemonkey脚本中执行可拖动和可排序的列表?
我正在编写一个 GreaseMonkey 脚本,作为其中的一部分,我想通过拖动列表项来对列表进行排序。我正在使用 mootools,但可排序列表的组件在 GM 沙盒环境中不起作用。您能推荐一个小型库/代码段以最轻量级的方式进行列表排序吗?我希望它独立于任何大型框架,并且不想自己实现它。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您需要调试 mootools 等库,只需将整个源代码复制/粘贴到您自己的脚本中,而不是 @require-ing 它。然后你就可以像你自己的代码一样调试它了。
另一方面,此脚本包括将其自己的窗口拖放到屏幕,无需额外的库。也许你可以分析它并借用代码?
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?
我不确定 MooTools 是否存在任何特定问题,但通常您可以将外部脚本包含到 GreaseMonkey 脚本中。
这已在之前的问题中得到解决,例如 这个 或 这个,以及GreaseSpot 维基。
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.