Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/24/2012 06:10:17 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Switch to .min for compressed JS and CSS files.

  • This moves our "development" versions from .dev.js to .js (same for css).
  • The compressed version then moves from .js to .min.js (same for css).
  • By switching to the standard .min convention, it sets expectations for developers, and works nicely with existing tools such as ack.
  • Fixes #4455.
  • Props nacin.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r5868 r6264  
    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' );
Note: See TracChangeset for help on using the changeset viewer.