Ticket #22491: 22491-2.patch
File 22491-2.patch, 1.9 KB (added by , 12 years ago) |
---|
-
wp-admin/edit-form-advanced.php
418 418 try{document.post.title.focus();}catch(e){} 419 419 </script> 420 420 <?php endif; ?> 421 422 <?php if ( 'attachment' == $post_type ) { ?> 423 <script type="text/javascript"> 424 (function($){ 425 function getFieldsContent() { 426 return ($('#title').val() || '') + ($('#attachment_caption').val() || '') + 427 ($('#attachment_alt').val() || '') + ($('#attachment_content').val() || '') + ($('#post_name').val() || ''); 428 } 429 430 var initial = getFieldsContent(); 431 432 window.onbeforeunload = function() { 433 if ( initial != getFieldsContent() ) 434 return '<?php _e('The changes you made will be lost if you navigate away from this page.'); ?>'; 435 }; 436 })(jQuery); 437 </script> 438 <?php } ?> -
wp-admin/post-new.php
43 43 if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) 44 44 wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); 45 45 46 wp_enqueue_script('autosave'); 46 if ( 'attachment' !== $post_type ) 47 wp_enqueue_script('autosave'); 47 48 48 49 // Show post form. 49 50 $post = get_default_post_to_edit( $post_type, true ); -
wp-admin/post.php
169 169 add_action('admin_notices', '_admin_notice_post_locked' ); 170 170 } else { 171 171 $active_post_lock = wp_set_post_lock( $post->ID ); 172 wp_enqueue_script('autosave'); 172 173 if ( 'attachment' !== $post_type ) 174 wp_enqueue_script('autosave'); 173 175 } 174 176 175 177 $title = $post_type_object->labels->edit_item;