From 59770443b62f9206c511cf03ed3b32ebf31d7387 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Fri, 9 Jan 2015 14:09:13 -0800 Subject: [PATCH] Projects - tokenize [ProjectX] so "projectX" is a match Summary: Fixes T4656. Helps users with this naming convention, which is probably not super duper rare. Users will need to make an edit to a project -or- run bin/search index "#project-tag" to make this actually work. Test Plan: made a project "[T4656test]". Typed "t4" and project showed up! Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T4656 Differential Revision: https://secure.phabricator.com/D11302 --- resources/celerity/map.php | 12 ++++++------ .../datasource/PhabricatorTypeaheadDatasource.php | 2 +- .../typeahead/normalizer/TypeaheadNormalizer.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index f617600b74..e161da67f4 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '8fc8031a', - 'core.pkg.js' => '21041609', + 'core.pkg.js' => 'd49bf8b2', 'darkconsole.pkg.js' => '8ab24e01', 'differential.pkg.css' => '8af45893', 'differential.pkg.js' => 'dad3622f', @@ -211,7 +211,7 @@ return array( 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '9f06389f', 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'e614d22b', - 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '1c22377d', + 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '6f7a9da8', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0', @@ -674,7 +674,7 @@ return array( 'javelin-tokenizer' => '9f06389f', 'javelin-typeahead' => 'e614d22b', 'javelin-typeahead-composite-source' => '503e17fd', - 'javelin-typeahead-normalizer' => '1c22377d', + 'javelin-typeahead-normalizer' => '6f7a9da8', 'javelin-typeahead-ondemand-source' => '8b3fd187', 'javelin-typeahead-preloaded-source' => '54f314a0', 'javelin-typeahead-source' => 'fcba4ecc', @@ -956,9 +956,6 @@ return array( 'javelin-util', 'phabricator-keyboard-shortcut-manager', ), - '1c22377d' => array( - 'javelin-install', - ), '1def2711' => array( 'javelin-install', 'javelin-dom', @@ -1266,6 +1263,9 @@ return array( 'javelin-util', 'javelin-stratcom', ), + '6f7a9da8' => array( + 'javelin-install', + ), '724b1247' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', diff --git a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php index faf01795da..d08ea87685 100644 --- a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php +++ b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php @@ -74,7 +74,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject { return array(); } - $tokens = preg_split('/\s+|-/', $string); + $tokens = preg_split('/\s+|[-\[\]]/', $string); return array_unique($tokens); } diff --git a/webroot/rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js b/webroot/rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js index d048b67e47..0c5d6724c6 100644 --- a/webroot/rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js +++ b/webroot/rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js @@ -17,7 +17,7 @@ JX.install('TypeaheadNormalizer', { return ('' + str) .toLocaleLowerCase() .replace(/[\.,\/#!$%\^&\*;:{}=_`~()]/g, '') - .replace(/-/g, ' ') + .replace(/[-\[\]]/g, ' ') .replace(/ +/g, ' ') .replace(/^\s*|\s*$/g, ''); }