From e880260aa5719098d164a94f74d693260454406c Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:59:11 +0200 Subject: [PATCH] Simplify mobile text label editor --- README.md | 2 +- app/static/mobile.css | 6 ++-- app/static/mobile.js | 18 ++++-------- app/templates/mobile.html | 62 +++++++++++++-------------------------- 4 files changed, 30 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index b0fee2c..5405a1a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Die Weboberflaeche bildet die wichtigsten P-touch-Editor-Funktionen nach: - QR-Code und Code128-Barcode - Layout speichern/laden im Browser - serverseitige Vorschau und Druck ueber `ptouch-print` -- vereinfachte Mobile-Webansicht unter `/mobile` +- einfache Text-only Mobile-Webansicht unter `/mobile` - Schnittmodi: normal, Kettendruck/Streifen, Schnittmarke und Streifen mit Schnittmarke ## Wichtig fuer den PT-P700 diff --git a/app/static/mobile.css b/app/static/mobile.css index 0d686a4..b889d05 100644 --- a/app/static/mobile.css +++ b/app/static/mobile.css @@ -114,13 +114,13 @@ button.primary { gap: 8px; } -.check-row { +.toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } -.check-row label { +.toggle-row label { display: flex; align-items: center; gap: 9px; @@ -131,7 +131,7 @@ button.primary { background: #303030; } -.check-row input { +.toggle-row input { width: 20px; min-height: 20px; } diff --git a/app/static/mobile.js b/app/static/mobile.js index 590d4a2..02567cc 100644 --- a/app/static/mobile.js +++ b/app/static/mobile.js @@ -1,13 +1,10 @@ const fields = { text: document.getElementById("mobileText"), tape: document.getElementById("mobileTape"), - length: document.getElementById("mobileLength"), - autoLength: document.getElementById("mobileAutoLength"), margin: document.getElementById("mobileMargin"), font: document.getElementById("mobileFont"), copies: document.getElementById("mobileCopies"), align: document.getElementById("mobileAlign"), - cutMode: document.getElementById("mobileCutMode"), bold: document.getElementById("mobileBold"), frame: document.getElementById("mobileFrame"), preview: document.getElementById("mobilePreview"), @@ -31,12 +28,7 @@ function mobileDesign() { const margin = Number(fields.margin.value); const text = fields.text.value.trim() || " "; const fontSize = Number(fields.font.value); - const autoLength = fields.autoLength.checked; - const length = autoLength - ? estimateTextLengthMm(text, fontSize, margin, fields.frame.checked) - : Number(fields.length.value); - fields.length.value = String(length); - fields.length.disabled = autoLength; + const length = estimateTextLengthMm(text, fontSize, margin, fields.frame.checked); const objects = []; if (fields.frame.checked) { objects.push({ @@ -66,10 +58,10 @@ function mobileDesign() { return { tapeWidthMm: tapeWidth, lengthMm: length, - autoLength, + autoLength: true, marginMm: margin, orientation: "landscape", - cutMode: fields.cutMode.value, + cutMode: "auto", halfcut: "off", objects, }; @@ -105,9 +97,9 @@ document.getElementById("mobileDetect").addEventListener("click", async () => { setMessage(`Band erkannt: ${payload.width} mm`, "success"); }); -["text", "font", "margin", "frame", "autoLength"].forEach((name) => { +["text", "font", "margin", "frame", "bold", "align", "tape"].forEach((name) => { fields[name].addEventListener("input", () => { - if (name === "autoLength" || fields.autoLength.checked) mobileDesign(); + mobileDesign(); }); }); diff --git a/app/templates/mobile.html b/app/templates/mobile.html index aaacaa1..24252c9 100644 --- a/app/templates/mobile.html +++ b/app/templates/mobile.html @@ -24,37 +24,17 @@
- -
- -
- - -
-
+
+ + +
+ - -

PT-P700: kein Halbschnitt. Fuer zusammenhaengende Labels Kettendruck / Streifen nutzen.

- -
+