Ticket #7392: 7392-6.patch
File 7392-6.patch, 2.5 KB (added by , 12 years ago) |
---|
-
wp-includes/js/autosave.js
1 1 var autosave, autosaveLast = '', autosavePeriodical, autosaveDelayPreview = false, notSaved = true, blockSave = false, fullscreen, autosaveLockRelease = true; 2 2 3 jQuery(document).ready( function($) { 3 if ( jQuery('#wp-content-wrap').hasClass('tmce-active') ) { 4 jQuery(document).on( '_tinymce-body-onload.autosave', function( e, editor ) { 5 if ( 'content' === editor.id && ! editor.isHidden() ) { 6 setTimeout( function(){ 7 editor.save(); 8 autosaveLast = wp.autosave.getCompareString(); 4 9 5 if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof tinymce != 'undefined' ) { 6 tinymce.onAddEditor.add( function( tinymce, editor ) { 7 if ( 'content' == editor.id ) { 8 editor.onLoad.add( function() { 9 editor.save(); 10 if ( typeof switchEditors != 'undefined' ) { 11 autosaveLast = wp.autosave.getCompareString({ 12 post_title : $('#title').val() || '', 13 content : switchEditors.pre_wpautop( $('#content').val() ) || '', 14 excerpt : $('#excerpt').val() || '', 15 }); 16 } else { 17 autosaveLast = wp.autosave.getCompareString(); 18 } 19 }); 20 } 21 }); 22 } else { 23 autosaveLast = wp.autosave.getCompareString(); 24 } 10 // temp debug 11 if ( 'console' in window ) 12 console.log( 'autosave will run = %s', autosaveLast !== wp.autosave.getCompareString() ); 13 }, 1000 ); 14 } 15 }); 16 } 25 17 18 jQuery(document).ready( function($) { 19 autosaveLast = wp.autosave.getCompareString(); 26 20 autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true}); 27 21 28 22 //Disable autosave after the form has been submitted -
wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
236 236 o.content = switchEditors.pre_wpautop(o.content); 237 237 }); 238 238 239 ed.onLoad.add( function(ed) { 240 if ( typeof jQuery === 'function' ) 241 jQuery(document).trigger( '_tinymce-body-onload', [ ed ] ); 242 }); 243 239 244 /* disable for now 240 245 ed.onBeforeSetContent.add(function(ed, o) { 241 246 o.content = t._setEmbed(o.content);