From 99e29bde04d6ad0c28acf40a9b06d3577470e9d1 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 26 May 2026 19:25:40 +0000 Subject: [PATCH 01/12] feat: flight-plan placement picker (replaces pin-to-map) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the entire pin-button + drag/resize flow with a single 6-button row inside the Export PNG modal: Flight plan placement: [ None ] [↖ TL] [↗ TR] [↙ BL] [↘ BR] [Custom…] - None → no plan drawn on export - TL/TR/BL/BR → wireframe placeholder snaps to that corner of the current page frame (A3/A4) or the viewport when no frame is set - Custom → centred placeholder, fully draggable and resizable - Selected option highlights yellow; user can re-pick freely without leaving the export dialog Replaces all of: - the .modal-pin button + planPinned state + PLANPIN_KEY - pin-modal drag handlers - four-corner resize handles on the flight-plan modal - font auto-shrink + ResizeObserver hooks - navaid.planPin / planW / planH localStorage (auto-cleared on open so old installs migrate silently) - modal.pinned CSS (replaced with plan-placeholder rules) Canvas drawFlightPlanTable always uses S.fpHeadersShort now — no DOM-class check for pinned, no headers branch. Test set updated: pin tests dropped; new tests cover pin-button gone, stale-storage cleanup, corner placement creates a placeholder, None removes it, Export with a placement still downloads a PNG. Co-Authored-By: Claude Sonnet 4.7 --- docs/core.js | 18 +- docs/he/strings.js | 17 +- docs/index.html | 4 +- docs/io.js | 468 +++++++++++++++++++++++++++++-- docs/style.css | 248 ++++++++++++++-- tests/export-png-options.spec.js | 62 ++++ tests/flight-plan.spec.js | 138 ++------- tests/fuel-flight-plan.spec.js | 40 +-- tests/orient-pageexport.spec.js | 4 +- 9 files changed, 802 insertions(+), 197 deletions(-) diff --git a/docs/core.js b/docs/core.js index 19f45e3a..e18eaa81 100644 --- a/docs/core.js +++ b/docs/core.js @@ -83,12 +83,14 @@ window.S = Object.assign({ }, errNoLegs: 'No legs yet — drop at least two waypoints first.', flightPlan: 'Flight plan', - fpHeaders: ['#', 'From', 'To', 'Hdg', 'Dist (NM)', 'Speed (kt)', 'Alt (ft)', 'Time', 'Fuel (gal)', ''], - fpDel: '✕', + fpHeaders: ['#', 'From', 'To', 'Hdg', 'Dist (NM)', 'Speed (kt)', 'Alt (ft)', 'Time', 'Fuel (gal)'], + fpHeadersShort: ['#', 'From', 'To', 'Hdg', 'Dist', 'Spd', 'Alt', 'Time', 'Fuel'], fpReturn: 'Return route', fpTotal: 'Total', fpClose: 'Close', fpPrint: 'Print', + fpPin: 'Pin', + fpUnpin: 'Unpin', fpFuel: 'Fuel', tbAircraft: 'Aircraft', tbGph: 'Gallons per Hour', @@ -211,7 +213,6 @@ window.S = Object.assign({ tbSecExport: '📤 Export/Import', tbViewSource: 'GitHub', tbWiki: 'Wiki', - tbIssues: 'Issues / Requests', exportModalTitle: 'Export PNG', exportShowNavWP: 'Print Navigation Waypoints', exportShowAirfields: 'Print Airfields', @@ -220,6 +221,17 @@ window.S = Object.assign({ exportNoPageWarn: 'No page size selected — exported image ratio may not match a print page.', exportLayer: 'Layer', exportBtn: 'Export', + addPlanToMap: 'Add plan to map', + addPlanToMapTitle: 'Drop a draggable, resizable placeholder on the map; the flight plan table will be drawn into it on export.', + removePlanFromMap: 'Remove plan placeholder', + planPlaceholderLabel: 'PLAN', + planPlacementLabel: 'Flight plan on print:', + planPlacementNone: 'None', + planPlacementTL: '↖ TL', + planPlacementTR: '↗ TR', + planPlacementBL: '↙ BL', + planPlacementBR: '↘ BR', + planPlacementCustom: 'Custom…', }, window.S || {}); // Fill data-i18n / data-i18n-title / data-i18n-placeholder / data-i18n-aria diff --git a/docs/he/strings.js b/docs/he/strings.js index 6fe6e28b..e03481d8 100644 --- a/docs/he/strings.js +++ b/docs/he/strings.js @@ -45,12 +45,13 @@ window.S = { }, errNoLegs: 'אין קטעים עדיין — הוסף לפחות שני ציוני דרך תחילה.', flightPlan: 'תכנית טיסה', - fpHeaders: ['#', 'מ-', 'אל-', 'כיוון', 'מרחק (NM)', 'מהירות (קשר)', 'גובה (ft)', 'זמן', 'דלק (גאל)', ''], - fpDel: '✕', + fpHeaders: ['#', 'מ-', 'אל-', 'כיוון', 'מרחק (NM)', 'מהירות (קשר)', 'גובה (ft)', 'זמן', 'דלק (גאל)'], fpTotal: 'סה"כ', fpReturn: 'מסלול חזרה', fpClose: 'סגור', fpPrint: 'הדפס', + fpPin: 'נעץ', + fpUnpin: 'שחרר', fpFuel: 'דלק', tbAircraft: 'כלי טיס', tbGph: 'גלונים לשעה', @@ -173,7 +174,6 @@ window.S = { tbSecExport: '📤 ייצוא/ייבוא', tbViewSource: 'GitHub', tbWiki: 'Wiki', - tbIssues: 'בעיות / הצעות', exportShowDrift: 'הדפס קווי סחיפה', exportModalTitle: 'ייצוא PNG', exportShowNavWP: 'הדפס ציוני ניווט', @@ -182,4 +182,15 @@ window.S = { exportNoPageWarn: 'לא נבחר גודל דף — יחס התמונה המיוצאת עשוי שלא להתאים להדפסה.', exportLayer: 'שכבת מפה', exportBtn: 'ייצא', + addPlanToMap: 'הוסף מסלול למפה', + addPlanToMapTitle: 'מיקום מציין-מקום הניתן לגרירה ולשינוי גודל על המפה; טבלת תכנית הטיסה תצויר לתוכו בייצוא.', + removePlanFromMap: 'הסר את מציין-המקום', + planPlaceholderLabel: 'מסלול', + planPlacementLabel: 'מיקום תכנית הטיסה בהדפסה:', + planPlacementNone: 'ללא', + planPlacementTL: '↖ ש"ע', + planPlacementTR: '↗ י"ע', + planPlacementBL: '↙ ש"ת', + planPlacementBR: '↘ י"ת', + planPlacementCustom: 'מותאם…', }; diff --git a/docs/index.html b/docs/index.html index 75830649..769ab641 100644 --- a/docs/index.html +++ b/docs/index.html @@ -77,7 +77,7 @@ gtag('config', 'G-0XM5PHEK8B'); - +
@@ -288,7 +288,7 @@ hack for strings.js. Silences CodeQL js/eval-like-call (#12). -->