Make WordPress Core

Changeset 50547


Ignore:
Timestamp:
03/18/2021 06:59:34 PM (5 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Further fix jQuery deprecations in WordPress core.

Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429].

Props Clorith.
See #51812.

Location:
trunk/src/js
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/comment.js

    r50001 r50547  
    1212 * @param {jQuery} $ The jQuery object.
    1313 */
    14 jQuery(document).ready( function($) {
     14jQuery( function($) {
    1515
    1616        postboxes.add_postbox_toggles('comment');
  • trunk/src/js/_enqueues/admin/common.js

    r50429 r50547  
    484484};
    485485
    486 $document.ready(function(){columns.init();});
     486$( function() { columns.init(); } );
    487487
    488488/**
     
    803803} );
    804804
    805 $document.ready( function() {
     805$( function() {
    806806        var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions,
    807807                lastClicked = false,
     
    17071707
    17081708                        self.trigger();
    1709                         $document.on( 'wp-window-resized.wp-responsive', $.proxy( this.trigger, this ) );
     1709                        $document.on( 'wp-window-resized.wp-responsive', this.trigger.bind( this ) );
    17101710
    17111711                        // This needs to run later as UI Sortable may be initialized later on $(document).ready().
     
    18901890        }
    18911891
    1892         $( document ).ajaxComplete( function() {
     1892        $( document ).on( 'ajaxComplete', function() {
    18931893                aria_button_if_js();
    18941894        });
     
    20092009 * @since 5.5.0
    20102010 */
    2011 $document.ready( function( $ ) {
     2011$( function( $ ) {
    20122012        var $overwrite, $warning;
    20132013
  • trunk/src/js/_enqueues/admin/custom-background.js

    r50420 r50547  
    1313 */
    1414(function($) {
    15         $(document).ready(function() {
     15        $( function() {
    1616                var frame,
    1717                        bgImage = $( '#custom-background-image' );
  • trunk/src/js/_enqueues/admin/edit-comments.js

    r50420 r50547  
    12261226};
    12271227
    1228 $(document).ready(function(){
     1228$( function(){
    12291229        var make_hotkeys_redirect, edit_comment, toggle_all, make_bulk;
    12301230
  • trunk/src/js/_enqueues/admin/inline-edit-post.js

    r50001 r50547  
    517517};
    518518
    519 $( document ).ready( function(){ inlineEditPost.init(); } );
     519$( function() { inlineEditPost.init(); } );
    520520
    521521// Show/hide locks on posts.
    522 $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
     522$( function() {
     523
     524        // Set the heartbeat interval to 15 seconds.
     525        if ( typeof wp !== 'undefined' && wp.heartbeat ) {
     526                wp.heartbeat.interval( 15 );
     527        }
     528}).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
    523529        var locked = data['wp-check-locked-posts'] || {};
    524530
     
    561567                data['wp-check-locked-posts'] = check;
    562568        }
    563 }).ready( function() {
    564 
    565         // Set the heartbeat interval to 15 seconds.
    566         if ( typeof wp !== 'undefined' && wp.heartbeat ) {
    567                 wp.heartbeat.interval( 15 );
    568         }
    569569});
    570570
  • trunk/src/js/_enqueues/admin/inline-edit-tax.js

    r50001 r50547  
    290290};
    291291
    292 $(document).ready(function(){inlineEditTax.init();});
     292$( function() { inlineEditTax.init(); } );
    293293
    294294})( jQuery, window.wp );
  • trunk/src/js/_enqueues/admin/link.js

    r50420 r50547  
    55/* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */
    66
    7 jQuery(document).ready( function($) {
     7jQuery( function($) {
    88
    99        var newCat, noSyncChecks = false, syncChecks, catAddAfter;
     
    8282                        var t = $($(this).text());
    8383                        t.find( 'label' ).each( function() {
    84                                 var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o;
     84                                var th = $(this),
     85                                        val = th.find('input').val(),
     86                                        id = th.find('input')[0].id,
     87                                        name = th.text().trim(),
     88                                        o;
    8589                                $('#' + id).on( 'change', syncChecks );
    8690                                o = $( '<option value="' +  parseInt( val, 10 ) + '"></option>' ).text( name );
  • trunk/src/js/_enqueues/admin/media.js

    r50420 r50547  
    141141         * @return {void}
    142142         */
    143         $( document ).ready( function() {
     143        $( function() {
    144144                var settings, $mediaGridWrap = $( '#wp-media-grid' );
    145145
  • trunk/src/js/_enqueues/admin/plugin-install.js

    r50420 r50547  
    77/* global tb_click, tb_remove, tb_position */
    88
    9 jQuery( document ).ready( function( $ ) {
     9jQuery( function( $ ) {
    1010
    1111        var tbWindow,
  • trunk/src/js/_enqueues/admin/post.js

    r50420 r50547  
    261261        }
    262262
    263         $(document).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
     263        $( function() {
     264                schedule();
     265        }).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
    264266                var post_id,
    265267                        $authCheck = $('#wp-auth-check-wrap');
     
    287289                                window.heartbeatSettings.nonce = nonces.heartbeatNonce;
    288290                }
    289         }).ready( function() {
    290                 schedule();
    291291        });
    292292}(jQuery));
     
    295295 * All post and postbox controls and functionality.
    296296 */
    297 jQuery(document).ready( function($) {
     297jQuery( function($) {
    298298        var stamp, visibility, $submitButtons, updateVisibility, updateText,
    299299                $textarea = $('#content'),
     
    662662                        e.preventDefault();
    663663                        $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
    664                         $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
     664                        $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').trigger( 'click' );
    665665                        $('#new'+taxonomy).trigger( 'focus' );
    666666                });
  • trunk/src/js/_enqueues/admin/privacy-tools.js

    r50420 r50547  
    66
    77// Privacy request action handling.
    8 jQuery( document ).ready( function( $ ) {
     8jQuery( function( $ ) {
    99        var __ = wp.i18n.__,
    1010                copiedNoticeTimeout;
  • trunk/src/js/_enqueues/admin/site-health.js

    r50367 r50547  
    77/* global ajaxurl, ClipboardJS, SiteHealth, wp */
    88
    9 jQuery( document ).ready( function( $ ) {
     9jQuery( function( $ ) {
    1010
    1111        var __ = wp.i18n.__,
  • trunk/src/js/_enqueues/admin/tags-box.js

    r50420 r50547  
    2828                // Trim the values and ensure they are unique.
    2929                $.each( array, function( key, val ) {
    30                         val = $.trim( val );
     30                        val = val || '';
     31                        val = val.trim();
    3132
    3233                        if ( val && $.inArray( val, out ) === -1 ) {
     
    9798                        // Sanitize the current tags and push them as if they're new tags.
    9899                        $.each( current_tags, function( key, val ) {
    99                                 val = $.trim( val );
     100                                val = val || '';
     101                                val = val.trim();
    100102                                if ( val ) {
    101103                                        new_tags.push( val );
     
    149151                                var listItem, xbutton;
    150152
    151                                 val = $.trim( val );
     153                                val = val || '';
     154                                val = val.trim();
    152155
    153156                                if ( ! val )
  • trunk/src/js/_enqueues/admin/tags.js

    r50001 r50547  
    1010 /* global ajaxurl, wpAjax, showNotice, validateForm */
    1111
    12 jQuery(document).ready(function($) {
     12jQuery( function($) {
    1313
    1414        var addingTerm = false;
  • trunk/src/js/_enqueues/admin/user-profile.js

    r50420 r50547  
    320320        }
    321321
    322         $(document).ready( function() {
     322        $( function() {
    323323                var $colorpicker, $stylesheet, user_id, current_user_id,
    324324                        select       = $( '#display_name' ),
     
    375375                                }
    376376
    377                                 var display_name = $.trim( this.value ) || current_name;
     377                                var display_name = this.value.trim() || current_name;
    378378
    379379                                greeting.text( display_name );
     
    467467         * See ticket #39638.
    468468         */
    469         $( document ).ready( function() {
     469        $( function() {
    470470                if ( $( '.reset-pass-submit' ).length ) {
    471471                        $( '.reset-pass-submit button.wp-generate-pw' ).trigger( 'click' );
  • trunk/src/js/_enqueues/admin/widgets.js

    r50420 r50547  
    742742};
    743743
    744 $document.ready( function(){ wpWidgets.init(); } );
     744$( function(){ wpWidgets.init(); } );
    745745
    746746})(jQuery);
  • trunk/src/js/_enqueues/admin/xfn.js

    r50367 r50547  
    55 * @output wp-admin/js/xfn.js
    66 */
    7 jQuery( document ).ready(function( $ ) {
     7jQuery( function( $ ) {
    88        $( '#link_rel' ).prop( 'readonly', true );
    99        $( '#linkxfndiv input' ).on( 'click keyup', function() {
  • trunk/src/js/_enqueues/lib/accordion.js

    r47122 r50547  
    3232( function( $ ){
    3333
    34         $( document ).ready( function () {
     34        $( function () {
    3535
    3636                // Expand/Collapse accordion sections on click.
  • trunk/src/js/_enqueues/lib/ajax-response.js

    r50420 r50547  
    6666
    6767// Basic form validation.
    68 jQuery(document).ready( function($){
     68jQuery( function($){
    6969        $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } );
    7070});
  • trunk/src/js/_enqueues/lib/auth-check.js

    r48339 r50547  
    145145         * @param {Object} data Response data.
    146146         */
    147         $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
    148                 if ( 'wp-auth-check' in data ) {
    149                         if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
    150                                 show();
    151                         } else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
    152                                 hide();
    153                         }
    154                 }
    155         }).ready( function() {
     147        $( function() {
    156148
    157149                /**
     
    167159                        setShowTimeout();
    168160                });
     161        }).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
     162                if ( 'wp-auth-check' in data ) {
     163                        if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
     164                                show();
     165                        } else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
     166                                hide();
     167                        }
     168                }
    169169        });
    170170
  • trunk/src/js/_enqueues/lib/color-picker.js

    r50420 r50547  
    102102
    103103                        // Bind the close event.
    104                         self.close = $.proxy( self.close, self );
     104                        self.close = self.close.bind( self );
    105105
    106106                        self.initialValue = el.val();
     
    278278                                        self.element.val( '' );
    279279                                        self.toggler.css( 'backgroundColor', '' );
    280                                         if ( $.isFunction( self.options.clear ) ) {
     280                                        if ( typeof self.options.clear === 'function' ) {
    281281                                                self.options.clear.call( this, event );
    282282                                        }
  • trunk/src/js/_enqueues/lib/gallery.js

    r50420 r50547  
    55/* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */
    66
    7 jQuery(document).ready(function($) {
     7jQuery( function($) {
    88        var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false;
    99
  • trunk/src/js/_enqueues/lib/link.js

    r50420 r50547  
    9494                // If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://.
    9595                correctURL: function () {
    96                         var url = $.trim( inputs.url.val() );
     96                        var url = inputs.url.val().trim();
    9797
    9898                        if ( url && correctedURL !== url && ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( url ) ) {
     
    239239                                href = linkNode.attr( 'href' );
    240240
    241                                 if ( ! $.trim( linkText ) ) {
     241                                if ( ! linkText.trim() ) {
    242242                                        linkText = text || '';
    243243                                }
     
    313313
    314314                        return {
    315                                 href: $.trim( inputs.url.val() ),
     315                                href: inputs.url.val().trim(),
    316316                                target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null
    317317                        };
     
    426426                                        editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder', 'data-wp-temp-link': 1 } );
    427427                                        $link = editor.$( 'a[data-wp-temp-link="1"]' ).removeAttr( 'data-wp-temp-link' );
    428                                         hasText = $.trim( $link.text() );
     428                                        hasText = $link.text().trim();
    429429                                }
    430430
     
    484484                        }
    485485
    486                         selection = $.trim( selection );
     486                        selection = selection || '';
     487                        selection = selection.trim();
    487488
    488489                        if ( selection && emailRegexp.test( selection ) ) {
     
    798799        });
    799800
    800         $( document ).ready( wpLink.init );
     801        $( wpLink.init );
    801802})( jQuery, window.wpLinkL10n, window.wp );
  • trunk/src/js/_enqueues/lib/nav-menu.js

    r50420 r50547  
    13321332        };
    13331333
    1334         $(document).ready(function() {
     1334        $( function() {
    13351335
    13361336                wpNavMenu.init();
  • trunk/src/js/_enqueues/lib/quicktags.js

    r47122 r50547  
    5858
    5959                if ( typeof jQuery !== 'undefined' ) {
    60                         jQuery(document).ready(func);
     60                        jQuery( func );
    6161                } else {
    6262                        t = _domReady;
  • trunk/src/js/_enqueues/lib/user-suggest.js

    r43347 r50547  
    1515(function( $ ) {
    1616        var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
    17         $(document).ready( function() {
     17        $( function() {
    1818                var position = { offset: '0, -1' };
    1919                if ( typeof isRtl !== 'undefined' && isRtl ) {
  • trunk/src/js/_enqueues/wp/autosave.js

    r50420 r50547  
    583583                         */
    584584                        if ( checkStorage() && blog_id && ( $('#content').length || $('#excerpt').length ) ) {
    585                                 $document.ready( run );
     585                                $( run );
    586586                        }
    587587
     
    799799                         * @return {void}
    800800                         */
    801                         $document.on( 'heartbeat-send.autosave', function( event, data ) {
     801                        $( function() {
     802                                _schedule();
     803                        }).on( 'heartbeat-send.autosave', function( event, data ) {
    802804                                var autosaveData = save();
    803805
     
    849851                                $('#lost-connection-notice').hide();
    850852                                enableButtons();
    851                         }).ready( function() {
    852                                 _schedule();
    853853                        });
    854854
     
    874874                 * @return {void}
    875875                 */
    876                 $document.on( 'tinymce-editor-init.autosave', function( event, editor ) {
     876                $( function() {
     877                        // Set the initial compare string in case TinyMCE is not used or not loaded first.
     878                        setInitialCompare();
     879                }).on( 'tinymce-editor-init.autosave', function( event, editor ) {
    877880                        // Reset the initialCompare data after the TinyMCE instances have been initialized.
    878881                        if ( 'content' === editor.id || 'excerpt' === editor.id ) {
     
    882885                                }, 1000 );
    883886                        }
    884                 }).ready( function() {
    885                         // Set the initial compare string in case TinyMCE is not used or not loaded first.
    886                         setInitialCompare();
    887887                });
    888888
  • trunk/src/js/_enqueues/wp/customize/base.js

    r50001 r50547  
    198198                        $.extend( this, options || {} );
    199199
    200                         this.set = $.proxy( this.set, this );
     200                        this.set = this.set.bind( this );
    201201                },
    202202
     
    735735                         * unbound when calling $.off( 'message', this.receive );
    736736                         */
    737                         this.receive = $.proxy( this.receive, this );
     737                        this.receive = this.receive.bind( this );
    738738                        this.receive.guid = $.guid++;
    739739
  • trunk/src/js/_enqueues/wp/customize/controls.js

    r50001 r50547  
    290290                                }
    291291                        } else if ( collection.previousActiveElement ) {
    292                                 $( collection.previousActiveElement ).focus();
     292                                $( collection.previousActiveElement ).trigger( 'focus' );
    293293                                collection.previousActiveElement = null;
    294294                        }
     
    15931593                                        expand = args.completeCallback;
    15941594                                } else {
    1595                                         expand = $.proxy( function() {
     1595                                        expand = function() {
    15961596                                                section._animateChangeExpanded( function() {
    15971597                                                        sectionTitle.attr( 'tabindex', '-1' );
     
    16101610                                                overlay.addClass( 'section-open' );
    16111611                                                api.state( 'expandedSection' ).set( section );
    1612                                         }, this );
     1612                                        }.bind( this );
    16131613                                }
    16141614
     
    26972697                                        expand = args.completeCallback;
    26982698                                } else {
    2699                                         expand = $.proxy( function() {
     2699                                        expand = function() {
    27002700                                                section._animateChangeExpanded( function() {
    27012701                                                        sectionTitle.attr( 'tabindex', '-1' );
    27022702                                                        backBtn.attr( 'tabindex', '0' );
    27032703
    2704                                                         backBtn.focus();
     2704                                                        backBtn.trigger( 'focus' );
    27052705                                                        content.css( 'top', '' );
    27062706                                                        container.scrollTop( 0 );
     
    27122712
    27132713                                                content.addClass( 'open' );
    2714                                         }, this );
     2714                                        }.bind( this );
    27152715                                }
    27162716
     
    29572957                                                backBtn.attr( 'tabindex', '0' );
    29582958
    2959                                                 backBtn.focus();
     2959                                                backBtn.trigger( 'focus' );
    29602960                                                accordionSection.css( 'top', '' );
    29612961                                                container.scrollTop( 0 );
     
    38753875                        control.container.toggleClass( 'has-notifications', 0 !== notifications.length );
    38763876                        control.container.toggleClass( 'has-error', hasError );
    3877                         container.empty().append( $.trim(
    3878                                 control.notificationsTemplate( { notifications: notifications, altNotice: Boolean( control.altNotice ) } )
    3879                         ) );
     3877                        container.empty().append(
     3878                                control.notificationsTemplate( { notifications: notifications, altNotice: Boolean( control.altNotice ) } ).trim()
     3879                        );
    38803880                },
    38813881
  • trunk/src/js/_enqueues/wp/customize/nav-menus.js

    r50001 r50547  
    219219                        // Clear the search results and trigger an `input` event to fire a new search.
    220220                        this.$clearResults.on( 'click', function() {
    221                                 self.$search.val( '' ).focus().trigger( 'input' );
     221                                self.$search.val( '' ).trigger( 'focus' ).trigger( 'input' );
    222222                        } );
    223223
     
    447447                                                return;
    448448                                        } else if ( ( 'post_type:page' === name ) && ( ! availableMenuItemContainers[ name ].hasClass( 'open' ) ) ) {
    449                                                 availableMenuItemContainers[ name ].find( '.accordion-section-title > button' ).click();
     449                                                availableMenuItemContainers[ name ].find( '.accordion-section-title > button' ).trigger( 'click' );
    450450                                        }
    451451                                        typeItems = new api.Menus.AvailableItemCollection( typeItems ); // @todo Why is this collection created and then thrown away?
     
    645645                        }
    646646
    647                         if ( '' === $.trim( itemName.val() ) ) {
     647                        if ( '' === itemName.val().trim() ) {
    648648                                itemName.addClass( 'invalid' );
    649649                                itemName.focus();
     
    717717                        this.$el.find( '.selected' ).removeClass( 'selected' );
    718718
    719                         this.$search.focus();
     719                        this.$search.trigger( 'focus' );
    720720                },
    721721
     
    18801880                        // Ensure that whitespace is trimmed on blur so placeholder can be shown.
    18811881                        control.container.find( '.edit-menu-item-title' ).on( 'blur', function() {
    1882                                 $( this ).val( $.trim( $( this ).val() ) );
     1882                                $( this ).val( $( this ).val().trim() );
    18831883                        } );
    18841884
     
    18891889                                        return;
    18901890                                }
    1891                                 trimmedTitle = $.trim( item.title );
     1891                                item.title = item.title || '';
     1892                                trimmedTitle = item.title.trim();
    18921893
    18931894                                titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled;
  • trunk/src/js/_enqueues/wp/customize/widgets.js

    r49586 r50547  
    196196                        // Clear the search results and trigger an `input` event to fire a new search.
    197197                        this.$clearResults.on( 'click', function() {
    198                                 self.$search.val( '' ).focus().trigger( 'input' );
     198                                self.$search.val( '' ).trigger( 'focus' ).trigger( 'input' );
    199199                        } );
    200200
     
    366366
    367367                        if ( ! api.settings.browser.mobile ) {
    368                                 this.$search.focus();
     368                                this.$search.trigger( 'focus' );
    369369                        }
    370370                },
     
    422422
    423423                                if ( selected ) {
    424                                         selected.focus();
     424                                        selected.trigger( 'focus' );
    425425                                } else {
    426                                         this.$search.focus();
     426                                        this.$search.trigger( 'focus' );
    427427                                }
    428428
     
    819819                                        return;
    820820                                }
    821                                 $( this ).focus();
     821                                $( this ).trigger( 'focus' );
    822822
    823823                                if ( $( this ).is( '.move-widget' ) ) {
     
    840840                                        }
    841841
    842                                         $( this ).focus(); // Re-focus after the container was moved.
     842                                        $( this ).trigger( 'focus' ); // Re-focus after the container was moved.
    843843                                }
    844844                        } );
     
    11041104                                input.prop( 'checked', state );
    11051105                        } else if ( input.is( 'select[multiple]' ) ) {
    1106                                 if ( ! $.isArray( state ) ) {
     1106                                if ( ! Array.isArray( state ) ) {
    11071107                                        state = [];
    11081108                                } else {
     
    20902090                        }
    20912091
    2092                         controlHtml = $.trim( $( '#widget-tpl-' + widget.get( 'id' ) ).html() );
     2092                        controlHtml = $( '#widget-tpl-' + widget.get( 'id' ) ).html().trim();
    20932093                        if ( widget.get( 'is_multi' ) ) {
    20942094                                controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) {
  • trunk/src/js/_enqueues/wp/dashboard.js

    r50420 r50547  
    1313 * @since 2.7.0
    1414 */
    15 jQuery(document).ready( function($) {
     15jQuery( function($) {
    1616        var welcomePanel = $( '#welcome-panel' ),
    1717                welcomePanelHide = $('#wp_welcome_panel-hide'),
     
    329329                         */
    330330                        $container.on( 'submit', '.community-events-form', function( event ) {
    331                                 var location = $.trim( $( '#community-events-location' ).val() );
     331                                var location = $( '#community-events-location' ).val().trim();
    332332
    333333                                event.preventDefault();
  • trunk/src/js/_enqueues/wp/editor/base.js

    r49841 r50547  
    11791179
    11801180                if ( $ ) {
    1181                         $( document ).ready( init );
     1181                        $( init );
    11821182                } else if ( document.addEventListener ) {
    11831183                        document.addEventListener( 'DOMContentLoaded', init, false );
  • trunk/src/js/_enqueues/wp/heartbeat.js

    r48168 r50547  
    235235
    236236                        // Start one tick after DOM ready.
    237                         $document.ready( function() {
     237                        $( function() {
    238238                                settings.lastTick = time();
    239239                                scheduleNextTick();
  • trunk/src/js/_enqueues/wp/svg-painter.js

    r50420 r50547  
    1313                elements = [];
    1414
    15         $(document).ready( function() {
     15        $( function() {
    1616                // Detection for browser SVG capability.
    1717                if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
  • trunk/src/js/_enqueues/wp/theme-plugin-editor.js

    r50001 r50547  
    329329                 */
    330330                codeEditorSettings.onTabPrevious = function() {
    331                         $( '#templateside' ).find( ':tabbable' ).last().focus();
     331                        $( '#templateside' ).find( ':tabbable' ).last().trigger( 'focus' );
    332332                };
    333333
     
    340340                 */
    341341                codeEditorSettings.onTabNext = function() {
    342                         $( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().focus();
     342                        $( '#template' ).find( ':tabbable:not(.CodeMirror-code)' ).first().trigger( 'focus' );
    343343                };
    344344
  • trunk/src/js/_enqueues/wp/theme.js

    r50001 r50547  
    20622062
    20632063// Ready...
    2064 $( document ).ready(function() {
     2064$( function() {
    20652065        if ( themes.isInstall ) {
    20662066                themes.RunInstaller.init();
     
    20902090
    20912091// Align theme browser thickbox.
    2092 jQuery(document).ready( function($) {
     2092jQuery( function($) {
    20932093        window.tb_position = function() {
    20942094                var tbWindow = $('#TB_window'),
  • trunk/src/js/_enqueues/wp/updates.js

    r50420 r50547  
    18041804
    18051805                if ( wp.updates.$elToReturnFocusToFromCredentialsModal ) {
    1806                         wp.updates.$elToReturnFocusToFromCredentialsModal.focus();
     1806                        wp.updates.$elToReturnFocusToFromCredentialsModal.trigger( 'focus' );
    18071807                }
    18081808        };
  • trunk/src/js/_enqueues/wp/widgets/media.js

    r50001 r50547  
    552552                        control.$el.on( 'input change', '.title', function updateTitle() {
    553553                                control.model.set({
    554                                         title: $.trim( $( this ).val() )
     554                                        title: $( this ).val().trim()
    555555                                });
    556556                        });
     
    558558                        // Update link_url attribute.
    559559                        control.$el.on( 'input change', '.link', function updateLinkUrl() {
    560                                 var linkUrl = $.trim( $( this ).val() ), linkType = 'custom';
     560                                var linkUrl = $( this ).val().trim(), linkType = 'custom';
    561561                                if ( control.selectedAttachment.get( 'linkUrl' ) === linkUrl || control.selectedAttachment.get( 'link' ) === linkUrl ) {
    562562                                        linkType = 'post';
  • trunk/src/js/media/views/embed/url.js

    r46800 r50547  
    5858
    5959        url: function( event ) {
    60                 this.model.set( 'url', $.trim( event.target.value ) );
     60                var url = event.target.value || '';
     61                this.model.set( 'url', url.trim() );
    6162        }
    6263});
  • trunk/src/js/media/views/modal.js

    r50264 r50547  
    134134
    135135                // Pause current audio/video even after closing the modal.
    136                 $( '.mejs-pause button' ).click();
     136                $( '.mejs-pause button' ).trigger( 'click' );
    137137
    138138                // Enable page scrolling.
     
    156156                        $( '#wpbody-content' )
    157157                                .attr( 'tabindex', '-1' )
    158                                 .focus();
     158                                .trigger( 'focus' );
    159159                }
    160160
  • trunk/src/js/media/views/uploader/inline.js

    r50352 r50547  
    135135                                .attr( 'aria-expanded', 'false' )
    136136                                // Move focus back to the toggle button when closing the uploader.
    137                                 .focus();
     137                                .trigger( 'focus' );
    138138                }
    139139        }
Note: See TracChangeset for help on using the changeset viewer.