From 59d6c150f7b3562b7e8cb1a0504186c5ad097b0a Mon Sep 17 00:00:00 2001
From: Jonas Kohl
Date: Fri, 26 Jul 2024 10:15:48 +0200
Subject: Tweak emoticons data formatting
---
src/codegen/emoticons.php | 4 ++--
src/pages/guestbook.php | 8 +++++---
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(
''
);
@@ -61,8 +62,9 @@ $(function() {
idx = EMOTICONS[1][i];
win.document.write(
"