Changeset 37668
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
r37023 r37668 63 63 enter(); 64 64 } 65 66 // Wait for the browser to insert the character. 67 if ( event.keyCode === VK.SPACEBAR && ! event.ctrlKey && ! event.metaKey && ! event.altKey ) { 68 setTimeout( space ); 69 } else if ( event.keyCode > 47 && ! ( event.keyCode >= 91 && event.keyCode <= 93 ) ) { 70 setTimeout( inline ); 71 } 65 72 }, true ); 66 67 editor.on( 'keyup', function( event ) {68 if ( event.keyCode === VK.SPACEBAR && ! event.ctrlKey && ! event.metaKey && ! event.altKey ) {69 space();70 } else if ( event.keyCode > 47 && ! ( event.keyCode >= 91 && event.keyCode <= 93 ) ) {71 inline();72 }73 } );74 73 75 74 function inline() { -
trunk/tests/qunit/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
r37080 r37668 7 7 } 8 8 9 function mceType( chr) {9 function mceType( chr, noKeyUp ) { 10 10 var editor = tinymce.activeEditor, keyCode, charCode, evt, startElm, rng, startContainer, startOffset, textNode; 11 11 … … 110 110 } 111 111 112 fakeEvent(startElm, 'keyup', evt); 112 if ( ! noKeyUp ) { 113 fakeEvent(startElm, 'keyup', evt); 114 } 113 115 } 114 116 … … 116 118 var args = arguments; 117 119 120 // Wait once for conversions to be triggered, 121 // and once for the `canUndo` flag to be set. 122 setTimeout( function() { 118 123 setTimeout( function() { 119 124 if ( typeof args[0] === 'string' ) { … … 134 139 type.apply( null, args ); 135 140 } 141 } ); 136 142 } ); 137 143 } … … 178 184 } ); 179 185 186 QUnit.test( 'Unordered list. (fast)', function( assert ) { 187 type( '*', function() { 188 mceType( ' ', true ); 189 }, 'a', function() { 190 assert.equal( editor.getContent(), '<ul>\n<li>a</li>\n</ul>' ); 191 }, assert.async() ); 192 } ); 193 180 194 QUnit.test( 'Ordered list.', function( assert ) { 181 195 type( '1. a', function() {
Note: See TracChangeset
for help on using the changeset viewer.