Widget Customizer: Move style/script registration to script loader. Update Gruntfile.js.

fixes #27356.
Built from https://develop.svn.wordpress.org/trunk@27525


git-svn-id: http://core.svn.wordpress.org/trunk@27368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-03-13 19:41:14 +00:00
parent f46a085f7c
commit f48e3f5719
4 changed files with 9 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -457,17 +457,8 @@ class WP_Customize_Widgets {
* @action customize_controls_enqueue_scripts
*/
static function customize_controls_enqueue_deps() {
wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'jquery-ui-droppable' );
wp_enqueue_style(
'widget-customizer',
admin_url( 'css/customize-widgets.css' )
);
wp_enqueue_script(
'widget-customizer',
admin_url( 'js/customize-widgets.js' ),
array( 'jquery', 'wp-backbone', 'wp-util', 'customize-controls' )
);
wp_enqueue_style( 'customize-widgets' );
wp_enqueue_script( 'customize-widgets' );
// Export available widgets with control_tpl removed from model
// since plugins need templates to be in the DOM
@ -533,7 +524,7 @@ class WP_Customize_Widgets {
}
$wp_scripts->add_data(
'widget-customizer',
'customize-widgets',
'data',
sprintf( 'var WidgetCustomizer_exports = %s;', json_encode( $exports ) )
);

View File

@ -378,6 +378,8 @@ function wp_default_scripts( &$scripts ) {
'allowedFiles' => __( 'Allowed Files' ),
) );
$scripts->add( 'customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 );
$scripts->add( 'accordion', "/wp-admin/js/accordion$suffix.js", array( 'jquery' ), false, 1 );
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
@ -591,6 +593,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'buttons', 'open-sans' ) );
$styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
$styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) );
$styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css" );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
@ -623,7 +626,7 @@ function wp_default_styles( &$styles ) {
// RTL CSS
$rtl_styles = array(
// wp-admin
'wp-admin', 'install', 'wp-color-picker', 'customize-controls', 'ie',
'wp-admin', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'ie',
// wp-includes
'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
'wp-jquery-ui-dialog',