Changeset 63545
- Timestamp:
- 09/08/2026 09:33:53 PM (2 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
-
admin-footer.php (modified) (1 diff)
-
async-upload.php (modified) (1 diff)
-
install.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-footer.php
r62649 r63545 115 115 116 116 <div class="clear"></div></div><!-- wpwrap --> 117 <script>if(typeof wpOnload==='function')wpOnload();</script> 117 <?php 118 wp_print_inline_script_tag( 119 <<<'JS' 120 if ( typeof wpOnload === 'function' ) { 121 wpOnload(); 122 } 123 JS 124 ); 125 ?> 118 126 </body> 119 127 </html> -
trunk/src/wp-admin/async-upload.php
r60681 r63545 146 146 ); 147 147 148 echo '<script>_.delay(function() {wp.a11y.speak(' . wp_json_encode( $speak_message, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ");}, 1500);jQuery( 'button#{$button_unique_id}' ).on( 'click', function() {jQuery(this).parents('div.media-item').slideUp(200, function(){jQuery(this).remove();wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) );jQuery( '#plupload-browse-button' ).trigger( 'focus' );})});</script>\n"; 148 $js_function = <<<'JS' 149 /** 150 * Announces the upload failure and wires up its dismiss button. 151 * 152 * @param {JQueryStatic} $ The jQuery object. 153 * @param {Object} args PHP exports. 154 * @param {string} args.speakMessage Message announced to assistive technology. 155 * @param {string} args.buttonSelector Selector for the notice's dismiss button. 156 * @return {void} 157 */ 158 ( $, { speakMessage, buttonSelector } ) => { 159 setTimeout( () => wp.a11y.speak( speakMessage ), 1500 ); 160 $( buttonSelector ).on( 'click', function () { 161 $( this ) 162 .parents( 'div.media-item' ) 163 .slideUp( 200, function () { 164 $( this ).remove(); 165 wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) ); 166 $( '#plupload-browse-button' ).trigger( 'focus' ); 167 } ); 168 } ); 169 } 170 JS; 171 wp_print_inline_script_tag( 172 sprintf( 173 '( %s )( jQuery, %s )', 174 $js_function, 175 wp_json_encode( 176 array( 177 'speakMessage' => $speak_message, 178 'buttonSelector' => 'button#' . $button_unique_id, 179 ), 180 JSON_HEX_TAG | JSON_UNESCAPED_SLASHES 181 ) 182 ) 183 ); 149 184 exit; 150 185 } -
trunk/src/wp-admin/install.php
r62967 r63545 471 471 472 472 if ( ! wp_is_mobile() ) { 473 ?> 474 <script>var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script> 475 <?php 473 wp_print_inline_script_tag( 474 <<<'JS' 475 const t = document.getElementById( 'weblog_title' ); 476 if ( t ) { 477 t.focus(); 478 } 479 JS 480 ); 476 481 } 477 482 478 483 wp_print_scripts( $scripts_to_print ); 484 485 wp_print_inline_script_tag( 486 <<<'JS' 487 /** 488 * Shows the content intended only for browsers with JS enabled. 489 * 490 * @param {JQueryStatic} $ The jQuery object. 491 */ 492 jQuery( function ( $ ) { 493 $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' ); 494 } ); 495 JS 496 ); 479 497 ?> 480 <script>481 jQuery( function( $ ) {482 $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );483 } );484 </script>485 498 </body> 486 499 </html>
Note:
See TracChangeset
for help on using the changeset viewer.