From ed72e776938e8dd6e4721daf66ad473457e11d75 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 6 May 2016 11:37:30 +0100 Subject: [PATCH] Use Html class to make Html in onDiffViewHeader Change-Id: I2e4f06d1700dd9c686bb8eda53408370784ef365 --- RevisionSlider.hooks.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/RevisionSlider.hooks.php b/RevisionSlider.hooks.php index f8583846..3f595226 100755 --- a/RevisionSlider.hooks.php +++ b/RevisionSlider.hooks.php @@ -16,16 +16,32 @@ class RevisionSliderHooks { ) { $out = RequestContext::getMain()->getOutput(); $out->addModules( 'ext.RevisionSlider.init' ); - $out->addHTML( '
' ); - $placeHolder = ( new Message( 'revisionslider-loading-placeholder' ) )->parse(); $out->addHTML( - '

' . $placeHolder. '

' + 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( - '' - ); - $out->addHTML( '
' ); } public static function onResourceLoaderTestModules( array &$testModules, ResourceLoader $rl ) {