MediaWiki REL1_32
ResourceLoaderJqueryMsgModule.php
Go to the documentation of this file.
1<?php
27
33 $fileScript = parent::getScript( $context );
34
35 $tagData = Sanitizer::getRecognizedTagData();
36 $allowedHtmlElements = array_merge(
37 array_keys( $tagData['htmlpairs'] ),
38 array_diff(
39 array_keys( $tagData['htmlsingle'] ),
40 array_keys( $tagData['htmlsingleonly'] )
41 )
42 );
43
44 $magicWords = [
45 'SITENAME' => $this->getConfig()->get( 'Sitename' ),
46 ];
47 Hooks::run( 'ResourceLoaderJqueryMsgModuleMagicWords', [ $context, &$magicWords ] );
48
49 $parserDefaults = [
50 'allowedHtmlElements' => $allowedHtmlElements,
51 'magic' => $magicWords,
52 ];
53
54 $setDataScript = Xml::encodeJsCall( 'mw.jqueryMsg.setParserDefaults', [
55 $parserDefaults,
56 // Pass deep=true because mediawiki.jqueryMsg.js contains
57 // page-specific magic words that must not be overwritten.
58 true,
59 ] );
60
61 return $fileScript . $setDataScript;
62 }
63
69 // Bypass file module urls
71 }
72
76 public function enableModuleContentVersion() {
77 return true;
78 }
79}
Object passed around to modules which contains information about the state of a specific loader reque...
ResourceLoader module based on local JavaScript/CSS files.
ResourceLoader module for mediawiki.jqueryMsg and its generated data.
getScript(ResourceLoaderContext $context)
getScriptURLsForDebug(ResourceLoaderContext $context)
getScriptURLsForDebug(ResourceLoaderContext $context)
Get the URL or URLs to load for this module's JS in debug mode.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2885
magicword txt Magic Words are some phrases used in the wikitext They are used for two that looks like templates but that don t accept any parameter *Parser functions(like {{fullurl:...}}, {{#special:...}}) $magicWords['en']
Definition magicword.txt:33