Changeset 50001
- Timestamp:
- 01/22/2021 12:30:39 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/application-passwords.js
r49716 r50001 16 16 userId = $( '#user_id' ).val(); 17 17 18 $newAppPassButton. click(function( e ) {18 $newAppPassButton.on( 'click', function( e ) { 19 19 e.preventDefault(); 20 20 -
trunk/src/js/_enqueues/admin/comment.js
r48395 r50001 30 30 * @return {void} 31 31 */ 32 $edittimestamp. click(function( event ) {32 $edittimestamp.on( 'click', function( event ) { 33 33 if ( $timestampdiv.is( ':hidden' ) ) { 34 34 // Slide down the form and set focus on the first field. 35 35 $timestampdiv.slideDown( 'fast', function() { 36 $( 'input, select', $timestampwrap ).first(). focus();36 $( 'input, select', $timestampwrap ).first().trigger( 'focus' ); 37 37 } ); 38 38 $(this).hide(); … … 50 50 */ 51 51 52 $timestampdiv.find('.cancel-timestamp'). click(function( event ) {52 $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) { 53 53 // Move focus back to the Edit link. 54 $edittimestamp.show(). focus();54 $edittimestamp.show().trigger( 'focus' ); 55 55 $timestampdiv.slideUp( 'fast' ); 56 56 $('#mm').val($('#hidden_mm').val()); … … 71 71 * @return {void} 72 72 */ 73 $timestampdiv.find('.save-timestamp'). click(function( event ) { // Crazyhorse - multiple OK cancels.73 $timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels. 74 74 var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(), 75 75 newD = new Date( aa, mm - 1, jj, hh, mn ); … … 97 97 98 98 // Move focus back to the Edit link. 99 $edittimestamp.show(). focus();99 $edittimestamp.show().trigger( 'focus' ); 100 100 $timestampdiv.slideUp( 'fast' ); 101 101 }); -
trunk/src/js/_enqueues/admin/common.js
r49944 r50001 383 383 init : function() { 384 384 var that = this; 385 $('.hide-column-tog', '#adv-settings'). click(function() {385 $('.hide-column-tog', '#adv-settings').on( 'click', function() { 386 386 var $t = $(this), column = $t.val(); 387 387 if ( $t.prop('checked') ) … … 501 501 .addClass( 'form-invalid' ) 502 502 .find( ':input:visible' ) 503 . change(function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )503 .on( 'change', function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } ) 504 504 .length; 505 505 }; … … 572 572 this.page = $('#wpcontent'); 573 573 574 this.toggles. click(this.toggleEvent );574 this.toggles.on( 'click', this.toggleEvent ); 575 575 }, 576 576 … … 618 618 */ 619 619 panel.slideDown( 'fast', function() { 620 panel. focus();620 panel.trigger( 'focus' ); 621 621 button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true ); 622 622 }); … … 660 660 * @return {void} 661 661 */ 662 $('.contextual-help-tabs'). delegate('a', 'click', function(e) {662 $('.contextual-help-tabs').on( 'click', 'a', function(e) { 663 663 var link = $(this), 664 664 panel; … … 799 799 newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length; 800 800 $permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart ); 801 $permalinkStructure. focus();801 $permalinkStructure.trigger( 'focus' ); 802 802 } 803 803 } ); … … 1303 1303 }); 1304 1304 1305 $('#default-password-nag-no'). click(function() {1305 $('#default-password-nag-no').on( 'click', function() { 1306 1306 setUserSetting('default_password_nag', 'hide'); 1307 1307 $('div.default-password-nag').hide(); … … 1316 1316 * @return {void} 1317 1317 */ 1318 $('#newcontent'). bind('keydown.wpevent_InsertTab', function(e) {1318 $('#newcontent').on('keydown.wpevent_InsertTab', function(e) { 1319 1319 var el = e.target, selStart, selEnd, val, scroll, sel; 1320 1320 … … 1375 1375 * @return {void} 1376 1376 */ 1377 pageInput.closest('form'). submit(function() {1377 pageInput.closest('form').on( 'submit', function() { 1378 1378 /* 1379 1379 * action = bulk action dropdown at the top of the table … … 1389 1389 * @return {void} 1390 1390 */ 1391 $('.search-box input[type="search"], .search-box input[type="submit"]'). mousedown(function () {1391 $('.search-box input[type="search"], .search-box input[type="submit"]').on( 'mousedown', function () { 1392 1392 $('select[name^="action"]').val('-1'); 1393 1393 }); … … 1690 1690 if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) { 1691 1691 $(this).find('a').attr( 'aria-expanded', 'true' ); 1692 $( '#adminmenu a:first' ). focus();1692 $( '#adminmenu a:first' ).trigger( 'focus' ); 1693 1693 } else { 1694 1694 $(this).find('a').attr( 'aria-expanded', 'false' ); … … 1979 1979 1980 1980 // Set initial focus on a specific element. 1981 $( '.wp-initial-focus' ). focus();1981 $( '.wp-initial-focus' ).trigger( 'focus' ); 1982 1982 1983 1983 // Toggle update details on update-core.php. -
trunk/src/js/_enqueues/admin/edit-comments.js
r49944 r50001 446 446 $('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside'); 447 447 448 a. click(function( e ){448 a.on( 'click', function( e ){ 449 449 e.preventDefault(); 450 450 e.stopPropagation(); // Ticket #35904. … … 763 763 */ 764 764 window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ) 765 . bind('wpListDelEnd', function(e, s){765 .on('wpListDelEnd', function(e, s){ 766 766 var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, ''); 767 767 … … 794 794 var row = $('#replyrow'); 795 795 796 $( '.cancel', row ). click(function() { return commentReply.revert(); } );797 $( '.save', row ). click(function() { return commentReply.send(); } );798 $( 'input#author-name, input#author-email, input#author-url', row ). keypress(function( e ) {796 $( '.cancel', row ).on( 'click', function() { return commentReply.revert(); } ); 797 $( '.save', row ).on( 'click', function() { return commentReply.send(); } ); 798 $( 'input#author-name, input#author-email, input#author-url', row ).on( 'keypress', function( e ) { 799 799 if ( e.which == 13 ) { 800 800 commentReply.send(); … … 805 805 806 806 // Add events. 807 $('#the-comment-list .column-comment > p'). dblclick(function(){807 $('#the-comment-list .column-comment > p').on( 'dblclick', function(){ 808 808 commentReply.toggle($(this).parent()); 809 809 }); 810 810 811 $('#doaction, #post-query-submit'). click(function(){811 $('#doaction, #post-query-submit').on( 'click', function(){ 812 812 if ( $('#the-comment-list #replyrow').length > 0 ) 813 813 commentReply.close(); … … 832 832 addEvents : function(r) { 833 833 r.each(function() { 834 $(this).find('.column-comment > p'). dblclick(function(){834 $(this).find('.column-comment > p').on( 'dblclick', function(){ 835 835 commentReply.toggle($(this).parent()); 836 836 }); … … 906 906 .find( '.vim-q' ) 907 907 .attr( 'aria-expanded', 'false' ) 908 . focus();908 .trigger( 'focus' ); 909 909 } ).css( 'backgroundColor', '' ); 910 910 } … … 914 914 commentRow.find( '.vim-r' ) 915 915 .attr( 'aria-expanded', 'false' ) 916 . focus();916 .trigger( 'focus' ); 917 917 } 918 918 … … 1033 1033 window.scroll(0, rtop - 35); 1034 1034 1035 $('#replycontent'). focus().keyup(function(e){1035 $('#replycontent').trigger( 'focus' ).on( 'keyup', function(e){ 1036 1036 if ( e.which == 27 ) 1037 1037 commentReply.revert(); // Close on Escape. … … 1136 1136 } 1137 1137 1138 c = $.trim(r.data); // Trim leading whitespaces. 1138 r.data = r.data || ''; 1139 c = r.data.toString().trim(); // Trim leading whitespaces. 1139 1140 $(c).hide(); 1140 1141 $('#replyrow').after(c); -
trunk/src/js/_enqueues/admin/inline-edit-post.js
r49944 r50001 52 52 * @return {boolean} The result of revert. 53 53 */ 54 qeRow. keyup(function(e){54 qeRow.on( 'keyup', function(e){ 55 55 // Revert changes if Escape key is pressed. 56 56 if ( e.which === 27 ) { … … 64 64 * @return {boolean} The result of revert. 65 65 */ 66 bulkRow. keyup(function(e){66 bulkRow.on( 'keyup', function(e){ 67 67 // Revert changes if Escape key is pressed. 68 68 if ( e.which === 27 ) { … … 76 76 * @return {boolean} The result of revert. 77 77 */ 78 $( '.cancel', qeRow ). click(function() {78 $( '.cancel', qeRow ).on( 'click', function() { 79 79 return inlineEditPost.revert(); 80 80 }); … … 85 85 * @return {boolean} The result of save. 86 86 */ 87 $( '.save', qeRow ). click(function() {87 $( '.save', qeRow ).on( 'click', function() { 88 88 return inlineEditPost.save(this); 89 89 }); … … 94 94 * @return {boolean} The result of save. 95 95 */ 96 $('td', qeRow). keydown(function(e){96 $('td', qeRow).on( 'keydown', function(e){ 97 97 if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) { 98 98 return inlineEditPost.save(this); … … 105 105 * @return {boolean} The result of revert. 106 106 */ 107 $( '.cancel', bulkRow ). click(function() {107 $( '.cancel', bulkRow ).on( 'click', function() { 108 108 return inlineEditPost.revert(); 109 109 }); … … 112 112 * Disables the password input field when the private post checkbox is checked. 113 113 */ 114 $('#inline-edit .inline-edit-private input[value="private"]'). click(function(){114 $('#inline-edit .inline-edit-private input[value="private"]').on( 'click', function(){ 115 115 var pw = $('input.inline-edit-password-input'); 116 116 if ( $(this).prop('checked') ) { … … 140 140 * Adds onclick events to the apply buttons. 141 141 */ 142 $('#doaction'). click(function(e){142 $('#doaction').on( 'click', function(e){ 143 143 var n; 144 144 … … 216 216 * @listens click 217 217 */ 218 $('#bulk-titles a'). click(function(){218 $('#bulk-titles a').on( 'click', function(){ 219 219 var id = $(this).attr('id').substr(1); 220 220 … … 384 384 385 385 $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); 386 $('.ptitle', editRow). focus();386 $('.ptitle', editRow).trigger( 'focus' ); 387 387 388 388 return false; … … 435 435 $( this ).find( '.editinline' ) 436 436 .attr( 'aria-expanded', 'false' ) 437 . focus();437 .trigger( 'focus' ); 438 438 wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) ); 439 439 }); … … 482 482 483 483 // Move focus back to the Bulk Action button that was activated. 484 $( '#' + inlineEditPost.whichBulkButtonId ). focus();484 $( '#' + inlineEditPost.whichBulkButtonId ).trigger( 'focus' ); 485 485 } else { 486 486 … … 492 492 $( this.what + id ).show().find( '.editinline' ) 493 493 .attr( 'aria-expanded', 'false' ) 494 . focus();494 .trigger( 'focus' ); 495 495 } 496 496 } -
trunk/src/js/_enqueues/admin/inline-edit-tax.js
r48391 r50001 48 48 * @param {Object} e The keyup event that has been triggered. 49 49 */ 50 row. keyup(function( e ) {50 row.on( 'keyup', function( e ) { 51 51 // 27 = [Escape]. 52 52 if ( e.which === 27 ) { … … 58 58 * Cancels inline editing when clicking the cancel button. 59 59 */ 60 $( '.cancel', row ). click(function() {60 $( '.cancel', row ).on( 'click', function() { 61 61 return inlineEditTax.revert(); 62 62 }); … … 65 65 * Saves the inline edits when clicking the save button. 66 66 */ 67 $( '.save', row ). click(function() {67 $( '.save', row ).on( 'click', function() { 68 68 return inlineEditTax.save(this); 69 69 }); … … 72 72 * Saves the inline edits when pressing Enter inside the inline editor. 73 73 */ 74 $( 'input, select', row ). keydown(function( e ) {74 $( 'input, select', row ).on( 'keydown', function( e ) { 75 75 // 13 = [Enter]. 76 76 if ( e.which === 13 ) { … … 82 82 * Saves the inline edits on submitting the inline edit form. 83 83 */ 84 $( '#posts-filter input[type="submit"]' ). mousedown(function() {84 $( '#posts-filter input[type="submit"]' ).on( 'mousedown', function() { 85 85 t.revert(); 86 86 }); … … 144 144 145 145 $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); 146 $('.ptitle', editRow).eq(0). focus();146 $('.ptitle', editRow).eq(0).trigger( 'focus' ); 147 147 148 148 return false; … … 224 224 row.find( '.editinline' ) 225 225 .attr( 'aria-expanded', 'false' ) 226 . focus();226 .trigger( 'focus' ); 227 227 wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) ); 228 228 }); … … 269 269 $( this.what + id ).show().find( '.editinline' ) 270 270 .attr( 'aria-expanded', 'false' ) 271 . focus();271 .trigger( 'focus' ); 272 272 } 273 273 }, -
trunk/src/js/_enqueues/admin/media-upload.js
r47122 r50001 109 109 110 110 // Add handler to recalculates the ThickBox position when the window is resized. 111 $(window). resize(function(){ tb_position(); });111 $(window).on( 'resize', function(){ tb_position(); }); 112 112 113 113 })(jQuery); -
trunk/src/js/_enqueues/admin/media.js
r49944 r50001 159 159 160 160 // Prevents form submission if no post has been selected. 161 $( '#find-posts-submit' ). click(function( event ) {161 $( '#find-posts-submit' ).on( 'click', function( event ) { 162 162 if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length ) 163 163 event.preventDefault(); … … 165 165 166 166 // Submits the search query when hitting the enter key in the search input. 167 $( '#find-posts .find-box-search :input' ). keypress(function( event ) {167 $( '#find-posts .find-box-search :input' ).on( 'keypress', function( event ) { 168 168 if ( 13 == event.which ) { 169 169 findPosts.send(); … … 173 173 174 174 // Binds the click event to the search button. 175 $( '#find-posts-search' ). click(findPosts.send );175 $( '#find-posts-search' ).on( 'click', findPosts.send ); 176 176 177 177 // Binds the close dialog click event. 178 $( '#find-posts-close' ). click(findPosts.close );178 $( '#find-posts-close' ).on( 'click', findPosts.close ); 179 179 180 180 // Binds the bulk action events to the submit buttons. 181 $( '#doaction' ). click(function( event ) {181 $( '#doaction' ).on( 'click', function( event ) { 182 182 183 183 /* -
trunk/src/js/_enqueues/admin/plugin-install.js
r48392 r50001 51 51 }; 52 52 53 $( window ). resize(function() {53 $( window ).on( 'resize', function() { 54 54 tb_position(); 55 55 }); … … 186 186 187 187 /* Plugin install related JS */ 188 $( '#plugin-information-tabs a' ). click(function( event ) {188 $( '#plugin-information-tabs a' ).on( 'click', function( event ) { 189 189 var tab = $( this ).attr( 'name' ); 190 190 event.preventDefault(); -
trunk/src/js/_enqueues/admin/post.js
r49807 r50001 214 214 215 215 wrap.show().find('.currently-editing').text( received.lock_error.text ); 216 wrap.find('.wp-tab-first'). focus();216 wrap.find('.wp-tab-first').trigger( 'focus' ); 217 217 } 218 218 } else if ( received.new_lock ) { … … 328 328 // [Shift] + [Tab] on first tab cycles back to last tab. 329 329 if ( target.hasClass('wp-tab-first') && e.shiftKey ) { 330 $(this).find('.wp-tab-last'). focus();330 $(this).find('.wp-tab-last').trigger( 'focus' ); 331 331 e.preventDefault(); 332 332 // [Tab] on last tab cycles back to first tab. 333 333 } else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) { 334 $(this).find('.wp-tab-first'). focus();334 $(this).find('.wp-tab-first').trigger( 'focus' ); 335 335 e.preventDefault(); 336 336 } 337 }).filter(':visible').find('.wp-tab-first'). focus();337 }).filter(':visible').find('.wp-tab-first').trigger( 'focus' ); 338 338 339 339 // Set the heartbeat interval to 15 seconds if post lock dialogs are enabled. … … 438 438 editor.focus(); 439 439 } else if ( $textarea.length ) { 440 $textarea. focus();440 $textarea.trigger( 'focus' ); 441 441 } else { 442 442 return; … … 579 579 580 580 // @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js. 581 $('a', '#' + taxonomy + '-tabs'). click(function( e ) {581 $('a', '#' + taxonomy + '-tabs').on( 'click', function( e ) { 582 582 e.preventDefault(); 583 583 var t = $(this).attr('href'); … … 609 609 610 610 // After submitting a new taxonomy, re-focus the input field. 611 $('#' + taxonomy + '-add-submit'). click(function() {612 $('#new' + taxonomy). focus();611 $('#' + taxonomy + '-add-submit').on( 'click', function() { 612 $('#new' + taxonomy).trigger( 'focus' ); 613 613 }); 614 614 … … 659 659 660 660 // Add new taxonomy button toggles input form visibility. 661 $('#' + taxonomy + '-add-toggle'). click(function( e ) {661 $('#' + taxonomy + '-add-toggle').on( 'click', function( e ) { 662 662 e.preventDefault(); 663 663 $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' ); 664 664 $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click(); 665 $('#new'+taxonomy). focus();665 $('#new'+taxonomy).trigger( 'focus' ); 666 666 }); 667 667 … … 835 835 836 836 // Show the visibility options and hide the toggle button when opened. 837 $( '#visibility .edit-visibility'). click(function( e ) {837 $( '#visibility .edit-visibility').on( 'click', function( e ) { 838 838 e.preventDefault(); 839 839 if ( $postVisibilitySelect.is(':hidden') ) { 840 840 updateVisibility(); 841 841 $postVisibilitySelect.slideDown( 'fast', function() { 842 $postVisibilitySelect.find( 'input[type="radio"]' ).first(). focus();842 $postVisibilitySelect.find( 'input[type="radio"]' ).first().trigger( 'focus' ); 843 843 } ); 844 844 $(this).hide(); … … 847 847 848 848 // Cancel visibility selection area and hide it from view. 849 $postVisibilitySelect.find('.cancel-post-visibility'). click(function( event ) {849 $postVisibilitySelect.find('.cancel-post-visibility').on( 'click', function( event ) { 850 850 $postVisibilitySelect.slideUp('fast'); 851 851 $('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true); … … 853 853 $('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked')); 854 854 $('#post-visibility-display').html(visibility); 855 $('#visibility .edit-visibility').show(). focus();855 $('#visibility .edit-visibility').show().trigger( 'focus' ); 856 856 updateText(); 857 857 event.preventDefault(); … … 859 859 860 860 // Set the selected visibility as current. 861 $postVisibilitySelect.find('.save-post-visibility'). click(function( event ) { // Crazyhorse - multiple OK cancels.861 $postVisibilitySelect.find('.save-post-visibility').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels. 862 862 var visibilityLabel = '', selectedVisibility = $postVisibilitySelect.find('input:radio:checked').val(); 863 863 864 864 $postVisibilitySelect.slideUp('fast'); 865 $('#visibility .edit-visibility').show(). focus();865 $('#visibility .edit-visibility').show().trigger( 'focus' ); 866 866 updateText(); 867 867 … … 887 887 888 888 // When the selection changes, update labels. 889 $postVisibilitySelect.find('input:radio'). change(function() {889 $postVisibilitySelect.find('input:radio').on( 'change', function() { 890 890 updateVisibility(); 891 891 }); 892 892 893 893 // Edit publish time click. 894 $timestampdiv.siblings('a.edit-timestamp'). click(function( event ) {894 $timestampdiv.siblings('a.edit-timestamp').on( 'click', function( event ) { 895 895 if ( $timestampdiv.is( ':hidden' ) ) { 896 896 $timestampdiv.slideDown( 'fast', function() { 897 $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first(). focus();897 $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().trigger( 'focus' ); 898 898 } ); 899 899 $(this).hide(); … … 903 903 904 904 // Cancel editing the publish time and hide the settings. 905 $timestampdiv.find('.cancel-timestamp'). click(function( event ) {906 $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show(). focus();905 $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) { 906 $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().trigger( 'focus' ); 907 907 $('#mm').val($('#hidden_mm').val()); 908 908 $('#jj').val($('#hidden_jj').val()); … … 915 915 916 916 // Save the changed timestamp. 917 $timestampdiv.find('.save-timestamp'). click(function( event ) { // Crazyhorse - multiple OK cancels.917 $timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels. 918 918 if ( updateText() ) { 919 919 $timestampdiv.slideUp('fast'); 920 $timestampdiv.siblings('a.edit-timestamp').show(). focus();920 $timestampdiv.siblings('a.edit-timestamp').show().trigger( 'focus' ); 921 921 } 922 922 event.preventDefault(); … … 938 938 939 939 // Post Status edit click. 940 $postStatusSelect.siblings('a.edit-post-status'). click(function( event ) {940 $postStatusSelect.siblings('a.edit-post-status').on( 'click', function( event ) { 941 941 if ( $postStatusSelect.is( ':hidden' ) ) { 942 942 $postStatusSelect.slideDown( 'fast', function() { 943 $postStatusSelect.find('select'). focus();943 $postStatusSelect.find('select').trigger( 'focus' ); 944 944 } ); 945 945 $(this).hide(); … … 949 949 950 950 // Save the Post Status changes and hide the options. 951 $postStatusSelect.find('.save-post-status'). click(function( event ) {952 $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show(). focus();951 $postStatusSelect.find('.save-post-status').on( 'click', function( event ) { 952 $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' ); 953 953 updateText(); 954 954 event.preventDefault(); … … 956 956 957 957 // Cancel Post Status editing and hide the options. 958 $postStatusSelect.find('.cancel-post-status'). click(function( event ) {959 $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show(). focus();958 $postStatusSelect.find('.cancel-post-status').on( 'click', function( event ) { 959 $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' ); 960 960 $('#post_status').val( $('#hidden_post_status').val() ); 961 961 updateText(); … … 998 998 999 999 // Save permalink changes. 1000 buttons.children( '.save' ). click(function() {1000 buttons.children( '.save' ).on( 'click', function() { 1001 1001 var new_slug = $el.children( 'input' ).val(); 1002 1002 … … 1027 1027 permalink.html(permalinkOrig); 1028 1028 real_slug.val(new_slug); 1029 $( '.edit-slug' ). focus();1029 $( '.edit-slug' ).trigger( 'focus' ); 1030 1030 wp.a11y.speak( __( 'Permalink saved' ) ); 1031 1031 } … … 1034 1034 1035 1035 // Cancel editing of permalink. 1036 buttons.children( '.cancel' ). click(function() {1036 buttons.children( '.cancel' ).on( 'click', function() { 1037 1037 $('#view-post-btn').show(); 1038 1038 $el.html(revert_e); … … 1040 1040 permalink.html(permalinkOrig); 1041 1041 real_slug.val(revert_slug); 1042 $( '.edit-slug' ). focus();1042 $( '.edit-slug' ).trigger( 'focus' ); 1043 1043 }); 1044 1044 … … 1050 1050 slug_value = ( c > full.length / 4 ) ? '' : full; 1051 1051 1052 $el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ). keydown(function( e ) {1052 $el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).on( 'keydown', function( e ) { 1053 1053 var key = e.which; 1054 1054 // On [Enter], just save the new slug, don't save the post. … … 1061 1061 buttons.children( '.cancel' ).click(); 1062 1062 } 1063 } ). keyup(function() {1063 } ).on( 'keyup', function() { 1064 1064 real_slug.val( this.value ); 1065 }). focus();1065 }).trigger( 'focus' ); 1066 1066 } 1067 1067 … … 1155 1155 height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28; 1156 1156 } else { 1157 $textarea. focus();1157 $textarea.trigger( 'focus' ); 1158 1158 height = parseInt( $textarea.css('height'), 10 ); 1159 1159 } -
trunk/src/js/_enqueues/admin/postbox.js
r49325 r50001 68 68 69 69 if ( id ) { 70 if ( !p.hasClass('closed') && $.isFunction( postboxes.pbshow )) {70 if ( !p.hasClass('closed') && typeof postboxes.pbshow === 'function' ) { 71 71 postboxes.pbshow( id ); 72 } else if ( p.hasClass('closed') && $.isFunction( postboxes.pbhide )) {72 } else if ( p.hasClass('closed') && typeof postboxes.pbhide === 'function' ) { 73 73 postboxes.pbhide( id ); 74 74 } … … 268 268 * @since 2.7.0 269 269 */ 270 $('.postbox .hndle a'). click(function(e) {270 $('.postbox .hndle a').on( 'click', function(e) { 271 271 e.stopPropagation(); 272 272 }); … … 303 303 * @return {void} 304 304 */ 305 $('.hide-postbox-tog'). bind('click.postboxes', function() {305 $('.hide-postbox-tog').on('click.postboxes', function() { 306 306 var $el = $(this), 307 307 boxId = $el.val(), … … 310 310 if ( $el.prop( 'checked' ) ) { 311 311 $postbox.show(); 312 if ( $.isFunction( postboxes.pbshow )) {312 if ( typeof postboxes.pbshow === 'function' ) { 313 313 postboxes.pbshow( boxId ); 314 314 } 315 315 } else { 316 316 $postbox.hide(); 317 if ( $.isFunction( postboxes.pbhide )) {317 if ( typeof postboxes.pbhide === 'function' ) { 318 318 postboxes.pbhide( boxId ); 319 319 } … … 337 337 * @return {void} 338 338 */ 339 $('.columns-prefs input[type="radio"]'). bind('click.postboxes', function(){339 $('.columns-prefs input[type="radio"]').on('click.postboxes', function(){ 340 340 var n = parseInt($(this).val(), 10); 341 341 … … 421 421 422 422 if ( isMobile ) { 423 $(document.body). bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });423 $(document.body).on('orientationchange.postboxes', function(){ postboxes._pb_change(); }); 424 424 this._pb_change(); 425 425 } -
trunk/src/js/_enqueues/admin/privacy-tools.js
r49289 r50001 57 57 } 58 58 59 $( '.export-personal-data-handle' ). click(function( event ) {59 $( '.export-personal-data-handle' ).on( 'click', function( event ) { 60 60 var $this = $( this ), 61 61 $action = $this.parents( '.export-personal-data' ), … … 160 160 }); 161 161 162 $( '.remove-personal-data-handle' ). click(function( event ) {162 $( '.remove-personal-data-handle' ).on( 'click', function( event ) { 163 163 var $this = $( this ), 164 164 $action = $this.parents( '.remove-personal-data' ), -
trunk/src/js/_enqueues/admin/site-health.js
r49716 r50001 206 206 } 207 207 208 pct = ( ( 100 - val ) / 100 ) * c ;208 pct = ( ( 100 - val ) / 100 ) * c + 'px'; 209 209 210 210 $circle.css( { strokeDashoffset: pct } ); -
trunk/src/js/_enqueues/admin/tags.js
r48347 r50001 99 99 * @return {boolean} Always returns false to cancel the default event handling. 100 100 */ 101 $('#submit'). click(function(){101 $('#submit').on( 'click', function(){ 102 102 var form = $(this).parents('form'); 103 103 -
trunk/src/js/_enqueues/admin/user-profile.js
r49337 r50001 109 109 $weakRow = $( '.pw-weak' ); 110 110 $weakCheckbox = $weakRow.find( '.pw-checkbox' ); 111 $weakCheckbox. change(function() {111 $weakCheckbox.on( 'change', function() { 112 112 $submitButtons.prop( 'disabled', ! $weakCheckbox.prop( 'checked' ) ); 113 113 } ); … … 266 266 $( '#pass1' ).val( '' ).on( 'input' + ' pwupdate', check_pass_strength ); 267 267 $('#pass-strength-result').show(); 268 $('.color-palette'). click(function() {268 $('.color-palette').on( 'click', function() { 269 269 $(this).siblings('input[name="admin_color"]').prop('checked', true); 270 270 }); 271 271 272 272 if ( select.length ) { 273 $('#first_name, #last_name, #nickname'). bind( 'blur.user_profile', function() {273 $('#first_name, #last_name, #nickname').on( 'blur.user_profile', function() { 274 274 var dub = [], 275 275 inputs = { -
trunk/src/js/_enqueues/admin/widgets.js
r49151 r50001 37 37 * button `aria-expanded` attribute value. 38 38 */ 39 . click(function() {39 .on( 'click', function() { 40 40 var $this = $( this ), 41 41 $wrap = $this.closest( '.widgets-holder-wrap '), … … 102 102 103 103 // Handle the widgets containers in the left column. 104 $( '#widgets-left .sidebar-name' ). click(function() {104 $( '#widgets-left .sidebar-name' ).on( 'click', function() { 105 105 var $wrap = $( this ).closest( '.widgets-holder-wrap' ); 106 106 … … 113 113 }); 114 114 115 $(document.body). bind('click.widgets-toggle', function(e) {115 $(document.body).on('click.widgets-toggle', function(e) { 116 116 var target = $(e.target), css = {}, 117 117 widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId, … … 420 420 $( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) { 421 421 var $element = $( element ), 422 name = $element.find( '.sidebar-name h2' ).text() ,422 name = $element.find( '.sidebar-name h2' ).text() || '', 423 423 ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ), 424 424 id = $element.find( '.widgets-sortables' ).attr( 'id' ), … … 429 429 'class': 'widgets-chooser-button', 430 430 'aria-label': ariaLabel 431 } ).text( $.trim( name) );431 } ).text( name.toString().trim() ); 432 432 433 433 li.append( button ); -
trunk/src/js/_enqueues/lib/ajax-response.js
r48040 r50001 67 67 // Basic form validation. 68 68 jQuery(document).ready( function($){ 69 $('form.validate'). submit(function() { return wpAjax.validateForm( $(this) ); } );69 $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } ); 70 70 }); -
trunk/src/js/_enqueues/lib/color-picker.js
r48383 r50001 233 233 * @since 3.5.0 234 234 */ 235 self.toggler. click(function(){235 self.toggler.on( 'click', function(){ 236 236 if ( self.toggler.hasClass( 'wp-picker-open' ) ) { 237 237 self.close(); … … 251 251 * @return {void} 252 252 */ 253 self.element. change(function( event ) {253 self.element.on( 'change', function( event ) { 254 254 var me = $( this ), 255 255 val = me.val(); … … 273 273 * @return {void} 274 274 */ 275 self.button. click(function( event ) {275 self.button.on( 'click', function( event ) { 276 276 var me = $( this ); 277 277 if ( me.hasClass( 'wp-picker-clear' ) ) { -
trunk/src/js/_enqueues/lib/link.js
r47122 r50001 55 55 56 56 // Bind event handlers. 57 inputs.dialog. keydown(wpLink.keydown );58 inputs.dialog. keyup(wpLink.keyup );59 inputs.submit. click(function( event ) {57 inputs.dialog.on( 'keydown', wpLink.keydown ); 58 inputs.dialog.on( 'keyup', wpLink.keyup ); 59 inputs.submit.on( 'click', function( event ) { 60 60 event.preventDefault(); 61 61 wpLink.update(); 62 62 }); 63 63 64 inputs.close.add( inputs.backdrop ).add( '#wp-link-cancel button' ). click(function( event ) {64 inputs.close.add( inputs.backdrop ).add( '#wp-link-cancel button' ).on( 'click', function( event ) { 65 65 event.preventDefault(); 66 66 wpLink.close(); … … 626 626 this.refresh(); 627 627 628 $( '#wp-link .query-results, #wp-link #link-selector' ). scroll(function() {628 $( '#wp-link .query-results, #wp-link #link-selector' ).on( 'scroll', function() { 629 629 self.maybeLoad(); 630 630 }); -
trunk/src/js/_enqueues/lib/nav-menu.js
r48650 r50001 391 391 break; 392 392 } 393 $this. focus();393 $this.trigger( 'focus' ); 394 394 api.registerChange(); 395 395 api.refreshKeyboardAccessibility(); … … 573 573 } 574 574 // Put focus back on same menu item. 575 $( '#edit-' + thisItemData['menu-item-db-id'] ). focus();575 $( '#edit-' + thisItemData['menu-item-db-id'] ).trigger( 'focus' ); 576 576 return false; 577 577 }); … … 609 609 api.menuList.hideAdvancedMenuItemFields(); 610 610 611 $('.hide-postbox-tog'). click(function () {611 $('.hide-postbox-tog').on( 'click', function () { 612 612 var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(','); 613 613 $.post(ajaxurl, { … … 810 810 811 811 initManageLocations : function () { 812 $('#menu-locations-wrap form'). submit(function(){812 $('#menu-locations-wrap form').on( 'submit', function(){ 813 813 window.onbeforeunload = null; 814 814 }); … … 824 824 attachMenuEditListeners : function() { 825 825 var that = this; 826 $('#update-nav-menu'). bind('click', function(e) {826 $('#update-nav-menu').on('click', function(e) { 827 827 if ( e.target && e.target.className ) { 828 828 if ( -1 != e.target.className.indexOf('item-edit') ) { … … 853 853 }, 500 ) ); 854 854 855 $('#add-custom-links input[type="text"]'). keypress(function(e){855 $('#add-custom-links input[type="text"]').on( 'keypress', function(e){ 856 856 $('#customlinkdiv').removeClass('form-invalid'); 857 857 … … 868 868 * in a single input to avoid PHP `max_input_vars` limitations. See #14134. 869 869 */ 870 $( '#update-nav-menu' ). submit(function() {870 $( '#update-nav-menu' ).on( 'submit', function() { 871 871 var navMenuData = $( '#update-nav-menu' ).serializeArray(); 872 872 $( '[name="nav-menu-data"]' ).val( JSON.stringify( navMenuData ) ); … … 878 878 params.action = 'menu-locations-save'; 879 879 params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val(); 880 loc.find('input[type="submit"]'). click(function() {880 loc.find('input[type="submit"]').on( 'click', function() { 881 881 loc.find('select').each(function() { 882 882 params[this.name] = $(this).val(); … … 948 948 949 949 addCustomLink : function( processMethod ) { 950 var url = $('#custom-menu-item-url').val().t rim(),950 var url = $('#custom-menu-item-url').val().toString(), 951 951 label = $('#custom-menu-item-name').val(); 952 953 if ( '' !== url ) { 954 url = url.trim(); 955 } 952 956 953 957 processMethod = processMethod || api.addMenuItemToBottom; … … 1000 1004 var ins = $('#menu-instructions'); 1001 1005 1002 menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces. 1006 menuMarkup = menuMarkup || ''; 1007 menuMarkup = menuMarkup.toString().trim(); // Trim leading whitespaces. 1003 1008 processMethod(menuMarkup, params); 1004 1009 … … 1044 1049 1045 1050 attachUnsavedChangesListener : function() { 1046 $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select'). change(function(){1051 $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').on( 'change', function(){ 1047 1052 api.registerChange(); 1048 1053 }); … … 1064 1069 1065 1070 attachTabsPanelListeners : function() { 1066 $('#menu-settings-column'). bind('click', function(e) {1071 $('#menu-settings-column').on('click', function(e) { 1067 1072 var selectAreaMatch, selectAll, panelId, wrapper, items, 1068 1073 target = $(e.target); … … 1084 1089 1085 1090 // Select the search bar. 1086 $('.quick-search', wrapper). focus();1091 $('.quick-search', wrapper).trigger( 'focus' ); 1087 1092 1088 1093 // Hide controls in the search tab if no items found. -
trunk/src/js/_enqueues/vendor/plupload/wp-plupload.js
r48288 r50001 71 71 // Proxy all methods so this always refers to the current instance. 72 72 for ( key in this ) { 73 if ( $.isFunction( this[ key ] )) {73 if ( typeof this[ key ] === 'function' ) { 74 74 this[ key ] = $.proxy( this[ key ], this ); 75 75 } … … 285 285 286 286 // 'dragenter' doesn't fire correctly, simulate it with a limited 'dragover'. 287 dropzone. bind( 'dragover.wp-uploader', function() {287 dropzone.on( 'dragover.wp-uploader', function() { 288 288 if ( timer ) { 289 289 clearTimeout( timer ); … … 298 298 }); 299 299 300 dropzone. bind('dragleave.wp-uploader, drop.wp-uploader', function() {300 dropzone.on('dragleave.wp-uploader, drop.wp-uploader', function() { 301 301 /* 302 302 * Using an instant timer prevents the drag-over class … … 441 441 message = Uploader.errorMap[ key ]; 442 442 443 if ( _.isFunction( message )) {443 if ( typeof message === 'function' ) { 444 444 message = message( pluploadError.file, pluploadError ); 445 445 } -
trunk/src/js/_enqueues/wp/customize/base.js
r49353 r50001 502 502 503 503 // If the last argument is a callback, bind it to .done(). 504 if ( $.isFunction( ids[ ids.length - 1 ] )) {504 if ( typeof ids[ ids.length - 1 ] === 'function' ) { 505 505 dfd.done( ids.pop() ); 506 506 } … … 610 610 611 611 this.bind( this.update ); 612 this.element. bind( this.events, this.refresh );612 this.element.on( this.events, this.refresh ); 613 613 }, 614 614 -
trunk/src/js/_enqueues/wp/customize/controls.js
r49785 r50001 1343 1343 } 1344 1344 if ( template && container.container ) { 1345 return $.trim(template( _.extend(1345 return template( _.extend( 1346 1346 { id: container.id }, 1347 1347 container.params 1348 ) ) 1348 ) ).toString().trim(); 1349 1349 } 1350 1350 … … 1598 1598 backBtn.attr( 'tabindex', '0' ); 1599 1599 1600 backBtn. focus();1600 backBtn.trigger( 'focus' ); 1601 1601 content.css( 'top', '' ); 1602 1602 container.scrollTop( 0 ); … … 1646 1646 sectionTitle.attr( 'tabindex', '0' ); 1647 1647 1648 sectionTitle. focus();1648 sectionTitle.trigger( 'focus' ); 1649 1649 content.css( 'top', '' ); 1650 1650 … … 2735 2735 sectionTitle.attr( 'tabindex', '0' ); 2736 2736 2737 sectionTitle. focus();2737 sectionTitle.trigger( 'focus' ); 2738 2738 content.css( 'top', '' ); 2739 2739 … … 4486 4486 inputValue = String( x ) + ' ' + String( y ); 4487 4487 radioInput = control.container.find( 'input[name="background-position"][value="' + inputValue + '"]' ); 4488 radioInput. click();4488 radioInput.trigger( 'click' ); 4489 4489 } ); 4490 4490 control.settings.x.bind( updateRadios ); … … 5453 5453 controlIndex = controls.indexOf( control ); 5454 5454 if ( controls.length === controlIndex + 1 ) { 5455 $( '#customize-footer-actions .collapse-sidebar' ). focus();5455 $( '#customize-footer-actions .collapse-sidebar' ).trigger( 'focus' ); 5456 5456 } else { 5457 5457 controls[ controlIndex + 1 ].container.find( ':focusable:first' ).focus(); … … 6337 6337 } ); 6338 6338 previewFrame.container.append( form ); 6339 form. submit();6339 form.trigger( 'submit' ); 6340 6340 form.remove(); // No need to keep the form around after submitted. 6341 6341 } … … 7082 7082 // Restore focus if there was a reflow and there was an active (focused) element. 7083 7083 if ( wasReflowed && activeElement ) { 7084 activeElement. focus();7084 activeElement.trigger( 'focus' ); 7085 7085 } 7086 7086 api.trigger( 'pane-contents-reflowed' ); … … 8398 8398 8399 8399 // Button bindings. 8400 saveBtn. click(function( event ) {8400 saveBtn.on( 'click', function( event ) { 8401 8401 api.previewer.save(); 8402 8402 event.preventDefault(); 8403 }). keydown(function( event ) {8403 }).on( 'keydown', function( event ) { 8404 8404 if ( 9 === event.which ) { // Tab. 8405 8405 return; … … 8411 8411 }); 8412 8412 8413 closeBtn. keydown(function( event ) {8413 closeBtn.on( 'keydown', function( event ) { 8414 8414 if ( 9 === event.which ) { // Tab. 8415 8415 return; … … 8753 8753 api( 'blogname', function( setting ) { 8754 8754 var updateTitle = function() { 8755 title.text( $.trim( setting() ) || api.l10n.untitledBlogName ); 8755 var blogTitle = setting() || ''; 8756 title.text( blogTitle.toString().trim() || api.l10n.untitledBlogName ); 8756 8757 }; 8757 8758 setting.bind( updateTitle ); -
trunk/src/js/_enqueues/wp/customize/nav-menus.js
r48650 r50001 227 227 228 228 // Load available items if it looks like we'll need them. 229 api.panel( 'nav_menus' ).container. bind( 'expanded', function() {229 api.panel( 'nav_menus' ).container.on( 'expanded', function() { 230 230 if ( ! self.rendered ) { 231 231 self.initList(); … … 235 235 236 236 // Load more items. 237 this.sectionContent. scroll(function() {237 this.sectionContent.on( 'scroll', function() { 238 238 var totalHeight = self.$el.find( '.accordion-section.open .available-menu-items-list' ).prop( 'scrollHeight' ), 239 239 visibleHeight = self.$el.find( '.accordion-section.open' ).height(); … … 828 828 ready: function() { 829 829 var panel = this; 830 panel.container.find( '.hide-column-tog' ). click(function() {830 panel.container.find( '.hide-column-tog' ).on( 'click', function() { 831 831 panel.saveManageColumnsState(); 832 832 }); … … 3422 3422 name = name || ''; 3423 3423 name = wp.sanitize.stripTagsAndEncodeText( name ); // Remove any potential tags from name. 3424 name = $.trim( name);3424 name = name.toString().trim(); 3425 3425 return name || api.Menus.data.l10n.unnamed; 3426 3426 } -
trunk/src/js/_enqueues/wp/dashboard.js
r49325 r50001 41 41 42 42 // Hide the welcome panel when the dismiss button or close button is clicked. 43 $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel). click(function(e) {43 $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).on( 'click', function(e) { 44 44 e.preventDefault(); 45 45 welcomePanel.addClass('hidden'); … … 49 49 50 50 // Set welcome panel visibility based on Welcome Option checkbox value. 51 welcomePanelHide. click(function() {51 welcomePanelHide.on( 'click', function() { 52 52 welcomePanel.toggleClass('hidden', ! this.checked ); 53 53 updateWelcomePanel( this.checked ? 1 : 0 ); … … 137 137 $( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false ); 138 138 139 t = $('#quick-press'). submit(function( e ) {139 t = $('#quick-press').on( 'submit', function( e ) { 140 140 e.preventDefault(); 141 141 … … 173 173 174 174 // Change the QuickPost action to the publish value. 175 $('#publish'). click(function() { act.val( 'post-quickpress-publish' ); } );175 $('#publish').on( 'click', function() { act.val( 'post-quickpress-publish' ); } ); 176 176 177 177 $('#quick-press').on( 'click focusin', function() { -
trunk/src/js/_enqueues/wp/password-strength-meter.js
r48167 r50001 33 33 */ 34 34 meter : function( password1, disallowedList, password2 ) { 35 if ( ! $.isArray( disallowedList ) )35 if ( ! Array.isArray( disallowedList ) ) 36 36 disallowedList = [ disallowedList.toString() ]; 37 37 -
trunk/src/js/_enqueues/wp/theme-plugin-editor.js
r49151 r50001 102 102 component.warning 103 103 .removeClass( 'hidden' ) 104 .find( '.file-editor-warning-go-back' ). focus();104 .find( '.file-editor-warning-go-back' ).trigger( 'focus' ); 105 105 // Get the links and buttons within the modal. 106 106 component.warningTabbables = component.warning.find( 'a, button' ); -
trunk/src/js/_enqueues/wp/theme.js
r48688 r50001 74 74 // Bind to the scroll event and throttle 75 75 // the results from this.scroller. 76 this.window. bind( 'scroll', _.throttle( this.scroller, 300 ) );76 this.window.on( 'scroll', _.throttle( this.scroller, 300 ) ); 77 77 }, 78 78 … … 551 551 preview.render(); 552 552 this.setNavButtonsState(); 553 $( '.next-theme' ). focus();553 $( '.next-theme' ).trigger( 'focus' ); 554 554 }) 555 555 .listenTo( preview, 'theme:previous', function() { … … 581 581 preview.render(); 582 582 this.setNavButtonsState(); 583 $( '.previous-theme' ). focus();583 $( '.previous-theme' ).trigger( 'focus' ); 584 584 }); 585 585 … … 603 603 .prop( 'disabled', true ); 604 604 605 nextThemeButton. focus();605 nextThemeButton.trigger( 'focus' ); 606 606 } 607 607 … … 612 612 .prop( 'disabled', true ); 613 613 614 previousThemeButton. focus();614 previousThemeButton.trigger( 'focus' ); 615 615 } 616 616 }, … … 706 706 // Set initial focus on the primary action control. 707 707 _.delay( function() { 708 $( '.theme-overlay' ). focus();708 $( '.theme-overlay' ).trigger( 'focus' ); 709 709 }, 100 ); 710 710 … … 717 717 if ( 9 === event.which ) { 718 718 if ( $firstFocusable[0] === event.target && event.shiftKey ) { 719 $lastFocusable. focus();719 $lastFocusable.trigger( 'focus' ); 720 720 event.preventDefault(); 721 721 } else if ( $lastFocusable[0] === event.target && ! event.shiftKey ) { 722 $firstFocusable. focus();722 $firstFocusable.trigger( 'focus' ); 723 723 event.preventDefault(); 724 724 } … … 765 765 // Return focus to the theme div. 766 766 if ( themes.focusedTheme ) { 767 themes.focusedTheme. focus();767 themes.focusedTheme.trigger( 'focus' ); 768 768 } 769 769 }); … … 953 953 // Return focus to the theme div. 954 954 if ( themes.focusedTheme ) { 955 themes.focusedTheme. focus();955 themes.focusedTheme.trigger( 'focus' ); 956 956 } 957 957 }).removeClass( 'iframe-ready' ); … … 2050 2050 // The `search` route event. The router populates the input field. 2051 2051 themes.router.on( 'route:search', function() { 2052 $( '.wp-filter-search' ). focus().trigger( 'keyup' );2052 $( '.wp-filter-search' ).trigger( 'focus' ).trigger( 'keyup' ); 2053 2053 }); 2054 2054 … … 2102 2102 } 2103 2103 2104 if ( tbWindow. size()) {2104 if ( tbWindow.length >= 1 ) { 2105 2105 tbWindow.width( W - 50 ).height( H - 45 - adminbar_height ); 2106 2106 $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height ); … … 2112 2112 }; 2113 2113 2114 $(window). resize(function(){ tb_position(); });2114 $(window).on( 'resize', function(){ tb_position(); }); 2115 2115 }); -
trunk/src/js/_enqueues/wp/updates.js
r49582 r50001 1553 1553 themes.disabled = _.without( themes.disabled, response.slug ); 1554 1554 if ( themes.disabled.length ) { 1555 $views.find( '.disabled .count' ).text( '(' + themes.disabled.length + ')' ); 1555 $views.find( '.disabled .count' ).text( '(' + themes.disabled.length + ')' ); 1556 1556 } else { 1557 1557 $views.find( '.disabled' ).remove(); … … 1567 1567 } 1568 1568 } 1569 1569 1570 1570 if ( -1 !== _.indexOf( themes['auto-update-disabled'], response.slug ) ) { 1571 1571 themes['auto-update-disabled'] = _.without( themes['auto-update-disabled'], response.slug ); … … 2046 2046 $filesystemForm.on( 'change', 'input[name="connection_type"]', function() { 2047 2047 $( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) ); 2048 } ). change();2048 } ).trigger( 'change' ); 2049 2049 2050 2050 /** … … 2766 2766 2767 2767 try { 2768 message = $.parseJSON( originalEvent.data );2768 message = JSON.parse( originalEvent.data ); 2769 2769 } catch ( e ) { 2770 2770 return; -
trunk/src/js/_enqueues/wp/widgets/custom-html.js
r48650 r50001 447 447 448 448 // Accessibility mode. 449 $( window ).on( 'load', function() { 449 if ( document.readyState === 'complete' ) { 450 // Page is fully loaded. 450 451 component.setupAccessibleMode(); 451 }); 452 } else { 453 // Page is still loading. 454 $( window ).on( 'load', function() { 455 component.setupAccessibleMode(); 456 }); 457 } 452 458 }); 453 459 }; -
trunk/src/js/_enqueues/wp/widgets/media.js
r48650 r50001 1321 1321 1322 1322 // Accessibility mode. 1323 $( window ).on( 'load', function() { 1323 if ( document.readyState === 'complete' ) { 1324 // Page is fully loaded. 1324 1325 component.setupAccessibleMode(); 1325 }); 1326 } else { 1327 // Page is still loading. 1328 $( window ).on( 'load', function() { 1329 component.setupAccessibleMode(); 1330 }); 1331 } 1326 1332 }); 1327 1333 }; -
trunk/src/js/media/views/focus-manager.js
r48650 r50001 70 70 */ 71 71 focus: function() { 72 this.$( '.media-modal' ). focus();72 this.$( '.media-modal' ).trigger( 'focus' ); 73 73 }, 74 74 -
trunk/src/js/media/views/frame/edit-attachments.js
r47122 r50001 95 95 $( 'body' ).off( 'keydown.media-modal' ); 96 96 // Move focus back to the original item in the grid if possible. 97 $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ). focus();97 $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).trigger( 'focus' ); 98 98 this.resetRoute(); 99 99 }, this ) ); … … 233 233 */ 234 234 focusNavButton: function( which ) { 235 $( which ). focus();235 $( which ).trigger( 'focus' ); 236 236 }, 237 237 -
trunk/src/js/media/views/modal.js
r47122 r50001 116 116 117 117 // Set initial focus on the content instead of this view element, to avoid page scrolling. 118 this.$( '.media-modal' ). focus();118 this.$( '.media-modal' ).trigger( 'focus' ); 119 119 120 120 // Hide the page content from assistive technologies. … … 137 137 138 138 // Hide modal and remove restricted media modal tab focus once it's closed. 139 this.$el.hide(). undelegate( 'keydown' );139 this.$el.hide().off( 'keydown' ); 140 140 141 141 /* -
trunk/src/wp-admin/export.php
r47785 r50001 30 30 filters = form.find('.export-filters'); 31 31 filters.hide(); 32 form.find('input:radio'). change(function() {32 form.find('input:radio').on( 'change', function() { 33 33 filters.slideUp('fast'); 34 34 switch ( $(this).val() ) { -
trunk/src/wp-admin/includes/ms.php
r49936 r50001 1002 1002 jQuery(document).ready( function($) { 1003 1003 var languageSelect = $( '#WPLANG' ); 1004 $( 'form' ). submit(function() {1004 $( 'form' ).on( 'submit', function() { 1005 1005 // Don't show a spinner for English and installed languages, 1006 1006 // as there is nothing to download. -
trunk/src/wp-admin/includes/options.php
r47808 r50001 19 19 var parent = $( '#show_avatars' ), 20 20 children = $( '.avatar-settings' ); 21 parent. change(function(){21 parent.on( 'change', function(){ 22 22 children.toggleClass( 'hide-if-js', ! this.checked ); 23 23 }); … … 50 50 }); 51 51 52 $( 'input[name="date_format"]' ). click(function() {52 $( 'input[name="date_format"]' ).on( 'click', function() { 53 53 if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) ) 54 54 $( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); … … 59 59 }); 60 60 61 $( 'input[name="time_format"]' ). click(function() {61 $( 'input[name="time_format"]' ).on( 'click', function() { 62 62 if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) ) 63 63 $( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); … … 90 90 91 91 var languageSelect = $( '#WPLANG' ); 92 $( 'form' ). submit(function() {92 $( 'form' ).on( 'submit', function() { 93 93 // Don't show a spinner for English and installed languages, 94 94 // as there is nothing to download. … … 118 118 }; 119 119 check_disabled(); 120 section.find( 'input:radio' ). change(check_disabled );120 section.find( 'input:radio' ).on( 'change', check_disabled ); 121 121 }); 122 122 </script> -
trunk/src/wp-content/themes/twentyeleven/js/showcase.js
r17761 r50001 1 1 (function($) { 2 2 $(document).ready( function() { 3 $('.feature-slider a'). click(function(e) {3 $('.feature-slider a').on( 'click', function(e) { 4 4 $('.featured-posts section.featured-post').css({ 5 5 opacity: 0, -
trunk/src/wp-content/themes/twentyfifteen/js/functions.js
r47122 r50001 18 18 container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); 19 19 20 container.find( '.dropdown-toggle' ). click(function( e ) {20 container.find( '.dropdown-toggle' ).on( 'click', function( e ) { 21 21 var _this = $( this ); 22 22 e.preventDefault(); -
trunk/src/wp-content/themes/twentyfourteen/js/functions.js
r47122 r50001 148 148 } ); 149 149 150 _window. load(function() {150 _window.on( 'load', function() { 151 151 var footerSidebar, 152 152 isCustomizeSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ); 153 153 154 154 // Arrange footer widgets vertically. 155 if ( $.isFunction( $.fn.masonry )) {155 if ( typeof $.fn.masonry === 'function' ) { 156 156 footerSidebar = $( '#footer-sidebar' ); 157 157 footerSidebar.masonry( { -
trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js
r46586 r50001 27 27 28 28 // Ensure the sticky navigation doesn't cover current focused links. 29 $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ). focus(function() {29 $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).on( 'focus', function() { 30 30 if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { 31 31 var windowScrollTop = $( window ).scrollTop(), … … 198 198 } 199 199 200 $menuScrollDown. click(function( e ) {200 $menuScrollDown.on( 'click', function( e ) { 201 201 e.preventDefault(); 202 202 $( window ).scrollTo( '#primary', { … … 229 229 230 230 // Also want to make sure the navigation is where it should be on resize. 231 $( window ). resize(function() {231 $( window ).on( 'resize', function() { 232 232 setNavProps(); 233 233 setTimeout( adjustScrollClass, 500 ); … … 235 235 } 236 236 237 $( window ). resize(function() {237 $( window ).on( 'resize', function() { 238 238 clearTimeout( resizeTimer ); 239 239 resizeTimer = setTimeout( function() { -
trunk/src/wp-content/themes/twentyseventeen/assets/js/navigation.js
r46586 r50001 27 27 container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); 28 28 29 container.find( '.dropdown-toggle' ). click(function( e ) {29 container.find( '.dropdown-toggle' ).on( 'click', function( e ) { 30 30 var _this = $( this ), 31 31 screenReaderSpan = _this.find( '.screen-reader-text' ); -
trunk/src/wp-content/themes/twentysixteen/js/functions.js
r44263 r50001 29 29 container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' ); 30 30 31 container.find( '.dropdown-toggle' ). click(function( e ) {31 container.find( '.dropdown-toggle' ).on( 'click', function( e ) { 32 32 var _this = $( this ), 33 33 screenReaderSpan = _this.find( '.screen-reader-text' ); -
trunk/src/wp-content/themes/twentythirteen/js/functions.js
r42411 r50001 124 124 $( function() { 125 125 var columnWidth, widgetArea; 126 if ( ! $.isFunction( $.fn.masonry )) {126 if ( typeof $.fn.masonry !== 'function' ) { 127 127 return; 128 128 }
Note: See TracChangeset
for help on using the changeset viewer.