Cleanup of Custom Background. Move JS to external file, Add @since, Remove redundant steps functionality, Preview of Image alignment. See #12186

git-svn-id: https://develop.svn.wordpress.org/trunk@13788 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-21 06:06:18 +00:00
parent af3144f092
commit 3ca4e60665
4 changed files with 105 additions and 154 deletions

View File

@@ -406,6 +406,11 @@ function wp_default_scripts( &$scripts ) {
'edit' => _x('Edit', 'menu item edit text'),
'warnDelete' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
) );
$scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100321' );
$scripts->add_data( 'custom-background', 'group', 1 );
// See wp_just_in_time_script_localization() for translation data for this object
}
}
@@ -509,7 +514,7 @@ function wp_prototype_before_jquery( $js_array ) {
}
/**
* Load localized script just in time for MCE.
* Load localized data on print rather than initialization.
*
* These localizations require information that may not be loaded even by init.
*
@@ -526,6 +531,10 @@ function wp_just_in_time_script_localization() {
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
'l10n_print_after' => 'try{convertEntities(autosaveL10n);}catch(e){};'
) );
wp_localize_script( 'custom-background', 'customBackgroundL10n', array(
'backgroundcolor' => '#' . get_background_color(),
) );
}
/**