Skip to:
Content

BuddyPress.org

Ticket #4455: 4455.diff

File 4455.diff, 14.9 KB (added by nacin, 12 years ago)
  • bp-core/bp-core-widgets.php

     
    1919                parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
    2020
    2121                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() );
    2724                }
    2825        }
    2926
  • bp-core/bp-core-adminbar.php

     
    4949 * @since BuddyPress 1.5
    5050 */
    5151function bp_core_load_admin_bar_css() {
     52        global $wp_styles;
    5253
    5354        if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() )
    5455                return;
    5556
     57        $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     58
    5659        // 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";
    6161
    6262        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 );
    7366}
    7467add_action( 'bp_init', 'bp_core_load_admin_bar_css' );
    7568
  • bp-core/bp-core-admin.php

     
    403403         */
    404404        public function enqueue_scripts() {
    405405
    406                 $maybe_dev = '';
    407                 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    408                         $maybe_dev = '.dev';
     406                $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    409407
    410                 $file = $this->css_url . "common{$maybe_dev}.css";
     408                $file = $this->css_url . "common{$min}.css";
    411409                $file = apply_filters( 'bp_core_admin_common_css', $file );
    412410                wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
    413411
     
    415413                if ( bp_get_maintenance_mode() ) {
    416414
    417415                        // Styling
    418                         $file = $this->css_url . "wizard{$maybe_dev}.css";
     416                        $file = $this->css_url . "wizard{$min}.css";
    419417                        $file = apply_filters( 'bp_core_admin_wizard_css', $file );
    420418                        wp_enqueue_style( 'bp-admin-wizard-css', $file, array(), bp_get_version() );
    421419
    422420                        // JS
    423                         $file = $this->js_url . "wizard{$maybe_dev}.js";
     421                        $file = $this->js_url . "wizard{$min}.js";
    424422                        $file = apply_filters( 'bp_core_admin_wizard_js', $file );
    425423                        wp_enqueue_script( 'bp-admin-wizard-js', $file, array(), bp_get_version() );
    426424
  • bp-core/bp-core-buddybar.php

     
    665665 * Handle the BuddyBar CSS
    666666 */
    667667function bp_core_load_buddybar_css() {
     668        global $wp_styles;
     669
    668670        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 ) )
    669671                return;
    670672
     673        $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     674
    671675        if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
    672676                $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';
    675677        else
    676                 $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.css';
     678                $stylesheet = BP_PLUGIN_URL . "bp-core/css/buddybar{$min}.css";
    677679
    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 );
    689684}
    690685add_action( 'bp_init', 'bp_core_load_buddybar_css' );
    691686
  • bp-xprofile/bp-xprofile-cssjs.php

     
    1717 */
    1818function xprofile_add_admin_css() {
    1919        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() );
    2522        }
    2623}
    2724add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' );
     
    4037                wp_enqueue_script( 'jquery-ui-droppable' );
    4138                wp_enqueue_script( 'jquery-ui-sortable'  );
    4239
    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() );
    4842        }
    4943}
    5044add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 );
  • bp-activity/bp-activity-admin.php

     
    159159        global $bp, $bp_activity_list_table;
    160160
    161161        // 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.';
    163163
    164164        // Decide whether to load the index or edit screen
    165165        $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
     
    244244        }
    245245
    246246        // 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()       );
    249249
    250250        // Handle spam/un-spam/delete of activities
    251251        if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
     
    568568                        <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post">
    569569                                <div id="poststuff">
    570570
    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'; ?>">
    572572                                                <div id="post-body-content">
    573573                                                        <div id="postdiv" class="postarea">
    574574                                                                <div id="bp_activity_action" class="postbox">
  • bp-messages/bp-messages-cssjs.php

     
    1818        if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
    1919                add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
    2020
    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() );
    3326        }
    3427}
    3528add_action( 'bp_actions', 'messages_add_autocomplete_js' );
     
    3730function messages_add_autocomplete_css() {
    3831
    3932        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() );
    4535
    4636                wp_print_styles();
    4737        }
  • bp-groups/bp-groups-widgets.php

     
    2828                parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops );
    2929
    3030                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() );
    3633                }
    3734        }
    3835
     
    4845                        $instance['title'] = __( 'Groups', 'buddypress' );
    4946
    5047                echo $before_widget;
    51                
     48
    5249                $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
    53                
     50
    5451                echo $before_title
    5552                   . $title
    5653                   . $after_title; ?>
     
    105102
    106103        function update( $new_instance, $old_instance ) {
    107104                $instance = $old_instance;
    108                
     105
    109106                $instance['title']         = strip_tags( $new_instance['title'] );
    110107                $instance['max_groups']    = strip_tags( $new_instance['max_groups'] );
    111108                $instance['group_default'] = strip_tags( $new_instance['group_default'] );
     
    130127                ?>
    131128
    132129                <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
    134131                <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>
    135132
    136133                <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>