Changeset 22858
- Timestamp:
- 11/27/2012 02:02:32 AM (12 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r22854 r22858 435 435 </script> 436 436 <?php endif; ?> 437 438 <?php if ( 'attachment' == $post_type ) { ?>439 <script type="text/javascript">440 (function($){441 function getFieldsContent() {442 return [ $('#title').val() || '',443 $('#attachment_caption').val() || '',444 $('#attachment_alt').val() || '',445 $('#attachment_content').val() || '',446 $('#post_name').val() || '' ];447 }448 449 var initial = getFieldsContent();450 451 window.onbeforeunload = function() {452 var i, changed, current = getFieldsContent();453 for ( var i = 0; i < initial.length; i++ ) {454 if ( changed = ( initial[i] !== current[i]) )455 break;456 }457 if ( changed )458 return '<?php _e('The changes you made will be lost if you navigate away from this page.'); ?>';459 };460 })(jQuery);461 </script>462 <?php } ?> -
trunk/wp-admin/post-new.php
r22777 r22858 47 47 wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); 48 48 49 if ( 'attachment' !== $post_type ) 50 wp_enqueue_script('autosave'); 49 wp_enqueue_script( 'autosave' ); 51 50 52 51 // Show post form.
Note: See TracChangeset
for help on using the changeset viewer.