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-messages/bp-messages-cssjs.php

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