mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
Add localizable placeholder message while loading
Change-Id: I762b03c5af8765b90afee81af750880096db6638
This commit is contained in:
parent
8490d0f040
commit
ba4015ed6b
|
@ -25,6 +25,12 @@ class RevisionSliderHooks {
|
|||
) {
|
||||
$out = RequestContext::getMain()->getOutput();
|
||||
$out->addHTML( '<div id="revision-slider-container" style="min-height: 150px;"></div>' );
|
||||
|
||||
$placeHolder = ( new Message( 'revisionslider-loading-placeholder' ) )->parse();
|
||||
$out->addHTML(
|
||||
'<p id="revision-slider-placeholder" style="text-align: center">' . $placeHolder. '</p>'
|
||||
);
|
||||
$out->addHTML( '</div>' );
|
||||
}
|
||||
|
||||
public static function onResourceLoaderTestModules( array &$testModules, ResourceLoader $rl ) {
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
]
|
||||
},
|
||||
"revisionslider": "RevisionSlider",
|
||||
"revisionslider-desc": ""
|
||||
"revisionslider-desc": "",
|
||||
"revisionslider-loading-placeholder": "The revision slider is loading."
|
||||
}
|
|
@ -5,5 +5,6 @@
|
|||
]
|
||||
},
|
||||
"revisionslider": "Revision Slider",
|
||||
"revisionslider-desc": "{{desc|name=RevisionSlider|url=https://www.mediawiki.org/wiki/Extension:RevisionSlider}}"
|
||||
"revisionslider-desc": "{{desc|name=RevisionSlider|url=https://www.mediawiki.org/wiki/Extension:RevisionSlider}}",
|
||||
"revisionslider-loading-placeholder": "Message shown while the RevisionSlider is still loading on a diff page. Once loaded the message is removed."
|
||||
}
|
||||
|
|
|
@ -275,6 +275,8 @@
|
|||
}
|
||||
} );
|
||||
|
||||
$( '#revision-slider-placeholder' ).remove();
|
||||
|
||||
$( '#revision-slider-container' )
|
||||
.append( $revisionSlider )
|
||||
.append( getSectionLegend( revs ) );
|
||||
|
|
Loading…
Reference in a new issue