Ticket #6043: 6043.3.diff
| File 6043.3.diff, 5.3 KB (added by , 18 years ago) |
|---|
-
wp-includes/js/autosave.js
1 1 var autosaveLast = ''; 2 2 var autosavePeriodical; 3 var autosaveOldMessage = ''; 3 4 4 5 jQuery(function($) { 5 6 autosaveLast = $('#post #title').val()+$('#post #content').val(); … … 17 18 18 19 // called when autosaving pre-existing post 19 20 function autosave_saved(response) { 20 var oldMessage = jQuery('#autosave').html();21 21 var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response 22 22 var message = ''; 23 23 … … 39 39 } 40 40 } 41 41 if ( message ) { jQuery('#autosave').html(message); } // update autosave message 42 else if ( oldMessage && res ) { jQuery('#autosave').html( oldMessage ); }42 else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } 43 43 autosave_enable_buttons(); // re-enable disabled form buttons 44 44 return res; 45 45 } … … 180 180 post_data['autosave'] = 0; 181 181 } 182 182 183 autosaveOldMessage = jQuery('#autosave').html(); 184 183 185 jQuery.ajax({ 184 186 data: post_data, 185 187 beforeSend: doAutoSave ? autosave_loading : null, -
wp-admin/admin-ajax.php
472 472 check_ajax_referer( 'autosave', 'autosavenonce' ); 473 473 global $current_user; 474 474 475 $_POST['post_content'] = $_POST['content'];476 $_POST['post_excerpt'] = $_POST['excerpt'];477 475 $_POST['post_status'] = 'draft'; 478 476 $_POST['post_category'] = explode(",", $_POST['catslist']); 479 477 $_POST['tags_input'] = explode(",", $_POST['tags_input']); … … 521 519 die(__('You are not allowed to edit this post.')); 522 520 } 523 521 if ( $do_autosave ) { 524 $id = wp_update_post($_POST);522 $id = edit_post(); 525 523 $data = $message; 526 524 } else { 527 525 $id = $post->ID; -
wp-admin/wp-admin.css
1215 1215 border-bottom: 1px solid #ccc; 1216 1216 } 1217 1217 1218 .submitbox #autosave .error { 1219 color: #333; 1220 } 1221 1218 1222 /* Categories */ 1219 1223 1220 1224 #categorydiv #category-adder { -
wp-admin/includes/post.php
113 113 // Now that we have an ID we can fix any attachment anchor hrefs 114 114 _fix_attachment_links( $post_ID ); 115 115 116 wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID ); 117 116 118 return $post_ID; 117 119 } 118 120 … … 321 323 // Now that we have an ID we can fix any attachment anchor hrefs 322 324 _fix_attachment_links( $post_ID ); 323 325 326 wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID ); 327 324 328 return $post_ID; 325 329 } 326 330 -
wp-admin/post.php
69 69 if ( $last = wp_check_post_lock( $post->ID ) ) { 70 70 $last_user = get_userdata( $last ); 71 71 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 72 $message = sprintf( __( ' %s is currently editing this post' ), wp_specialchars( $last_user_name ) );72 $message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) ); 73 73 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 74 74 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 75 75 } else { -
wp-admin/edit-page-form.php
129 129 <br class="clear" /> 130 130 <?php if ($post_ID): ?> 131 131 <?php printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); ?> 132 <br class="clear" /> 132 133 <?php endif; ?> 133 134 <span id="autosave"></span> 134 135 </p> -
wp-admin/edit-form-advanced.php
151 151 <br class="clear" /> 152 152 <?php if ($post_ID): ?> 153 153 <?php printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); ?> 154 <br class="clear" /> 154 155 <?php endif; ?> 155 156 <span id="autosave"></span> 156 157 </p> -
wp-admin/page.php
60 60 if ( $last = wp_check_post_lock( $post->ID ) ) { 61 61 $last_user = get_userdata( $last ); 62 62 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 63 $message = sprintf( __( ' %s is currently editing this page' ), wp_specialchars( $last_user_name ) );63 $message = sprintf( __( 'Warning: %s is currently editing this page' ), wp_specialchars( $last_user_name ) ); 64 64 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 65 65 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 66 66 } else {