Go to the documentation of this file.
37 parent::__construct(
'JavaScriptTest' );
44 $out->disallowUserJs();
46 if ( $par ===
null ) {
48 $out->setStatusCode( 404 );
49 $out->setPageTitle( $this->
msg(
'javascripttest' ) );
51 $this->
msg(
'javascripttest-pagetext-noframework' )->parseAsBlock()
58 $pars = explode(
'/', $par, 2 );
60 $framework = $pars[0];
61 if ( !in_array( $framework, self::$frameworks ) ) {
63 $out->setStatusCode( 404 );
66 . $this->
msg(
'javascripttest-pagetext-unknownframework' )
67 ->plaintextParams( $par )->parseAsBlock()
77 $out->allowClickjacking();
79 $this->
msg(
'javascripttest-backlink' )
84 if ( isset( $pars[1] ) ) {
86 if ( !in_array( $action,
array(
'export',
'plain' ) ) ) {
87 $out->setStatusCode( 404 );
90 . $this->
msg(
'javascripttest-pagetext-unknownaction' )
91 ->plaintextParams( $action )->parseAsBlock()
96 $method = $action . ucfirst( $framework );
101 $out->addModules(
'mediawiki.special.javaScriptTest' );
103 $method =
'view' . ucfirst( $framework );
105 $out->setPageTitle( $this->
msg(
106 'javascripttest-title',
108 $this->
msg(
"javascripttest-$framework-name" )->plain()
120 foreach ( self::$frameworks
as $framework ) {
127 $this->
msg(
"javascripttest-$framework-name" )->escaped()
133 return $this->
msg(
'javascripttest-pagetext-frameworks' )->rawParams( $list )
144 return "<div id=\"mw-javascripttest-summary\">$html</div>";
153 global $wgJavaScriptTestConfig;
156 $testConfig = $wgJavaScriptTestConfig;
158 $modules =
$out->getResourceLoader()->getTestModuleNames(
'qunit' );
160 $summary = $this->
msg(
'javascripttest-qunit-intro' )
161 ->params( $wgJavaScriptTestConfig[
'qunit'][
'documentation'] )
165 <div
class=
"mw-content-ltr">
166 <div
id=
"qunit"></div>
172 $out->addJsConfigVars(
173 'QUnitTestSwarmInjectJSPath',
174 $testConfig[
'qunit'][
'testswarm-injectjs']
185 array(
'jquery.qunit',
'jquery.qunit.completenessTest' ),
209 $rl =
$out->getResourceLoader();
213 'skin' => $this->
getSkin()->getSkinName(),
217 $query[
'only'] =
'scripts';
220 $modules = $rl->getTestModuleNames(
'qunit' );
223 $startup = $rl->makeModuleResponse( $startupContext,
array(
224 'startup' => $rl->getModule(
'startup' ),
231 $code .= $rl->makeModuleResponse( $embedContext,
array(
232 'user.options' => $rl->getModule(
'user.options' ),
233 'user.tokens' => $rl->getModule(
'user.tokens' ),
237 header(
'Content-Type: text/javascript; charset=utf-8' );
238 header(
'Cache-Control: private, no-cache, must-revalidate' );
239 header(
'Pragma: no-cache' );
261 $head = trim( $styles[
'html'] . $scripts[
'html'] );
266 <div
id=
"qunit"></div>
270 header(
'Content-Type: text/html; charset=utf-8' );
static makeLoaderConditionalScript( $script)
Returns JS code which runs given JS code if the client-side framework is present.
getPageTitle( $subpage=false)
Get a self-referential title object.
Object passed around to modules which contains information about the state of a specific loader reque...
WebRequest clone which takes values from a provided array.
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static makeConfigSetScript(array $configuration)
Returns JS code which will set the MediaWiki configuration array to the given value.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
getOutput()
Get the OutputPage being used for this instance.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getSkin()
Shortcut to get the skin being used for this instance.
getLanguage()
Shortcut to get user's language.
static inlineScript( $contents)
Output a "<script>" tag with the given contents.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
wrapSummaryHtml( $html)
Wrap HTML contents in a summary container.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string a...
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
static encodeJsCall( $name, $args, $pretty=false)
Create a call to a JavaScript function.
static linkedScript( $url)
Output a "<script>" tag linking to the given URL, e.g., "<script src=foo.js></script>".
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
when a variable name is used in a it is silently declared as a new masking the global
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
exportQUnit()
Generate self-sufficient JavaScript payload to run the tests elsewhere.
static inDebugMode()
Determine whether debug mode was requested Order of priority is 1) request param, 2) cookie,...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
viewQUnit()
Run the test suite on the Special page.
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
getFrameworkListHtml()
Get a list of frameworks (including introduction paragraph and links to the framework run pages)