Modularise editable element text access#424
Conversation
There was a problem hiding this comment.
Developers outside Wikimedia will not be familiar with OOJS. You can remove reference to OOJS and just state what really the method does- in this case having static members initizlied with empty object.
There was a problem hiding this comment.
I think it's worth mentioning that this is based on OOJS so in future we don't add code which may conflict with it, and therefore leave the door open to actually using it.
|
Very good improvements. Thanks. I get A sample is given below. All CE tests return blank output. At the same time, when I tested manually in FF by typing something in the CE, I dont see any functionality broken.So I guess issue is in the testing instrumentation. |
|
Hmmm, I think there's something strange going on with the tests on Firefox. I'm seeing 53 failures on this commit (d6778c8), versus 693 failures(!) on the prior commit (ea97e4b). Server: cd src/jquery.ime && python -m SimpleHTTPServer |
|
On a subsequent identical run on this commit ( d6778c8 ), I see only 8 failures on Firefox (the same 8 failures as on Chromium), so I think there's a race condition or something similar. |
9be365a to
ca73b01
Compare
Move the code specific to each type of editable element text access into a dedicated class, and use a factory pattern so a project using jQuery.IME can register its own editable element text access implementation. TextEntry, TextEntry#getTextBeforeSelection( maxLength ), TextEntry#replaceTextAtSelection( precedingCharCount, newText ): * Abstract base class with methods to read/replace editable element text FormWidgetEntry: * Concrete implementation for form widgets containing plain text. * IE8 fallback compatibility ContentEditableEntry: * Concrete implementation for ContentEditable widgets * Fires jQuery fake composition/input events, for clean interaction with other JS code TextEntryFactory, TextEntryFactory#wrap( $element ), * Factory class with method to wrap editable element $.ime.TextEntry, $.ime.textEntryFactory, $.ime.inheritClass: * Publicly accesible abstract base class, factory singleton, and inheritance tool
|
Merged in commit 65cdfaf |
Move the code specific to each type of editable element text access into a
dedicated class, and use a factory pattern so a project using jQuery.IME can
register its own editable element text access implementation.
TextEntry,
TextEntry#getTextBeforeSelection( maxLength ),
TextEntry#replaceTextAtSelection( precedingCharCount, newText ):
FormWidgetEntry,
ContentEditableEntry:
TextEntryFactory,
TextEntryFactory#wrap( $element ),
$.ime.TextEntry,
$.ime.textEntryFactory: