Compare commits
2 Commits
7008b40987
...
6864838999
| Author | SHA1 | Date | |
|---|---|---|---|
| 6864838999 | |||
| 6f2a34ae0e |
@@ -8,19 +8,23 @@ 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"
|
||||||
|
|
||||||
|
# === VERSION ===
|
||||||
|
VERSION="v1.8.6"
|
||||||
|
|
||||||
mkdir -p "$DIST_DIR"
|
mkdir -p "$DIST_DIR"
|
||||||
|
|
||||||
echo "=== Kantine Bookmarklet Builder ==="
|
echo "=== Kantine Bookmarklet Builder ($VERSION) ==="
|
||||||
|
|
||||||
# Check files exist
|
# Check files exist
|
||||||
if [ ! -f "$CSS_FILE" ]; then echo "ERROR: $CSS_FILE not found"; exit 1; fi
|
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
|
||||||
|
|
||||||
CSS_CONTENT=$(cat "$CSS_FILE")
|
CSS_CONTENT=$(cat "$CSS_FILE")
|
||||||
JS_CONTENT=$(cat "$JS_FILE")
|
# Inject version into JS
|
||||||
|
JS_CONTENT=$(cat "$JS_FILE" | sed "s/{{VERSION}}/$VERSION/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
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
@@ -37,7 +41,7 @@ HTMLEOF
|
|||||||
# Inject CSS
|
# Inject CSS
|
||||||
cat "$CSS_FILE" >> "$DIST_DIR/kantine-standalone.html"
|
cat "$CSS_FILE" >> "$DIST_DIR/kantine-standalone.html"
|
||||||
|
|
||||||
cat >> "$DIST_DIR/kantine-standalone.html" << 'HTMLEOF'
|
cat >> "$DIST_DIR/kantine-standalone.html" << HTMLEOF
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -45,9 +49,9 @@ cat >> "$DIST_DIR/kantine-standalone.html" << 'HTMLEOF'
|
|||||||
HTMLEOF
|
HTMLEOF
|
||||||
|
|
||||||
# Inject JS
|
# Inject JS
|
||||||
cat "$JS_FILE" >> "$DIST_DIR/kantine-standalone.html"
|
echo "$JS_CONTENT" >> "$DIST_DIR/kantine-standalone.html"
|
||||||
|
|
||||||
cat >> "$DIST_DIR/kantine-standalone.html" << 'HTMLEOF'
|
cat >> "$DIST_DIR/kantine-standalone.html" << HTMLEOF
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -69,7 +73,7 @@ var s=document.createElement('style');
|
|||||||
s.textContent='${CSS_ESCAPED}';
|
s.textContent='${CSS_ESCAPED}';
|
||||||
document.head.appendChild(s);
|
document.head.appendChild(s);
|
||||||
var sc=document.createElement('script');
|
var sc=document.createElement('script');
|
||||||
sc.textContent=$(cat "$JS_FILE" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null || cat "$JS_FILE" | sed 's/\\/\\\\/g' | sed "s/'/\\\\'/g" | sed 's/"/\\\\"/g' | tr '\n' ' ' | sed 's/^/"/' | sed 's/$/"/');
|
sc.textContent=$(echo "$JS_CONTENT" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null || echo "$JS_CONTENT" | sed 's/\\/\\\\/g' | sed "s/'/\\\\'/g" | sed 's/"/\\\\"/g' | tr '\n' ' ' | sed 's/^/"/' | sed 's/$/"/');
|
||||||
document.head.appendChild(sc);
|
document.head.appendChild(sc);
|
||||||
})();
|
})();
|
||||||
PAYLOADEOF
|
PAYLOADEOF
|
||||||
@@ -81,15 +85,15 @@ echo "javascript:${BOOKMARKLET_RAW}" > "$DIST_DIR/bookmarklet.txt"
|
|||||||
echo "✅ Bookmarklet URL: $DIST_DIR/bookmarklet.txt"
|
echo "✅ Bookmarklet URL: $DIST_DIR/bookmarklet.txt"
|
||||||
|
|
||||||
# === 3. Create an easy-to-use HTML installer page ===
|
# === 3. Create an easy-to-use HTML installer page ===
|
||||||
cat > "$DIST_DIR/install.html" << 'INSTALLEOF'
|
cat > "$DIST_DIR/install.html" << INSTALLEOF
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Kantine Wrapper Installer</title>
|
<title>Kantine Wrapper Installer ($VERSION)</title>
|
||||||
<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; }
|
h1 { color: #029AA8; } /* Knapp Teal */
|
||||||
.instructions { background: #16213e; padding: 20px; border-radius: 12px; margin: 20px 0; }
|
.instructions { background: #16213e; padding: 20px; border-radius: 12px; margin: 20px 0; }
|
||||||
.instructions ol li { margin: 10px 0; }
|
.instructions ol li { margin: 10px 0; }
|
||||||
a.bookmarklet { display: inline-block; background: #029AA8; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 18px; cursor: grab; }
|
a.bookmarklet { display: inline-block; background: #029AA8; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 18px; cursor: grab; }
|
||||||
@@ -98,13 +102,13 @@ cat > "$DIST_DIR/install.html" << 'INSTALLEOF'
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>🍽️ Kantine Wrapper</h1>
|
<h1>🍽️ Kantine Wrapper <span style="font-size:0.5em; opacity:0.6; font-weight:400; vertical-align:middle; margin-left:10px;">$VERSION</span></h1>
|
||||||
<div class="instructions">
|
<div class="instructions">
|
||||||
<h2>Installation</h2>
|
<h2>Installation</h2>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Ziehe den Button unten in deine <strong>Lesezeichen-Leiste</strong> (Drag & Drop)</li>
|
<li>Ziehe den Button unten in deine <strong>Lesezeichen-Leiste</strong> (Drag & Drop)</li>
|
||||||
<li>Navigiere zu <a href="https://web.bessa.app/knapp-kantine" style="color:#029AA8">web.bessa.app/knapp-kantine</a></li>
|
<li>Navigiere zu <a href="https://web.bessa.app/knapp-kantine" style="color:#029AA8">web.bessa.app/knapp-kantine</a></li>
|
||||||
<li>Klicke auf das Lesezeichen <code>Kantine Wrapper</code></li>
|
<li>Klicke auf das Lesezeichen <code>Kantine $VERSION</code></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2>✨ Features</h2>
|
<h2>✨ Features</h2>
|
||||||
@@ -128,7 +132,7 @@ INSTALLEOF
|
|||||||
|
|
||||||
# Embed the bookmarklet URL inline
|
# Embed the bookmarklet URL inline
|
||||||
echo "document.getElementById('bookmarklet-link').href = " >> "$DIST_DIR/install.html"
|
echo "document.getElementById('bookmarklet-link').href = " >> "$DIST_DIR/install.html"
|
||||||
cat "$JS_FILE" | python3 -c "
|
echo "$JS_CONTENT" | python3 -c "
|
||||||
import sys, json
|
import sys, json
|
||||||
js = sys.stdin.read()
|
js = sys.stdin.read()
|
||||||
css = open('$CSS_FILE').read().replace('\\n', ' ').replace(' ', ' ')
|
css = open('$CSS_FILE').read().replace('\\n', ' ').replace(' ', ' ')
|
||||||
@@ -136,8 +140,8 @@ bmk = '''javascript:(function(){if(window.__KANTINE_LOADED){alert(\"Already load
|
|||||||
print(json.dumps(bmk) + ';')
|
print(json.dumps(bmk) + ';')
|
||||||
" 2>/dev/null >> "$DIST_DIR/install.html" || echo "'javascript:alert(\"Build error\")'" >> "$DIST_DIR/install.html"
|
" 2>/dev/null >> "$DIST_DIR/install.html" || echo "'javascript:alert(\"Build error\")'" >> "$DIST_DIR/install.html"
|
||||||
|
|
||||||
cat >> "$DIST_DIR/install.html" << 'INSTALLEOF'
|
cat >> "$DIST_DIR/install.html" << INSTALLEOF
|
||||||
document.getElementById('bookmarklet-link').textContent = '🍽️ Kantine Wrapper';
|
document.getElementById('bookmarklet-link').textContent = 'Kantine $VERSION';
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
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
12
dist/install.html
vendored
12
dist/install.html
vendored
File diff suppressed because one or more lines are too long
4
dist/kantine-standalone.html
vendored
4
dist/kantine-standalone.html
vendored
@@ -1247,8 +1247,8 @@ body {
|
|||||||
<div class="header-content">
|
<div class="header-content">
|
||||||
<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="brand-text">
|
<div class="header-left">
|
||||||
<h1>Kantinen Übersicht</h1>
|
<h1>Kantinen Übersicht <small style="font-size: 0.6em; opacity: 0.7; font-weight: 400;">${CLIENT_VERSION}</small></h1>
|
||||||
<div id="last-updated-subtitle" class="subtitle"></div>
|
<div id="last-updated-subtitle" class="subtitle"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -65,8 +65,8 @@
|
|||||||
<div class="header-content">
|
<div class="header-content">
|
||||||
<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="brand-text">
|
<div class="header-left">
|
||||||
<h1>Kantinen Übersicht</h1>
|
<h1>Kantinen Übersicht <small style="font-size: 0.6em; opacity: 0.7; font-weight: 400;">${CLIENT_VERSION}</small></h1>
|
||||||
<div id="last-updated-subtitle" class="subtitle"></div>
|
<div id="last-updated-subtitle" class="subtitle"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user