Added hook to support partial rendering for the InlineEditor extension. Doesn't affect normal behaviour.

This commit is contained in:
Jan Paul Posma 2011-02-27 14:50:56 +00:00
parent 286a80efc1
commit efb47a9d90

View file

@ -1013,6 +1013,14 @@ class Cite {
} }
return true; return true;
} }
/**
* Hook for the InlineEditor extension. If any reference is in the text, the entire
* page should be reparsed, so we return false in that case.
*/
function checkAnyRefs( &$output ) {
return ( empty( $this->mRefs ) );
}
/** /**
* Initialize the parser hooks * Initialize the parser hooks
@ -1025,6 +1033,7 @@ class Cite {
$wgHooks['ParserClearState'][] = array( self::$instance, 'clearState' ); $wgHooks['ParserClearState'][] = array( self::$instance, 'clearState' );
$wgHooks['ParserBeforeTidy'][] = array( self::$instance, 'checkRefsNoReferences' ); $wgHooks['ParserBeforeTidy'][] = array( self::$instance, 'checkRefsNoReferences' );
$wgHooks['InlineEditorPartialAfterParse'][] = array( self::$instance, 'checkAnyRefs' );
} }
$parser->setHook( 'ref' , array( self::$instance, 'ref' ) ); $parser->setHook( 'ref' , array( self::$instance, 'ref' ) );
$parser->setHook( 'references' , array( self::$instance, 'references' ) ); $parser->setHook( 'references' , array( self::$instance, 'references' ) );