Add localizable placeholder message while loading

Change-Id: I762b03c5af8765b90afee81af750880096db6638
This commit is contained in:
addshore 2016-05-03 12:36:34 +01:00 committed by WMDE-Fisch
parent 8490d0f040
commit ba4015ed6b
4 changed files with 12 additions and 2 deletions

View file

@ -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 ) {

View file

@ -5,5 +5,6 @@
]
},
"revisionslider": "RevisionSlider",
"revisionslider-desc": ""
"revisionslider-desc": "",
"revisionslider-loading-placeholder": "The revision slider is loading."
}

View file

@ -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."
}

View file

@ -275,6 +275,8 @@
}
} );
$( '#revision-slider-placeholder' ).remove();
$( '#revision-slider-container' )
.append( $revisionSlider )
.append( getSectionLegend( revs ) );