Last modified: 2013-06-10 03:03:30 UTC
Actually this bug is against version 1.12alpha (r26409) as installed on de.wikinews.org but i could not choose that version. I believe i have found a bug in the handling of the JavaScript mwCustomEditButtons variable. I have added this code to MediaWiki:Common.js: function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) { mwCustomEditButtons[mwCustomEditButtons.length] = {"imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, "sampleText": sampleText}; } I use this function to add custom buttons to the edit bar. Now MediaWiki seems to be intended to place the cursor between the output of "tagOpen" and "tagClose". When i add a button like this... addCustomButton('http://upload.wikimedia.org/wikipedia/commons/b/bb/Button_ébauche.png','test', "foo","bar",""); ...it works without a flaw and places the cursor between 'foo' and 'bar'. When i however add a button like this... addCustomButton('http://upload.wikimedia.org/wikipedia/commons/b/bb/Button_ébauche.png','test', "foo","bar\nbaz\n",""); ...it does not work correct, but places the cursor after the 'a' of the word 'bar'. What triggers the bug seems to be the newlines (\n) in the tagClose text. It looks like the correct position for the cursor is counted from the end of the text but the newlines are not considered in this, therefore placing the cursor two positions too far to the end of the text (because the tagClose text contains two newlines).
Is this problem still happening? Still relevant? Sorry, it's not simple for me to test.
A lot has changed since 2007. mwCustomEditButtons is no longer supported. Please migrate to mw.toolbar. If the issue can be reproduced in MediaWiki 1.20 or later and using the following syntax: > if ( mw.toolbar ) { > mw.toolbar.addButton( { > imageFile: 'http:// ... ', > speedTip: 'test', > etc. > } ); > } Then please re-open this report and be sure to mention "mw.toolbar" in the title.