Page MenuHomePhabricator

D17594.id42323.diff
No OneTemporary

D17594.id42323.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -10,7 +10,7 @@
'conpherence.pkg.css' => '82aca405',
'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => '1bf8fa70',
- 'core.pkg.js' => '021685f1',
+ 'core.pkg.js' => '154b64fc',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '90b30783',
'differential.pkg.js' => 'ddfeb49b',
@@ -504,6 +504,7 @@
'rsrc/js/core/behavior-oncopy.js' => '2926fff2',
'rsrc/js/core/behavior-phabricator-nav.js' => '08675c6d',
'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'a0777ea3',
+ 'rsrc/js/core/behavior-phix-spelling.js' => '9b9ddf14',
'rsrc/js/core/behavior-read-only-warning.js' => 'ba158207',
'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b',
'rsrc/js/core/behavior-remarkup-preview.js' => '4b700e9e',
@@ -589,6 +590,7 @@
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
'javelin-behavior-aphront-drag-and-drop-textarea' => '484a6e22',
'javelin-behavior-aphront-form-disable-on-submit' => '5c54cbf3',
+ 'javelin-behavior-aphront-form-phix-spelling' => '9b9ddf14',
'javelin-behavior-aphront-more' => 'a80d0378',
'javelin-behavior-audio-source' => '59b251eb',
'javelin-behavior-audit-preview' => 'd835b03a',
@@ -1670,6 +1672,11 @@
'aphront-typeahead-control-css',
'phui-tag-view-css',
),
+ '9b9ddf14' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ ),
'9bbf3762' => array(
'javelin-behavior',
'javelin-dom',
@@ -2411,6 +2418,7 @@
'javelin-behavior-aphlict-status',
'javelin-behavior-user-menu',
'phabricator-favicon',
+ 'javelin-behavior-aphront-form-phix-spelling',
),
'darkconsole.pkg.js' => array(
'javelin-behavior-dark-console',
diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php
--- a/resources/celerity/packages.php
+++ b/resources/celerity/packages.php
@@ -87,6 +87,7 @@
'javelin-behavior-aphlict-status',
'javelin-behavior-user-menu',
'phabricator-favicon',
+ 'javelin-behavior-aphront-form-phix-spelling',
),
'core.pkg.css' => array(
'phabricator-core-css',
diff --git a/webroot/rsrc/js/core/behavior-phix-spelling.js b/webroot/rsrc/js/core/behavior-phix-spelling.js
new file mode 100644
--- /dev/null
+++ b/webroot/rsrc/js/core/behavior-phix-spelling.js
@@ -0,0 +1,18 @@
+/**
+ * @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);
+ }
+});

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 7:53 PM (16 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6775787
Default Alt Text
D17594.id42323.diff (3 KB)

Event Timeline