Use Html class to make Html in onDiffViewHeader

Change-Id: I2e4f06d1700dd9c686bb8eda53408370784ef365
This commit is contained in:
addshore 2016-05-06 11:37:30 +01:00
parent a768ca1a8c
commit ed72e77693

View file

@ -16,16 +16,32 @@ class RevisionSliderHooks {
) {
$out = RequestContext::getMain()->getOutput();
$out->addModules( 'ext.RevisionSlider.init' );
$out->addHTML( '<div id="revision-slider-container" style="min-height: 150px;">' );
$placeHolder = ( new Message( 'revisionslider-loading-placeholder' ) )->parse();
$out->addHTML(
'<p id="revision-slider-placeholder" style="text-align: center">' . $placeHolder. '</p>'
Html::rawElement(
'div',
[
'id' => 'revision-slider-container',
'style' => 'min-height: 150px;',
],
Html::element(
'p',
[
'id' => 'revision-slider-placeholder',
'style' => 'text-align: center',
],
( new Message( 'revisionslider-loading-placeholder' ) )->parse()
) .
Html::rawElement(
'noscript',
[ ],
Html::element(
'p',
[ 'style' => 'text-align: center' ],
( new Message( 'revisionslider-loading-noscript' ) )->parse()
)
)
)
);
$noScriptMessage = ( new Message( 'revisionslider-loading-noscript' ) )->parse();
$out->addHTML(
'<noscript><p style="text-align: center" >' . $noScriptMessage . '</p></noscript>'
);
$out->addHTML( '</div>' );
}
public static function onResourceLoaderTestModules( array &$testModules, ResourceLoader $rl ) {