feat: show version number in app header (v1.8.6)
This commit is contained in:
@@ -9,7 +9,7 @@ CSS_FILE="$SCRIPT_DIR/style.css"
|
|||||||
JS_FILE="$SCRIPT_DIR/kantine.js"
|
JS_FILE="$SCRIPT_DIR/kantine.js"
|
||||||
|
|
||||||
# === VERSION ===
|
# === VERSION ===
|
||||||
VERSION="v1.8.5"
|
VERSION="v1.8.6"
|
||||||
|
|
||||||
mkdir -p "$DIST_DIR"
|
mkdir -p "$DIST_DIR"
|
||||||
|
|
||||||
@@ -20,7 +20,8 @@ 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
|
||||||
@@ -48,7 +49,7 @@ 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>
|
||||||
@@ -72,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
|
||||||
@@ -131,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(' ', ' ')
|
||||||
|
|||||||
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
10
dist/install.html
vendored
10
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