Changeset 10446
- Timestamp:
- 01/12/2016 04:04:52 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 2 deleted
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/deprecated/2.1.php
r10108 r10446 17 17 */ 18 18 function bp_core_register_deprecated_scripts() { 19 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 20 $url = buddypress()->plugin_url . 'bp-core/deprecated/js/'; 21 22 $scripts = apply_filters( 'bp_core_register_deprecated_scripts', array( 23 24 // Messages 25 'bp-jquery-autocomplete' => array( 26 'file' => "{$url}autocomplete/jquery.autocomplete{$min}.js", 27 'dependencies' => array( 'jquery' ), 28 ), 29 30 'bp-jquery-autocomplete-fb' => array( 31 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.js", 32 'dependencies' => array( 'jquery' ), 33 ), 34 35 'bp-jquery-bgiframe' => array( 36 'file' => "{$url}autocomplete/jquery.bgiframe{$min}.js", 37 'dependencies' => array( 'jquery' ), 38 ), 39 40 'bp-jquery-dimensions' => array( 41 'file' => "{$url}autocomplete/jquery.dimensions{$min}.js", 42 'dependencies' => array( 'jquery' ), 43 ), 44 ) ); 45 46 foreach ( $scripts as $id => $script ) { 47 wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version(), true ); 48 } 49 } 50 add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_scripts', 1 ); 19 // Scripts undeprecated as of 2.5.0. 20 } 51 21 52 22 /** … … 56 26 */ 57 27 function bp_core_register_deprecated_styles() { 58 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 59 $url = buddypress()->plugin_url . 'bp-core/deprecated/css/'; 60 61 $styles = apply_filters( 'bp_core_register_deprecated_styles', array( 62 // Messages 63 'bp-messages-autocomplete' => array( 64 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.css", 65 'dependencies' => array(), 66 ) 67 ) ); 68 69 foreach ( $styles as $id => $style ) { 70 wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() ); 71 72 wp_style_add_data( $id, 'rtl', true ); 73 if ( $min ) { 74 wp_style_add_data( $id, 'suffix', $min ); 75 } 76 } 77 } 78 add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_styles', 1 ); 28 // Scripts undeprecated as of 2.5.0. 29 } 79 30 80 31 /** BuddyBar *****************************************************************/ -
trunk/src/bp-messages/bp-messages-cssjs.php
r10417 r10446 20 20 add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); 21 21 22 wp_enqueue_script( 'bp-jquery-autocomplete' ); 23 wp_enqueue_script( 'bp-jquery-autocomplete-fb' ); 24 wp_enqueue_script( 'bp-jquery-bgiframe' ); 25 wp_enqueue_script( 'bp-jquery-dimensions' ); 22 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 23 $url = buddypress()->plugin_url . 'bp-messages/js/'; 24 25 wp_enqueue_script( 'bp-jquery-autocomplete', "{$url}autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version() ); 26 wp_enqueue_script( 'bp-jquery-autocomplete-fb', "{$url}autocomplete/jquery.autocompletefb{$min}.js", array( 'jquery' ), bp_get_version() ); 27 wp_enqueue_script( 'bp-jquery-bgiframe', "{$url}autocomplete/jquery.bgiframe{$min}.js", array( 'jquery' ), bp_get_version() ); 28 wp_enqueue_script( 'bp-jquery-dimensions', "{$url}autocomplete/jquery.dimensions{$min}.js", array( 'jquery' ), bp_get_version() ); 26 29 } 27 30 } … … 35 38 function messages_add_autocomplete_css() { 36 39 if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { 37 wp_enqueue_style( 'bp-messages-autocomplete' ); 40 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 41 $url = buddypress()->plugin_url . 'bp-messages/css/'; 42 43 wp_register_style( 'bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletfb{$min}.css", array(), bp_get_version() ); 44 45 wp_style_add_data( 'bp-messages-autocomplete', 'rtl', true ); 46 if ( $min ) { 47 wp_style_add_data( 'bp-messages-autocomplete', 'suffix', $min ); 48 } 49 38 50 wp_print_styles(); 39 51 } -
trunk/src/bp-messages/js/autocomplete/jquery.autocompletefb.js
r9819 r10446 14 14 * http://www.gnu.org/licenses/gpl.html 15 15 */ 16 17 16 jQuery.fn.autoCompletefb = function(options) 18 17 { … … 53 52 var d = String(d).split(' ('); 54 53 var un = d[1].substr(0, d[1].length-1); 55 54 56 55 /* Don't add the same user multiple times */ 57 if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) { 56 if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) { 58 57 var ln = '#link-' + un; 59 58 var l = jQuery(ln).attr('href'); 60 59 var v = '<li class="'+f+'" id="un-'+un+'"><span><a href="'+l+'">'+d[0]+'</a></span> <span class="p">X</span></li>'; 61 60 62 61 var x = jQuery(settings.inputClass,tmp).before(v); 63 62 jQuery('#send-to-usernames').addClass(un); 64 63 65 64 jQuery('.p',x[0].previousSibling).click(function(){ 66 65 acfb.removeFind(this); 67 66 }); 68 } 69 67 } 68 70 69 jQuery(settings.inputClass,tmp).val(''); 71 70
Note: See TracChangeset
for help on using the changeset viewer.