Ticket #15782: garyc40-15782.patch
File garyc40-15782.patch, 9.2 KB (added by , 14 years ago) |
---|
-
wp-admin/admin-header.php
diff --git wp-admin/admin-header.php wp-admin/admin-header.php index 916b219..6ac2a75 100644
if ( is_multisite() ) 47 47 wp_enqueue_script('utils'); 48 48 49 49 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 50 ?>51 <script type="text/javascript">52 //<![CDATA[53 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();}}};54 var userSettings = {55 'url': '<?php echo SITECOOKIEPATH; ?>',56 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',57 'time':'<?php echo time() ?>'58 },59 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',60 pagenow = '<?php echo $current_screen->id; ?>',61 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',62 adminpage = '<?php echo $admin_body_class; ?>',63 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',64 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',65 isRtl = <?php echo (int) is_rtl(); ?>;66 //]]>67 </script>68 <?php69 50 70 51 if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) { 71 52 add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 ); -
wp-admin/includes/media.php
diff --git wp-admin/includes/media.php wp-admin/includes/media.php index 33e7867..326b8d8 100644
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( 315 315 || ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) ) 316 316 wp_enqueue_style( 'media' ); 317 317 wp_enqueue_style( 'ie' ); 318 ?> 319 <script type="text/javascript"> 320 //<![CDATA[ 321 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();}}}; 322 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(); ?>'}; 323 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 324 isRtl = <?php echo (int) is_rtl(); ?>; 325 //]]> 326 </script> 327 <?php 318 328 319 do_action('admin_enqueue_scripts', 'media-upload-popup'); 329 320 do_action('admin_print_styles-media-upload-popup'); 330 321 do_action('admin_print_styles'); -
wp-admin/includes/template.php
diff --git wp-admin/includes/template.php wp-admin/includes/template.php index b221e78..4b89c98 100644
wp_enqueue_style( 'global' ); 1549 1549 if ( ! $limit_styles ) 1550 1550 wp_enqueue_style( 'wp-admin' ); 1551 1551 wp_enqueue_style( 'colors' ); 1552 ?>1553 <script type="text/javascript">1554 //<![CDATA[1555 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();}}};1556 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}1557 var userSettings = {1558 'url': '<?php echo SITECOOKIEPATH; ?>',1559 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',1560 'time':'<?php echo time() ?>'1561 },1562 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',1563 pagenow = '<?php echo $current_screen->id; ?>',1564 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',1565 adminpage = '<?php echo $admin_body_class; ?>',1566 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',1567 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',1568 isRtl = <?php echo (int) is_rtl(); ?>;1569 //]]>1570 </script>1571 <?php1572 1552 do_action('admin_enqueue_scripts', $hook_suffix); 1573 1553 do_action("admin_print_styles-$hook_suffix"); 1574 1554 do_action('admin_print_styles'); -
wp-admin/press-this.php
diff --git wp-admin/press-this.php wp-admin/press-this.php index 1d826a8..988ed67 100644
die; 316 316 wp_enqueue_script( 'post' ); 317 317 wp_enqueue_script( 'editor' ); 318 318 ?> 319 <script type="text/javascript"> 320 //<![CDATA[ 321 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();}}}; 322 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() ?>'}; 323 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 324 var photostorage = false; 325 //]]> 326 </script> 327 319 <?php admin_script_init( '', array( 'pagenow' => 'press-this', 'photostorage' => false ) ) ?> 328 320 <?php 329 321 do_action('admin_print_styles'); 330 322 do_action('admin_print_scripts'); -
wp-includes/functions.wp-scripts.php
diff --git wp-includes/functions.wp-scripts.php wp-includes/functions.wp-scripts.php index af2055d..bf842c8 100644
function wp_script_is( $handle, $list = 'queue' ) { 144 144 return true; 145 145 146 146 return $query; 147 } 147 } 148 No newline at end of file -
wp-includes/script-loader.php
diff --git wp-includes/script-loader.php wp-includes/script-loader.php index ddfcaeb..b69ed5c 100644
function print_admin_styles() { 775 775 return $wp_styles->done; 776 776 } 777 777 778 function admin_addLoadEvent() { 779 ?> 780 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();}}}; 781 <?php 782 } 783 784 function admin_script_globals() { 785 $current_screen = get_current_screen(); 786 $current_user = wp_get_current_user(); 787 ?> 788 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 789 var userSettings = { 790 'url': '<?php echo SITECOOKIEPATH; ?>', 791 'uid': '<?php echo $current_user->ID; ?>', 792 'time':'<?php echo time() ?>' 793 }, 794 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 795 pagenow = '<?php echo $current_screen->id; ?>', 796 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 797 adminpage = '<?php echo $admin_body_class; ?>', 798 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 799 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', 800 isRtl = <?php echo (int) is_rtl(); ?>; 801 <?php 802 } 803 804 function admin_script_init( $hook_suffix = '', $set_globals = array() ) { 805 global $wp_locale; 806 $current_user = wp_get_current_user(); 807 $current_screen = get_current_screen(); 808 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 809 $defaults = array( 810 'userSettings' => array( 811 'url' => SITECOOKIEPATH, 812 'uid' => $current_user->ID, 813 'time' => time(), 814 ), 815 'ajaxurl' => admin_url( 'admin-ajax.php' ), 816 'adminpage' => $admin_body_class, 817 'thousandsSeparator' => addslashes( $wp_locale->number_format['thousands_sep'] ), 818 'decimalPoint' => addslashes( $wp_locale->number_format['decimal_point'] ), 819 'isRtl' => (int) is_rtl(), 820 ); 821 822 if ( $current_screen ) { 823 $defaults['pagenow'] = $current_screen->id; 824 if ( isset( $current_screen->post_type ) ) { 825 $defaults['typenow'] = $current_screen->post_type; 826 } 827 } 828 829 $globals = wp_parse_args( $set_globals, $defaults ); 830 831 ?> 832 <script type="text/javascript"> 833 //<![CDATA[ 834 <?php admin_addLoadEvent(); ?> 835 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 836 <?php 837 $outputs = array(); 838 echo 'var '; 839 foreach ( $globals as $name => $value ) { 840 $value = json_encode( $value ); 841 842 $outputs[] = "{$name} = {$value}"; 843 } 844 845 echo implode( ",\n\t", $outputs ) . ";\n"; 846 ?> 847 //]]> 848 </script> 849 <?php 850 } 851 778 852 function script_concat_settings() { 779 853 global $concatenate_scripts, $compress_scripts, $compress_css; 780 854 … … add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); 805 879 806 880 add_action( 'wp_default_styles', 'wp_default_styles' ); 807 881 add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); 882 883 add_action( 'admin_enqueue_scripts', 'admin_script_init', 1, 1 ); 884 No newline at end of file -
wp-login.php
diff --git wp-login.php wp-login.php index 0ae7b85..2e85f81 100644
function wp_shake_js() { 146 146 return; 147 147 ?> 148 148 <script type="text/javascript"> 149 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();}}}; 149 <?php admin_addLoadEvent(); ?> 150 150 function s(id,pos){g(id).left=pos+'px';} 151 151 function g(id){return document.getElementById(id).style;} 152 152 function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}