mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Send users whose browsers support JS but are unsupported by MW to the WTE using venoscript=1
Bug: T123457 Change-Id: Ia7e6f4dc1b7dc15fa287bf6b2c4ea12eb4a7c4ba Depends-On: Ice6ebb95bfcb2050f4813705467942f95f7e720c
This commit is contained in:
parent
2837cfb400
commit
188ec0f5d2
|
@ -153,19 +153,26 @@ class VisualEditorHooks {
|
|||
isset( $params['preloadparams'] );
|
||||
// Known-good parameters: edit, veaction, section, vesection, veswitched
|
||||
|
||||
$params['venoscript'] = '1';
|
||||
$url = wfScript() . '?' . wfArrayToCgi( $params );
|
||||
$out = $article->getContext()->getOutput();
|
||||
if ( !$ret ) {
|
||||
$out = $article->getContext()->getOutput();
|
||||
|
||||
$params['venoscript'] = '1';
|
||||
$url = htmlspecialchars( wfScript() . '?' . wfArrayToCgi( $params ) );
|
||||
$escapedUrl = htmlspecialchars( $url );
|
||||
$out->addHeadItem(
|
||||
've-noscript-fallback',
|
||||
"<noscript><meta http-equiv=\"refresh\" content=\"0; url=$url\"></noscript>"
|
||||
"<noscript><meta http-equiv=\"refresh\" content=\"0; url=$escapedUrl\"></noscript>"
|
||||
);
|
||||
|
||||
$titleMsg = $title->exists() ? 'editing' : 'creating';
|
||||
$out->setPageTitle( wfMessage( $titleMsg, $title->getPrefixedText() ) );
|
||||
}
|
||||
$out->addScript( Html::inlineScript(
|
||||
"(window.NORLQ=window.NORLQ||[]).push(" .
|
||||
"function(){" .
|
||||
"location.href=\"$url\";" .
|
||||
"}" .
|
||||
");"
|
||||
) );
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue