diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 1bb3bfbeae..527cd6a39e 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' => '442efd08', - 'rsrc/js/phuix/PHUIXAutocomplete.js' => 'bb19ed2c', + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '623a766b', 'rsrc/js/phuix/PHUIXButtonView.js' => '8a91e1ac', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '04b2ae03', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', @@ -881,7 +881,7 @@ return array( 'phui-workpanel-view-css' => 'a3a63478', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => '442efd08', - 'phuix-autocomplete' => 'bb19ed2c', + 'phuix-autocomplete' => '623a766b', 'phuix-button-view' => '8a91e1ac', 'phuix-dropdown-menu' => '04b2ae03', 'phuix-form-control-view' => '16ad6224', @@ -1407,6 +1407,12 @@ return array( 'javelin-magical-init', 'javelin-util', ), + '623a766b' => array( + 'javelin-install', + 'javelin-dom', + 'phuix-icon-view', + 'phabricator-prefab', + ), '628f59de' => array( 'phui-oi-list-view-css', ), @@ -1868,12 +1874,6 @@ return array( 'javelin-uri', 'phabricator-notification', ), - 'bb19ed2c' => array( - 'javelin-install', - 'javelin-dom', - 'phuix-icon-view', - 'phabricator-prefab', - ), 'bcaccd64' => array( 'javelin-behavior', 'javelin-behavior-device', diff --git a/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php b/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php index cd01c265c8..f8d3cda0cd 100644 --- a/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php +++ b/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php @@ -24,6 +24,7 @@ final class PhabricatorPhurlURLDatasource ->setDisplayName($url->getName()) ->setName($url->getName()." ".$url->getAlias()) ->setPHID($url->getPHID()) + ->setAutocomplete('(('.$url->getAlias().'))') ->addAttribute($url->getLongURL()); $results[] = $result; diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index 219702b2c7..dba0ef0546 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -73,6 +73,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { )); $phriction_datasource = new PhrictionDocumentDatasource(); + $phurl_datasource = new PhabricatorPhurlURLDatasource(); Javelin::initBehavior( 'phabricator-remarkup-assist', @@ -130,7 +131,17 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { '|', ']', ), - 'prefix' => '^\\[*', + 'prefix' => '^\\[', + ), + 40 => array( // "(" + 'datasourceURI' => $phurl_datasource->getDatasourceURI(), + 'headerIcon' => 'fa-compress', + 'headerText' => pht('Find Phurl:'), + 'hintText' => $phurl_datasource->getPlaceholderText(), + 'cancel' => array( + ')', + ), + 'prefix' => '^\\(', ), ), )); diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js index e5928b0297..b534af83f0 100644 --- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js +++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js @@ -107,6 +107,12 @@ JX.install('PHUIXAutocomplete', { prior = ''; } + // If this is a repeating sequence and the previous character is the + // same as the one the user just typed, like "((", don't reactivate. + if (prior === String.fromCharCode(code)) { + return; + } + switch (prior) { case '': case ' ':