Page MenuHomePhabricator

Allow arbitrary HTML for buttons
Closed, ResolvedPublic2 Estimated Story PointsFeature

Description

Currently, a tool in a toolbar can be of type button (ButtonWidget), toggle (ToggleButtonWidget), or select (custom picklist). This limits what can be added to a toolbar, for example it is not possible to add a ButtonGroupWidget for a button with context menu (as is needed for T285712), or a ComboBoxWidget for entering custom data.

To fix this, it is proposed to add a new type: 'element' value and element={string|jQuery|HTMLElement} key, with which to add arbitrary HTML as toolbar items. The element would still get a wrapper such as <div class="tool">…</div>.

Event Timeline

Samwilson added a subscriber: DLynch.

@DLynch how does this sound?

This is no longer required for CommTech's work on Wikimedia OCR (we ended up just inserting the HTML with jQuery).

The task is still valid though.

Aklapper changed the subtype of this task from "Task" to "Feature Request".

Change 760697 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Add 'element' type for toolbar tools

https://gerrit.wikimedia.org/r/760697

Change 760697 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Add 'element' type for toolbar tools

https://gerrit.wikimedia.org/r/760697

Samwilson claimed this task.
Samwilson set the point value for this task to 2.

Change 767266 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Allow tool.element to be a function

https://gerrit.wikimedia.org/r/767266

Change 767266 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Allow tool.element to be a function

https://gerrit.wikimedia.org/r/767266

This was merged last week, but I'm assuming we'll save the QA phase for when we make use of the new functionality? As it stands now, there's nothing to test without doing some coding of your own.

Yes, I agree, no need for QA or anything here. Let's mark as done and revisit (again!) as required.