WordPress.org

Make WordPress Core

Changeset 31034


Ignore:
Timestamp:
01/03/2015 05:45:17 AM (7 years ago)
Author:
wonderboymusic
Message:

Inline <script>s that are only printed in the admin for pages that are served with the HTML5 doctype absolutely do not need CDATA comments.

Props tw2113 for the initial patch.
See #18788.

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-header.php

    r30695 r31034  
    391391
    392392<script type="text/javascript">
    393 /* <![CDATA[ */
    394393(function($){
    395394    var default_color = '<?php echo $default_color; ?>',
     
    434433    });
    435434})(jQuery);
    436 /* ]]> */
    437435</script>
    438436<?php
     
    446444    public function js_2() { ?>
    447445<script type="text/javascript">
    448 /* <![CDATA[ */
    449446    function onEndCrop( coords ) {
    450447        jQuery( '#x1' ).val(coords.x);
     
    508505        });
    509506    });
    510 /* ]]> */
    511507</script>
    512508<?php
  • trunk/src/wp-admin/export.php

    r30155 r31034  
    2525?>
    2626<script type="text/javascript">
    27 //<![CDATA[
    2827    jQuery(document).ready(function($){
    2928        var form = $('#export-filters'),
     
    3837        });
    3938    });
    40 //]]>
    4139</script>
    4240<?php
  • trunk/src/wp-admin/includes/media.php

    r30981 r31034  
    240240?>
    241241<script type="text/javascript">
    242 /* <![CDATA[ */
    243242var win = window.dialogArguments || opener || parent || top;
    244243win.send_to_editor('<?php echo addslashes($html); ?>');
    245 /* ]]> */
    246244</script>
    247245<?php
     
    449447?>
    450448<script type="text/javascript">
    451 //<![CDATA[
    452449addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    453450var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
    454451isRtl = <?php echo (int) is_rtl(); ?>;
    455 //]]>
    456452</script>
    457453<?php
     
    683679    if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>
    684680        <script type="text/javascript">
    685         /* <![CDATA[ */
    686681        var win = window.dialogArguments || opener || parent || top;
    687682        win.tb_remove();
    688         /* ]]> */
    689683        </script>
    690684        <?php
     
    19471941
    19481942<script type="text/javascript">
    1949 //<![CDATA[
    19501943jQuery(function($){
    19511944    var preloaded = $(".media-item.preloaded");
     
    19551948    updateMediaForm();
    19561949});
    1957 //]]>
    19581950</script>
    19591951<div id="media-items"><?php
     
    20102002
    20112003<script type="text/javascript">
    2012 //<![CDATA[
    20132004var addExtImage = {
    20142005
     
    21002091    });
    21012092});
    2102 
    2103 //]]>
    21042093</script>
    21052094
  • trunk/src/wp-admin/includes/ms.php

    r30630 r31034  
    956956?>
    957957<script type="text/javascript">
    958 //<![CDATA[
    959958var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ); ?>";
    960 //]]>
    961959</script>
    962960<?php
  • trunk/src/wp-admin/includes/template.php

    r31019 r31034  
    15501550?>
    15511551<script type="text/javascript">
    1552 //<![CDATA[
    15531552addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    15541553function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
     
    15601559    decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
    15611560    isRtl = <?php echo (int) is_rtl(); ?>;
    1562 //]]>
    15631561</script>
    15641562<?php
     
    15971595<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
    15981596<script type="text/javascript">
    1599 //<![CDATA[
    16001597(function(){
    16011598var c = document.body.className;
     
    16031600document.body.className = c;
    16041601})();
    1605 //]]>
    16061602</script>
    16071603<?php
     
    17301726?>
    17311727    <script type="text/javascript">
    1732     /* <![CDATA[ */
    17331728    var testCompression = {
    17341729        get : function(test) {
     
    17771772    };
    17781773    testCompression.check();
    1779     /* ]]> */
    17801774    </script>
    17811775<?php
     
    19761970        ?>
    19771971        <script type="text/javascript">
    1978         //<![CDATA[
    19791972        (function($){
    19801973            var options = <?php echo wp_json_encode( $args ); ?>, setup;
     
    20021995
    20031996        })( jQuery );
    2004         //]]>
    20051997        </script>
    20061998        <?php
  • trunk/src/wp-admin/network/site-users.php

    r30356 r31034  
    178178
    179179<script type="text/javascript">
    180 /* <![CDATA[ */
    181180var current_site_id = <?php echo $id; ?>;
    182 /* ]]> */
    183181</script>
    184182
  • trunk/src/wp-admin/options-general.php

    r30705 r31034  
    2929?>
    3030<script type="text/javascript">
    31 //<![CDATA[
    3231    jQuery(document).ready(function($){
    3332        var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
     
    7877        });
    7978    });
    80 //]]>
    8179</script>
    8280<?php
  • trunk/src/wp-admin/options-permalink.php

    r29716 r31034  
    5555    ?>
    5656<script type="text/javascript">
    57 //<![CDATA[
    5857jQuery(document).ready(function() {
    5958    jQuery('.permalink-structure input:radio').change(function() {
     
    6665    });
    6766});
    68 //]]>
    6967</script>
    7068<?php
  • trunk/src/wp-admin/options-reading.php

    r27469 r31034  
    2424?>
    2525<script type="text/javascript">
    26 //<![CDATA[
    2726    jQuery(document).ready(function($){
    2827        var section = $('#front-static-pages'),
     
    3534        section.find('input:radio').change(check_disabled);
    3635    });
    37 //]]>
    3836</script>
    3937<?php
  • trunk/src/wp-admin/press-this.php

    r30438 r31034  
    110110        case 'video': ?>
    111111            <script type="text/javascript">
    112             /* <![CDATA[ */
    113112                jQuery('.select').click(function() {
    114113                    append_editor(jQuery('#embed-code').val());
     
    120119                    jQuery('#extra-fields').html('');
    121120                });
    122             /* ]]> */
    123121            </script>
    124122            <div class="postbox">
     
    133131        case 'photo_thickbox': ?>
    134132            <script type="text/javascript">
    135                 /* <![CDATA[ */
    136133                jQuery('.cancel').click(function() {
    137134                    tb_remove();
     
    140137                    image_selector(this);
    141138                });
    142                 /* ]]> */
    143139            </script>
    144140            <h3 class="tb"><label for="tb_this_photo_description"><?php _e('Description') ?></label></h3>
     
    300296<title><?php _e('Press This') ?></title>
    301297<script type="text/javascript">
    302 //<![CDATA[
    303298addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    304299var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
    305300var photostorage = false;
    306 //]]>
    307301</script>
    308302
  • trunk/src/wp-admin/theme-editor.php

    r29206 r31034  
    230230</div>
    231231<script type="text/javascript">
    232 /* <![CDATA[ */
    233232jQuery(document).ready(function($){
    234233    $('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); });
    235234    $('#newcontent').scrollTop( $('#scrollto').val() );
    236235});
    237 /* ]]> */
    238236</script>
    239237<?php
  • trunk/src/wp-includes/class-wp-embed.php

    r30979 r31034  
    7878?>
    7979<script type="text/javascript">
    80 /* <![CDATA[ */
    8180    jQuery(document).ready(function($){
    8281        $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>");
    8382    });
    84 /* ]]> */
    8583</script>
    8684<?php
Note: See TracChangeset for help on using the changeset viewer.