Make WordPress Core


Ignore:
Timestamp:
01/14/2009 02:18:51 PM (16 years ago)
Author:
azaozz
Message:

Split the script queue in head and footer part, concatenate and compress the default js and css, first run, see #8628

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r10348 r10357  
    33883388}
    33893389
     3390/**
     3391 * Test support for compressed JavaScript and CSS
     3392 *
     3393 * Outputs JavaScript that tests if compression from PHP works as expected
     3394 * and sets an option with the result. Has no effect when the current user
     3395 * is not an administrator. To run the test again the option 'can_compress_scripts'
     3396 * has to be deleted.
     3397 *
     3398 * @since 2.8.0
     3399 */
     3400function compression_test() {
    33903401?>
     3402    <script type="text/javascript" src="load-scripts.php?test=1"></script>
     3403    <script type="text/javascript">
     3404    /* <![CDATA[ */
     3405    (function() {
     3406        var x, test = typeof wpCompressionTest == 'undefined' ? 0 : 1;
     3407        if ( window.XMLHttpRequest ) {
     3408            x = new XMLHttpRequest();
     3409        } else {
     3410            try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};}
     3411        }
     3412   
     3413        if (x) {
     3414            x.open('GET', 'admin-ajax.php?action=wp-compression-test&tested='+test+'&'+(new Date()).getTime(), true);
     3415            x.send('');
     3416        }
     3417    })();
     3418    /* ]]> */
     3419    </script>
     3420<?php
     3421}
     3422
     3423?>
Note: See TracChangeset for help on using the changeset viewer.