mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +00:00
Autosave to the browser's sessionStorage, compare this autosave to the post content on page load and let the user restore it when the data is not the same. First run, see #23220
git-svn-id: https://develop.svn.wordpress.org/trunk@23683 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -106,7 +106,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'dismiss' => __('Dismiss'),
|
||||
) );
|
||||
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), false, 1 );
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response', 'editor'), false, 1 );
|
||||
|
||||
$scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings',
|
||||
@@ -585,7 +585,8 @@ function wp_just_in_time_script_localization() {
|
||||
wp_localize_script( 'autosave', 'autosaveL10n', array(
|
||||
'autosaveInterval' => AUTOSAVE_INTERVAL,
|
||||
'savingText' => __('Saving Draft…'),
|
||||
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
|
||||
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
|
||||
'blog_id' => get_current_blog_id(),
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user