summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Kohl <gitlab@jonaskohl.de>2024-07-26 10:15:48 +0200
committerJonas Kohl <gitlab@jonaskohl.de>2024-07-26 10:15:48 +0200
commit59d6c150f7b3562b7e8cb1a0504186c5ad097b0a (patch)
treebdac781ba4a006a31f2854ad97b0e607438ee1d6 /src
parent8effbccd6057b2d804ea55b88c5dfe5d5c0945a5 (diff)
Tweak emoticons data formatting
Diffstat (limited to 'src')
-rw-r--r--src/codegen/emoticons.php4
-rw-r--r--src/pages/guestbook.php8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/codegen/emoticons.php b/src/codegen/emoticons.php
index 51b9ed6..5b6f51f 100644
--- a/src/codegen/emoticons.php
+++ b/src/codegen/emoticons.php
@@ -4,7 +4,7 @@ $em_dir = SRCDIR . "/static/emoticons";
$emoticons = array_map(
fn($i) => [
pathinfo($i, PATHINFO_FILENAME),
- getimagesize($em_dir . "/" . $i)["3"]
+ ...array_slice(getimagesize($em_dir . "/" . $i), 0, 2),
],
array_values(
array_filter(
@@ -32,5 +32,5 @@ return [
json_encode([
$emoticons,
$emoticons_alpha_lookup,
- ], JSON_PRETTY_PRINT) . ";\n",
+ ]) . ";\n",
];
diff --git a/src/pages/guestbook.php b/src/pages/guestbook.php
index e7c3e28..6a3393d 100644
--- a/src/pages/guestbook.php
+++ b/src/pages/guestbook.php
@@ -28,7 +28,8 @@ function replace_emoticons(html) {
html = html.split(":" + EMOTICONS[0][i][0] + ":")
.join(
'<img src="/static/emoticons/' + EMOTICONS[0][i][0] + '.gif" ' +
- EMOTICONS[0][i][1] +
+ ' width="' + EMOTICONS[0][i][1] + '"' +
+ ' height="' + EMOTICONS[0][i][2] + '"' +
' alt="' + EMOTICONS[0][i][0] + '"' +
' title=":' + EMOTICONS[0][i][0] + ':" />'
);
@@ -61,8 +62,9 @@ $(function() {
idx = EMOTICONS[1][i];
win.document.write(
"<tr><td>" +
- '<img src="/static/emoticons/' + EMOTICONS[0][idx][0] + '.gif" ' +
- EMOTICONS[0][idx][1] +
+ '<img src="/static/emoticons/' + EMOTICONS[0][idx][0] + '.gif"' +
+ ' width="' + EMOTICONS[0][idx][1] + '"' +
+ ' height="' + EMOTICONS[0][idx][2] + '"' +
' alt="' + EMOTICONS[0][idx][0] + '"' +
' title=":' + EMOTICONS[0][idx][0] + ':" />' +
"</td><td><font face=Verdana size=2>" +