Last change
on this file since 681 was
69,
checked in by guille, 17 years ago
|
Se agrego Plugin Crayon y se actualizaron los esqueletos para que funcione
|
File size:
705 bytes
|
Rev | Line | |
---|
[69] | 1 | <?php |
---|
| 2 | |
---|
| 3 | // |
---|
| 4 | // Les crayons ont leur propre copie du pack de Dean Edwards |
---|
| 5 | // pour compatibilite avec SPIP < [9717] |
---|
| 6 | // |
---|
| 7 | |
---|
| 8 | function pack_cQuery($chemin) { |
---|
| 9 | $flux = spip_file_get_contents($chemin); |
---|
| 10 | $flux = str_replace('jQuery', 'cQuery', $flux); |
---|
| 11 | $flux = str_replace('var $ = cQuery','// dont set dollar', $flux); |
---|
| 12 | $flux = str_replace('window.$ = cQuery','// dont set dollar', $flux); |
---|
| 13 | |
---|
| 14 | if (!strlen($flux) |
---|
| 15 | OR _request('debug_crayons')) |
---|
| 16 | return $flux; |
---|
| 17 | |
---|
| 18 | include_spip('inc/class.JavaScriptPacker'); |
---|
| 19 | $packer = new JavaScriptPacker($flux, 0, true, false); |
---|
| 20 | |
---|
| 21 | // en cas d'echec (?) renvoyer l'original |
---|
| 22 | if (strlen($t = $packer->pack())) |
---|
| 23 | return $t; |
---|
| 24 | |
---|
| 25 | // erreur |
---|
| 26 | spip_log('erreur de pack_js'); |
---|
| 27 | return $flux; |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.