Changeset 21300 for trunk/wp-includes/js/autosave.dev.js
- Timestamp:
- 07/22/2012 02:33:53 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/autosave.dev.js
r19593 r21300 2 2 3 3 jQuery(document).ready( function($) { 4 var dotabkey = true;5 4 6 5 autosaveLast = $('#post #title').val() + $('#post #content').val(); … … 30 29 31 30 window.onbeforeunload = function(){ 32 var mce = typeof(tiny MCE) != 'undefined' ? tinyMCE.activeEditor : false, title, content;31 var mce = typeof(tinymce) != 'undefined' ? tinymce.activeEditor : false, title, content; 33 32 34 33 if ( mce && !mce.isHidden() ) { … … 98 97 } 99 98 100 // This code is meant to allow tabbing from Title to Post if tinyMCE is defined. 101 if ( typeof tinyMCE != 'undefined' ) { 102 $('#title')[$.browser.opera ? 'keypress' : 'keydown'](function (e) { 103 if ( e.which == 9 && !e.shiftKey && !e.controlKey && !e.altKey ) { 104 if ( ($('#auto_draft').val() == '1') && ($("#title").val().length > 0) ) { autosave(); } 105 if ( tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() && dotabkey ) { 106 e.preventDefault(); 107 dotabkey = false; 108 tinyMCE.activeEditor.focus(); 109 return false; 110 } 99 // This code is meant to allow tabbing from Title to Post if tinymce is defined. 100 if ( typeof tinymce != 'undefined' ) { 101 $('#title').bind('keydown.focus-tinymce', function(e) { 102 if ( e.which != 9 ) 103 return; 104 105 if ( !e.ctrlKey && !e.altKey && !e.shiftKey && tinymce.activeEditor && !tinymce.activeEditor.isHidden() ) { 106 $('td.mceToolbar > a').focus(); 107 e.preventDefault(); 111 108 } 112 109 }); … … 245 242 // (bool) is rich editor enabled and active 246 243 blockSave = true; 247 var rich = (typeof tiny MCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden(),244 var rich = (typeof tinymce != "undefined") && tinymce.activeEditor && !tinymce.activeEditor.isHidden(), 248 245 post_data, doAutoSave, ed, origStatus, successCallback; 249 246 … … 270 267 doAutoSave = false; 271 268 272 /* Gotta do this up here so we can check the length when tiny MCEis in use */269 /* Gotta do this up here so we can check the length when tinymce is in use */ 273 270 if ( rich && doAutoSave ) { 274 ed = tiny MCE.activeEditor;275 // Don't run while the TinyMCEspellcheck is on. It resets all found words.271 ed = tinymce.activeEditor; 272 // Don't run while the tinymce spellcheck is on. It resets all found words. 276 273 if ( ed.plugins.spellchecker && ed.plugins.spellchecker.active ) { 277 274 doAutoSave = false; 278 275 } else { 279 276 if ( 'mce_fullscreen' == ed.id || 'wp_mce_fullscreen' == ed.id ) 280 tiny MCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});281 tiny MCE.triggerSave();277 tinymce.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); 278 tinymce.triggerSave(); 282 279 } 283 280 }
Note: See TracChangeset
for help on using the changeset viewer.