Index: trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js |
— | — | @@ -32,7 +32,9 @@ |
33 | 33 | var code = charstr.charCodeAt(i); |
34 | 34 | // Trigger event and undo if prevented |
35 | 35 | var event = new jQuery.Event( 'keypress', { keyCode: code, which: code, charCode: code } ); |
36 | | - $input.trigger( event ); |
| 36 | + if( $input.triggerHandler( event ) ) { |
| 37 | + $input.val( $input.val() + charstr[i] ) ; |
| 38 | + } |
37 | 39 | } |
38 | 40 | }; |
39 | 41 | |
— | — | @@ -130,7 +132,16 @@ |
131 | 133 | scheme: 'mr', |
132 | 134 | $input: $( '<input>' ).attr( { id: "mr", type: 'text' } ) |
133 | 135 | } ); |
134 | | - |
| 136 | +narayamTest( { |
| 137 | + description: 'German Transliteration and keybuffer test', |
| 138 | + tests: [ |
| 139 | + { input: '~o', output: 'ö', description: 'German ö' }, |
| 140 | + { input: '~O', output: 'Ö', description: 'German Ö' }, |
| 141 | + { input: '~s', output: 'ß', description: 'German ß' } |
| 142 | + ], |
| 143 | + scheme: 'de', |
| 144 | + $input: $( '<input>' ).attr( { id: 'de', type: 'text' } ) |
| 145 | +} ); |
135 | 146 | teardown( ); |
136 | 147 | |
137 | 148 | }() ); |