Add global JS vars and actions to the media uploader iframe

git-svn-id: http://svn.automattic.com/wordpress/trunk@11868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-08-24 00:09:39 +00:00
parent 904530f12a
commit a50bce6e70
1 changed files with 7 additions and 1 deletions

View File

@ -316,13 +316,19 @@ wp_enqueue_style( 'ie' );
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'}; var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup';
//]]> //]]>
</script> </script>
<?php <?php
do_action('admin_enqueue_scripts', 'media-upload-popup');
do_action('admin_print_styles-media-upload-popup');
do_action('admin_print_styles'); do_action('admin_print_styles');
do_action('admin_print_scripts-media-upload-popup');
do_action('admin_print_scripts'); do_action('admin_print_scripts');
do_action('admin_head-media-upload-popup');
do_action('admin_head'); do_action('admin_head');
if ( is_string($content_func) ) if ( is_string($content_func) )
do_action( "admin_head_{$content_func}" ); do_action( "admin_head_{$content_func}" );
?> ?>