Only pretty-print the parser report JS vars
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 26 Jul 2016 20:29:17 +0000 (13:29 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 27 Jul 2016 00:16:56 +0000 (17:16 -0700)
Follow-up to b7c4c8717f9.

Change-Id: I3030df4ed890d9d20daca31fbd33c6d9db91b94c

includes/OutputPage.php
includes/resourceloader/ResourceLoader.php

index c8a385a..d34ace8 100644 (file)
@@ -3082,7 +3082,12 @@ class OutputPage extends ContextSource {
         */
        function getBottomScripts() {
                return $this->getScriptsForBottomQueue() .
         */
        function getBottomScripts() {
                return $this->getScriptsForBottomQueue() .
-                       Skin::makeVariablesScript( [ 'wgPageParseReport' => $this->limitReportData ] );
+                       ResourceLoader::makeInlineScript(
+                               ResourceLoader::makeConfigSetScript(
+                                       [ 'wgPageParseReport' => $this->limitReportData ],
+                                       true
+                               )
+                       );
        }
 
        /**
        }
 
        /**
index 59f6462..1a93f6e 100644 (file)
@@ -1388,13 +1388,14 @@ MESSAGE;
         * the given value.
         *
         * @param array $configuration List of configuration values keyed by variable name
         * the given value.
         *
         * @param array $configuration List of configuration values keyed by variable name
+        * @param bool $pretty Pretty-print with extra whitespace
         * @return string
         */
         * @return string
         */
-       public static function makeConfigSetScript( array $configuration ) {
+       public static function makeConfigSetScript( array $configuration, $pretty = null ) {
                return Xml::encodeJsCall(
                        'mw.config.set',
                        [ $configuration ],
                return Xml::encodeJsCall(
                        'mw.config.set',
                        [ $configuration ],
-                       true // readable
+                       ( $pretty === null ) ? ResourceLoader::inDebugMode() : $pretty
                );
        }
 
                );
        }