Skip to content

Commit

Permalink
Switch from addLoadEvent to jQuery(document).ready. Fixes #6241 props…
Browse files Browse the repository at this point in the history
… azaozz.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
westi committed Mar 15, 2008
1 parent 04ae1fc commit e65d636
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 41 deletions.
16 changes: 7 additions & 9 deletions wp-admin/edit-form-advanced.php
Expand Up @@ -66,15 +66,7 @@
?>" />

<?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">
Expand Down Expand Up @@ -352,3 +344,9 @@ function focusit() {
</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; ?>
11 changes: 4 additions & 7 deletions wp-admin/edit-form-comment.php
Expand Up @@ -12,13 +12,6 @@
<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">
Expand Down Expand Up @@ -108,3 +101,7 @@ function focusit() { // focus on first input field
</div>

</form>

<script type="text/javascript">
try{document.post.name.focus();}catch(e){}
</script>
12 changes: 3 additions & 9 deletions wp-admin/edit-form.php
Expand Up @@ -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>
Expand Down Expand Up @@ -72,4 +63,7 @@ function focusit() { // focus on first input field
</div>
</form>

<script type="text/javascript">
try{document.getElementById('title').focus();}catch(e){}
</script>
</div>
12 changes: 4 additions & 8 deletions wp-admin/edit-page-form.php
Expand Up @@ -44,14 +44,6 @@
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">
Expand Down Expand Up @@ -281,3 +273,7 @@ function focusit() { // focus on first input field
</div>

</form>

<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
2 changes: 1 addition & 1 deletion wp-admin/js/comment.js
@@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
add_postbox_toggles('comment');

jQuery('.edit-timestamp').click(function () {
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/common.js
@@ -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);

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/link.js
@@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
jQuery('#link_name').focus();
// postboxes
add_postbox_toggles('link');
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/page.js
@@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
add_postbox_toggles('page');
make_slugedit_clickable();

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/post.js
Expand Up @@ -58,7 +58,7 @@ function tag_press_key( e ) {
}
}

addLoadEvent( function() {
jQuery(document).ready( function() {
// postboxes
add_postbox_toggles('post');

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/upload.js
@@ -1,4 +1,4 @@
addLoadEvent( function() {
jQuery(document).ready( function() {
theFileList = {
currentImage: {ID: 0},
nonce: '',
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/user-edit.php
Expand Up @@ -47,7 +47,7 @@ function check_pass_strength ( ) {
$('.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>
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/thickbox/thickbox.js
Expand Up @@ -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;
Expand Down

0 comments on commit e65d636

Please sign in to comment.