Manual:Minify.php

This page is a translated version of the page Manual:Minify.php and the translation is 100% complete.
MediaWiki バージョン:
1.35

詳細

Minify.php ファイルは、ファイルやファイル群を縮小 (minify) するための、メンテナンス スクリプトです。

This script has been removed in Gerrit change 663099 (MediaWiki 1.36) as minification has moved to its own library. See タスク T273247, new library can be found at https://gerrit.wikimedia.org/g/mediawiki/libs/Minify.

Options

minify.php accepts three options.

Option Description Required
file Input file. Use - to read from standard input. 必須
--outfile Write minified output to this file (instead of standard out). 省略可能
--type Override the input type (one of "js" or "css"). Defaults to file extension. Required if reading from standard input. 省略可能

If multiple input files are given, they will be concatenated.

使用法

php maintenance/minify.php filename|- [ --outfile| --type ]
testcode.js
// Long list into two col
$( document ).ready( function(){

	var longList = $("#longList").addClass("grid_row"),
		dlElements = longList.children().filter("dl"),
		dlElementsLength = dlElements.length;
	
	var list1 = [],
		list2 = [];
	
	var count = 0;
	dlElements.each( function(index, ele){
		if( count < dlElementsLength/2 ){
			list1.push(ele);
			list1.push( $(ele).next() );
		} else {
			list2.push(ele);
			list2.push( $(ele).next() );
		}
		count = count + 1;
	});
	
	longList.empty();
	
	var leftDiv = $("<div/>").addClass("grid_col");
	list1.forEach( function(value, index){
		leftDiv.append(value);
	});
	
	
	var rightDiv = $("<div/>").addClass("grid_col");
	list2.forEach( function(value, index){
		rightDiv.append(value);
	});
	
	longList.append(leftDiv, rightDiv );
	
});
Terminal

See also