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-buddybar.php

    r6161 r6264  
    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';
    677 
    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() );
     678        $stylesheet = BP_PLUGIN_URL . "bp-core/css/buddybar{$min}.css";
     679
     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' );
Note: See TracChangeset for help on using the changeset viewer.