- restorePostData = postData;
- undoPostData = {
- content: content,
- post_title: post_title,
- excerpt: excerpt
- };
-
- $notice = $( '#local-storage-notice' );
- $('.wrap h2').first().after( $notice.addClass( 'updated' ).show() );
-
- $notice.on( 'click.autosave-local', function( event ) {
- var $target = $( event.target );
-
- if ( $target.hasClass( 'restore-backup' ) ) {
- restorePost( restorePostData );
- $target.parent().hide();
- $(this).find( 'p.undo-restore' ).show();
- } else if ( $target.hasClass( 'undo-restore-backup' ) ) {
- restorePost( undoPostData );
- $target.parent().hide();
- $(this).find( 'p.local-restore' ).show();
- }
+ $notice = $( '#local-storage-notice' )
+ .insertAfter( $( '.wrap h1, .wrap h2' ).first() )
+ .addClass( 'notice-warning' );
+
+ if ( $newerAutosaveNotice.length ) {
+ // If there is a "server" autosave notice, hide it.
+ // The data in the session storage is either the same or newer.
+ $newerAutosaveNotice.slideUp( 150, function() {
+ $notice.slideDown( 150 );
+ });
+ } else {
+ $notice.slideDown( 200 );
+ }