Skip to:
Content

BuddyPress.org

Ticket #8422: 8422.2.diff

File 8422.2.diff, 8.8 KB (added by imath, 4 years ago)
  • src/bp-activity/js/mentions.js

    diff --git src/bp-activity/js/mentions.js src/bp-activity/js/mentions.js
    index 17407faaf..3fbdd9d0c 100644
    window.bp = window.bp || {}; 
    2020         * @since 2.1.0
    2121         */
    2222        $.fn.bp_mentions = function( options ) {
    23                 if ( $.isArray( options ) ) {
     23                if ( Array.isArray( options ) ) {
    2424                        options = { data: options };
    2525                }
    2626
  • src/bp-templates/bp-legacy/js/buddypress.js

    diff --git src/bp-templates/bp-legacy/js/buddypress.js src/bp-templates/bp-legacy/js/buddypress.js
    index 338644fa1..268b727a2 100644
    jq(document).ready( function() { 
    4949        /**** Activity Posting ********************************************************/
    5050
    5151        /* Textarea focus */
    52         $whats_new.focus( function(){
     52        $whats_new.on( 'focus', function() {
    5353                jq( '#whats-new-options' ).slideDown();
    5454
    5555                jq( this ).animate({
    jq(document).ready( function() { 
    8080                                jq( '#activity-filter-select select' ).trigger( 'change' );
    8181                        }
    8282                }
    83         });
     83        } );
    8484
    8585        /* For the "What's New" form, do the following on focusout. */
    8686        jq( '#whats-new-form' ).on( 'focusout', function( e ) {
    jq(document).ready( function() { 
    124124                                        inputs[ input.name ] = input.value;
    125125                                } else {
    126126                                        // Checkboxes/dropdown list can have multiple selected value
    127                                         if ( ! jq.isArray( inputs[ input.name ] ) ) {
     127                                        if ( ! Array.isArray( inputs[ input.name ] ) ) {
    128128                                                inputs[ input.name ] = new Array( inputs[ input.name ], input.value );
    129129                                        } else {
    130130                                                inputs[ input.name ].push( input.value );
    jq(document).ready( function() { 
    275275        });
    276276
    277277        /* Activity filter select */
    278         jq('#activity-filter-select select').change( function() {
     278        jq( '#activity-filter-select select' ).on( 'change', function() {
    279279                var selected_tab = jq( 'div.activity-type-tabs li.selected' ),
    280280                        filter = jq(this).val(),
    281281                        scope;
    jq(document).ready( function() { 
    289289                bp_activity_request(scope, filter);
    290290
    291291                return false;
    292         });
     292        } );
    293293
    294294        /* Stream event delegation */
    295295        jq('div.activity').on( 'click', function(event) {
    jq(document).ready( function() { 
    800800        });
    801801
    802802        /* Escape Key Press for cancelling comment forms */
    803         jq(document).keydown( function(e) {
     803        jq(document).on( 'keydown', function(e) {
    804804                e = e || window.event;
    805805                if (e.target) {
    806806                        element = e.target;
    jq(document).ready( function() { 
    898898        });
    899899
    900900        /* When the filter select box is changed re-query */
    901         jq('li.filter select').change( function() {
     901        jq( 'li.filter select' ).on( 'change', function() {
    902902                var el,
    903903                        css_id, object, scope, filter, search_terms, template,
    904904                        $gm_search;
    jq(document).ready( function() { 
    944944                bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template );
    945945
    946946                return false;
    947         });
     947        } );
    948948
    949949        /* All pagination links run through this function */
    950950        jq('#buddypress').on( 'click', function(event) {
    jq(document).ready( function() { 
    11641164                        .show().removeClass( 'field-visibility-settings-hide' );
    11651165        } );
    11661166
    1167         jq('#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select').change( function() {
     1167        jq( '#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select' ).on( 'change', function() {
    11681168                var shouldconfirm = true;
    11691169
    11701170                jq('#profile-edit-form input:submit, #signup_form input:submit').on( 'click', function() {
    jq(document).ready( function() { 
    11761176                                return BP_DTheme.unsaved_changes;
    11771177                        }
    11781178                };
    1179         });
     1179        } );
    11801180
    11811181        /** Friendship Requests **************************************/
    11821182
    jq(document).ready( function() { 
    14191419        });
    14201420
    14211421        /* AJAX send reply functionality */
    1422         jq('#send_reply_button').click(
     1422        jq( '#send_reply_button' ).on( 'click',
    14231423                function() {
    14241424                        var order = jq('#messages_order').val() || 'ASC',
    14251425                                offset  = jq('#message-recipients').offset(),
    jq(document).ready( function() { 
    14911491        });
    14921492
    14931493        /* Selecting/Deselecting all messages */
    1494         jq('#select-all-messages').click(function(event) {
    1495                 if( this.checked ) {
    1496                         jq('.message-check').each(function() {
     1494        jq( '#select-all-messages' ).on( 'click', function() {
     1495                if ( this.checked ) {
     1496                        jq( '.message-check' ).each( function() {
    14971497                                this.checked = true;
    1498                         });
     1498                        } );
    14991499                } else {
    1500                         jq('.message-check').each(function() {
     1500                        jq( '.message-check' ).each( function() {
    15011501                                this.checked = false;
    1502                         });
     1502                        } );
    15031503                }
    1504         });
     1504        } );
    15051505
    15061506        /* Make sure a 'Bulk Action' is selected before submitting the messages bulk action form */
    15071507        jq('#messages-bulk-manage').attr('disabled', 'disabled');
    jq(document).ready( function() { 
    15901590        /** Notifications **********************************************/
    15911591
    15921592        /* Selecting/Deselecting all notifications */
    1593         jq('#select-all-notifications').click(function(event) {
    1594                 if( this.checked ) {
    1595                         jq('.notification-check').each(function() {
     1593        jq( '#select-all-notifications' ).on( 'click', function() {
     1594                if ( this.checked ) {
     1595                        jq( '.notification-check' ).each( function() {
    15961596                                this.checked = true;
    1597                         });
     1597                        } );
    15981598                } else {
    1599                         jq('.notification-check').each(function() {
     1599                        jq( '.notification-check' ).each( function() {
    16001600                                this.checked = false;
    1601                         });
     1601                        } );
    16021602                }
    1603         });
     1603        } );
    16041604
    16051605        /* Make sure a 'Bulk Action' is selected before submitting the form */
    16061606        jq('#notification-bulk-manage').attr('disabled', 'disabled');
    jq(document).ready( function() { 
    16341634        });
    16351635
    16361636        /* Toolbar & wp_list_pages JavaScript IE6 hover class */
    1637         jq('#wp-admin-bar ul.main-nav li, #nav li').mouseover( function() {
     1637        jq('#wp-admin-bar ul.main-nav li, #nav li').on( 'mouseover', function() {
    16381638                jq(this).addClass('sfhover');
    16391639        });
    16401640
    1641         jq('#wp-admin-bar ul.main-nav li, #nav li').mouseout( function() {
     1641        jq('#wp-admin-bar ul.main-nav li, #nav li').on( 'mouseout', function() {
    16421642                jq(this).removeClass('sfhover');
    16431643        });
    16441644
  • src/bp-xprofile/admin/js/admin.js

    diff --git src/bp-xprofile/admin/js/admin.js src/bp-xprofile/admin/js/admin.js
    index 07d7cc0fd..f4f522489 100644
    function titleHint( id ) { 
    171171                titleprompt.addClass('screen-reader-text');
    172172        }
    173173
    174         titleprompt.click(function(){
     174        titleprompt.on( 'click', function(){
    175175                jQuery(this).addClass('screen-reader-text');
    176176                title.focus();
    177177        });
    178178
    179         title.blur(function(){
     179        title.on( 'blur', function(){
    180180                if ( '' === this.value ) {
    181181                        titleprompt.removeClass('screen-reader-text');
    182182                }
    183         }).focus(function(){
     183        }).on( 'focus', function(){
    184184                titleprompt.addClass('screen-reader-text');
    185         }).keydown(function(e){
     185        }).on( 'keydown', function(e){
    186186                titleprompt.addClass('screen-reader-text');
    187187                jQuery(this).unbind(e);
    188188        });
    function titleHint( id ) { 
    191191jQuery( document ).ready( function() {
    192192
    193193        // Set focus in Field Title, if we're on the right page.
    194         jQuery( '#bp-xprofile-add-field #title' ).focus();
     194        jQuery( '#bp-xprofile-add-field #title' ).trigger( 'focus' );
    195195
    196196        // Set up the notice that shows when no member types are selected for a field.
    197197        toggle_no_member_type_notice();
    jQuery( document ).ready( function() { 
    214214        } );
    215215
    216216        // Set up the sort order change actions.
    217         jQuery( '[id^="sort_order_"]' ).change(function() {
     217        jQuery( '[id^="sort_order_"]' ).on( 'change', function() {
    218218                if ( jQuery( this ).val() !== 'custom' ) {
    219219                        destroySortableFieldOptions();
    220220                } else {
    221221                        enableSortableFieldOptions( jQuery('#fieldtype :selected').val() );
    222222                }
    223         });
     223        } );
    224224
    225225        // Show object if JS is enabled.
    226226        jQuery( 'ul#field-group-tabs' ).show();
    jQuery( document ).ready( function() { 
    276276        var $date_format = jQuery( 'input[name="date_format"]' );
    277277        var $date_format_custom_value = jQuery( '#date-format-custom-value' );
    278278        var $date_format_sample = jQuery( '#date-format-custom-sample' );
    279         $date_format.click( function( e ) {
     279        $date_format.on( 'click', function( e ) {
    280280                switch ( e.target.value ) {
    281281                        case 'elapsed' :
    282282                                $date_format_custom_value.val( '' );
    jQuery( document ).ready( function() { 
    295295
    296296        // Clicking into the custom date format field should select the Custom radio button.
    297297        var $date_format_custom = jQuery( '#date-format-custom' );
    298         $date_format_custom_value.focus( function() {
     298        $date_format_custom_value.on( 'focus', function() {
    299299                $date_format_custom.prop( 'checked', 'checked' );
    300300        } );
    301301
    302302        // Validate custom date field.
    303303        var $date_format_spinner = jQuery( '#date-format-custom-spinner' );
    304         $date_format_custom_value.change( function( e ) {
     304        $date_format_custom_value.on( 'change', function( e ) {
    305305                $date_format_spinner.addClass( 'is-active' );
    306306                jQuery.post( ajaxurl, {
    307307                        action: 'date_format',