Workaround for WebKit bug when previewing posts, props SergeyBiryukov, fixes #18341

git-svn-id: http://svn.automattic.com/wordpress/trunk@19299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-15 18:48:55 +00:00
parent 5e3fe22bac
commit 5bc81f5d80
3 changed files with 13 additions and 2 deletions

View File

@ -83,6 +83,17 @@ jQuery(document).ready( function($) {
doPreview = function() {
$('input#wp-preview').val('dopreview');
$('form#post').attr('target', 'wp-preview').submit().attr('target', '');
/*
* Workaround for WebKit bug preventing a form submitting twice to the same action.
* https://bugs.webkit.org/show_bug.cgi?id=28633
*/
if ( $.browser.safari ) {
$('form#post').attr('action', function(index, value) {
return value + '?t=' + new Date().getTime();
});
}
$('input#wp-preview').val('');
}

File diff suppressed because one or more lines are too long

View File

@ -101,7 +101,7 @@ function wp_default_scripts( &$scripts ) {
'dismiss' => __('Dismiss'),
) );
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111111', 1 );
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111115', 1 );
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20110521', 1 );