Changeset 50420
- Timestamp:
- 02/23/2021 07:43:23 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/auth-app.js
r50030 r50420 16 16 }; 17 17 18 $approveBtn. click(function( e ) {18 $approveBtn.on( 'click', function( e ) { 19 19 var name = $appNameField.val(), 20 20 appId = $( 'input[name="app_id"]', $form ).val(); … … 27 27 28 28 if ( 0 === name.length ) { 29 $appNameField. focus();29 $appNameField.trigger( 'focus' ); 30 30 return; 31 31 } … … 103 103 104 104 $form.replaceWith( $notice ); 105 $notice. focus();105 $notice.trigger( 'focus' ); 106 106 } 107 107 } ).fail( function( jqXHR, textStatus, errorThrown ) { … … 141 141 } ); 142 142 143 $rejectBtn. click(function( e ) {143 $rejectBtn.on( 'click', function( e ) { 144 144 e.preventDefault(); 145 145 -
trunk/src/js/_enqueues/admin/common.js
r50001 r50420 841 841 */ 842 842 $adminmenu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){ 843 $(e.target).parent().siblings('a').get(0). click();843 $(e.target).parent().siblings('a').get(0).trigger( 'click' ); 844 844 }); 845 845 -
trunk/src/js/_enqueues/admin/custom-background.js
r49388 r50420 40 40 * @return {void} 41 41 */ 42 $( 'select[name="background-size"]' ). change(function() {42 $( 'select[name="background-size"]' ).on( 'change', function() { 43 43 bgImage.css( 'background-size', $( this ).val() ); 44 44 }); … … 51 51 * @return {void} 52 52 */ 53 $( 'input[name="background-position"]' ). change(function() {53 $( 'input[name="background-position"]' ).on( 'change', function() { 54 54 bgImage.css( 'background-position', $( this ).val() ); 55 55 }); … … 62 62 * @return {void} 63 63 */ 64 $( 'input[name="background-repeat"]' ). change(function() {64 $( 'input[name="background-repeat"]' ).on( 'change', function() { 65 65 bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' ); 66 66 }); … … 73 73 * @return {void} 74 74 */ 75 $( 'input[name="background-attachment"]' ). change(function() {75 $( 'input[name="background-attachment"]' ).on( 'change', function() { 76 76 bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' ); 77 77 }); … … 84 84 * @return {void} 85 85 */ 86 $('#choose-from-library-link'). click(function( event ) {86 $('#choose-from-library-link').on( 'click', function( event ) { 87 87 var $el = $(this); 88 88 -
trunk/src/js/_enqueues/admin/custom-header.js
r46800 r50420 36 36 * @return {void} 37 37 */ 38 $('#choose-from-library-link'). click(function( event ) {38 $('#choose-from-library-link').on( 'click', function( event ) { 39 39 var $el = $(this); 40 40 event.preventDefault(); -
trunk/src/js/_enqueues/admin/edit-comments.js
r50001 r50420 851 851 toggle : function(el) { 852 852 if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( __( 'Are you sure you want to edit this comment?\nThe changes you made will be lost.' ) ) ) ) { 853 $( el ).find( 'button.vim-q' ). click();853 $( el ).find( 'button.vim-q' ).trigger( 'click' ); 854 854 } 855 855 }, … … 1299 1299 var scope = $('select[name="action"]'); 1300 1300 $('option[value="' + value + '"]', scope).prop('selected', true); 1301 $('#doaction'). click();1301 $('#doaction').trigger( 'click' ); 1302 1302 }; 1303 1303 }; -
trunk/src/js/_enqueues/admin/link.js
r47122 r50420 9 9 var newCat, noSyncChecks = false, syncChecks, catAddAfter; 10 10 11 $('#link_name'). focus();11 $('#link_name').trigger( 'focus' ); 12 12 // Postboxes. 13 13 postboxes.add_postbox_toggles('link'); … … 20 20 * @return {boolean} Always returns false to prevent the default behavior. 21 21 */ 22 $('#category-tabs a'). click(function(){22 $('#category-tabs a').on( 'click', function(){ 23 23 var t = $(this).attr('href'); 24 24 $(this).parent().addClass('tabs').siblings('li').removeClass('tabs'); … … 32 32 }); 33 33 if ( getUserSetting('cats') ) 34 $('#category-tabs a[href="#categories-pop"]'). click();34 $('#category-tabs a[href="#categories-pop"]').trigger( 'click' ); 35 35 36 36 // Ajax Cat. … … 42 42 * @return {void} 43 43 */ 44 $('#link-category-add-submit'). click(function() { newCat.focus(); } );44 $('#link-category-add-submit').on( 'click', function() { newCat.focus(); } ); 45 45 46 46 /** … … 83 83 t.find( 'label' ).each( function() { 84 84 var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o; 85 $('#' + id). change(syncChecks );85 $('#' + id).on( 'change', syncChecks ); 86 86 o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name ); 87 87 } ); … … 109 109 110 110 // All categories is the default tab, so we delete the user setting. 111 $('a[href="#categories-all"]'). click(function(){deleteUserSetting('cats');});111 $('a[href="#categories-all"]').on( 'click', function(){deleteUserSetting('cats');}); 112 112 113 113 // Set a preference for the popular categories to cookies. 114 $('a[href="#categories-pop"]'). click(function(){setUserSetting('cats','pop');});114 $('a[href="#categories-pop"]').on( 'click', function(){setUserSetting('cats','pop');}); 115 115 116 116 if ( 'pop' == getUserSetting('cats') ) 117 $('a[href="#categories-pop"]'). click();117 $('a[href="#categories-pop"]').trigger( 'click' ); 118 118 119 119 /** … … 126 126 * functionality. 127 127 */ 128 $('#category-add-toggle'). click(function() {128 $('#category-add-toggle').on( 'click', function() { 129 129 $(this).parents('div:first').toggleClass( 'wp-hidden-children' ); 130 $('#category-tabs a[href="#categories-all"]'). click();131 $('#newcategory'). focus();130 $('#category-tabs a[href="#categories-all"]').trigger( 'click' ); 131 $('#newcategory').trigger( 'focus' ); 132 132 return false; 133 133 } ); 134 134 135 $('.categorychecklist :checkbox'). change( syncChecks ).filter( ':checked' ).change();135 $('.categorychecklist :checkbox').on( 'change', syncChecks ).filter( ':checked' ).trigger( 'change' ); 136 136 }); -
trunk/src/js/_enqueues/admin/media.js
r50001 r50420 47 47 48 48 // Close the dialog when the escape key is pressed. 49 $('#find-posts-input'). focus().keyup(function( event ){49 $('#find-posts-input').trigger( 'focus' ).on( 'keyup', function( event ){ 50 50 if ( event.which == 27 ) { 51 51 findPosts.close(); -
trunk/src/js/_enqueues/admin/plugin-install.js
r50001 r50420 76 76 // Set focus back to the element that opened the modal dialog. 77 77 // Note: IE 8 would need this wrapped in a fake setTimeout `0`. 78 $focusedBefore. focus();78 $focusedBefore.trigger( 'focus' ); 79 79 }); 80 80 … … 89 89 90 90 // Set initial focus on the "Close" button. 91 $firstTabbable. focus();91 $firstTabbable.trigger( 'focus' ); 92 92 93 93 /* … … 142 142 if ( $lastTabbable[0] === event.target && ! event.shiftKey ) { 143 143 event.preventDefault(); 144 $firstTabbable. focus();144 $firstTabbable.trigger( 'focus' ); 145 145 } else if ( $firstTabbable[0] === event.target && event.shiftKey ) { 146 146 event.preventDefault(); 147 $lastTabbable. focus();147 $lastTabbable.trigger( 'focus' ); 148 148 } 149 149 } -
trunk/src/js/_enqueues/admin/post.js
r50001 r50420 69 69 70 70 theList = theExtraList = null; 71 $( 'a[className*=\':\']' ). unbind();71 $( 'a[className*=\':\']' ).off(); 72 72 73 73 // If the offset is over the total number of comments we cannot fetch any more, so hide the button. … … 415 415 416 416 $previewField.val('dopreview'); 417 $form.attr( 'target', target ). submit().attr( 'target', '' );417 $form.attr( 'target', target ).trigger( 'submit' ).attr( 'target', '' ); 418 418 419 419 // Workaround for WebKit bug preventing a form submitting twice to the same action. … … 449 449 // Auto save new posts after a title is typed. 450 450 if ( $( '#auto_draft' ).val() ) { 451 $( '#title' ). blur(function() {451 $( '#title' ).on( 'blur', function() { 452 452 var cancel; 453 453 … … 593 593 594 594 if ( getUserSetting( settingName ) ) 595 $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs'). click();595 $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').trigger( 'click' ); 596 596 597 597 // Add category button controls. … … 601 601 602 602 // On [Enter] submit the taxonomy. 603 $('#new' + taxonomy). keypress(function(event){603 $('#new' + taxonomy).on( 'keypress', function(event){ 604 604 if( 13 === event.keyCode ) { 605 605 event.preventDefault(); 606 $('#' + taxonomy + '-add-submit'). click();606 $('#' + taxonomy + '-add-submit').trigger( 'click' ); 607 607 } 608 608 }); … … 1002 1002 1003 1003 if ( new_slug == $('#editable-post-name-full').text() ) { 1004 buttons.children('.cancel'). click();1004 buttons.children('.cancel').trigger( 'click' ); 1005 1005 return; 1006 1006 } … … 1055 1055 if ( 13 === key ) { 1056 1056 e.preventDefault(); 1057 buttons.children( '.save' ). click();1057 buttons.children( '.save' ).trigger( 'click' ); 1058 1058 } 1059 1059 // On [Esc] cancel the editing. 1060 1060 if ( 27 === key ) { 1061 buttons.children( '.cancel' ). click();1061 buttons.children( '.cancel' ).trigger( 'click' ); 1062 1062 } 1063 1063 } ).on( 'keyup', function() { … … 1178 1178 mce = false; 1179 1179 offset = $textarea.height() - event.pageY; 1180 $textarea. blur();1180 $textarea.trigger( 'blur' ); 1181 1181 } 1182 1182 … … 1262 1262 event.clearSelection(); 1263 1263 // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 1264 triggerElement. focus();1264 triggerElement.trigger( 'focus' ); 1265 1265 1266 1266 // Show success visual feedback. -
trunk/src/js/_enqueues/admin/postbox.js
r50001 r50420 128 128 129 129 postbox.prevAll( '.postbox:visible' ).eq( 0 ).before( postbox ); 130 button. focus();130 button.trigger( 'focus' ); 131 131 postboxes.updateOrderButtonsProperties(); 132 132 postboxes.save_order( postboxes.page ); … … 142 142 143 143 postbox.nextAll( '.postbox:visible' ).eq( 0 ).after( postbox ); 144 button. focus();144 button.trigger( 'focus' ); 145 145 postboxes.updateOrderButtonsProperties(); 146 146 postboxes.save_order( postboxes.page ); -
trunk/src/js/_enqueues/admin/privacy-tools.js
r50367 r50420 329 329 $( 'body.options-privacy-php label[for=create-page]' ).on( 'click', function( e ) { 330 330 e.preventDefault(); 331 $( 'input#create-page' ). focus();331 $( 'input#create-page' ).trigger( 'focus' ); 332 332 } ); 333 333 -
trunk/src/js/_enqueues/admin/tags-box.js
r48350 r50420 189 189 */ 190 190 if ( 13 === e.keyCode || 32 === e.keyCode ) { 191 $( this ).closest( '.tagsdiv' ).find( 'input.newtag' ). focus();191 $( this ).closest( '.tagsdiv' ).find( 'input.newtag' ).trigger( 'focus' ); 192 192 } 193 193 … … 256 256 newtag.val(''); 257 257 if ( 'undefined' == typeof( f ) ) 258 newtag. focus();258 newtag.trigger( 'focus' ); 259 259 260 260 return false; … … 304 304 * @return {boolean} Returns false to prevent the default action. 305 305 */ 306 $( 'a', r ). click(function() {306 $( 'a', r ).on( 'click', function() { 307 307 tagBox.userAction = 'add'; 308 308 tagBox.flushTags( $( '#' + tax ), this ); … … 369 369 }); 370 370 371 $( '.tagadd', ajaxtag ). click(function() {371 $( '.tagadd', ajaxtag ).on( 'click', function() { 372 372 tagBox.userAction = 'add'; 373 373 tagBox.flushTags( $( this ).closest( '.tagsdiv' ) ); … … 386 386 * @return {void} 387 387 */ 388 $( 'input.newtag', ajaxtag ). keypress(function( event ) {388 $( 'input.newtag', ajaxtag ).on( 'keypress', function( event ) { 389 389 if ( 13 == event.which ) { 390 390 tagBox.userAction = 'add'; … … 405 405 * @return {void} 406 406 */ 407 $('#post'). submit(function(){407 $('#post').on( 'submit', function(){ 408 408 $('div.tagsdiv').each( function() { 409 409 tagBox.flushTags(this, false, 1); … … 420 420 * @return {void} 421 421 */ 422 $('.tagcloud-link'). click(function(){422 $('.tagcloud-link').on( 'click', function(){ 423 423 // On the first click, fetch the tag cloud and insert it in the DOM. 424 424 tagBox.get( $( this ).attr( 'id' ) ); … … 426 426 $( this ) 427 427 .attr( 'aria-expanded', 'true' ) 428 . unbind()429 . click(function() {428 .off() 429 .on( 'click', function() { 430 430 $( this ) 431 431 .attr( 'aria-expanded', 'false' === $( this ).attr( 'aria-expanded' ) ? 'true' : 'false' ) -
trunk/src/js/_enqueues/admin/user-profile.js
r50153 r50420 409 409 if ( typeof wp !== 'undefined' && wp.svgPainter ) { 410 410 try { 411 colors = $.parseJSON( $this.children( '.icon_colors' ).val() );411 colors = JSON.parse( $this.children( '.icon_colors' ).val() ); 412 412 } catch ( error ) {} 413 413 -
trunk/src/js/_enqueues/admin/widgets.js
r50001 r50420 82 82 unsavedWidgetsElements.each( function() { 83 83 if ( ! $( this ).hasClass( 'open' ) ) { 84 $( this ).find( '.widget-title-action:first' ). click();84 $( this ).find( '.widget-title-action:first' ).trigger( 'click' ); 85 85 } 86 86 }); … … 93 93 this.scrollIntoView(); 94 94 } 95 $( this ).find( '.widget-inside :tabbable:first' ). focus();95 $( this ).find( '.widget-inside :tabbable:first' ).trigger( 'focus' ); 96 96 } ); 97 97 -
trunk/src/js/_enqueues/deprecated/media-gallery.js
r49388 r50420 11 11 * Adds a click event handler to the element with a 'wp-gallery' class. 12 12 */ 13 $( 'body' ). bind( 'click.wp-gallery', function(e) {13 $( 'body' ).on( 'click.wp-gallery', function(e) { 14 14 var target = $( e.target ), id, img_size, nonceValue; 15 15 -
trunk/src/js/_enqueues/lib/ajax-response.js
r50001 r50420 12 12 pp = s.split('&'); 13 13 for ( i in pp ) { 14 if ( jQuery.isFunction(pp.hasOwnProperty)&& !pp.hasOwnProperty(i) ) { continue; }14 if ( typeof pp.hasOwnProperty === 'function' && !pp.hasOwnProperty(i) ) { continue; } 15 15 p = pp[i].split('='); 16 16 r[p[0]] = p[1]; -
trunk/src/js/_enqueues/lib/color-picker.js
r50001 r50420 68 68 */ 69 69 change: function( event, ui ) { 70 if ( $.isFunction( self.options.change )) {70 if ( typeof self.options.change === 'function' ) { 71 71 self.options.change.call( this, event, ui ); 72 72 } … … 190 190 self.toggler.css( { backgroundColor: ui.color.toString() } ); 191 191 192 if ( $.isFunction( self.options.change )) {192 if ( typeof self.options.change === 'function' ) { 193 193 self.options.change.call( this, event, ui ); 194 194 } … … 258 258 self.toggler.css( 'backgroundColor', '' ); 259 259 // Fire clear callback if we have one. 260 if ( $.isFunction( self.options.clear )) {260 if ( typeof self.options.clear === 'function' ) { 261 261 self.options.clear.call( this, event ); 262 262 } -
trunk/src/js/_enqueues/lib/gallery.js
r47122 r50420 43 43 }; 44 44 45 $('#asc'). click(function( e ) {45 $('#asc').on( 'click', function( e ) { 46 46 e.preventDefault(); 47 47 desc = false; 48 48 sortIt(); 49 49 }); 50 $('#desc'). click(function( e ) {50 $('#desc').on( 'click', function( e ) { 51 51 e.preventDefault(); 52 52 desc = true; 53 53 sortIt(); 54 54 }); 55 $('#clear'). click(function( e ) {55 $('#clear').on( 'click', function( e ) { 56 56 e.preventDefault(); 57 57 clearAll(1); 58 58 }); 59 $('#showall'). click(function( e ) {59 $('#showall').on( 'click', function( e ) { 60 60 e.preventDefault(); 61 61 $('#sort-buttons span a').toggle(); … … 64 64 $('img.pinkynail').toggle(false); 65 65 }); 66 $('#hideall'). click(function( e ) {66 $('#hideall').on( 'click', function( e ) { 67 67 e.preventDefault(); 68 68 $('#sort-buttons span a').toggle(); … … 89 89 }); 90 90 91 jQuery(window). unload(function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup.91 jQuery(window).on( 'unload', function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup. 92 92 93 93 /* gallery settings */ -
trunk/src/js/_enqueues/lib/image-edit.js
r50270 r50420 128 128 // Key codes 37 through 40 are the arrow keys. 129 129 if ( 36 < k && k < 41 ) { 130 $(this). blur();130 $(this).trigger( 'blur' ); 131 131 } 132 132 -
trunk/src/js/_enqueues/lib/language-chooser.js
r43347 r50420 15 15 } 16 16 17 select. focus().on( 'change', function() {17 select.trigger( 'focus' ).on( 'change', function() { 18 18 /* 19 19 * When a language is selected, set matching translation to continue button … … 27 27 }); 28 28 29 $( 'form' ). submit(function() {29 $( 'form' ).on( 'submit', function() { 30 30 // Show spinner for languages that need to be downloaded. 31 31 if ( ! select.children( 'option:selected' ).data( 'installed' ) ) { -
trunk/src/js/_enqueues/lib/link.js
r50001 r50420 182 182 if ( isTouch ) { 183 183 // Close the onscreen keyboard. 184 inputs.url. focus().blur();184 inputs.url.trigger( 'focus' ).trigger( 'blur' ); 185 185 } else { 186 186 /* … … 191 191 window.setTimeout( function() { 192 192 inputs.url[0].select(); 193 inputs.url. focus();193 inputs.url.trigger( 'focus' ); 194 194 } ); 195 195 } … … 558 558 // Following focusable elements will be skipped on keyboard navigation. 559 559 if ( id === 'wp-link-submit' && ! event.shiftKey ) { 560 inputs.close. focus();560 inputs.close.trigger( 'focus' ); 561 561 event.preventDefault(); 562 562 } else if ( id === 'wp-link-close' && event.shiftKey ) { 563 inputs.submit. focus();563 inputs.submit.trigger( 'focus' ); 564 564 event.preventDefault(); 565 565 } -
trunk/src/js/_enqueues/lib/lists.js
r48650 r50420 272 272 }, settings || {} ); 273 273 274 if ( $.isFunction( settings.confirm )) {274 if ( typeof settings.confirm === 'function' ) { 275 275 $element = $( '#' + settings.element ); 276 276 … … 338 338 339 339 formValues = $( '#' + settings.element + ' :input' ).not( '[name="_ajax_nonce"], [name="_wpnonce"], [name="action"]' ); 340 formData = $.isFunction( formValues.fieldSerialize )? formValues.fieldSerialize() : formValues.serialize();340 formData = typeof formValues.fieldSerialize === 'function' ? formValues.fieldSerialize() : formValues.serialize(); 341 341 342 342 if ( formData ) { … … 344 344 } 345 345 346 if ( $.isFunction( settings.addBefore )) {346 if ( typeof settings.addBefore === 'function' ) { 347 347 settings = settings.addBefore( settings ); 348 348 … … 382 382 383 383 settings.complete = function( jqXHR, status ) { 384 if ( $.isFunction( settings.addAfter )) {384 if ( typeof settings.addAfter === 'function' ) { 385 385 settings.addAfter( returnedResponse, $.extend( { 386 386 xml: jqXHR, … … 428 428 }, wpAjax.unserialize( data[4] || '' ) ); 429 429 430 if ( $.isFunction( settings.delBefore )) {430 if ( typeof settings.delBefore === 'function' ) { 431 431 settings = settings.delBefore( settings, list ); 432 432 … … 467 467 468 468 settings.complete = function( jqXHR, status ) { 469 if ( $.isFunction( settings.delAfter )) {469 if ( typeof settings.delAfter === 'function' ) { 470 470 $eventTarget.queue( function() { 471 471 settings.delAfter( returnedResponse, $.extend( { … … 523 523 }, wpAjax.unserialize( data[6] || '' ) ); 524 524 525 if ( $.isFunction( settings.dimBefore )) {525 if ( typeof settings.dimBefore === 'function' ) { 526 526 settings = settings.dimBefore( settings ); 527 527 … … 592 592 593 593 settings.complete = function( jqXHR, status ) { 594 if ( $.isFunction( settings.dimAfter )) {594 if ( typeof settings.dimAfter === 'function' ) { 595 595 $eventTarget.queue( function() { 596 596 settings.dimAfter( returnedResponse, $.extend( { -
trunk/src/js/_enqueues/lib/nav-menu.js
r50115 r50420 858 858 if ( e.keyCode === 13 ) { 859 859 e.preventDefault(); 860 $( '#submit-customlinkdiv' ). click();860 $( '#submit-customlinkdiv' ).trigger( 'click' ); 861 861 } 862 862 }); … … 968 968 $( '.customlinkdiv .spinner' ).removeClass( 'is-active' ); 969 969 // Set custom link form back to defaults. 970 $('#custom-menu-item-name').val(''). blur();970 $('#custom-menu-item-name').val('').trigger( 'blur' ); 971 971 $( '#custom-menu-item-url' ).val( '' ).attr( 'placeholder', 'https://' ); 972 972 }); … … 1060 1060 } else { 1061 1061 // Make the post boxes read-only, as they can't be used yet. 1062 $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ). unbind( 'click' );1062 $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).off( 'click' ); 1063 1063 } 1064 1064 }, … … 1142 1142 $.post( ajaxurl, this.href.replace( /.*\?/, '' ).replace( /action=([^&]*)/, '' ) + '&action=menu-get-metabox', 1143 1143 function( resp ) { 1144 var metaBoxData = $.parseJSON( resp ),1144 var metaBoxData = JSON.parse( resp ), 1145 1145 toReplace; 1146 1146 -
trunk/src/js/_enqueues/vendor/jquery/jquery.hotkeys.js
r43309 r50420 40 40 41 41 this.add = function(combi, options, callback) { 42 if ( jQuery.isFunction(options)){42 if ( typeof options === 'function' ){ 43 43 callback = options; 44 44 options = {}; -
trunk/src/js/_enqueues/vendor/jquery/jquery.serialize-object.js
r43309 r50420 1 1 /*! 2 * jQuery serializeObject - v0.2 - 1/20/20102 * jQuery serializeObject - v0.2-wp - 1/20/2010 3 3 * http://benalman.com/projects/jquery-misc-plugins/ 4 * 4 * 5 5 * Copyright (c) 2010 "Cowboy" Ben Alman 6 6 * Dual licensed under the MIT and GPL licenses. … … 13 13 (function($,undefined){ 14 14 '$:nomunge'; // Used by YUI compressor. 15 15 16 16 $.fn.serializeObject = function(){ 17 17 var obj = {}; 18 18 19 19 $.each( this.serializeArray(), function(i,o){ 20 20 var n = o.name, 21 21 v = o.value; 22 22 23 23 obj[n] = obj[n] === undefined ? v 24 : $.isArray( obj[n] ) ? obj[n].concat( v )24 : Array.isArray( obj[n] ) ? obj[n].concat( v ) 25 25 : [ obj[n], v ]; 26 26 }); 27 27 28 28 return obj; 29 29 }; 30 30 31 31 })(jQuery); -
trunk/src/js/_enqueues/vendor/jquery/jquery.table-hotkeys.js
r43309 r50420 15 15 opts = $.extend($.table_hotkeys.defaults, opts); 16 16 var selected_class, destructive_class, set_current_row, adjacent_row_callback, get_adjacent_row, adjacent_row, prev_row, next_row, check, get_first_row, get_last_row, make_key_callback, first_row; 17 17 18 18 selected_class = opts.class_prefix + opts.selected_suffix; 19 19 destructive_class = opts.class_prefix + opts.destructive_suffix; … … 25 25 }; 26 26 adjacent_row_callback = function(which) { 27 if (!adjacent_row(which) && $.isFunction(opts[which+'_page_link_cb'])) {27 if (!adjacent_row(which) && typeof opts[which+'_page_link_cb'] === 'function' ) { 28 28 opts[which+'_page_link_cb'](); 29 29 } … … 31 31 get_adjacent_row = function(which) { 32 32 var first_row, method; 33 33 34 34 if (!$.table_hotkeys.current_row) { 35 35 first_row = get_first_row(); … … 66 66 if (!clickable.length) return false; 67 67 if (clickable.is('.'+destructive_class)) next_row() || prev_row(); 68 clickable. click();68 clickable.trigger( 'click' ); 69 69 }; 70 70 }; … … 80 80 $.each(keys, function() { 81 81 var callback, key; 82 83 if ( $.isFunction(this[1])) {82 83 if ( typeof this[1] === 'function' ) { 84 84 callback = this[1]; 85 85 key = this[0]; -
trunk/src/js/_enqueues/wp/autosave.js
r50232 r50420 542 542 543 543 if ( $( '#title' ).val() !== postData.post_title ) { 544 $( '#title' ). focus().val( postData.post_title || '' );544 $( '#title' ).trigger( 'focus' ).val( postData.post_title || '' ); 545 545 } 546 546 … … 561 561 562 562 // Make sure the Text editor is selected. 563 $( '#content-html' ). click();564 $( '#content' ). focus();563 $( '#content-html' ).trigger( 'click' ); 564 $( '#content' ).trigger( 'focus' ); 565 565 566 566 // Using document.execCommand() will let the user undo. -
trunk/src/js/_enqueues/wp/dashboard.js
r50001 r50420 155 155 156 156 // Focus the title to allow for quickly drafting another post. 157 $('#title'). focus();157 $('#title').trigger( 'focus' ); 158 158 }); 159 159 … … 392 392 */ 393 393 if ( $target.hasClass( 'community-events-cancel' ) ) { 394 $toggleButton. focus();394 $toggleButton.trigger( 'focus' ); 395 395 } 396 396 } else { … … 611 611 * on screen readers don't lose their place. 612 612 */ 613 $toggleButton. focus();613 $toggleButton.trigger( 'focus' ); 614 614 } 615 615 } else { -
trunk/src/js/_enqueues/wp/svg-painter.js
r47122 r50420 161 161 162 162 // Set hover callbacks. 163 $menuitem.hover( 164 function() { 165 painter.paintElement( $element, 'focus' ); 166 }, 167 function() { 168 // Match the delay from hoverIntent. 169 window.setTimeout( function() { 170 painter.paintElement( $element, 'base' ); 171 }, 100 ); 172 } 173 ); 163 $menuitem.on( 'mouseenter', function() { 164 painter.paintElement( $element, 'focus' ); 165 } ).on( 'mouseleave', function() { 166 // Match the delay from hoverIntent. 167 window.setTimeout( function() { 168 painter.paintElement( $element, 'base' ); 169 }, 100 ); 170 } ); 174 171 } 175 172 }); -
trunk/src/js/_enqueues/wp/updates.js
r50027 r50420 630 630 $card 631 631 .removeClass( 'plugin-card-update-failed' ) 632 .find( '.column-name a' ). focus();632 .find( '.column-name a' ).trigger( 'focus' ); 633 633 634 634 $card.find( '.update-now' ) … … 802 802 $card 803 803 .removeClass( 'plugin-card-update-failed' ) 804 .find( '.column-name a' ). focus();804 .find( '.column-name a' ).trigger( 'focus' ); 805 805 }, 200 ); 806 806 } ); … … 1216 1216 // Focus on Customize button after updating. 1217 1217 if ( isModalOpen ) { 1218 $( '.load-customize:visible' ). focus();1218 $( '.load-customize:visible' ).trigger( 'focus' ); 1219 1219 $( '.theme-info .theme-autoupdate' ).find( '.auto-update-time' ).empty(); 1220 1220 } else { 1221 $theme.find( '.load-customize' ). focus();1221 $theme.find( '.load-customize' ).trigger( 'focus' ); 1222 1222 } 1223 1223 } … … 1272 1272 $notice = $( '.theme-info .notice' ).add( $theme.find( '.notice' ) ); 1273 1273 1274 $( 'body.modal-open' ).length ? $( '.load-customize:visible' ). focus() : $theme.find( '.load-customize' ).focus();1274 $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).trigger( 'focus' ) : $theme.find( '.load-customize' ).trigger( 'focus'); 1275 1275 } 1276 1276 … … 1769 1769 // #upgrade button must always be the last focus-able element in the dialog. 1770 1770 if ( 'upgrade' === event.target.id && ! event.shiftKey ) { 1771 $( '#hostname' ). focus();1771 $( '#hostname' ).trigger( 'focus' ); 1772 1772 1773 1773 event.preventDefault(); 1774 1774 } else if ( 'hostname' === event.target.id && event.shiftKey ) { 1775 $( '#upgrade' ). focus();1775 $( '#upgrade' ).trigger( 'focus' ); 1776 1776 1777 1777 event.preventDefault(); … … 1790 1790 $( 'body' ).addClass( 'modal-open' ); 1791 1791 $modal.show(); 1792 $modal.find( 'input:enabled:first' ). focus();1792 $modal.find( 'input:enabled:first' ).trigger( 'focus' ); 1793 1793 $modal.on( 'keydown', wp.updates.keydown ); 1794 1794 }; -
trunk/src/js/_enqueues/wp/widgets/text.js
r49973 r50420 60 60 event.preventDefault(); 61 61 control.customHtmlWidgetPointer.hide(); 62 $( '#' + control.fields.text.attr( 'id' ) + '-html' ). focus();62 $( '#' + control.fields.text.attr( 'id' ) + '-html' ).trigger( 'focus' ); 63 63 control.dismissPointers( [ 'text_widget_custom_html' ] ); 64 64 }); … … 279 279 showPointerElement = function( pointerElement ) { 280 280 pointerElement.show(); 281 pointerElement.find( '.close' ). focus();281 pointerElement.find( '.close' ).trigger( 'focus' ); 282 282 wp.a11y.speak( pointerElement.find( 'h3, p' ).map( function() { 283 283 return $( this ).text(); -
trunk/src/wp-includes/script-loader.php
r50409 r50420 828 828 $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 ); 829 829 $scripts->add( 'jquery-query', '/wp-includes/js/jquery/jquery.query.js', array( 'jquery' ), '2.1.7', 1 ); 830 $scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2 ', 1 );830 $scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2-wp', 1 ); 831 831 $scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array( 'jquery' ), '0.0.2m', 1 ); 832 832 $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array( 'jquery', 'jquery-hotkeys' ), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.