Ticket #36036: patch-reduced-js.diff
File patch-reduced-js.diff, 7.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
1189 1189 ?> 1190 1190 1191 1191 <script type="text/javascript"> 1192 /*<![CDATA[*/ 1192 1193 tinyMCEPreInit = { 1193 1194 baseURL: "<?php echo self::$baseurl; ?>", 1194 1195 suffix: "<?php echo $suffix; ?>", … … 1204 1205 ref: <?php echo self::_parse_init( $ref ); ?>, 1205 1206 load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} 1206 1207 }; 1208 /*]]>*/ 1207 1209 </script> 1208 1210 <?php 1209 1211 … … 1219 1221 echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n"; 1220 1222 } 1221 1223 1222 echo "<script type='text/javascript'> \n" . self::wp_mce_translation() . "</script>\n";1224 echo "<script type='text/javascript'>/*<![CDATA[*/\n" . self::wp_mce_translation() . "/*]]>*/</script>\n"; 1223 1225 1224 1226 if ( self::$ext_plugins ) { 1225 1227 // Load the old-format English strings to prevent unsightly labels in old style popups … … 1239 1241 1240 1242 ?> 1241 1243 <script type="text/javascript"> 1244 /*<![CDATA[*/ 1242 1245 <?php 1243 1246 1244 1247 if ( self::$ext_plugins ) … … 1277 1280 } 1278 1281 } 1279 1282 }()); 1283 /*]]>*/ 1280 1284 </script> 1281 1285 <?php 1282 1286 -
src/wp-includes/class-wp-embed.php
80 80 81 81 ?> 82 82 <script type="text/javascript"> 83 /*<![CDATA[*/ 83 84 jQuery(document).ready(function($){ 84 85 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>"); 85 86 }); 87 /*]]>*/ 86 88 </script> 87 89 <?php 88 90 } -
src/wp-includes/class.wp-scripts.php
227 227 if ( !$echo ) 228 228 return $output; 229 229 230 echo "<script type='text/javascript'>\n"; // CDATA andtype='text/javascript' is not needed for HTML 5230 echo "<script type='text/javascript'>\n"; // type='text/javascript' is not needed for HTML 5 231 231 echo "/* <![CDATA[ */\n"; 232 232 echo "$output\n"; 233 233 echo "/* ]]> */\n"; … … 285 285 $after_handle = $this->print_inline_script( $handle, 'after', false ); 286 286 287 287 if ( $before_handle ) { 288 $before_handle = sprintf( "<script type='text/javascript'> \n%s\n</script>\n", $before_handle );288 $before_handle = sprintf( "<script type='text/javascript'>/*<![CDATA[*/\n%s\n/*]]>*/</script>\n", $before_handle ); 289 289 } 290 290 291 291 if ( $after_handle ) { 292 $after_handle = sprintf( "<script type='text/javascript'> \n%s\n</script>\n", $after_handle );292 $after_handle = sprintf( "<script type='text/javascript'>/*<![CDATA[*/\n%s\n/*]]>*/</script>\n", $after_handle ); 293 293 } 294 294 295 295 if ( $this->do_concat ) { … … 424 424 $output = trim( implode( "\n", $output ), "\n" ); 425 425 426 426 if ( $echo ) { 427 printf( "<script type='text/javascript'> \n%s\n</script>\n", $output );427 printf( "<script type='text/javascript'>/*<![CDATA[*/\n%s\n/*]]>*/</script>\n", $output ); 428 428 } 429 429 430 430 return $output; -
src/wp-includes/embed.php
464 464 $output = '<blockquote class="wp-embedded-content"><a href="' . esc_url( get_permalink( $post ) ) . '">' . get_the_title( $post ) . "</a></blockquote>\n"; 465 465 466 466 $output .= "<script type='text/javascript'>\n"; 467 $output .= " <!--//--><![CDATA[//><!--\n";467 $output .= "/*<![CDATA[*/\n"; 468 468 if ( SCRIPT_DEBUG ) { 469 469 $output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' ); 470 470 } else { … … 482 482 include "js/wp-embed.min.js" 483 483 JS; 484 484 } 485 $output .= "\n/ /--><!]]>";485 $output .= "\n/*]]>*/"; 486 486 $output .= "\n</script>"; 487 487 488 488 $output .= sprintf( … … 920 920 function print_embed_scripts() { 921 921 ?> 922 922 <script type="text/javascript"> 923 /*<![CDATA[*/ 923 924 <?php 924 925 if ( SCRIPT_DEBUG ) { 925 926 readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" ); … … 939 940 <?php 940 941 } 941 942 ?> 943 /*]]>*/ 942 944 </script> 943 945 <?php 944 946 } -
src/wp-includes/formatting.php
4559 4559 4560 4560 ?> 4561 4561 <script type="text/javascript"> 4562 /*<![CDATA[*/ 4562 4563 window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>; 4563 4564 <?php readfile( ABSPATH . WPINC . "/js/wp-emoji-loader.js" ); ?> 4565 /*]]>*/ 4564 4566 </script> 4565 4567 <?php 4566 4568 } else { … … 4581 4583 */ 4582 4584 ?> 4583 4585 <script type="text/javascript"> 4586 /*<![CDATA[*/ 4584 4587 window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>; 4585 4588 include "js/wp-emoji-loader.min.js" 4589 /*]]>*/ 4586 4590 </script> 4587 4591 <?php 4588 4592 } -
src/wp-includes/js/mediaelement/wp-playlist.js
7 7 initialize : function (options) { 8 8 this.index = 0; 9 9 this.settings = {}; 10 this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() ); 10 this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() 11 .replace(/^\s*<!\[CDATA\[([\s\S]*)\]\]>\s*$/, "$1") 12 ); 11 13 this.playerNode = this.$( this.data.type ); 12 14 13 15 this.tracks = new Backbone.Collection( this.data.tracks ); -
src/wp-includes/media.php
2045 2045 } 2046 2046 ?></ol> 2047 2047 </noscript> 2048 <script type="application/json" class="wp-playlist-script">< ?php echo wp_json_encode( $data ) ?></script>2048 <script type="application/json" class="wp-playlist-script"><![CDATA[<?php echo wp_json_encode( $data ) ?>]]></script> 2049 2049 </div> 2050 2050 <?php 2051 2051 return ob_get_clean(); -
src/wp-includes/script-loader.php
989 981 990 982 if ( !empty($wp_scripts->print_code) ) { 991 983 echo "\n<script type='text/javascript'>\n"; 992 echo "/* <![CDATA[ */\n"; // not needed in HTML 5984 echo "/* <![CDATA[ */\n"; 993 985 echo $wp_scripts->print_code; 994 986 echo "/* ]]> */\n"; 995 987 echo "</script>\n"; -
src/wp-includes/theme.php
2082 2082 2083 2083 ?> 2084 2084 <script type="text/javascript"> 2085 /*<![CDATA[*/ 2085 2086 (function() { 2086 2087 var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)'); 2087 2088 … … 2094 2095 b[c] = b[c].replace( rcs, ' ' ); 2095 2096 b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs; 2096 2097 }()); 2098 /*]]>*/ 2097 2099 </script> 2098 2100 <?php 2099 2101 }