(123 . 8)(123 . 6)
10047 }
10048
10049 var autosave = function() {
10050 // (bool) is rich editor enabled and active
10051 var rich = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
10052 var post_data = {
10053 action: "autosave",
10054 post_ID: jQuery("#post_ID").val() || 0,
(143 . 14)(141 . 6)
10056 if ( jQuery("#TB_window").css('display') == 'block' )
10057 doAutoSave = false;
10058
10059 /* Gotta do this up here so we can check the length when tinyMCE is in use */
10060 if ( rich ) {
10061 var ed = tinyMCE.activeEditor;
10062 if ( 'mce_fullscreen' == ed.id )
10063 tinyMCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
10064 tinyMCE.get('content').save();
10065 }
10066
10067 post_data["content"] = jQuery("#content").val();
10068 if ( jQuery('#post_name').val() )
10069 post_data["post_name"] = jQuery('#post_name').val();
(179 . 13)(169 . 9)
10071 post_data["excerpt"] = jQuery("#excerpt").val();
10072 if ( jQuery("#post_author").size() )
10073 post_data["post_author"] = jQuery("#post_author").val();
10074
10075 post_data["user_ID"] = jQuery("#user-id").val();
10076
10077 // Don't run while the TinyMCE spellcheck is on. Why? Who knows.
10078 if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) {
10079 doAutoSave = false;
10080 }
10081
10082 if(parseInt(post_data["post_ID"]) < 1) {
10083 post_data["temp_ID"] = post_data["post_ID"];
10084 var successCallback = autosave_saved_new; // new post