mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-23 23:13:29 +00:00
When JavaScript disabled do not show RevisionSlider
As suggested in a comment in T135198, do not show anything above the diff when JavaScript disabled instead of always putting a message there. Change-Id: I1c66fa4a9fa6e90f8318de3a4f656d629000d9ca
This commit is contained in:
parent
225f48ac52
commit
f9d9a4a4b7
|
@ -38,6 +38,7 @@ class RevisionSliderHooks {
|
|||
|
||||
$out = RequestContext::getMain()->getOutput();
|
||||
$out->addModules( 'ext.RevisionSlider.init' );
|
||||
$out->addModuleStyles( 'ext.RevisionSlider.noscript' );
|
||||
$out->addJsConfigVars( 'extRevisionSliderOldRev', $oldRev->getId() );
|
||||
$out->addJsConfigVars( 'extRevisionSliderNewRev', $newRev->getId() );
|
||||
$out->addJsConfigVars( 'extRevisionSliderTimeOffset', intval( $timeOffset ) );
|
||||
|
@ -55,15 +56,6 @@ class RevisionSliderHooks {
|
|||
'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()
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
],
|
||||
"position": "top"
|
||||
},
|
||||
"ext.RevisionSlider.noscript": {
|
||||
"styles": "modules/ext.RevisionSlider.noscript.css"
|
||||
},
|
||||
"ext.RevisionSlider.fetchRevisions": {
|
||||
"scripts": [
|
||||
"modules/ext.RevisionSlider.fetchRevisions.js"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"revisionslider-loading-placeholder": "The revision slider is loading.",
|
||||
"revisionslider-loading-failed": "The revision slider failed to load.",
|
||||
"revisionslider-loading-out-of-range": "The revision slider failed to load as the requested revisions are not in the top 500 versions of the page.",
|
||||
"revisionslider-loading-noscript": "As you have JavaScript disabled the revision slider will not be able to load.",
|
||||
"revisionslider-arrow-tooltip-newer": "See newer revisions",
|
||||
"revisionslider-arrow-tooltip-older": "See older revisions"
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
"revisionslider-loading-placeholder": "Message shown while the RevisionSlider is still loading on a diff page. Once loaded the message is removed.",
|
||||
"revisionslider-loading-failed": "Message shown if the RevisionSlider fails to initially load.",
|
||||
"revisionslider-loading-out-of-range": "Message shown if the RevisionSlider fails to initially load due to revisions being requested that are not in the most recent 500 revisions.",
|
||||
"revisionslider-loading-noscript": "Message shown while the RevisionSlider is trying to load but when JavaScript is disabled and thus it will not be successful.",
|
||||
"revisionslider-arrow-tooltip-newer": "Text shown after hovering the button scrolling to newer revisions.",
|
||||
"revisionslider-arrow-tooltip-older": "Text shown after hovering the button scrolling to older revisions."
|
||||
}
|
||||
|
|
3
modules/ext.RevisionSlider.noscript.css
Normal file
3
modules/ext.RevisionSlider.noscript.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.client-nojs #mw-revision-slider-container {
|
||||
display: none;
|
||||
}
|
Loading…
Reference in a new issue