Changeset 8754
- Timestamp:
- 08/03/2014 08:52:05 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r8551 r8754 7 7 8 8 BP_CSS = [ 9 'bp-activity/css/*.css', 9 10 'bp-activity/admin/css/*.css', 10 11 'bp-core/admin/css/*.css', … … 19 20 20 21 BP_JS = [ 22 'bp-activity/js/*.js', 21 23 'bp-activity/admin/js/*.js', 22 24 'bp-core/js/*.js', … … 31 33 32 34 BP_EXCLUDED_JS = [ 35 '!bp-core/js/jquery.atwho.js', 36 '!bp-core/js/jquery.caret.js', 33 37 '!bp-templates/bp-legacy/js/*.js' 34 38 ]; -
trunk/src/bp-activity/bp-activity-actions.php
r8662 r8754 648 648 $bp->activity->akismet = new BP_Akismet(); 649 649 } 650 651 /** 652 * AJAX endpoint for Suggestions API lookups. 653 * 654 * @since BuddyPress (2.1.0) 655 */ 656 function bp_ajax_get_suggestions() { 657 if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) { 658 wp_send_json_error( 'missing_parameter' ); 659 exit; 660 } 661 662 $results = bp_core_get_suggestions( array( 663 'term' => sanitize_text_field( $_GET['term'] ), 664 'type' => sanitize_text_field( $_GET['type'] ), 665 ) ); 666 667 if ( is_wp_error( $results ) ) { 668 wp_send_json_error( $results->get_error_message() ); 669 exit; 670 } 671 672 wp_send_json_success( $results ); 673 } 674 add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' ); -
trunk/src/bp-activity/bp-activity-functions.php
r8716 r8754 47 47 function bp_activity_do_mentions() { 48 48 return (bool) apply_filters( 'bp_activity_do_mentions', true ); 49 } 50 51 /** 52 * Should BuddyPress load the mentions scripts and related assets, including results to prime the 53 * mentions suggestions? 54 * 55 * @return bool True if mentions scripts should be loaded. 56 * @since BuddyPress (2.1.0) 57 */ 58 function bp_activity_maybe_load_mentions_scripts() { 59 $retval = 60 bp_activity_do_mentions() && 61 bp_is_user_active() && 62 ( bp_is_activity_component() || bp_is_blog_page() && is_singular() && comments_open() || is_admin() ); 63 64 return (bool) apply_filters( 'bp_activity_maybe_load_mentions_scripts', $retval ); 49 65 } 50 66 -
trunk/src/bp-activity/bp-activity-loader.php
r8705 r8754 48 48 // Files to include 49 49 $includes = array( 50 'cssjs', 50 51 'actions', 51 52 'screens', -
trunk/src/bp-core/bp-core-cssjs.php
r8673 r8754 20 20 21 21 $scripts = apply_filters( 'bp_core_register_common_scripts', array( 22 // Legacy 22 23 'bp-confirm' => array( 'file' => "{$url}confirm{$ext}", 'dependencies' => array( 'jquery' ) ), 23 24 'bp-widget-members' => array( 'file' => "{$url}widget-members{$ext}", 'dependencies' => array( 'jquery' ) ), 24 25 'bp-jquery-query' => array( 'file' => "{$url}jquery-query{$ext}", 'dependencies' => array( 'jquery' ) ), 25 26 'bp-jquery-cookie' => array( 'file' => "{$url}jquery-cookie{$ext}", 'dependencies' => array( 'jquery' ) ), 27 28 // 2.1 29 'jquery-caret' => array( 'file' => "{$url}jquery.caret{$ext}", 'dependencies' => array( 'jquery' ) ), 30 'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$ext}", 'dependencies' => array( 'jquery', 'jquery-caret' ) ), 26 31 ) ); 27 32 -
trunk/src/bp-friends/bp-friends-functions.php
r8514 r8754 567 567 add_action( 'delete_user', 'friends_remove_data' ); 568 568 add_action( 'bp_make_spam_user', 'friends_remove_data' ); 569 570 /** 571 * Used by the Activity component's @mentions to print a JSON list of the current user's friends. 572 * 573 * This is intended to speed up @mentions lookups for a majority of use cases. 574 * 575 * @see bp_activity_mentions_script() 576 */ 577 function bp_friends_prime_mentions_results() { 578 if ( ! bp_activity_maybe_load_mentions_scripts() ) { 579 return; 580 } 581 582 $friends_query = array( 583 'count_total' => '', // Prevents total count 584 'populate_extras' => false, 585 586 'type' => 'alphabetical', 587 'user_id' => get_current_user_id(), 588 ); 589 590 $friends_query = new BP_User_Query( $friends_query ); 591 $results = array(); 592 593 foreach ( $friends_query->results as $user ) { 594 $result = new stdClass(); 595 $result->ID = $user->user_nicename; 596 $result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) ); 597 $result->name = bp_core_get_user_displayname( $user->ID ); 598 599 $results[] = $result; 600 } 601 602 wp_localize_script( 'bp-mentions', 'BP_Suggestions', array( 603 'friends' => $results, 604 ) ); 605 } 606 add_action( 'bp_activity_mentions_prime_results', 'bp_friends_prime_mentions_results' ); -
trunk/src/bp-templates/bp-legacy/buddypress/activity/entry.php
r7965 r8754 98 98 <div class="ac-reply-content"> 99 99 <div class="ac-textarea"> 100 <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input " name="ac_input_<?php bp_activity_id(); ?>"></textarea>100 <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input bp-suggestions" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 101 101 </div> 102 102 <input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" /> <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a> -
trunk/src/bp-templates/bp-legacy/buddypress/activity/post-form.php
r8405 r8754 28 28 <div id="whats-new-content"> 29 29 <div id="whats-new-textarea"> 30 <textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>30 <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea> 31 31 </div> 32 32
Note: See TracChangeset
for help on using the changeset viewer.