mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
Use Html class to make Html in onDiffViewHeader
Change-Id: I2e4f06d1700dd9c686bb8eda53408370784ef365
This commit is contained in:
parent
a768ca1a8c
commit
ed72e77693
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue