Compare commits
12 Commits
v1.4.22
...
bc1a91b7d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc1a91b7d7 | ||
|
|
7d5beedfbb | ||
|
|
0651d517b2 | ||
|
|
c5e236e095 | ||
|
|
a5bff19796 | ||
|
|
284f3d9a32 | ||
|
|
7ce82ce82e | ||
|
|
ce12684193 | ||
|
|
6cee38e99f | ||
|
|
88758427fd | ||
|
|
23ed867ac4 | ||
|
|
f8b1334a9a |
@@ -7,7 +7,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|||||||
DIST_DIR="$SCRIPT_DIR/dist"
|
DIST_DIR="$SCRIPT_DIR/dist"
|
||||||
CSS_FILE="$SCRIPT_DIR/style.css"
|
CSS_FILE="$SCRIPT_DIR/style.css"
|
||||||
JS_FILE="$SCRIPT_DIR/kantine.js"
|
JS_FILE="$SCRIPT_DIR/kantine.js"
|
||||||
FAVICON_FILE="$SCRIPT_DIR/favicon.svg"
|
FAVICON_FILE="$SCRIPT_DIR/favicon.png"
|
||||||
|
|
||||||
# === VERSION ===
|
# === VERSION ===
|
||||||
if [ -f "$SCRIPT_DIR/version.txt" ]; then
|
if [ -f "$SCRIPT_DIR/version.txt" ]; then
|
||||||
@@ -26,14 +26,14 @@ if [ ! -f "$CSS_FILE" ]; then echo "ERROR: $CSS_FILE not found"; exit 1; fi
|
|||||||
if [ ! -f "$JS_FILE" ]; then echo "ERROR: $JS_FILE not found"; exit 1; fi
|
if [ ! -f "$JS_FILE" ]; then echo "ERROR: $JS_FILE not found"; exit 1; fi
|
||||||
if [ ! -f "$FAVICON_FILE" ]; then echo "ERROR: $FAVICON_FILE not found"; exit 1; fi
|
if [ ! -f "$FAVICON_FILE" ]; then echo "ERROR: $FAVICON_FILE not found"; exit 1; fi
|
||||||
|
|
||||||
# Generate favicon Base64 data URI
|
# Generate favicon Base64 data URI from PNG
|
||||||
FAVICON_B64=$(base64 -w0 "$FAVICON_FILE")
|
FAVICON_B64=$(base64 -w0 "$FAVICON_FILE")
|
||||||
FAVICON_URI="data:image/svg+xml;base64,${FAVICON_B64}"
|
FAVICON_URL="data:image/png;base64,${FAVICON_B64}"
|
||||||
|
|
||||||
CSS_CONTENT=$(cat "$CSS_FILE")
|
CSS_CONTENT=$(cat "$CSS_FILE")
|
||||||
|
|
||||||
# Inject version into JS
|
# Inject version and favicon into JS
|
||||||
JS_CONTENT=$(cat "$JS_FILE" | sed "s|{{VERSION}}|$VERSION|g")
|
JS_CONTENT=$(cat "$JS_FILE" | sed "s|{{VERSION}}|$VERSION|g" | sed "s|{{FAVICON_DATA_URI}}|$FAVICON_URL|g")
|
||||||
|
|
||||||
# === 1. Build standalone HTML (for local testing/dev) ===
|
# === 1. Build standalone HTML (for local testing/dev) ===
|
||||||
cat > "$DIST_DIR/kantine-standalone.html" << HTMLEOF
|
cat > "$DIST_DIR/kantine-standalone.html" << HTMLEOF
|
||||||
@@ -107,7 +107,7 @@ cat > "$DIST_DIR/install.html" << INSTALLEOF
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Kantine Wrapper Installer ($VERSION)</title>
|
<title>Kantine Wrapper Installer ($VERSION)</title>
|
||||||
<link rel="icon" type="image/svg+xml" href="$FAVICON_URI">
|
<link rel="icon" type="image/png" href="$FAVICON_URL">
|
||||||
<style>
|
<style>
|
||||||
body { font-family: 'Inter', sans-serif; max-width: 600px; margin: 40px auto; padding: 20px; background: #1a1a2e; color: #eee; }
|
body { font-family: 'Inter', sans-serif; max-width: 600px; margin: 40px auto; padding: 20px; background: #1a1a2e; color: #eee; }
|
||||||
h1 { color: #029AA8; } /* Knapp Teal */
|
h1 { color: #029AA8; } /* Knapp Teal */
|
||||||
@@ -207,9 +207,9 @@ echo "document.getElementById('bookmarklet-link').href = " >> "$DIST_DIR/install
|
|||||||
echo "$JS_CONTENT" | python3 -c "
|
echo "$JS_CONTENT" | python3 -c "
|
||||||
import sys, json, urllib.parse
|
import sys, json, urllib.parse
|
||||||
|
|
||||||
# 1. Read JS and Replace VERSION
|
# 1. Read JS and Replace VERSION + Favicon
|
||||||
js_template = sys.stdin.read()
|
js_template = sys.stdin.read()
|
||||||
js = js_template.replace('{{VERSION}}', '$VERSION')
|
js = js_template.replace('{{VERSION}}', '$VERSION').replace('{{FAVICON_DATA_URI}}', '$FAVICON_URL')
|
||||||
|
|
||||||
# 2. Prepare CSS for injection via createElement('style')
|
# 2. Prepare CSS for injection via createElement('style')
|
||||||
css = open('$CSS_FILE').read().replace('\n', ' ').replace(' ', ' ')
|
css = open('$CSS_FILE').read().replace('\n', ' ').replace(' ', ' ')
|
||||||
@@ -243,6 +243,13 @@ $CHANGELOG_HTML
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >> "$DIST_DIR/install.html" << INSTALLEOF
|
cat >> "$DIST_DIR/install.html" << INSTALLEOF
|
||||||
|
// Dynamic favicon injection (overrides proxy defaults like htmlpreview.github.io)
|
||||||
|
document.querySelectorAll('link[rel*="icon"]').forEach(function(el) { el.remove(); });
|
||||||
|
var fi = document.createElement('link');
|
||||||
|
fi.rel = 'icon';
|
||||||
|
fi.type = 'image/png';
|
||||||
|
fi.href = '$FAVICON_URL';
|
||||||
|
document.head.appendChild(fi);
|
||||||
document.getElementById('bookmarklet-link').textContent = 'Kantine $VERSION';
|
document.getElementById('bookmarklet-link').textContent = 'Kantine $VERSION';
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
15
changelog.md
15
changelog.md
@@ -1,3 +1,18 @@
|
|||||||
|
## v1.4.27
|
||||||
|
- 🔧 **Build**: Favicon wird jetzt sauber aus `favicon.png` per Build-Script als PNG-Base64-Data-URI generiert und über `{{FAVICON_DATA_URI}}` Platzhalter in `kantine.js` + `install.html` injiziert. Funktioniert auf allen Browsern und Proxy-Diensten.
|
||||||
|
|
||||||
|
## v1.4.26
|
||||||
|
- 🎨 **Favicon**: Von SVG-Base64 auf PNG-Datei (`favicon.png`) umgestellt, verlinkt via raw.githubusercontent.com. Funktioniert zuverlässig auf allen Browsern und Proxy-Diensten (htmlpreview.github.io).
|
||||||
|
|
||||||
|
## v1.4.25
|
||||||
|
- 🐛 **Bugfix**: Favicon wird in `install.html` jetzt zusätzlich per JavaScript injiziert, um Proxy-Dienste wie htmlpreview.github.io zu überschreiben. Release-Script pusht nun auch `main` Branch zu GitHub.
|
||||||
|
|
||||||
|
## v1.4.24
|
||||||
|
- 🐛 **Bugfix**: Favicon-Encoding korrigiert – `encodeURIComponent` verursachte doppeltes Encoding der Farbcodes (`%23` → `%2523`). Auf Base64 umgestellt, funktioniert nun auch unter Chrome/Windows.
|
||||||
|
|
||||||
|
## v1.4.23
|
||||||
|
- 🐛 **Bugfix**: Favicon wird jetzt beim Ausführen des Bookmarklets in die Seite injiziert (ersetzt das Bessa-Favicon im Tab). Chrome cached das Icon und übernimmt es anschließend auch in die Lesezeichenleiste.
|
||||||
|
|
||||||
## v1.4.22
|
## v1.4.22
|
||||||
- 📝 **Docs**: Vollständiger Dokumentations-Audit: README.md um fehlende Dateien (favicon.svg, release.sh, Tests) und Features (Bestellhistorie, Version-Menü, Cache leeren, Favicon) ergänzt. REQUIREMENTS.md: Doppelte IDs (FR-090/091) behoben, FR-092 an dynamische Glow-Logik angepasst, FR-116 (Cache leeren) und FR-117 (Favicon) hinzugefügt, NFR-008 um DOM-Tests erweitert.
|
- 📝 **Docs**: Vollständiger Dokumentations-Audit: README.md um fehlende Dateien (favicon.svg, release.sh, Tests) und Features (Bestellhistorie, Version-Menü, Cache leeren, Favicon) ergänzt. REQUIREMENTS.md: Doppelte IDs (FR-090/091) behoben, FR-092 an dynamische Glow-Logik angepasst, FR-116 (Cache leeren) und FR-117 (Favicon) hinzugefügt, NFR-008 um DOM-Tests erweitert.
|
||||||
|
|
||||||
|
|||||||
2
dist/bookmarklet-payload.js
vendored
2
dist/bookmarklet-payload.js
vendored
File diff suppressed because one or more lines are too long
2
dist/bookmarklet.txt
vendored
2
dist/bookmarklet.txt
vendored
File diff suppressed because one or more lines are too long
41
dist/install.html
vendored
41
dist/install.html
vendored
File diff suppressed because one or more lines are too long
18
dist/kantine-standalone.html
vendored
18
dist/kantine-standalone.html
vendored
@@ -2000,6 +2000,16 @@ body {
|
|||||||
// Replace entire page content
|
// Replace entire page content
|
||||||
document.title = 'Kantine Weekly Menu';
|
document.title = 'Kantine Weekly Menu';
|
||||||
|
|
||||||
|
// Inject custom favicon (triangle + fork & knife PNG)
|
||||||
|
if (document.querySelectorAll) {
|
||||||
|
document.querySelectorAll('link[rel*="icon"]').forEach(el => el.remove());
|
||||||
|
}
|
||||||
|
const favicon = document.createElement('link');
|
||||||
|
favicon.rel = 'icon';
|
||||||
|
favicon.type = 'image/png';
|
||||||
|
favicon.href = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC9UlEQVR4AcRVO28TQRCe2UtAQgkFShWIkoDogiAdFUo6XoYGIRoePwSw4Q/QUCBRgIA/gLCokBL+QIKBAipwwkt0pAlwvhtmxrvH+Xy39tkxjG5uZmdf3zf7MvCfZSgA59Y2ppfefp8YhsPAACqNj/Nk4ncT4faHk+tf5wYFMTAAIrgOgJOIMDWGv27AgDIQgPNvPs8g4VU3J7IvMVcuY70AKq+aJINlbRyFVUAIOAstUfE1Bm2R9qfXmvfaJf/fCyCvqzIlvKZ1SI94CZ6ozzGt0wKAMXS4nw1aGkActW4LYyCIgmC8ZoKxm+JLLIrCW3Z+4FgwGf68kJQLnNIAeODLMhYx+6dH9m+K8uSPJcZ74Uo6CwBxO1NSWaDlASAEDELYV8GKKcgCIZ4487p50DbLNX0DSDNz7N2I2Sy4OAIgxnARPNI3gFjWXgYiXfuEvYRE01mQcqJElxI/x+kJQI6U7afrmWVv6yCdBY2h2Q1Av8HAXS0X/HoC0IuAOzvLO7/KxdwvyQLXItBxANzFG/M+eMQL4NmxWSTAO64/AT1Qpi6QsVqHoCciU1VY9AKQXsxkWSzvfPKx1zb8M+5EsC+fkBBbpF4AuvMJjkpnZt9QhlLwqLZJZUHH8LT3AtCdj4DaH82K2j5+mgXbLkrfjjaWNoUAFDmB3nrSAYm2xPajmgXbEAkzt6OtsKYQQCznHkFuPYJhBCGIPFnIBZBmL2sPQ4ovC7kA4r/sIyix9rk4+ebkXVSYhS4AHez5xSuz9rkA7IkoykIXgDT7fs597qSpoHH3AubvhQ4AWfaym+uLszW5TMRCCZE+ojIGL4HejnlZ6AAQRWGNGwcyD7/lL8+uby7thMYIqyCCmoUapCQBcKrx6QAC6osn9YbgIT/mKzuhMhZYQZ6j8v7LlC3yY2k9DMIWuwkg9kf00RaFsMcNnkz4fGH+G42NzxKZ5VHq9uTeufrC9EYXAAlIRX1xZnWU+uLQvh8yl9MkAy7wr+3IAfQi9AcAAP//cvfPmgAAAAZJREFUAwAATd1Qkd2fWwAAAABJRU5ErkJggg==';
|
||||||
|
document.head.appendChild(favicon);
|
||||||
|
|
||||||
// Inject Google Fonts if not already present
|
// Inject Google Fonts if not already present
|
||||||
if (!document.querySelector('link[href*="fonts.googleapis.com/css2?family=Inter"]')) {
|
if (!document.querySelector('link[href*="fonts.googleapis.com/css2?family=Inter"]')) {
|
||||||
const fontLink = document.createElement('link');
|
const fontLink = document.createElement('link');
|
||||||
@@ -2021,7 +2031,7 @@ body {
|
|||||||
<div class="brand">
|
<div class="brand">
|
||||||
<span class="material-icons-round logo-icon">restaurant_menu</span>
|
<span class="material-icons-round logo-icon">restaurant_menu</span>
|
||||||
<div class="header-left">
|
<div class="header-left">
|
||||||
<h1>Kantinen Übersicht <small class="version-tag" style="font-size: 0.6em; opacity: 0.7; font-weight: 400; cursor: pointer;" title="Klick für Versionsmenü">v1.4.22</small></h1>
|
<h1>Kantinen Übersicht <small class="version-tag" style="font-size: 0.6em; opacity: 0.7; font-weight: 400; cursor: pointer;" title="Klick für Versionsmenü">v1.4.27</small></h1>
|
||||||
<div id="last-updated-subtitle" class="subtitle"></div>
|
<div id="last-updated-subtitle" class="subtitle"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-group" style="margin-left: 1rem;">
|
<div class="nav-group" style="margin-left: 1rem;">
|
||||||
@@ -2163,7 +2173,7 @@ body {
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div style="margin-bottom: 1rem;">
|
<div style="margin-bottom: 1rem;">
|
||||||
<strong>Aktuell:</strong> <span id="version-current">v1.4.22</span>
|
<strong>Aktuell:</strong> <span id="version-current">v1.4.27</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="dev-toggle">
|
<div class="dev-toggle">
|
||||||
<label style="display:flex;align-items:center;gap:8px;cursor:pointer;">
|
<label style="display:flex;align-items:center;gap:8px;cursor:pointer;">
|
||||||
@@ -4016,7 +4026,7 @@ body {
|
|||||||
|
|
||||||
// Periodic update check (runs on init + every hour)
|
// Periodic update check (runs on init + every hour)
|
||||||
async function checkForUpdates() {
|
async function checkForUpdates() {
|
||||||
const currentVersion = 'v1.4.22';
|
const currentVersion = 'v1.4.27';
|
||||||
const devMode = localStorage.getItem('kantine_dev_mode') === 'true';
|
const devMode = localStorage.getItem('kantine_dev_mode') === 'true';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -4057,7 +4067,7 @@ body {
|
|||||||
const modal = document.getElementById('version-modal');
|
const modal = document.getElementById('version-modal');
|
||||||
const container = document.getElementById('version-list-container');
|
const container = document.getElementById('version-list-container');
|
||||||
const devToggle = document.getElementById('dev-mode-toggle');
|
const devToggle = document.getElementById('dev-mode-toggle');
|
||||||
const currentVersion = 'v1.4.22';
|
const currentVersion = 'v1.4.27';
|
||||||
|
|
||||||
if (!modal) return;
|
if (!modal) return;
|
||||||
modal.classList.remove('hidden');
|
modal.classList.remove('hidden');
|
||||||
|
|||||||
BIN
favicon.png
Executable file
BIN
favicon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 832 B |
10
kantine.js
10
kantine.js
@@ -50,6 +50,16 @@
|
|||||||
// Replace entire page content
|
// Replace entire page content
|
||||||
document.title = 'Kantine Weekly Menu';
|
document.title = 'Kantine Weekly Menu';
|
||||||
|
|
||||||
|
// Inject custom favicon (triangle + fork & knife PNG)
|
||||||
|
if (document.querySelectorAll) {
|
||||||
|
document.querySelectorAll('link[rel*="icon"]').forEach(el => el.remove());
|
||||||
|
}
|
||||||
|
const favicon = document.createElement('link');
|
||||||
|
favicon.rel = 'icon';
|
||||||
|
favicon.type = 'image/png';
|
||||||
|
favicon.href = '{{FAVICON_DATA_URI}}';
|
||||||
|
document.head.appendChild(favicon);
|
||||||
|
|
||||||
// Inject Google Fonts if not already present
|
// Inject Google Fonts if not already present
|
||||||
if (!document.querySelector('link[href*="fonts.googleapis.com/css2?family=Inter"]')) {
|
if (!document.querySelector('link[href*="fonts.googleapis.com/css2?family=Inter"]')) {
|
||||||
const fontLink = document.createElement('link');
|
const fontLink = document.createElement('link');
|
||||||
|
|||||||
@@ -49,8 +49,9 @@ echo "=== Pushing to remotes ==="
|
|||||||
git push origin HEAD
|
git push origin HEAD
|
||||||
git push origin --force tag "$VERSION"
|
git push origin --force tag "$VERSION"
|
||||||
|
|
||||||
# If a remote named 'github' exists, push tags there too
|
# If a remote named 'github' exists, push branch and tags there too
|
||||||
if git remote | grep -q "^github$"; then
|
if git remote | grep -q "^github$"; then
|
||||||
|
git push github HEAD
|
||||||
git push github --force tag "$VERSION"
|
git push github --force tag "$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v1.4.22
|
v1.4.27
|
||||||
|
|||||||
Reference in New Issue
Block a user