Last modified: 2011-03-13 18:04:48 UTC
Created attachment 4901 [details] Patch by DanB created on his behalf From mediawiki-l@lists.wikimedia.org: In our wiki, we have many toolbar buttons on the edit page, so we want to split them into multiple lines at designated spots. My hacked solution is below -- is there a better way? To implement this, I hacked function mwInsertEditButton in skins/common/wikibits.js, so an imageFile value of "<br>" causes a real <br> to be inserted into the toolbar. I added this code as the first lines of mwInsertEditButton : if (item.imageFile == '<br>') { parent.appendChild(document.createElement("br")); return true; } Is there a better way to accomplish this task without modifying core code? Thanks, DanB This patch seems good, and an svn patch is attached
+need-review
Note that this code is now in skins/common/edit.js (formerly wikibits.js).
Please provide an updated unified diff.
Created attachment 5187 [details] Diff against -r39564 Uploaded new diff
Would someone please commit this patch? It is so small and useful, and it's been ready (and tested locally) for 9 months. I will upload a new unified diff.
Created attachment 5853 [details] Unified diff against trunk rev 47722
Any chance this simple patch could see the light of day? Thanks.
You may close this ticket. The "br" functionality can be implemented without a core code change, by overriding mwInsertEditButton in MediaWiki:common.js.
Solution: var orig_mwInsertEditButton = window.mwInsertEditButton; window.mwInsertEditButton = function(parent, item) { if (item.imageFile == '<br>') { parent.appendChild(document.createElement("br")); return true; } return orig_mwInsertEditButton(parent, item); }