5 * (c) Fil, toggg 2006-2013
10 if (!defined("_ECRIRE_INC_VERSION")) return;
13 // Les crayons ont leur propre copie du pack de Dean Edwards
14 // pour compatibilite avec SPIP < [9717]
17 function pack_cQuery($chemin) {
18 $flux = spip_file_get_contents($chemin);
19 $flux = str_replace('jQuery', 'cQuery', $flux);
20 $flux = str_replace('cQuery.spip', 'jQuery.spip', $flux);
22 // On ne compacte PAS deux fois (c'est inutile et en plus ca bugge)
24 // mode debug des crayons
25 OR _request('debug_crayons')
26 // le vieil auto_compress_js
27 OR ($GLOBALS['meta']['auto_compress_js'] == 'oui'
28 AND @file_exists
(_DIR_RESTREINT
.'inc/compacte_js.php'))
30 OR !function_exists('test_espace_prive')
31 OR test_espace_prive())
34 include_spip('lib/JavaScriptPacker/class.JavaScriptPacker');
35 $packer = new JavaScriptPacker($flux, 0, true, false);
37 // en cas d'echec (?) renvoyer l'original
38 if (strlen($t = $packer->pack()))
42 spip_log('erreur de pack_js');