Use packageFiles feature to replace special-purpose RL modules
[lhc/web/wiklou.git] / resources / src / mediawiki.jqueryMsg / mediawiki.jqueryMsg.js
index fdc988b..846deb9 100644 (file)
        var oldParser,
                slice = Array.prototype.slice,
                parserDefaults = {
+                       // Magic words and their expansions. Server-side data is added to this below.
                        magic: {
                                PAGENAME: mw.config.get( 'wgPageName' ),
                                PAGENAMEE: mw.util.wikiUrlencode( mw.config.get( 'wgPageName' ) )
                        },
                        // Whitelist for allowed HTML elements in wikitext.
                        // Self-closing tags are not currently supported.
-                       // Can be populated via setParserDefaults().
+                       // Filled in with server-side data below
                        allowedHtmlElements: [],
                        // Key tag name, value allowed attributes for that tag.
                        // See Sanitizer::setupAttributeWhitelist
@@ -56,6 +57,9 @@
                        format: 'parse'
                };
 
+       // Add in server-side data (allowedHtmlElements and magic words)
+       $.extend( true, parserDefaults, require( './parserDefaults.json' ) );
+
        /**
         * Wrapper around jQuery append that converts all non-objects to TextNode so append will not
         * convert what it detects as an htmlString to an element.