Changeset 32680
- Timestamp:
- 06/01/2015 07:01:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/post.js
r31996 r32680 205 205 sticky = '', 206 206 last = 0, 207 co= $('#content'),207 $textarea = $('#content'), 208 208 $document = $(document), 209 209 $editSlugWrap = $('#edit-slug-box'), … … 213 213 $postVisibilitySelect = $('#post-visibility-select'), 214 214 $timestampdiv = $('#timestampdiv'), 215 $postStatusSelect = $('#post-status-select'); 215 $postStatusSelect = $('#post-status-select'), 216 isMac = window.navigator.platform ? window.navigator.platform.indexOf( 'Mac' ) !== -1 : false; 216 217 217 218 postboxes.add_postbox_toggles(pagenow); … … 314 315 // This code is meant to allow tabbing from Title to Post content. 315 316 $('#title').on( 'keydown.editor-focus', function( event ) { 316 var editor , $textarea;317 var editor; 317 318 318 319 if ( event.keyCode === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) { 319 320 editor = typeof tinymce != 'undefined' && tinymce.get('content'); 320 $textarea = $('#content');321 321 322 322 if ( editor && ! editor.isHidden() ) { … … 791 791 // word count 792 792 if ( typeof(wpWordCount) != 'undefined' ) { 793 $document.triggerHandler('wpcountwords', [ co.val() ]);794 795 co.keyup( function(e) {793 $document.triggerHandler('wpcountwords', [ $textarea.val() ]); 794 795 $textarea.keyup( function(e) { 796 796 var k = e.keyCode || e.charCode; 797 797 … … 800 800 801 801 if ( 13 == k || 8 == last || 46 == last ) 802 $document.triggerHandler('wpcountwords', [ co.val() ]);802 $document.triggerHandler('wpcountwords', [ $textarea.val() ]); 803 803 804 804 last = k; … … 836 836 ( function() { 837 837 var editor, offset, mce, 838 $textarea = $('textarea#content'),839 838 $handle = $('#post-status-info'), 840 839 $postdivrich = $('#postdivrich'); … … 924 923 }); 925 924 } 925 926 // Save on pressing Ctrl/Command + S in the Text editor 927 $textarea.on( 'keydown.wp-autosave', function( event ) { 928 if ( event.which === 83 ) { 929 if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) { 930 return; 931 } 932 933 wp.autosave && wp.autosave.server.triggerSave(); 934 event.preventDefault(); 935 } 936 }); 926 937 });
Note: See TracChangeset
for help on using the changeset viewer.