Only load "ext.ajaxpoll" on pages that need it

Change-Id: I0e989b3c059b7aaf049476c8bb847bebf9ef4089
This commit is contained in:
Kunal Mehta 2014-10-03 02:54:26 -07:00
parent 7e65ec1e61
commit b7ab4f23f4

View file

@ -22,9 +22,7 @@ class AJAXPoll {
* @return Boolean: true * @return Boolean: true
*/ */
static function onParserInit( $parser ) { static function onParserInit( $parser ) {
global $wgOut;
$parser->setHook( 'poll', array( __CLASS__, 'AJAXPollRender' ) ); $parser->setHook( 'poll', array( __CLASS__, 'AJAXPollRender' ) );
$wgOut->addModules( 'ext.ajaxpoll' );
return true; return true;
} }
@ -34,6 +32,7 @@ class AJAXPoll {
$parser->disableCache(); $parser->disableCache();
$parser->addTrackingCategory( 'ajaxpoll-tracking-category' ); $parser->addTrackingCategory( 'ajaxpoll-tracking-category' );
$parser->getOutput()->addModules( 'ext.ajaxpoll' );
if ( $wgUser->getName() == '' ) { if ( $wgUser->getName() == '' ) {
$userName = $wgRequest->getIP(); $userName = $wgRequest->getIP();