-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.0 scroll bug fix, scrolllock, facebook, messenger emojiset suppo…
…rt, open on colon, better amd support, ability to disable specific categories, IE event fix, some performance improvements, snowman typo
- Loading branch information
Showing
16 changed files
with
43,008 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
error_reporting(E_ALL & ~E_NOTICE); | ||
$debug = TRUE; | ||
if ($debug) header('Content-Type: application/json'); | ||
|
||
$dir = dirname(__FILE__); | ||
$in = file_get_contents($dir . '/emoji_pretty.json'); | ||
$d = json_decode($in, TRUE); | ||
|
||
|
||
# | ||
# build the catalog | ||
# | ||
|
||
$out = array(); | ||
|
||
foreach ($d as $row) | ||
{ | ||
if (!isset($out[$row['category']])) | ||
$out[$row['category']] = array(); | ||
|
||
$out[$row['category']][] = array( | ||
'has_img_apple' => $row['has_img_apple'], | ||
'has_img_google' => $row['has_img_google'], | ||
'has_img_twitter' => $row['has_img_twitter'], | ||
'has_img_emojione' => $row['has_img_emojione'], | ||
'has_img_facebook' => $row['has_img_facebook'], | ||
'has_img_messenger' => $row['has_img_messenger'], | ||
|
||
'name' => $row['name'], | ||
'short_name' => $row['short_name'], | ||
'short_names' => $row['short_names'], | ||
'sort_order' => $row['sort_order'] | ||
); | ||
} | ||
|
||
foreach ($out as &$category) { | ||
sortArrayByKey($category, 'sort_order'); | ||
} | ||
|
||
function sortArrayByKey(&$array, $key) | ||
{ | ||
usort($array, function ($a, $b) use (&$key, &$asc) | ||
{ | ||
if ($a[$key] == $b[$key]) | ||
{ | ||
return 0; | ||
} | ||
return ($a[$key] < $b[$key]) ? -1 : 1; | ||
}); | ||
} | ||
|
||
$encoded = json_encode($out); | ||
|
||
$fp = fopen($dir . '/lightweight.json', 'w'); | ||
fwrite($fp, $encoded); | ||
fclose($fp); | ||
|
||
if ($debug) | ||
{ | ||
echo $encoded; | ||
} |
Oops, something went wrong.