From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/specials/SpecialJavaScriptTest.php | 61 ++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 15 deletions(-) (limited to 'includes/specials/SpecialJavaScriptTest.php') diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index d7e1655f..c217eccb 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -1,5 +1,29 @@ setPagetitle( wfMsgHtml( 'javascripttest' ) ); + $out->setPageTitle( $this->msg( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( - wfMsgHtml( 'javascripttest-pagetext-noframework' ) . $this->getFrameworkListHtml(), + $this->msg( 'javascripttest-pagetext-noframework' )->escaped() . $this->getFrameworkListHtml(), 'noframework' ); $out->addHtml( $summary ); // Matched! Display proper title and initialize the framework } elseif ( isset( self::$frameworks[$framework] ) ) { - $out->setPagetitle( wfMsgHtml( 'javascripttest-title', wfMsgHtml( "javascripttest-$framework-name" ) ) ); - $out->setSubtitle( - wfMessage( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) )->escaped() - ); + $out->setPageTitle( $this->msg( 'javascripttest-title', $this->msg( "javascripttest-$framework-name" )->plain() ) ); + $out->setSubtitle( $this->msg( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) ) ); $this->{self::$frameworks[$framework]}(); // Framework not found, display error } else { - $out->setPagetitle( wfMsgHtml( 'javascripttest' ) ); + $out->setPageTitle( $this->msg( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( '

' - . wfMsgHtml( 'javascripttest-pagetext-unknownframework', $par ) + . $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped() . '

' . $this->getFrameworkListHtml(), 'unknownframework' @@ -75,11 +97,11 @@ class SpecialJavaScriptTest extends SpecialPage { $list .= Html::rawElement( 'li', array(), - Linker::link( $this->getTitle( $framework ), wfMsgHtml( "javascripttest-$framework-name" ) ) + Linker::link( $this->getTitle( $framework ), $this->msg( "javascripttest-$framework-name" )->escaped() ) ); } $list .= ''; - $msg = wfMessage( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock(); + $msg = $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock(); return $msg; } @@ -90,6 +112,7 @@ class SpecialJavaScriptTest extends SpecialPage { * be thrown. * @param $html String: The raw HTML. * @param $state String: State, one of 'noframework', 'unknownframework' or 'frameworkfound' + * @return string */ private function wrapSummaryHtml( $html, $state ) { $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' ); @@ -106,7 +129,7 @@ class SpecialJavaScriptTest extends SpecialPage { * Initialize the page for QUnit. */ private function initQUnitTesting() { - global $wgJavaScriptTestConfig, $wgLang; + global $wgJavaScriptTestConfig; $out = $this->getOutput(); @@ -114,11 +137,11 @@ class SpecialJavaScriptTest extends SpecialPage { $qunitTestModules = $out->getResourceLoader()->getTestModuleNames( 'qunit' ); $out->addModules( $qunitTestModules ); - $summary = wfMessage( 'javascripttest-qunit-intro' ) + $summary = $this->msg( 'javascripttest-qunit-intro' ) ->params( $wgJavaScriptTestConfig['qunit']['documentation'] ) ->parseAsBlock(); - $header = wfMessage( 'javascripttest-qunit-heading' )->escaped(); - $userDir = $wgLang->getDir(); + $header = $this->msg( 'javascripttest-qunit-heading' )->escaped(); + $userDir = $this->getLanguage()->getDir(); $baseHtml = << @@ -132,6 +155,14 @@ class SpecialJavaScriptTest extends SpecialPage { HTML; $out->addHtml( $this->wrapSummaryHtml( $summary, 'frameworkfound' ) . $baseHtml ); + // This special page is disabled by default ($wgEnableJavaScriptTest), and contains + // no sensitive data. In order to allow TestSwarm to embed it into a test client window, + // we need to allow iframing of this page. + $out->allowClickjacking(); + + // Used in ./tests/qunit/data/testrunner.js, see also documentation of + // $wgJavaScriptTestConfig in DefaultSettings.php + $out->addJsConfigVars( 'QUnitTestSwarmInjectJSPath', $wgJavaScriptTestConfig['qunit']['testswarm-injectjs'] ); } public function isListed(){ -- cgit v1.2.3-54-g00ecf