WordPress.org

Make WordPress Core

Changeset 26780


Ignore:
Timestamp:
12/07/2013 09:04:02 AM (6 years ago)
Author:
nacin
Message:

Admin color schemes: Manually handle RTL and minified versions of the CSS files on registration.

This bypasses WP_Styles entirely, which is much simpler for the moment, given that color schemes bypass WP_Styles for plenty already. The script loader is told to stop thinking of colors.css as an RTL-ified file. The colors-fresh handle, used directly on the login screen, needed to be (even before this commit).

fixes #26316.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r26773 r26780  
    21162116 */
    21172117function register_admin_color_schemes() {
     2118    $suffix = is_rtl() ? '-rtl' : '';
     2119    $suffix .= SCRIPT_DEBUG ? '' : '.min';
     2120
    21182121    wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
    2119         admin_url( 'css/colors.min.css' ),
     2122        admin_url( "css/colors$suffix.css" ),
    21202123        array( '#222', '#333', '#0074a2', '#2ea2cc' ),
    21212124        array( 'base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff' )
     
    21272130
    21282131    wp_admin_css_color( 'light', _x( 'Light', 'admin color scheme' ),
    2129         admin_url( 'css/colors/light/colors.min.css' ),
     2132        admin_url( "css/colors/light/colors$suffix.css" ),
    21302133        array( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),
    21312134        array( 'base' => '#999', 'focus' => '#ccc', 'current' => '#ccc' )
     
    21332136
    21342137    wp_admin_css_color( 'blue', _x( 'Blue', 'admin color scheme' ),
    2135         admin_url( 'css/colors/blue/colors.min.css' ),
     2138        admin_url( "css/colors/blue/colors$suffix.css" ),
    21362139        array( '#096484', '#4796b3', '#52accc', '#74B6CE' ),
    21372140        array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )
     
    21392142
    21402143    wp_admin_css_color( 'midnight', _x( 'Midnight', 'admin color scheme' ),
    2141         admin_url( 'css/colors/midnight/colors.min.css' ),
     2144        admin_url( "css/colors/midnight/colors$suffix.css" ),
    21422145        array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
    21432146        array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' )
     
    21452148
    21462149    wp_admin_css_color( 'sunrise', _x( 'Sunrise', 'admin color scheme' ),
    2147         admin_url( 'css/colors/sunrise/colors.min.css' ),
    2148         array( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ), 
     2150        admin_url( "css/colors/sunrise/colors$suffix.css" ),
     2151        array( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ),
    21492152        array( 'base' => '#f3f1f1', 'focus' => '#fff', 'current' => '#fff' )
    21502153    );
    21512154
    21522155    wp_admin_css_color( 'ectoplasm', _x( 'Ectoplasm', 'admin color scheme' ),
    2153         admin_url( 'css/colors/ectoplasm/colors.min.css' ),
     2156        admin_url( "css/colors/ectoplasm/colors$suffix.css" ),
    21542157        array( '#413256', '#523f6d', '#a3b745', '#d46f15' ),
    21552158        array( 'base' => '#ece6f6', 'focus' => '#fff', 'current' => '#fff' )
    21562159    );
    2157    
     2160
    21582161    wp_admin_css_color( 'ocean', _x( 'Ocean', 'admin color scheme' ),
    2159         admin_url( 'css/colors/ocean/colors.min.css' ),
     2162        admin_url( "css/colors/ocean/colors$suffix.css" ),
    21602163        array( '#627c83', '#738e96', '#9ebaa0', '#aa9d88' ),
    21612164        array( 'base' => '#f2fcff', 'focus' => '#fff', 'current' => '#fff' )
     
    21632166
    21642167    wp_admin_css_color( 'coffee', _x( 'Coffee', 'admin color scheme' ),
    2165         admin_url( 'css/colors/coffee/colors.min.css' ),
     2168        admin_url( "css/colors/coffee/colors$suffix.css" ),
    21662169        array( '#46403c', '#59524c', '#c7a589', '#9ea476' ),
    21672170        array( 'base' => '#f3f2f1', 'focus' => '#fff', 'current' => '#fff' )
  • trunk/src/wp-includes/script-loader.php

    r26776 r26780  
    552552    $suffix = SCRIPT_DEBUG ? '' : '.min';
    553553
    554     $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker', 'wp-pointer', 'editor-buttons', 'farbtastic', 'wp-auth-check', 'wp-jquery-ui-dialog', 'media-views', 'buttons', 'install', 'colors' );
     554    $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker', 'wp-pointer', 'editor-buttons', 'farbtastic', 'wp-auth-check', 'wp-jquery-ui-dialog', 'media-views', 'buttons', 'install' );
    555555
    556556    $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) );
     
    700700        $url = $color->url;
    701701
    702         if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG )
    703             $url = preg_replace( '/.min.css$|.min.css(?=\?)/', '.css', $url );
    704 
    705702        if ( isset($parsed['query']) && $parsed['query'] ) {
    706703            wp_parse_str( $parsed['query'], $qv );
Note: See TracChangeset for help on using the changeset viewer.