From 7bca293dfd66cc6eca919d5d3d98940388745c1b Mon Sep 17 00:00:00 2001 From: umherirrender Date: Tue, 17 Dec 2013 19:41:33 +0100 Subject: Migrate redirectToFragment() from wikibits.js to own module This patch creates the new top module 'mediawiki.action.view.redirectToFragment'. This module contains the same code, but was migrated to use jQuery.profile to detect the layout of the browser. Other changes as written on bug 35858 can be done in seperate patch set(s). This is to have a start. The old code has to stay a version, because the cache can contain inline script calls to this function, which should not break. Bug: 35858 Change-Id: Ic10c060c3a2cbab455348e57740fc8abdc66ff9a --- includes/Article.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'includes/Article.php') diff --git a/includes/Article.php b/includes/Article.php index 821c32ea69c9..e7a1188ba4f4 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -989,9 +989,8 @@ class Article implements Page { // Set the fragment if one was specified in the redirect if ( strval( $this->getTitle()->getFragment() ) != '' ) { - $outputPage->addInlineScript( Xml::encodeJsCall( - 'redirectToFragment', array( $this->getTitle()->getFragmentForURL() ) - ) ); + $outputPage->addJsConfigVars( 'wgRedirectToFragment', $this->getTitle()->getFragmentForURL() ); + $outputPage->addModules( 'mediawiki.action.view.redirectToFragment' ); } // Add a tag -- cgit v1.2.3