bb_default_scripts

The BuddyPress bb default scripts function.

Description

bb_default_scripts( &$scripts ); 

Parameters (1)

0. $scripts
The scripts.

Usage

  1. if ( !function_exists( 'bb_default_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php'; 
  3.  
  4. // The scripts. 
  5. $scripts = &$scripts; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_default_scripts($scripts); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php  
  1. function bb_default_scripts( &$scripts ) { 
  2. $scripts->base_url = bb_get_uri( BB_INC, null, BB_URI_CONTEXT_SCRIPT_SRC ); 
  3. $scripts->base_url_admin = bb_get_uri( 'bb-admin/', null, BB_URI_CONTEXT_SCRIPT_SRC + BB_URI_CONTEXT_BB_ADMIN ); 
  4. $scripts->content_url = ''; // May not work - might need to specify plugin and theme urls 
  5. $scripts->default_version = bb_get_option( 'version' ); 
  6. $scripts->default_dirs = array( '/bb-admin/js/', '/bb-includes/js/' ); 
  7.  
  8. // These are our enqueued scripts 
  9. $scripts->add( 'topic', $scripts->base_url . 'js/topic.js', array('wp-lists'), '20090602' ); 
  10. $scripts->add( 'profile-edit', $scripts->base_url . 'js/profile-edit.js', array('password-strength-meter'), '20080721' ); 
  11. $scripts->add( 'admin-forums', $scripts->base_url_admin . 'js/admin-forums.js', array('wp-lists', 'interface'), '20090320' ); 
  12. $scripts->add( 'utils', $scripts->base_url_admin . 'js/utils.js', false, '20090102' ); 
  13. $scripts->add( 'common', $scripts->base_url_admin . 'js/common.js', array('jquery', 'hoverIntent', 'utils'), '20090517' ); 
  14. $scripts->add_data( 'common', 'group', 1 ); 
  15. $scripts->localize( 'common', 'commonL10n', array( 
  16. 'warnDelete' => __( "You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete." ),  
  17. 'l10n_print_after' => 'try{convertEntities(commonL10n);}catch(e) {};' 
  18. ) ); 
  19. $scripts->localize( 'admin-forums', 'bbSortForumsL10n', array( 
  20. 'handleText' => __('drag'),  
  21. 'saveText' => __('Save Forum Order'),  
  22. 'editText' => __('Edit Forum Order') 
  23. )); 
  24.  
  25. // These are non-3rd-party libraries 
  26. $scripts->add( 'wp-lists', $scripts->base_url . 'js/wp-lists.js', array('wp-ajax-response', 'jquery-color'), '20080826' ); 
  27. $scripts->localize( 'wp-lists', 'wpListL10n', array( 
  28. 'url' => $scripts->base_url_admin . 'admin-ajax.php' 
  29. ) ); 
  30. $scripts->add( 'wp-ajax-response', $scripts->base_url . 'js/wp-ajax-response.js', array('jquery'), '20080316' ); 
  31. $scripts->localize( 'wp-ajax-response', 'wpAjax', array( 
  32. 'noPerm' => __('You do not have permission to do that.'),  
  33. 'broken' => __('An unidentifiederrorhas occurred.') 
  34. ) ); 
  35.  
  36. // jQuery and friends 
  37. $scripts->add( 'jquery', $scripts->base_url . 'js/jquery/jquery.js', false, '1.4.2' ); 
  38. $scripts->add( 'jquery-color', $scripts->base_url . 'js/jquery/jquery.color.js', array('jquery'), '2.0-4561' ); 
  39. $scripts->add( 'interface', $scripts->base_url . 'js/jquery/interface.js', array('jquery'), '1.2.3' ); 
  40. $scripts->add( 'password-strength-meter', $scripts->base_url . 'js/jquery/password-strength-meter.js', array('jquery'), '20070405' ); 
  41. $scripts->localize( 'password-strength-meter', 'pwsL10n', array( 
  42. 'short' => __('Too short'),  
  43. 'bad' => __('Bad'),  
  44. 'good' => __('Good'),  
  45. 'strong' => __('Strong') 
  46. )); 
  47. $scripts->add( 'hoverIntent', $scripts->base_url . 'js/jquery/hoverIntent.js', array('jquery'), '20090102' ); 
  48. $scripts->add_data( 'hoverIntent', 'group', 1 );