Last modified: 2010-05-15 15:48:28 UTC
In skins/common/wikibits.js, function scrollEditBox is setting the form's onsubmit handler directly, overwriting any other onsubmit handlers. Therefore it's not possible for an extension to add an onsubmit handler to EditPage.php. I suggest scrollEditBox should use wikibits.js:hookEvent() instead of setting form.onsubmit directly. The code: editFormEl.onsubmit = function() { ...
hookEvent() can't be used directly because it adds events only to the window object. So I suggest wikibits.js get a new, more general function, hookObjectEvent, that works on any object, and you rewrite hookEvent in terms of it. // wikibits.js function hookObjectEvent(obj, hookName, hookFunct) { if (obj.addEventListener) { obj.addEventListener(hookName, hookFunct, false); } else if (obj.attachEvent) { obj.attachEvent("on" + hookName, hookFunct); } } function hookEvent(hookName, hookFunct) { hookObjectEvent(window, hookName, hookFunct); }
This is a very simple fix and I've provided full source code for it. Any chance that someone will consider it? It does not affect MediaWiki's behavior at all, but allows extension writers to add onsubmit handlers properly.
Fixed in r24565.