Ticket #2038: nodeflate.diff
| File nodeflate.diff, 1.6 KB (added by , 21 years ago) |
|---|
-
wp-includes/js/tinymce/tiny_mce_gzip.php
40 40 function wp_compact_tinymce_js($text) { 41 41 // This function was custom-made for TinyMCE 2.0, not expected to work with any other JS. 42 42 43 echo "\n//" . strlen(gzdeflate($text)) . " bytes gzdeflated\n";44 echo "//" . microtime() . " " . strlen($text) . " Micro Time Length\n";45 46 43 // Strip comments 47 44 $text = preg_replace("!(^|\s+)//.*$!m", '', $text); 48 echo "//" . microtime() . " " . strlen($text) . " Stripped // comments\n";49 45 $text = preg_replace("!/\*.*?\*/!s", '', $text); 50 echo "//" . microtime() . " " . strlen($text) . " Stripped /* */ comments\n";51 46 52 47 // Strip leading tabs, carriage returns and unnecessary line breaks. 53 48 $text = preg_replace("!^\t+!m", '', $text); 54 echo "//" . microtime() . " " . strlen($text) . " Stripped leading tabs\n";55 49 $text = str_replace("\r", '', $text); 56 echo "//" . microtime() . " " . strlen($text) . " Stripped returns\n";57 50 $text = preg_replace("!(^|{|}|;|:|\))\n!m", '\\1', $text); 58 echo "//" . microtime() . " " . strlen($text) . " Stripped safe linebreaks\n";59 51 60 // Strip spaces. This one is not generally economical.61 //$text = preg_replace("!\s*(\=|\=\=|\!\=|\<\=|\>\=|\+=|\+|\s|:|,)\s*!", '\\1', $text);62 //echo "//" . microtime() . " " . strlen($text) . " Stripped safe spaces\n";63 64 echo "//" . strlen(gzdeflate($text)) . " bytes gzdeflated\n";65 52 return $text; 66 53 } 67 54
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)