diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8a4146b0a3..f83c2b0f09 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -528,7 +528,7 @@ return array( 'rsrc/js/phui/behavior-phui-tab-group.js' => '0a0b10e9', 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionView.js' => 'b3465b9b', - 'rsrc/js/phuix/PHUIXAutocomplete.js' => '7c492cd2', + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '7910aacb', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8018ee50', 'rsrc/js/phuix/PHUIXFormControl.js' => '83e03671', 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', @@ -885,7 +885,7 @@ return array( 'phui-workpanel-view-css' => 'a3a63478', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => 'b3465b9b', - 'phuix-autocomplete' => '7c492cd2', + 'phuix-autocomplete' => '7910aacb', 'phuix-dropdown-menu' => '8018ee50', 'phuix-form-control-view' => '83e03671', 'phuix-icon-view' => 'bff6884b', @@ -1456,6 +1456,12 @@ return array( 'multirow-row-manager', 'javelin-json', ), + '7910aacb' => array( + 'javelin-install', + 'javelin-dom', + 'phuix-icon-view', + 'phabricator-prefab', + ), '7927a7d3' => array( 'javelin-behavior', 'javelin-quicksand', @@ -1464,12 +1470,6 @@ return array( 'owners-path-editor', 'javelin-behavior', ), - '7c492cd2' => array( - 'javelin-install', - 'javelin-dom', - 'phuix-icon-view', - 'phabricator-prefab', - ), '7cbe244b' => array( 'javelin-install', 'javelin-util', diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index 52fb44617d..75054b9575 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -97,6 +97,15 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { 'headerIcon' => 'fa-smile-o', 'headerText' => pht('Find Emoji:'), 'hintText' => $emoji_datasource->getPlaceholderText(), + + // Cancel on emoticons like ":3". + 'ignore' => array( + '3', + ')', + '(', + '-', + '/', + ), ), ), )); diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js index b7116c557b..e99dcc34f2 100644 --- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js +++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js @@ -343,6 +343,10 @@ JX.install('PHUIXAutocomplete', { return [' ', ':', ',', '.', '!', '?']; }, + _getIgnoreList: function() { + return this._map[this._active].ignore || []; + }, + _isTerminatedString: function(string) { var terminators = this._getTerminators(); for (var ii = 0; ii < terminators.length; ii++) { @@ -517,6 +521,14 @@ JX.install('PHUIXAutocomplete', { } } + var ignore = this._getIgnoreList(); + for (ii = 0; ii < ignore.length; ii++) { + if (trim.indexOf(ignore[ii]) === 0) { + this._deactivate(); + return; + } + } + // If the input is terminated by a space or another word-terminating // punctuation mark, we're going to deactivate if the results can not // be refined by addding more words.