Changeset 55861
- Timestamp:
- 05/26/2023 05:23:49 PM (19 months ago)
- Location:
- trunk/src/wp-content/themes
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r55476 r55861 436 436 wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' ); 437 437 438 wp_enqueue_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141028', true ); 438 // Skip-link fix is no longer enqueued by default. 439 wp_register_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', true ); 439 440 440 441 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { -
trunk/src/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js
r30046 r55861 1 1 /** 2 * Makes "skip to content" link work correctly in IE9, Chrome, and Opera 3 * for better accessibility. 2 * File skip-link-focus-fix.js. 4 3 * 5 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 4 * Helps with accessibility for keyboard only users. 5 * 6 * Learn more: https://git.io/vWdr2 6 7 */ 7 8 8 9 ( function() { 9 var ua = navigator.userAgent.toLowerCase();10 var isIe = /(trident|msie)/i.test( navigator.userAgent ); 10 11 11 if ( ( ua.indexOf( 'webkit' ) > -1 || ua.indexOf( 'opera' ) > -1 || ua.indexOf( 'msie' ) > -1 ) && 12 document.getElementById && window.addEventListener ) { 12 if ( isIe && document.getElementById && window.addEventListener ) { 13 window.addEventListener( 'hashchange', function() { 14 var id = location.hash.substring( 1 ), 15 element; 13 16 14 window.addEventListener( 'hashchange', function() { 15 var element = document.getElementById( location.hash.substring( 1 ) ); 17 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 18 return; 19 } 20 21 element = document.getElementById( id ); 16 22 17 23 if ( element ) { 18 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.nodeName) ) {24 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 19 25 element.tabIndex = -1; 20 26 } -
trunk/src/wp-content/themes/twentyfourteen/functions.php
r55476 r55861 372 372 } 373 373 374 wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '202 10122', true );374 wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', true ); 375 375 } 376 376 add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); -
trunk/src/wp-content/themes/twentyfourteen/js/functions.js
r50001 r55861 2 2 * Theme functions file. 3 3 * 4 * Contains handlers for navigation, accessibility, header sizing 5 * footer widgets and Featured Content slider 4 * Contains handlers for navigation, accessibility, header sizing, 5 * footer widgets and Featured Content slider. 6 6 * 7 7 */ … … 38 38 } ); 39 39 } )(); 40 41 /*42 * Makes "skip to content" link work correctly in IE9 and Chrome for better43 * accessibility.44 *45 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/46 */47 _window.on( 'hashchange.twentyfourteen', function() {48 var hash = location.hash.substring( 1 ), element;49 50 if ( ! hash ) {51 return;52 }53 54 element = document.getElementById( hash );55 56 if ( element ) {57 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {58 element.tabIndex = -1;59 }60 61 element.focus();62 63 // Repositions the window on jump-to-anchor to account for header height.64 window.scrollBy( 0, -80 );65 }66 } );67 40 68 41 $( function() { -
trunk/src/wp-content/themes/twentynineteen/functions.php
r54492 r55861 285 285 * thus it does not warrant having an entire dedicated blocking script being loaded. 286 286 * 287 * @since Twenty Nineteen 1.0 288 * @deprecated Twenty Nineteen 2.6 Removed from wp_print_footer_scripts action. 289 * 287 290 * @link https://git.io/vWdr2 288 291 */ … … 295 298 <?php 296 299 } 297 add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );298 300 299 301 /** -
trunk/src/wp-content/themes/twentyseventeen/functions.php
r55476 r55861 484 484 wp_script_add_data( 'html5', 'conditional', 'lt IE 9' ); 485 485 486 wp_enqueue_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true ); 486 // Skip-link fix is no longer enqueued by default. 487 wp_register_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true ); 488 489 wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', true ); 487 490 488 491 $twentyseventeen_l10n = array( … … 502 505 } 503 506 504 wp_ enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', true);507 wp_localize_script( 'twentyseventeen-global', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); 505 508 506 509 wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.3', true ); 507 508 wp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n );509 510 510 511 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { -
trunk/src/wp-content/themes/twentysixteen/functions.php
r55476 r55861 406 406 wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); 407 407 408 wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20170530', true ); 408 // Skip-link fix is no longer enqueued by default. 409 wp_register_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', true ); 409 410 410 411 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { -
trunk/src/wp-content/themes/twentysixteen/js/skip-link-focus-fix.js
r40851 r55861 1 1 /** 2 * Makes "skip to content" link work correctly in IE9, Chrome, and Opera 3 * for better accessibility. 2 * File skip-link-focus-fix.js. 4 3 * 5 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 4 * Helps with accessibility for keyboard only users. 5 * 6 * Learn more: https://git.io/vWdr2 6 7 */ 7 8 8 ( function() { 9 var isWebkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 10 isOpera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 11 isIE = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 9 ( function() { 10 var isIe = /(trident|msie)/i.test( navigator.userAgent ); 12 11 13 if ( ( isWebkit || isOpera || isIE )&& document.getElementById && window.addEventListener ) {12 if ( isIe && document.getElementById && window.addEventListener ) { 14 13 window.addEventListener( 'hashchange', function() { 15 14 var id = location.hash.substring( 1 ), -
trunk/src/wp-content/themes/twentythirteen/functions.php
r55476 r55861 315 315 316 316 // Loads JavaScript file with functionality specific to Twenty Thirteen. 317 wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '202 10122', true );317 wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', true ); 318 318 319 319 // Add Source Sans Pro and Bitter fonts, used in the main stylesheet. -
trunk/src/wp-content/themes/twentythirteen/js/functions.js
r50001 r55861 102 102 103 103 /** 104 * Makes "skip to content" link work correctly in IE9 and Chrome for better105 * accessibility.106 *107 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/108 */109 _window.on( 'hashchange.twentythirteen', function() {110 var element = document.getElementById( location.hash.substring( 1 ) );111 112 if ( element ) {113 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {114 element.tabIndex = -1;115 }116 117 element.focus();118 }119 } );120 121 /**122 104 * Arranges footer widgets vertically. 123 105 */ -
trunk/src/wp-content/themes/twentytwenty/functions.php
r55427 r55861 236 236 * 237 237 * @since Twenty Twenty 1.0 238 * @deprecated Twenty Twenty 2.3 Removed from wp_print_footer_scripts action. 238 239 * 239 240 * @link https://git.io/vWdr2 … … 247 248 <?php 248 249 } 249 add_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix' );250 250 251 251 /** -
trunk/src/wp-content/themes/twentytwentyone/functions.php
r55409 r55861 490 490 * 491 491 * @since Twenty Twenty-One 1.0 492 * @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action. 492 493 * 493 494 * @link https://git.io/vWdr2 … … 509 510 } 510 511 } 511 add_action( 'wp_print_footer_scripts', 'twenty_twenty_one_skip_link_focus_fix' );512 512 513 513 /**
Note: See TracChangeset
for help on using the changeset viewer.