Use new showPendingTakeover OutputPage method

Depends-On: I8f25f53a05ce0437b0e9f63033cc151213c797bf
Change-Id: Ib9a09514ed3da614ff8a654ae5b84a3a5b2ce886
This commit is contained in:
David Lynch 2023-04-06 17:20:30 -05:00
parent 5c38d0501a
commit 99336933b3

View file

@ -377,26 +377,12 @@ class Hooks {
$params = $req->getValues();
$params['venoscript'] = '1';
$url = wfScript() . '?' . wfArrayToCgi( $params );
$escapedUrl = htmlspecialchars( $url );
$out = $article->getContext()->getOutput();
$titleMsg = $title->exists() ? 'editing' : 'creating';
$out->setPageTitle( wfMessage( $titleMsg, $title->getPrefixedText() ) );
$out->addWikiMsg( 'visualeditor-toload', wfExpandUrl( $url ) );
$out->showPendingTakeover( $url, 'visualeditor-toload', wfExpandUrl( $url ) );
// Redirect if the user has no JS (<noscript>)
$out->addHeadItem(
've-noscript-fallback',
"<noscript><meta http-equiv=\"refresh\" content=\"0; url=$escapedUrl\"></noscript>"
);
// Redirect if the user has no ResourceLoader
$out->addScript( Html::inlineScript(
"(window.NORLQ=window.NORLQ||[]).push(" .
"function(){" .
"location.href=\"$url\";" .
"}" .
");"
) );
$out->setRevisionId( $req->getInt( 'oldid', $article->getRevIdFetched() ) );
return false;
}