Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/behavior-phix-spelling.js
- This file was added.
| /** | |||||
| * @requires javelin-behavior javelin-stratcom javelin-dom | |||||
| * @provides javelin-behavior-aphront-form-phix-spelling | |||||
| */ | |||||
| JX.Stratcom.listen('keydown', null, function(e) { | |||||
| var target = e.getTarget(); | |||||
| var tag = target.tagName.toLowerCase(); | |||||
| //TODONT: This logic should probably be done via sigils but that wasn't | |||||
| // working and this is which makes this better. | |||||
| if (tag === 'textarea' || (tag === 'input' && target.type === 'text')) { | |||||
| setTimeout(function() { | |||||
| target.value = target.value.replace(/f/g, 'ph'); | |||||
| target.value = target.value.replace(/F/g, 'Ph'); | |||||
| }, 0); | |||||
| } | |||||
| }); | |||||