Switch from addLoadEvent to jQuery(document).ready. Fixes #6241 props azaozz.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-03-15 22:57:47 +00:00
parent 04ae1fc75a
commit e65d6369f2
12 changed files with 26 additions and 41 deletions

View File

@ -66,15 +66,7 @@ else
?>" />
<?php echo $form_extra ?>
<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
<script type="text/javascript">
function focusit() {
// focus on first input field
document.post.title.focus();
}
addLoadEvent(focusit);
</script>
<?php endif; ?>
<div id="poststuff">
<div class="submitbox" id="submitpost">
@ -352,3 +344,9 @@ if ( $authors && count( $authors ) > 1 ) :
</div>
</form>
<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
<?php endif; ?>

View File

@ -12,13 +12,6 @@ $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment-
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
<script type="text/javascript">
function focusit() { // focus on first input field
document.post.name.focus();
}
addLoadEvent(focusit);
</script>
<div id="poststuff">
<div class="submitbox" id="submitcomment">
@ -108,3 +101,7 @@ echo "<a href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment
</div>
</form>
<script type="text/javascript">
try{document.post.name.focus();}catch(e){}
</script>

View File

@ -9,15 +9,6 @@
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='post' />
<script type="text/javascript">
<!--
function focusit() { // focus on first input field
document.getElementById('title').focus();
}
addLoadEvent(focusit);
//-->
</script>
<div id="poststuff">
<fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
@ -72,4 +63,7 @@ edCanvas = document.getElementById('content');
</div>
</form>
<script type="text/javascript">
try{document.getElementById('title').focus();}catch(e){}
</script>
</div>

View File

@ -44,14 +44,6 @@ else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<script type="text/javascript">
// <![CDATA[
function focusit() { // focus on first input field
document.post.title.focus();
}
addLoadEvent(focusit);
// ]]>
</script>
<div id="poststuff">
<div class="submitbox" id="submitpage">
@ -281,3 +273,7 @@ if ( $authors && count( $authors ) > 1 ) :
</div>
</form>
<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>

View File

@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
add_postbox_toggles('comment');
jQuery('.edit-timestamp').click(function () {

View File

@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
// pulse
jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);

View File

@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
jQuery('#link_name').focus();
// postboxes
add_postbox_toggles('link');

View File

@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
add_postbox_toggles('page');
make_slugedit_clickable();

View File

@ -58,7 +58,7 @@ function tag_press_key( e ) {
}
}
addLoadEvent( function() {
jQuery(document).ready( function() {
// postboxes
add_postbox_toggles('post');

View File

@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
theFileList = {
currentImage: {ID: 0},
nonce: '',

View File

@ -47,7 +47,7 @@ function profile_js ( ) {
$('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')});
} );
addLoadEvent( function() {
jQuery(document).ready( function() {
jQuery('#pass1,#pass2').attr('autocomplete','off');
});
</script>

View File

@ -11,7 +11,7 @@ var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
//on page load call tb_init
addLoadEvent(function(){
jQuery(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;