Ticket #36585: 36585.2.patch
File 36585.2.patch, 2.3 KB (added by , 8 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
62 62 if ( event.keyCode === VK.ENTER && ! VK.modifierPressed( event ) ) { 63 63 enter(); 64 64 } 65 }, true );66 65 67 editor.on( 'keyup', function( event ) {66 // Wait for the browser to insert the character. 68 67 if ( event.keyCode === VK.SPACEBAR && ! event.ctrlKey && ! event.metaKey && ! event.altKey ) { 69 s pace();68 setTimeout( space ); 70 69 } else if ( event.keyCode > 47 && ! ( event.keyCode >= 91 && event.keyCode <= 93 ) ) { 71 inline();70 setTimeout( inline ); 72 71 } 73 } );72 }, true ); 74 73 75 74 function inline() { 76 75 var rng = editor.selection.getRng(); -
tests/qunit/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
6 6 return; 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 12 12 function charCodeToKeyCode(charCode) { … … 109 109 } 110 110 } 111 111 112 fakeEvent(startElm, 'keyup', evt); 112 if ( ! noKeyUp ) { 113 fakeEvent(startElm, 'keyup', evt); 114 } 113 115 } 114 116 115 117 function type() { 116 118 var args = arguments; 117 119 118 120 setTimeout( function() { 121 setTimeout( function() { 119 122 if ( typeof args[0] === 'string' ) { 120 123 args[0] = args[0].split( '' ); 121 124 } … … 134 137 type.apply( null, args ); 135 138 } 136 139 } ); 140 } ); 137 141 } 138 142 139 143 QUnit.module( 'tinymce.plugins.wptextpattern', { … … 177 181 }, assert.async() ); 178 182 } ); 179 183 184 QUnit.test( 'Unordered list. (fast)', function( assert ) { 185 type( '*', function() { 186 mceType( ' ', true ); 187 }, 'a', function() { 188 assert.equal( editor.getContent(), '<ul>\n<li>a</li>\n</ul>' ); 189 }, assert.async() ); 190 } ); 191 180 192 QUnit.test( 'Ordered list.', function( assert ) { 181 193 type( '1. a', function() { 182 194 assert.equal( editor.getContent(), '<ol>\n<li>a</li>\n</ol>' );