Pass image URL's to thickbox via L10n in script-loader.php. Allows thickbox to be used on any page in the install without defining the image URL variables. Fixes #17050

git-svn-id: http://svn.automattic.com/wordpress/trunk@17596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2011-04-05 03:58:25 +00:00
parent 7c6cf52194
commit 0ec5e89f63
2 changed files with 5 additions and 3 deletions

View File

@ -6,10 +6,10 @@
*/
if ( typeof tb_pathToImage != 'string' ) {
var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
var tb_pathToImage = thickboxL10n.loadingAnimation;
}
if ( typeof tb_closeImage != 'string' ) {
var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
var tb_closeImage = thickboxL10n.closeImage;
}
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

View File

@ -184,7 +184,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' );
$scripts->add_data( 'jquery-table-hotkeys', 'group', 1 );
$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20100407');
$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20110405');
$scripts->add_data( 'thickbox', 'group', 1 );
$scripts->localize( 'thickbox', 'thickboxL10n', array(
'next' => __('Next >'),
@ -193,6 +193,8 @@ function wp_default_scripts( &$scripts ) {
'of' => __('of'),
'close' => __('Close'),
'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),
'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'),
'closeImage' => includes_url('js/thickbox/tb-close.png'),
'l10n_print_after' => 'try{convertEntities(thickboxL10n);}catch(e){};'
) );