Page MenuHomePhabricator

Add ordered/unordered list buttons to edit toolbar
Closed, DeclinedPublic

Description

Author: pedrovmm+bugzilla.wikimedia.org

Description:
unordered/ordered list buttons support

Mediawiki editor lacks a button for inserting markups for ordered/unordered lists. So I've created two extra buttons that should do the trick. When you edit a page, you can select a multi-line text and press a button to have each line of the selection prefixed with "#" or "*".

I know this patch is not complete yet (for instance, I haven't set i18n strings for it), but if there is enough interest I could make an improved version, following any standard needed to have it approved.

Additionally, this patch will need image buttons called button_ol.png and button_ul.png in the subdirectory /skins/common/images/


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz11018

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:52 PM
bzimport set Reference to bz11018.
bzimport added a subscriber: Unknown Object (MLST).

Buttons already exist:

http://commons.wikimedia.org/wiki/Image:Btn_toolbar_enum.png
http://commons.wikimedia.org/wiki/Image:Btn_toolbar_liste.png

In case it won't be implemented in default settings, you can add it either in MediaWiki:Common.js or your personal Monobook.js.

pedrovmm+bugzilla.wikimedia.org wrote:

Danny B,

it would not be enough to just change Common.js or Monobook.js. I had to change EditPage.php to create a new type of button, because I needed to insert wiki markup in a way that was not supported by current implementation. Consider this example:

(selected text bellow is between []s)

This is a list: [item1
item2
item3
item4]

The outcome is this after the ordered list button is pressed:

This is a list:
#item1
#item2
#item3
#item4

So my code actually puts the 'tagOpen' argument at the beginning of the selection and after each newline.

Well, since edit buttons are pure javascript, I'm pretty sure these two buttons can be added without fiddling with any php, if it isn't/won't be in default set.

  • one function for adding new button and its onclick event via DOM
  • one function for handling the onclick event (adding of * or #)

sumanah wrote:

Adding the "need-review" keyword to ask developers to review the patch. Thank you for the patch, Pedro, and sorry for the wait!

The old edit toolbar is deprecated and new features shouldn't be added to it.

RESOLVED WONTFIX

Created attachment 9520
Screenshot of the (un)ordered list buttons in the new WikiEditor toolbar

No need to port this to the new editor. Attached is a screenshot the new WikiEditor, which has these by default.

Attached:

Screen_Shot_2011-11-22_at_12.45.20_AM.png (351×297 px, 23 KB)