mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-22 03:13:33 +01:00
Reduce emoji.js size
This commit is contained in:
parent
8616be12a2
commit
28f4e1e55e
4 changed files with 22773 additions and 22749 deletions
24
scripts/emoji-convert.sh
Executable file
24
scripts/emoji-convert.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script reduces the size and converts the emoji.json file from https://github.com/github/gemoji/blob/master/db/emoji.json
|
||||||
|
# to be used in the Android app (app/src/main/resources/emoji.json) and the Web UI (server/static/js/emoji.js).
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
ROOTDIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Syntax: $0 FILE.(js|json)"
|
||||||
|
echo "Example:"
|
||||||
|
echo " $0 emoji-converted.json"
|
||||||
|
echo " $0 $ROOTDIR/server/static/js/emoji.js"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$1" == *.js ]]; then
|
||||||
|
echo -n "// This file is generated by scripts/emoji-convert.sh to reduce the size
|
||||||
|
// Original data source: https://github.com/github/gemoji/blob/master/db/emoji.json
|
||||||
|
const rawEmojis = " > "$1"
|
||||||
|
cat "$SCRIPTDIR/emoji.json" | jq -rc 'map({emoji: .emoji,aliases: .aliases})' >> "$1"
|
||||||
|
else
|
||||||
|
cat "$SCRIPTDIR/emoji.json" | jq -rc 'map({emoji: .emoji,aliases: .aliases})' > "$1"
|
||||||
|
fi
|
22747
scripts/emoji.json
Normal file
22747
scripts/emoji.json
Normal file
File diff suppressed because it is too large
Load diff
0
scripts/postrm.sh
Normal file → Executable file
0
scripts/postrm.sh
Normal file → Executable file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue