5 * (c) Fil, toggg 2006-2013
10 if (!defined('_ECRIRE_INC_VERSION')) {
15 // Les crayons ont leur propre copie du pack de Dean Edwards
16 // pour compatibilite avec SPIP < [9717]
18 function pack_cQuery($chemin) {
23 $flux = spip_file_get_contents($chemin);
24 $flux = str_replace('jQuery', 'cQuery', $flux);
25 $flux = str_replace('cQuery.spip', 'jQuery.spip', $flux);
27 // On ne compacte PAS deux fois (c'est inutile et en plus ca bugge)
29 or _request('debug_crayons') // mode debug des crayons
30 or ($GLOBALS['meta']['auto_compress_js'] == 'oui' // le vieil auto_compress_js
31 and @file_exists
(_DIR_RESTREINT
.'inc/compacte_js.php'))
32 or !function_exists('test_espace_prive')// ou l'espace prive
33 or test_espace_prive()) {
37 include_spip('lib/JavaScriptPacker/class.JavaScriptPacker');
38 $packer = new JavaScriptPacker($flux, 0, true, false);
40 // en cas d'echec (?) renvoyer l'original
41 if (strlen($t = $packer->pack())) {
46 spip_log('erreur de pack_js');