Add built in API to add buttons for editing gadgets
Problem: It's hard to add buttons for editing tools in a single, visible group.
Proposed solution: Basically want I want is a replacement for this toolbar library. It allows adding buttons but it is kind of hard to maintain especially when new editor is added/removed. Same with VE editor (code and non-code) -- don't really have a simple, unified API that would allow adding buttons to toolbars.
Who would benefit: Gadget creators and gadget users.
More comments: Also it is hard to add something else then an image. Like and image with text which would be less confusing then just an image. Or add a button with an input (the code adds the button to advanced section which kind of sucks and is said to be bad, but I see no other way).
@Nux: Could you say a bit more about the shortcomings with adding new buttons to the toolbar? The existing system for adding a button in a gadget (to the existing top-level 'insert' group) is something like this:
"don't really have a simple, unified API that would allow adding buttons to toolbars." I'll also note that part of this is because a lot of (requested) complexity has been added over the years. VE and the old editors are very different in design and capabilities. Wrapping a 'button' to work in multiple, much more advanced editors (which I think is what you want) is just not that easy to do and doesn't actually make it much easier to work with. —TheDJ (talk • contribs) 23:07, 13 January 2022 (UTC)[reply]
Sure, I can understand it is not easy. That's why I would prefer not to do that 😉. We (at plwiki) always figured some way to do that. But lately there is this discussion about using API rather then hacking into classes or relaying on structure. I'm all for using APIs if they are good enough. In all of the editors you basically need: an icon, maybe text, a handler and a container for all that. Most of the time that should be enough.
Adding stuff like "action: encapsulate" might be fun for doing something for yourself, but seems to simple for a gadget. At least I don't have any gadgets like that... Well I think I added one button like that on plwiki, but not as a gadget.
BTW. Making an easier API for manipulation text and selection in an editor would be great, but that is another problem. Nux (talk) 20:07, 14 January 2022 (UTC)[reply]