mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Use new showPendingTakeover OutputPage method
Depends-On: I8f25f53a05ce0437b0e9f63033cc151213c797bf Change-Id: Ib9a09514ed3da614ff8a654ae5b84a3a5b2ce886
This commit is contained in:
parent
5c38d0501a
commit
99336933b3
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue