diff --git src/bp-activity/js/mentions.js src/bp-activity/js/mentions.js
index 17407faaf..3fbdd9d0c 100644
|
|
|
window.bp = window.bp || {}; |
| 20 | 20 | * @since 2.1.0 |
| 21 | 21 | */ |
| 22 | 22 | $.fn.bp_mentions = function( options ) { |
| 23 | | if ( $.isArray( options ) ) { |
| | 23 | if ( Array.isArray( options ) ) { |
| 24 | 24 | options = { data: options }; |
| 25 | 25 | } |
| 26 | 26 | |
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() { |
| 49 | 49 | /**** Activity Posting ********************************************************/ |
| 50 | 50 | |
| 51 | 51 | /* Textarea focus */ |
| 52 | | $whats_new.focus( function(){ |
| | 52 | $whats_new.on( 'focus', function() { |
| 53 | 53 | jq( '#whats-new-options' ).slideDown(); |
| 54 | 54 | |
| 55 | 55 | jq( this ).animate({ |
| … |
… |
jq(document).ready( function() { |
| 80 | 80 | jq( '#activity-filter-select select' ).trigger( 'change' ); |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | | }); |
| | 83 | } ); |
| 84 | 84 | |
| 85 | 85 | /* For the "What's New" form, do the following on focusout. */ |
| 86 | 86 | jq( '#whats-new-form' ).on( 'focusout', function( e ) { |
| … |
… |
jq(document).ready( function() { |
| 124 | 124 | inputs[ input.name ] = input.value; |
| 125 | 125 | } else { |
| 126 | 126 | // Checkboxes/dropdown list can have multiple selected value |
| 127 | | if ( ! jq.isArray( inputs[ input.name ] ) ) { |
| | 127 | if ( ! Array.isArray( inputs[ input.name ] ) ) { |
| 128 | 128 | inputs[ input.name ] = new Array( inputs[ input.name ], input.value ); |
| 129 | 129 | } else { |
| 130 | 130 | inputs[ input.name ].push( input.value ); |
| … |
… |
jq(document).ready( function() { |
| 275 | 275 | }); |
| 276 | 276 | |
| 277 | 277 | /* Activity filter select */ |
| 278 | | jq('#activity-filter-select select').change( function() { |
| | 278 | jq( '#activity-filter-select select' ).on( 'change', function() { |
| 279 | 279 | var selected_tab = jq( 'div.activity-type-tabs li.selected' ), |
| 280 | 280 | filter = jq(this).val(), |
| 281 | 281 | scope; |
| … |
… |
jq(document).ready( function() { |
| 289 | 289 | bp_activity_request(scope, filter); |
| 290 | 290 | |
| 291 | 291 | return false; |
| 292 | | }); |
| | 292 | } ); |
| 293 | 293 | |
| 294 | 294 | /* Stream event delegation */ |
| 295 | 295 | jq('div.activity').on( 'click', function(event) { |
| … |
… |
jq(document).ready( function() { |
| 800 | 800 | }); |
| 801 | 801 | |
| 802 | 802 | /* Escape Key Press for cancelling comment forms */ |
| 803 | | jq(document).keydown( function(e) { |
| | 803 | jq(document).on( 'keydown', function(e) { |
| 804 | 804 | e = e || window.event; |
| 805 | 805 | if (e.target) { |
| 806 | 806 | element = e.target; |
| … |
… |
jq(document).ready( function() { |
| 898 | 898 | }); |
| 899 | 899 | |
| 900 | 900 | /* When the filter select box is changed re-query */ |
| 901 | | jq('li.filter select').change( function() { |
| | 901 | jq( 'li.filter select' ).on( 'change', function() { |
| 902 | 902 | var el, |
| 903 | 903 | css_id, object, scope, filter, search_terms, template, |
| 904 | 904 | $gm_search; |
| … |
… |
jq(document).ready( function() { |
| 944 | 944 | bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template ); |
| 945 | 945 | |
| 946 | 946 | return false; |
| 947 | | }); |
| | 947 | } ); |
| 948 | 948 | |
| 949 | 949 | /* All pagination links run through this function */ |
| 950 | 950 | jq('#buddypress').on( 'click', function(event) { |
| … |
… |
jq(document).ready( function() { |
| 1164 | 1164 | .show().removeClass( 'field-visibility-settings-hide' ); |
| 1165 | 1165 | } ); |
| 1166 | 1166 | |
| 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() { |
| 1168 | 1168 | var shouldconfirm = true; |
| 1169 | 1169 | |
| 1170 | 1170 | jq('#profile-edit-form input:submit, #signup_form input:submit').on( 'click', function() { |
| … |
… |
jq(document).ready( function() { |
| 1176 | 1176 | return BP_DTheme.unsaved_changes; |
| 1177 | 1177 | } |
| 1178 | 1178 | }; |
| 1179 | | }); |
| | 1179 | } ); |
| 1180 | 1180 | |
| 1181 | 1181 | /** Friendship Requests **************************************/ |
| 1182 | 1182 | |
| … |
… |
jq(document).ready( function() { |
| 1419 | 1419 | }); |
| 1420 | 1420 | |
| 1421 | 1421 | /* AJAX send reply functionality */ |
| 1422 | | jq('#send_reply_button').click( |
| | 1422 | jq( '#send_reply_button' ).on( 'click', |
| 1423 | 1423 | function() { |
| 1424 | 1424 | var order = jq('#messages_order').val() || 'ASC', |
| 1425 | 1425 | offset = jq('#message-recipients').offset(), |
| … |
… |
jq(document).ready( function() { |
| 1491 | 1491 | }); |
| 1492 | 1492 | |
| 1493 | 1493 | /* 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() { |
| 1497 | 1497 | this.checked = true; |
| 1498 | | }); |
| | 1498 | } ); |
| 1499 | 1499 | } else { |
| 1500 | | jq('.message-check').each(function() { |
| | 1500 | jq( '.message-check' ).each( function() { |
| 1501 | 1501 | this.checked = false; |
| 1502 | | }); |
| | 1502 | } ); |
| 1503 | 1503 | } |
| 1504 | | }); |
| | 1504 | } ); |
| 1505 | 1505 | |
| 1506 | 1506 | /* Make sure a 'Bulk Action' is selected before submitting the messages bulk action form */ |
| 1507 | 1507 | jq('#messages-bulk-manage').attr('disabled', 'disabled'); |
| … |
… |
jq(document).ready( function() { |
| 1590 | 1590 | /** Notifications **********************************************/ |
| 1591 | 1591 | |
| 1592 | 1592 | /* 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() { |
| 1596 | 1596 | this.checked = true; |
| 1597 | | }); |
| | 1597 | } ); |
| 1598 | 1598 | } else { |
| 1599 | | jq('.notification-check').each(function() { |
| | 1599 | jq( '.notification-check' ).each( function() { |
| 1600 | 1600 | this.checked = false; |
| 1601 | | }); |
| | 1601 | } ); |
| 1602 | 1602 | } |
| 1603 | | }); |
| | 1603 | } ); |
| 1604 | 1604 | |
| 1605 | 1605 | /* Make sure a 'Bulk Action' is selected before submitting the form */ |
| 1606 | 1606 | jq('#notification-bulk-manage').attr('disabled', 'disabled'); |
| … |
… |
jq(document).ready( function() { |
| 1634 | 1634 | }); |
| 1635 | 1635 | |
| 1636 | 1636 | /* 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() { |
| 1638 | 1638 | jq(this).addClass('sfhover'); |
| 1639 | 1639 | }); |
| 1640 | 1640 | |
| 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() { |
| 1642 | 1642 | jq(this).removeClass('sfhover'); |
| 1643 | 1643 | }); |
| 1644 | 1644 | |
diff --git src/bp-xprofile/admin/js/admin.js src/bp-xprofile/admin/js/admin.js
index 07d7cc0fd..f4f522489 100644
|
|
|
function titleHint( id ) { |
| 171 | 171 | titleprompt.addClass('screen-reader-text'); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | | titleprompt.click(function(){ |
| | 174 | titleprompt.on( 'click', function(){ |
| 175 | 175 | jQuery(this).addClass('screen-reader-text'); |
| 176 | 176 | title.focus(); |
| 177 | 177 | }); |
| 178 | 178 | |
| 179 | | title.blur(function(){ |
| | 179 | title.on( 'blur', function(){ |
| 180 | 180 | if ( '' === this.value ) { |
| 181 | 181 | titleprompt.removeClass('screen-reader-text'); |
| 182 | 182 | } |
| 183 | | }).focus(function(){ |
| | 183 | }).on( 'focus', function(){ |
| 184 | 184 | titleprompt.addClass('screen-reader-text'); |
| 185 | | }).keydown(function(e){ |
| | 185 | }).on( 'keydown', function(e){ |
| 186 | 186 | titleprompt.addClass('screen-reader-text'); |
| 187 | 187 | jQuery(this).unbind(e); |
| 188 | 188 | }); |
| … |
… |
function titleHint( id ) { |
| 191 | 191 | jQuery( document ).ready( function() { |
| 192 | 192 | |
| 193 | 193 | // 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' ); |
| 195 | 195 | |
| 196 | 196 | // Set up the notice that shows when no member types are selected for a field. |
| 197 | 197 | toggle_no_member_type_notice(); |
| … |
… |
jQuery( document ).ready( function() { |
| 214 | 214 | } ); |
| 215 | 215 | |
| 216 | 216 | // Set up the sort order change actions. |
| 217 | | jQuery( '[id^="sort_order_"]' ).change(function() { |
| | 217 | jQuery( '[id^="sort_order_"]' ).on( 'change', function() { |
| 218 | 218 | if ( jQuery( this ).val() !== 'custom' ) { |
| 219 | 219 | destroySortableFieldOptions(); |
| 220 | 220 | } else { |
| 221 | 221 | enableSortableFieldOptions( jQuery('#fieldtype :selected').val() ); |
| 222 | 222 | } |
| 223 | | }); |
| | 223 | } ); |
| 224 | 224 | |
| 225 | 225 | // Show object if JS is enabled. |
| 226 | 226 | jQuery( 'ul#field-group-tabs' ).show(); |
| … |
… |
jQuery( document ).ready( function() { |
| 276 | 276 | var $date_format = jQuery( 'input[name="date_format"]' ); |
| 277 | 277 | var $date_format_custom_value = jQuery( '#date-format-custom-value' ); |
| 278 | 278 | var $date_format_sample = jQuery( '#date-format-custom-sample' ); |
| 279 | | $date_format.click( function( e ) { |
| | 279 | $date_format.on( 'click', function( e ) { |
| 280 | 280 | switch ( e.target.value ) { |
| 281 | 281 | case 'elapsed' : |
| 282 | 282 | $date_format_custom_value.val( '' ); |
| … |
… |
jQuery( document ).ready( function() { |
| 295 | 295 | |
| 296 | 296 | // Clicking into the custom date format field should select the Custom radio button. |
| 297 | 297 | var $date_format_custom = jQuery( '#date-format-custom' ); |
| 298 | | $date_format_custom_value.focus( function() { |
| | 298 | $date_format_custom_value.on( 'focus', function() { |
| 299 | 299 | $date_format_custom.prop( 'checked', 'checked' ); |
| 300 | 300 | } ); |
| 301 | 301 | |
| 302 | 302 | // Validate custom date field. |
| 303 | 303 | 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 ) { |
| 305 | 305 | $date_format_spinner.addClass( 'is-active' ); |
| 306 | 306 | jQuery.post( ajaxurl, { |
| 307 | 307 | action: 'date_format', |