Ticket #4455: 4455.diff
File 4455.diff, 14.9 KB (added by , 12 years ago) |
---|
-
bp-core/bp-core-widgets.php
19 19 parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops ); 20 20 21 21 if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) { 22 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 23 wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.dev.js', array( 'jquery' ), bp_get_version() ); 24 } else { 25 wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.js', array( 'jquery' ), bp_get_version() ); 26 } 22 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 23 wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . "bp-core/js/widget-members{$min}.js", array( 'jquery' ), bp_get_version() ); 27 24 } 28 25 } 29 26 -
bp-core/bp-core-adminbar.php
49 49 * @since BuddyPress 1.5 50 50 */ 51 51 function bp_core_load_admin_bar_css() { 52 global $wp_styles; 52 53 53 54 if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) 54 55 return; 55 56 57 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 58 56 59 // Toolbar styles 57 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 58 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.dev.css'; 59 else 60 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.css'; 60 $stylesheet = BP_PLUGIN_URL . "bp-core/css/admin-bar{$min}.css"; 61 61 62 62 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() ); 63 64 if ( !is_rtl() ) 65 return; 66 67 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 68 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.dev.css'; 69 else 70 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.css'; 71 72 wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() ); 63 $wp_styles->add_data( 'bp-admin-bar', 'rtl', true ); 64 if ( $min ) 65 $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min ); 73 66 } 74 67 add_action( 'bp_init', 'bp_core_load_admin_bar_css' ); 75 68 -
bp-core/bp-core-admin.php
403 403 */ 404 404 public function enqueue_scripts() { 405 405 406 $maybe_dev = ''; 407 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 408 $maybe_dev = '.dev'; 406 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 409 407 410 $file = $this->css_url . "common{$m aybe_dev}.css";408 $file = $this->css_url . "common{$min}.css"; 411 409 $file = apply_filters( 'bp_core_admin_common_css', $file ); 412 410 wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() ); 413 411 … … 415 413 if ( bp_get_maintenance_mode() ) { 416 414 417 415 // Styling 418 $file = $this->css_url . "wizard{$m aybe_dev}.css";416 $file = $this->css_url . "wizard{$min}.css"; 419 417 $file = apply_filters( 'bp_core_admin_wizard_css', $file ); 420 418 wp_enqueue_style( 'bp-admin-wizard-css', $file, array(), bp_get_version() ); 421 419 422 420 // JS 423 $file = $this->js_url . "wizard{$m aybe_dev}.js";421 $file = $this->js_url . "wizard{$min}.js"; 424 422 $file = apply_filters( 'bp_core_admin_wizard_js', $file ); 425 423 wp_enqueue_script( 'bp-admin-wizard-js', $file, array(), bp_get_version() ); 426 424 -
bp-core/bp-core-buddybar.php
665 665 * Handle the BuddyBar CSS 666 666 */ 667 667 function bp_core_load_buddybar_css() { 668 global $wp_styles; 669 668 670 if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) 669 671 return; 670 672 673 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 674 671 675 if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility 672 676 $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css'; 673 elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )674 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.dev.css';675 677 else 676 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.css';678 $stylesheet = BP_PLUGIN_URL . "bp-core/css/buddybar{$min}.css"; 677 679 678 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), bp_get_version() ); 679 680 if ( !is_rtl() ) 681 return; 682 683 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 684 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.dev.css'; 685 else 686 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.css'; 687 688 wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() ); 680 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() ); 681 $wp_styles->add_data( 'bp-admin-bar', 'rtl', true ); 682 if ( $min ) 683 $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min ); 689 684 } 690 685 add_action( 'bp_init', 'bp_core_load_buddybar_css' ); 691 686 -
bp-xprofile/bp-xprofile-cssjs.php
17 17 */ 18 18 function xprofile_add_admin_css() { 19 19 if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { 20 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 21 wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.dev.css', array(), bp_get_version() ); 22 } else { 23 wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.css', array(), bp_get_version() ); 24 } 20 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 21 wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() ); 25 22 } 26 23 } 27 24 add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' ); … … 40 37 wp_enqueue_script( 'jquery-ui-droppable' ); 41 38 wp_enqueue_script( 'jquery-ui-sortable' ); 42 39 43 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 44 wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); 45 } else { 46 wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); 47 } 40 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 41 wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); 48 42 } 49 43 } 50 44 add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 ); -
bp-activity/bp-activity-admin.php
159 159 global $bp, $bp_activity_list_table; 160 160 161 161 // Decide whether to load the dev version of the CSS and JavaScript 162 $ dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : '';162 $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.'; 163 163 164 164 // Decide whether to load the index or edit screen 165 165 $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; … … 244 244 } 245 245 246 246 // Enqueue CSS and JavaScript 247 wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$ dev}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );248 wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$ dev}css", array(), bp_get_version() );247 wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true ); 248 wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() ); 249 249 250 250 // Handle spam/un-spam/delete of activities 251 251 if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) { … … 568 568 <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post"> 569 569 <div id="poststuff"> 570 570 571 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 571 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 572 572 <div id="post-body-content"> 573 573 <div id="postdiv" class="postarea"> 574 574 <div id="bp_activity_action" class="postbox"> -
bp-messages/bp-messages-cssjs.php
18 18 if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { 19 19 add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); 20 20 21 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 22 wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ), bp_get_version() ); 23 wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.dev.js', array(), bp_get_version() ); 24 wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.dev.js', array(), bp_get_version() ); 25 wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.dev.js', array(), bp_get_version() ); 26 27 } else { 28 wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ), bp_get_version() ); 29 wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.js', array(), bp_get_version() ); 30 wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.js', array(), bp_get_version() ); 31 wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.js', array(), bp_get_version() ); 32 } 21 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 22 wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version() ); 23 wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocompletefb{$min}.js", array(), bp_get_version() ); 24 wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.bgiframe{$min}.js", array(), bp_get_version() ); 25 wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.dimensions{$min}.js", array(), bp_get_version() ); 33 26 } 34 27 } 35 28 add_action( 'bp_actions', 'messages_add_autocomplete_js' ); … … 37 30 function messages_add_autocomplete_css() { 38 31 39 32 if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { 40 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 41 wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), bp_get_version() ); 42 } else { 43 wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), bp_get_version() ); 44 } 33 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 34 wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . "bp-messages/css/autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version() ); 45 35 46 36 wp_print_styles(); 47 37 } -
bp-groups/bp-groups-widgets.php
28 28 parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops ); 29 29 30 30 if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) { 31 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 32 wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.dev.js', array( 'jquery' ), bp_get_version() ); 33 } else { 34 wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.js', array( 'jquery' ), bp_get_version() ); 35 } 31 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 32 wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); 36 33 } 37 34 } 38 35 … … 48 45 $instance['title'] = __( 'Groups', 'buddypress' ); 49 46 50 47 echo $before_widget; 51 48 52 49 $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; 53 50 54 51 echo $before_title 55 52 . $title 56 53 . $after_title; ?> … … 105 102 106 103 function update( $new_instance, $old_instance ) { 107 104 $instance = $old_instance; 108 105 109 106 $instance['title'] = strip_tags( $new_instance['title'] ); 110 107 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 111 108 $instance['group_default'] = strip_tags( $new_instance['group_default'] ); … … 130 127 ?> 131 128 132 129 <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p> 133 130 134 131 <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p> 135 132 136 133 <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>