Last modified: 2014-11-17 10:35:42 UTC
In bug 26175, there was a suggestion to provide some sort of onContentLoad callback for use by gadgets, so that the gadget code can execute after the diff page loads.
I pondered about it, and came to the conclusion that it should not just be an onLoad-, but also an onChange-Event. For example, when I have changed some links I may inform other scripts (like popups) about the change. Most of these may be new content, changed and/or rendered by the API, but it has not to. We even could go so far providing these "event-Listeners" as new Hooks for the page load, so that scripts won't have to register twice. In my opinion, we should pass some arguments to the trigger: * distinguish between content and userinterface (sidebar, header). What about interwiki and categories? * selectors for the loaded elements, e.g. an id * identificator for the script and its function Other scripts can handle the events and react specific to the passed data.
Feel free to file a separate issue with your feature request, but please don't expand the scope of this issue. Thanks.
RobLa, Do you have an example of a gadget that was affected by bug 26175?
(In reply to comment #3) > RobLa, Do you have an example of a gadget that was affected by bug 26175? I don't. Perhaps Andreas (andber93@web.de) does?
(In reply to comment #3) Sorry, I thougt this bug was for a more general request. (In reply to comment #3) > Do you have an example of a gadget that was affected by bug 26175? Oh, everything that wants to change the page view or add eventListeners to the page content. And thats a lot: * Moving the [Edit]-Links right to the Headings (from monobook.js, common.js) * The to-top-link-gadget has the same problem * [[de:MediaWiki:Gadget-Einleitung-bearbeiten.js]] fails when there are no [edit]-links * [[de:MediaWiki:Gadget-bkl-check.js]] has no links to analyze * Lupin's popups can add event listeners only to links it knows about * Wikiminiatlas sees no coordinate-links it can add a map to ... In the official [[de:MediaWiki:Gadgets-definition]]-list also markadmins, screenreader-optimzing, ß -> ss (swiss spelling) and the timezone-converter are harmed. Not listing any userscripts which have the problem, too.
Moot since r88639.