Last modified: 2011-11-21 23:47:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11018 - Add ordered/unordered list buttons to edit toolbar
Add ordered/unordered list buttons to edit toolbar
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks: edit-toolbar
  Show dependency treegraph
Reported: 2007-08-21 20:48 UTC by Pedro de Medeiros
Modified: 2011-11-21 23:47 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

unordered/ordered list buttons support (6.63 KB, patch)
2007-08-21 20:48 UTC, Pedro de Medeiros
Screenshot of the (un)ordered list buttons in the new WikiEditor toolbar (23.47 KB, image/png)
2011-11-21 23:47 UTC, Krinkle

Description Pedro de Medeiros 2007-08-21 20:48:41 UTC
Created attachment 4024 [details]
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/
Comment 1 Danny B. 2007-08-22 00:02:27 UTC
Buttons already exist:

In case it won't be implemented in default settings, you can add it either in MediaWiki:Common.js or your personal Monobook.js.
Comment 2 Pedro de Medeiros 2007-08-28 19:40:18 UTC
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

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

This is a list:

So my code actually puts the 'tagOpen' argument at the beginning of the selection and after each newline.
Comment 3 Danny B. 2007-08-29 00:51:49 UTC
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 #)
Comment 4 Sumana Harihareswara 2011-11-09 23:54:55 UTC
Adding the "need-review" keyword to ask developers to review the patch.  Thank you for the patch, Pedro, and sorry for the wait!
Comment 5 Sam Reed (reedy) 2011-11-20 14:17:59 UTC
The old edit toolbar is deprecated and new features shouldn't be added to it.

Comment 6 Krinkle 2011-11-21 23:47:12 UTC
Created attachment 9520 [details]
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.

Note You need to log in before you can comment on or make changes to this bug.