mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Post locks:
- Show 'Saving revision...' while autosaving after a post has been taken over. Change to 'Your latest changes were saved as a revision.' when autosave completes. - Make sure a user exists before using $user->display_name. - Add 'post_lock_text' action for extending the message text. git-svn-id: https://develop.svn.wordpress.org/trunk@24042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+13
-2
@@ -277,15 +277,26 @@ $(document).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
|
||||
wrap = $('#notification-dialog-wrap');
|
||||
|
||||
if ( wrap.length && ! wrap.is(':visible') ) {
|
||||
if ( typeof autosave == 'function' )
|
||||
if ( typeof autosave == 'function' ) {
|
||||
$(document).on('autosave-disable-buttons.post-lock', function() {
|
||||
wrap.addClass('saving');
|
||||
}).on('autosave-enable-buttons.post-lock', function() {
|
||||
wrap.removeClass('saving').addClass('saved');
|
||||
window.onbeforeunload = null;
|
||||
});
|
||||
|
||||
// Save the latest changes and disable
|
||||
autosave();
|
||||
autosave = function(){};
|
||||
}
|
||||
|
||||
if ( received.lock_error.avatar_src ) {
|
||||
avatar = $('<img class="avatar avatar-64 photo" width="64" height="64" />').attr( 'src', received.lock_error.avatar_src.replace(/&/g, '&') );
|
||||
wrap.find('div.post-locked-avatar').empty().append( avatar );
|
||||
}
|
||||
|
||||
wrap.show().find('p.currently-editing').text( received.lock_error.text ).focus();
|
||||
wrap.show().find('.currently-editing').text( received.lock_error.text );
|
||||
wrap.find('.wp-tab-first').focus();
|
||||
}
|
||||
} else if ( received.new_lock ) {
|
||||
$('#active_post_lock').val( received.new_lock );
|
||||
|
||||
Reference in New Issue
Block a user