Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2014 04:22:03 PM (10 years ago)
Author:
djpaul
Message:

Core: make sure we load minified JS and CSS when SCRIPT_DEBUG is set.

Fixes #5615

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/2.1.php

    r8770 r8772  
    1717 */
    1818function bp_core_register_deprecated_scripts() {
    19     $ext = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.js' : '.min.js';
     19    $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    2020    $url = buddypress()->plugin_url . 'bp-core/deprecated/js/';
    2121
    2222    $scripts = apply_filters( 'bp_core_register_deprecated_scripts', array(
     23
    2324        // Core
    24         'bp-jquery-scroll-to' => 'jquery-scroll-to',
     25        'bp-jquery-scroll-to' => array(
     26            'file'         => "{$url}jquery-scroll-to{$min}.js",
     27            'dependencies' => array( 'jquery' ),
     28        ),
    2529
    2630        // Messages
    27         'bp-jquery-autocomplete'    => 'autocomplete/jquery.autocomplete',
    28         'bp-jquery-autocomplete-fb' => 'autocomplete/jquery.autocompletefb',
    29         'bp-jquery-bgiframe'        => 'autocomplete/jquery.bgiframe',
    30         'bp-jquery-dimensions'      => 'autocomplete/jquery.dimensions',
     31        'bp-jquery-autocomplete'    => array(
     32            'file'          => "{$url}autocomplete/jquery.autocomplete{$min}.js",
     33            'dependencies' => array( 'jquery' ),
     34        ),
     35
     36        'bp-jquery-autocomplete-fb' => array(
     37            'file'         => "{$url}autocomplete/jquery.autocompletefb{$min}.js",
     38            'dependencies' => array( 'jquery' ),
     39        ),
     40
     41        'bp-jquery-bgiframe' => array(
     42            'file'         => "{$url}autocomplete/jquery.bgiframe{$min}.js",
     43            'dependencies' => array( 'jquery' ),
     44        ),
     45
     46        'bp-jquery-dimensions' => array(
     47            'file'         => "{$url}autocomplete/jquery.dimensions{$min}.js",
     48            'dependencies' => array( 'jquery' ),
     49        ),
    3150    ) );
    3251
    33     foreach ( $scripts as $id => $file ) {
    34         wp_register_script( $id, $url . $file . $ext, array( 'jquery' ), bp_get_version(), true );
     52    foreach ( $scripts as $id => $script ) {
     53        wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version(), true );
    3554    }
    3655}
Note: See TracChangeset for help on using the changeset viewer.