mw.hook: Implement callback framework
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 13 Feb 2013 20:56:33 +0000 (21:56 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 3 May 2013 20:33:55 +0000 (22:33 +0200)
commit2e970257deedbea55987935146b5bc71af21525c
tree3b76ce55a69fb2fb3030175d95246c05e1f9ca01
parent95d1b998af46ad23251dfc5a02fd91ff8e3652ea
mw.hook: Implement callback framework

We have various interface components that are extended, enhanced
or manipulated in some other way by extensions, gadgets and even
in core itself.

This framework helps streamlining the timing of when these other
code paths fire their plugins (instead of using document-ready,
which can and should be limited to firing only once).

Features like navigating to other wiki pages, previewing an edit
and editing itself – without a refresh – can then retrigger these
hooks accordingly to ensure everything still works as expected.

For the server side this has been possible already, but for the
client side we've been limited to running only once on the
original page load.

Further documentation and examples are in the code documentation.

Bug: 23580
Bug: 30713
Change-Id: Ic73a3efe53d6fb731e7f1e531d5f51530cd7e4fe
maintenance/jsduck/categories.json
resources/mediawiki/mediawiki.js
resources/mediawiki/mediawiki.util.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js