mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 11:30:55 +01:00
Add some sort of sort to Emoji Autocomplete
Summary: Ref T12139. Adds sorting by shortname. Also I sorted everything else. No reason. It didn't help Test Plan: `:star` Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12139 Differential Revision: https://secure.phabricator.com/D17246
This commit is contained in:
parent
1fed61cf9d
commit
01b35cdc12
3 changed files with 1597 additions and 1593 deletions
File diff suppressed because it is too large
Load diff
|
@ -21,8 +21,9 @@ $args->parse(
|
||||||
));
|
));
|
||||||
|
|
||||||
$root = dirname(phutil_get_library_root('phabricator'));
|
$root = dirname(phutil_get_library_root('phabricator'));
|
||||||
$path = $root.'/webroot/rsrc/externals/emojione/emoji_strategy.json';
|
// move this to an argument?
|
||||||
$export_path = $root.'/webroot/rsrc/emoji/manifest.json';
|
$path = $root.'/emoji_strategy.json';
|
||||||
|
$export_path = $root.'/resources/emoji/manifest.json';
|
||||||
|
|
||||||
if (Filesystem::pathExists($path)) {
|
if (Filesystem::pathExists($path)) {
|
||||||
$json = Filesystem::readFile($path);
|
$json = Filesystem::readFile($path);
|
||||||
|
@ -39,6 +40,7 @@ if (Filesystem::pathExists($path)) {
|
||||||
$data[$shortname] = $hex;
|
$data[$shortname] = $hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ksort($data);
|
||||||
$json = new PhutilJSON();
|
$json = new PhutilJSON();
|
||||||
$data = $json->encodeFormatted($data);
|
$data = $json->encodeFormatted($data);
|
||||||
Filesystem::writeFile($export_path, $data);
|
Filesystem::writeFile($export_path, $data);
|
||||||
|
|
|
@ -32,9 +32,11 @@ final class PhabricatorEmojiDatasource extends PhabricatorTypeaheadDatasource {
|
||||||
$results = array();
|
$results = array();
|
||||||
foreach ($emojis as $shortname => $emoji) {
|
foreach ($emojis as $shortname => $emoji) {
|
||||||
$display_name = $emoji.' '.$shortname;
|
$display_name = $emoji.' '.$shortname;
|
||||||
|
$name = str_replace('_', ' ', $shortname);
|
||||||
$result = id(new PhabricatorTypeaheadResult())
|
$result = id(new PhabricatorTypeaheadResult())
|
||||||
->setPHID($shortname)
|
->setPHID($shortname)
|
||||||
->setName($display_name)
|
->setName($name)
|
||||||
|
->setDisplayname($display_name)
|
||||||
->setAutocomplete($emoji);
|
->setAutocomplete($emoji);
|
||||||
|
|
||||||
$results[$shortname] = $result;
|
$results[$shortname] = $result;
|
||||||
|
|
Loading…
Reference in a new issue