Page MenuHomePhabricator

Decouple the edit toolbar: make the activator more re-usable
Closed, ResolvedPublic

Description

Author: jp.posma

Description:


Version: unspecified
Severity: enhancement

Details

Reference
bz27164

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:13 PM
bzimport added a project: WikiEditor.
bzimport set Reference to bz27164.

jp.posma wrote:

Oops, hit return by accident.

The toolbar should be decoupled from the edit page to allow applying it to an arbitrary textarea. This is required for extensions like InlineEditor.

This sounds like a duplicate of bug 26918 (or maybe of bug 26914 comment 4).

jp.posma wrote:

No, that's about being able to select an editing interface in the global or user settings. What I'd like, is to be able to use the WikiEditor toolbar in other places. So this is purely about the toolbar, not about the editing interface.

For example, the toolbar could be used in my InlineEditor extension, or in LiquidThreads, or in any other place where wikitext can be used.

To be clear, the toolbar code is mostly very modular, and this is a use case we paid attention to in it's design. There are two components to the toolbar, the plugin and the activator. The configuration (what buttons are where, what they do, what the look like, what label text they use) is in the activator - ext.wikiEditor.toolbar. The code that takes that config and builds a toolbar from it is jquery.wikiEditor.toolbar.

There have been other requests, which I agree with, which propose to make the configuration more configurable. I just wanted to point out, that all that needs to happen is work to make the activator more re-usable. The jQuery extension is highly reusable, and can even be used more than once on a single page.

jp.posma wrote:

Ah, great! I was under the impression that it wasn't as easy as that. In that case we can keep this bug to make the activator more re-usable, since you have had more requests for that. Thanks for the clarification!

Please note that LiquidThreads does this already (in most cases replying somewhere puts up a textarea with the editor) - depending on how they did it this may be what this bug requests (thus FIXED or INVALID)