Index: trunk/phase3/maintenance/minify.php |
— | — | @@ -35,6 +35,9 @@ |
36 | 36 | "Directory for output. If this is not specified, and neither is --outfile, then the\n" . |
37 | 37 | "output files will be sent to the same directories as the input files.", |
38 | 38 | false, true ); |
| 39 | + $this->addOption( 'minify-vertical-space', |
| 40 | + "Boolean value for minifying the vertical space for javascript.", |
| 41 | + false, true ); |
39 | 42 | $this->mDescription = "Minify a file or set of files.\n\n" . |
40 | 43 | "If --outfile is not specified, then the output file names will have a .min extension\n" . |
41 | 44 | "added, e.g. jquery.js -> jquery.min.js."; |
— | — | @@ -96,6 +99,8 @@ |
97 | 100 | } |
98 | 101 | |
99 | 102 | public function minify( $inPath, $outPath ) { |
| 103 | + global $wgResourceLoaderMinifyJSVerticalSpace; |
| 104 | + |
100 | 105 | $extension = $this->getExtension( $inPath ); |
101 | 106 | $this->output( basename( $inPath ) . ' -> ' . basename( $outPath ) . '...' ); |
102 | 107 | |
— | — | @@ -112,7 +117,7 @@ |
113 | 118 | |
114 | 119 | switch ( $extension ) { |
115 | 120 | case 'js': |
116 | | - $outText = JSMin::minify( $inText ); |
| 121 | + $outText = JavaScriptDistiller::stripWhiteSpace( $inText, $this->getOption( 'minify-vertical-space', $wgResourceLoaderMinifyJSVerticalSpace ) ); |
117 | 122 | break; |
118 | 123 | case 'css': |
119 | 124 | $outText = CSSMin::minify( $inText ); |