Changeset 26202
- Timestamp:
- 11/15/2013 05:19:15 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/autosave.js
r25874 r26202 1 var autosave, autosaveLast = '', autosavePeriodical, autosaveDelayPreview = false, notSaved = true, blockSave = false, fullscreen, autosaveLockRelease = true; 1 /* global switchEditors, autosaveL10n, tinymce, ajaxurl, wpAjax, makeSlugeditClickable, wpCookies */ 2 var autosave, autosavePeriodical, fullscreen, doPreview, 3 autosaveLast = '', 4 autosaveDelayPreview = false, 5 notSaved = true, 6 blockSave = false, 7 autosaveLockRelease = true; 2 8 3 9 jQuery(document).ready( function($) { … … 16 22 17 23 //Disable autosave after the form has been submitted 18 $( "#post").submit(function() {24 $('#post').submit(function() { 19 25 $.cancel(autosavePeriodical); 20 26 autosaveLockRelease = false; … … 107 113 108 114 $('input#wp-preview').val(''); 109 } 115 }; 110 116 111 117 // This code is meant to allow tabbing from Title to Post content. … … 121 127 122 128 if ( ed && !ed.isHidden() ) { 123 $(this).one('keyup', function( e){129 $(this).one('keyup', function(){ 124 130 $('#content_tbl td.mceToolbar > a').focus(); 125 131 }); … … 283 289 284 290 // No autosave while thickbox is open (media buttons) 285 if ( jQuery( "#TB_window").css('display') == 'block' )291 if ( jQuery('#TB_window').css('display') == 'block' ) 286 292 return false; 287 293 … … 293 299 294 300 autosaveLast = compareString; 295 jQuery(document).triggerHandler('wpcountwords', [ post_data ["content"]]);301 jQuery(document).triggerHandler('wpcountwords', [ post_data.content ]); 296 302 297 303 // Disable buttons until we know the save completed. 298 304 autosave_disable_buttons(); 299 305 300 if ( post_data ["auto_draft"]== '1' ) {306 if ( post_data.auto_draft == '1' ) { 301 307 successCallback = autosave_saved_new; // new post 302 308 } else { … … 307 313 data: post_data, 308 314 beforeSend: autosave_loading, 309 type: "POST",315 type: 'POST', 310 316 url: ajaxurl, 311 317 success: successCallback … … 313 319 314 320 return true; 315 } 321 }; 316 322 317 323 // Autosave in localStorage … … 348 354 349 355 if ( typeof fullscreen != 'undefined' && fullscreen.settings.visible ) { 350 data ['post_title']= $('#wp-fullscreen-title').val() || '';351 data ['content']= $('#wp_mce_fullscreen').val() || '';356 data.post_title = $('#wp-fullscreen-title').val() || ''; 357 data.content = $('#wp_mce_fullscreen').val() || ''; 352 358 } else { 353 data ['post_title']= $('#title').val() || '';354 data ['content']= $('#content').val() || '';359 data.post_title = $('#title').val() || ''; 360 data.content = $('#content').val() || ''; 355 361 } 356 362 … … 365 371 cats.push(this.value); 366 372 }); 367 data ['catslist']= cats.join(',');373 data.catslist = cats.join(','); 368 374 369 375 if ( post_name = $('#post_name').val() ) 370 data ['post_name']= post_name;376 data.post_name = post_name; 371 377 372 378 if ( parent_id = $('#parent_id').val() ) 373 data ['parent_id']= parent_id;379 data.parent_id = parent_id; 374 380 375 381 if ( $('#comment_status').prop('checked') ) 376 data ['comment_status']= 'open';382 data.comment_status = 'open'; 377 383 378 384 if ( $('#ping_status').prop('checked') ) 379 data ['ping_status']= 'open';385 data.ping_status = 'open'; 380 386 381 387 if ( $('#auto_draft').val() == '1' ) 382 data ['auto_draft']= '1';388 data.auto_draft = '1'; 383 389 384 390 return data; … … 521 527 return false; 522 528 523 post_data ['save_time']= (new Date()).getTime();524 post_data ['status']= $('#post_status').val() || '';529 post_data.save_time = (new Date()).getTime(); 530 post_data.status = $('#post_status').val() || ''; 525 531 result = this.setData( post_data ); 526 532
Note: See TracChangeset
for help on using the changeset viewer.