Last modified: 2011-11-21 23:47:12 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/
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.
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 #)
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 [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.