Manuel:Minify.php
Appearance
Cette fonctionnalité a été supprimée entièrement dans la version 1.36. |
Version de MediaWiki : | ≤ 1.35 |
Fichier MediaWiki : minify.php | |
---|---|
Emplacement : | maintenance/ |
Code source : | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes : | MinifyScript |
Détails
Le fichier Minify.php est un script de maintenance qui miniaturise un fichier ou un ensemble de fichiers.
This script has been removed in Gerrit change 663099 (MediaWiki 1.36) as minification has moved to its own library: Minify. See tâche T273247.
Options
Option | Description | Obligatoire |
---|---|---|
file | Input file. Use - to read from standard input. | obligatoire |
--outfile | Write minified output to this file (instead of standard out). | optionnel |
--type | Override the input type (one of "js" or "css"). Defaults to file extension. Required if reading from standard input. | optionnel |
If multiple input files are given, they will be concatenated.
Utilisation
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
$ php maintenance/minify.php testcode.js $(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=$("").addClass("grid_col");list1.forEach(function(value,index){leftDiv.append(value);});var rightDiv=$("").addClass("grid_col");list2.forEach(function(value,index){rightDiv.append(value);});longList.append(leftDiv,rightDiv);});
Voir aussi
- Manuel:Jsparse.php
- Manuel:Eval.php (PHP interpreter)
- ResourceLoader