mock: three search tabs - stop code, place name, near me

- busStop.html: added the third tab (data-mode=near) and its own panel with
  the location button, hint and result area; removed the near button from the
  toolbar and deleted the old on-screen numpad markup
- busStop.search.js: MODE_NEAR in setMode, disables the other panels, hides
  the stop list while ranked results are shown, skips filtering in that mode,
  and removed the dead initNumpad code
- security gate: the tab is revealed only when isSecureContext and
  navigator.geolocation exist; otherwise it stays hidden and the mode is
  refused
- map.js: re-enable the button after a successful lookup
- i18n: stops.modeNear / nearCta / nearHint
- bump SW version to 2026.09.27.98

Verified on localhost:8090 - three tabs, near mode shows a map with 8 ranked
stops, button re-enables and works again, switching back restores the list;
with isSecureContext forced false the tab is hidden and unselectable.
This commit is contained in:
Bkk1234 committed 2026-10-24 00:11:56 +07:00
1 parent 74d605f1c4
commit 750b4a2ea8
25 files changed
+426 -180

No files matched your search

+89 -2
View File
@@ -131,7 +131,10 @@
"stops.noOffset": "No travel time from the first stop yet",
"stops.noBusLine": "No bus line listed",
"stops.modeCode": "Search by stop code",
"stops.modePlace": "Search by place name",
"stops.modeNear": "Near me",
"stops.nearCta": "Use my location",
"stops.nearHint": "We ask your device for a location, then rank stops by real distance.",
"stops.modePlace": "Search by place name",
"stops.codePh": "3+000",
"stops.codeHint": "Type 4 digits and the + sign is added automatically (e.g. 3000 → 3+000)",
"stops.codeHintBox": "Type digits in the boxes — empty boxes are filled with 0 automatically. For 4-digit codes such as 8+591, enter 08+591",
@@ -265,5 +268,89 @@
"check.noMoreToday": "No departures left today",
"check.stopsCount": "stops",
"check.toStopDetail": "View stop detail",
"common.routes": "routes"
"common.routes": "routes",
"page.home": "Home | Atroute",
"page.stops": "Bus Stops | Atroute",
"page.routes": "Route Details | Atroute",
"page.check": "Departure Schedule | Atroute",
"page.stop": "Stop Details | Atroute",
"page.credits": "Credits | Atroute",
"page.about": "About | Atroute",
"page.blog": "Blog | Atroute",
"router.loadFail": "Could not load content — please serve over HTTP (e.g. python3 -m http.server)",
"common.routePrefix": "Route {n}",
"common.stopPrefix": "Stop {n}",
"route.qrAlt": "LINE QR for route {n}",
"route.vehicleAlt": "Vehicle photo for route {n}",
"check.fromName": "From {name}",
"check.stopNameN": "Stop {n}",
"map.mUnit": "m",
"map.originShort": "Origin",
"day.sun": "Sunday",
"day.mon": "Monday",
"day.tue": "Tuesday",
"day.wed": "Wednesday",
"day.thu": "Thursday",
"day.fri": "Friday",
"day.sat": "Saturday",
"day.sunS": "Sun",
"day.monS": "Mon",
"day.tueS": "Tue",
"day.wedS": "Wed",
"day.thuS": "Thu",
"day.friS": "Fri",
"day.satS": "Sat",
"visitors.resetTitle": "Reset visitor counter",
"visitors.resetPass": "Reset code",
"visitors.cancel": "Cancel",
"visitors.confirm": "Reset",
"visitors.done": "Reset done — counting restarts from 0",
"visitors.unsupported": "Browser not supported — needs https or localhost",
"visitors.badPass": "Incorrect code",
"aria.mapsView": "View",
"aria.searchMode": "Search mode",
"aria.stopCode": "Stop code",
"aria.digitN": "Digit {n}",
"aria.routeSummary": "Route summary",
"aria.routeMap": "Route map",
"aria.routeGeom": "Route geometry map",
"aria.vehicleSection": "Vehicle and operator contact",
"aria.legend": "Card colours by route group",
"aria.sponsors": "Sponsors and partners",
"aria.networkMapAlt": "Atroute stop network map",
"aria.stopRoutesMap": "Routes through this stop map",
"route.kpiNext": "Next trip",
"route.mapSection": "Route map",
"route.summarySection": "Route summary",
"credits.lead": "Every resource used on this site, with the licence required by each owner",
"credits.src": "Source:",
"credits.lic": "Licence:",
"credits.iconsCount": "15 icons in use, stored at",
"credits.iconsUsage": "Usage: sprite",
"credits.iconNames": "alarm-clock, arrow-right, bus, bus-front, check, clock, globe, hourglass, map, map-pin, message-circle, phone, refresh-cw, search, triangle-alert",
"credits.mitStrong": "MIT License (summary):",
"credits.mitText": "Permission is granted, free of charge, to any person obtaining a copy of this software to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies, subject to the copyright and permission notice above being included in all copies or substantial portions of the software. The software is provided \"as is\", without warranty of any kind.",
"credits.fontK2D": "Primary typeface for body and headings · Thai looped style, weights 300–800",
"credits.fontNoto": "Body fallback (loaded via Google Fonts CDN)",
"credits.fontPrompt": "Heading / bold fallback",
"credits.fontMono": "Times, route numbers and figures (tabular alignment)",
"credits.mapLeaflet": "Leaflet — open-source mapping library",
"credits.mapOSM": "OpenStreetMap — map tiles and map data rendered here",
"credits.mapGIS": "Bus routes, stops and station pins are drawn from the team's own GIS data (GeoJSON) layered over the map",
"credits.photosLead": "Bus photos on the route detail pages come from the public sources below — thanks to every photographer and compiler",
"credits.breadHome": "Home",
"credits.breadSelf": "Credits",
"credits.lineRed": "SRT Red Line",
"visitors.label": "Visitors",
"visitors.tip": "Site visitor count",
"pwa.install": "Install app",
"aria.brandHome": "Atroute — home",
"aria.mainMenu": "Main menu",
"aria.langSwitch": "Language",
"credits.iconsFree": "— free for personal and commercial use without attribution, credited here for transparency",
"credits.tiles": "Map tiles:",
"credits.osmCredit": "OpenStreetMap © contributors (ODbL)",
"credits.facebookGroup": "Facebook group (web.facebook.com)",
"credits.from": "from",
"credits.routeN": "Route {n}"
}
+89 -2
View File
@@ -131,7 +131,10 @@
"stops.noOffset": "ยังไม่ระบุเวลาเดินทางจากจุดแรก",
"stops.noBusLine": "ยังไม่ระบุสายรถ",
"stops.modeCode": "ค้นหาด้วยรหัสป้าย",
"stops.modePlace": "ค้นหาด้วยชื่อสถานที่",
"stops.modeNear": "ป้ายใกล้ฉัน",
"stops.nearCta": "ขอพิกัดและหาป้ายใกล้ฉัน",
"stops.nearHint": "ระบบจะขอตำแหน่งจากเครื่อง แล้วคำนวณระยะจากพิกัดป้าย/ศาลารถ เรียงจากใกล้ไปไกล",
"stops.modePlace": "ค้นหาด้วยชื่อสถานที่",
"stops.codePh": "3+000",
"stops.codeHint": "พิมพ์ตัวเลข 4 หลัก ระบบจะเติมเครื่องหมาย + ให้อัตโนมัติ (เช่น 3000 → 3+000)",
"stops.codeHintBox": "พิมพ์ตัวเลขในช่อง ระบบจะเติม 0 ให้อัตโนมัติเมื่อเว้นว่าง และถ้าเจอรหัส 4 หลัก เช่น 8+591 ให้กรอก 08+591",
@@ -265,5 +268,89 @@
"check.noMoreToday": "ไม่มีรถเหลือในวันนี้แล้ว",
"check.stopsCount": "จุดจอด",
"check.toStopDetail": "ไปหน้ารายละเอียดจุดจอด",
"common.routes": "เส้นทาง"
"common.routes": "เส้นทาง",
"page.home": "หน้าแรก | Atroute",
"page.stops": "ป้ายหยุดรถ | Atroute",
"page.routes": "รายละเอียดสายรถ | Atroute",
"page.check": "เช็กเวลาเดินรถ | Atroute",
"page.stop": "รายละเอียดป้าย | Atroute",
"page.credits": "เครดิต | Atroute",
"page.about": "เกี่ยวกับเรา | Atroute",
"page.blog": "บ่นไปเรื่อย | Atroute",
"router.loadFail": "โหลดเนื้อหาไม่สำเร็จ — กรุณาเปิดผ่าน HTTP server (เช่น python3 -m http.server)",
"common.routePrefix": "สาย {n}",
"common.stopPrefix": "ป้าย {n}",
"route.qrAlt": "LINE QR สาย {n}",
"route.vehicleAlt": "รถของสาย {n}",
"check.fromName": "จาก {name}",
"check.stopNameN": "จุดจอด {n}",
"map.mUnit": "ม.",
"map.originShort": "ต้นทาง",
"day.sun": "อาทิตย์",
"day.mon": "จันทร์",
"day.tue": "อังคาร",
"day.wed": "พุธ",
"day.thu": "พฤหัสบดี",
"day.fri": "ศุกร์",
"day.sat": "เสาร์",
"day.sunS": "อา",
"day.monS": "จ",
"day.tueS": "อ.",
"day.wedS": "พ.",
"day.thuS": "พฤ.",
"day.friS": "ศ.",
"day.satS": "ส.",
"visitors.resetTitle": "รีเซ็ตจำนวนผู้เข้าชม",
"visitors.resetPass": "รหัสรีเซ็ต",
"visitors.cancel": "ยกเลิก",
"visitors.confirm": "รีเซ็ต",
"visitors.done": "รีเซ็ตแล้ว — เริ่มนับใหม่จาก 0",
"visitors.unsupported": "เบราว์เซอร์ไม่รองรับ — ต้องเปิดผ่าน https หรือ localhost",
"visitors.badPass": "รหัสไม่ถูกต้อง",
"aria.mapsView": "มุมมอง",
"aria.searchMode": "รูปแบบการค้นหา",
"aria.stopCode": "รหัสป้าย",
"aria.digitN": "หลักที่ {n}",
"aria.routeSummary": "สรุปเส้นทาง",
"aria.routeMap": "แผนที่เส้นทาง",
"aria.routeGeom": "แผนที่เส้นทางเดินรถ",
"aria.vehicleSection": "รถประจำสายและติดต่อผู้ประกอบการ",
"aria.legend": "คำอธิบายสีการ์ดตามหมวดเส้นทาง",
"aria.sponsors": "ผู้สนับสนุนและพาร์ทเนอร์",
"aria.networkMapAlt": "แผนที่เครือข่ายป้าย Atroute",
"aria.stopRoutesMap": "แผนที่เส้นทางที่ผ่านป้ายนี้",
"route.kpiNext": "รอบถัดไป",
"route.mapSection": "แผนที่เส้นทาง",
"route.summarySection": "สรุปเส้นทาง",
"credits.lead": "รายการทรัพยากรทั้งหมดที่ใช้ในเว็บนี้ พร้อมใบอนุญาต (license) ตามข้อกำหนดของเจ้าของแต่ละราย",
"credits.src": "แหล่งที่มา:",
"credits.lic": "ใบอนุญาต:",
"credits.iconsCount": "ไอคอนที่ใช้ทั้งหมด 15 รายการ เก็บที่",
"credits.iconsUsage": "วิธีใช้งาน: sprite",
"credits.iconNames": "alarm-clock, arrow-right, bus, bus-front, check, clock, globe, hourglass, map, map-pin, message-circle, phone, refresh-cw, search, triangle-alert",
"credits.mitStrong": "MIT License (สรุป):",
"credits.mitText": "อนุญาตให้ใช้ คัดลอก แก้ไข ผสาน เผยแพร่ แจกจ่าย ขาย และ/หรือให้สิทธิ์ใช้งานซอฟต์แวร์นี้ โดยมีเงื่อนไขให้ข้อความแสดงลิขสิทธิ์และข้อความอนุญาตข้างต้นปรากฏอยู่ในสำเนาทั้งหมดหรือส่วนสำคัญของซอฟต์แวร์ ซอฟต์แวร์นี้ให้บริการ \"ตามสภาพ\" โดยไม่มีการรับประกันใด ๆ",
"credits.fontK2D": "ฟอนต์หลักของเว็บ (เนื้อหา + หัวเรื่อง) · มีหัวแบบไทย น้ำหนัก 300–800",
"credits.fontNoto": "ตัวสำรองเนื้อหา (โหลดผ่าน Google Fonts CDN)",
"credits.fontPrompt": "ตัวสำรองหัวเรื่อง/ตัวหนา",
"credits.fontMono": "เวลา · เลขสาย · ตัวเลข (เรียงตรงกัน)",
"credits.mapLeaflet": "Leaflet — ไลบรารีแผนที่แบบ open-source",
"credits.mapOSM": "OpenStreetMap — ภาพ tiles และข้อมูลแผนที่ที่ใช้แสดงผล",
"credits.mapGIS": "เส้นทางเดินรถ จุดจอด และหมุดสถานี วาดจากข้อมูล GIS ของทีม (GeoJSON) ทับบนแผนที่",
"credits.photosLead": "ภาพรถโดยสารประจำทางที่แสดงในหน้ารายละเอียดสาย มาจากแหล่งข้อมูลสาธารณะด้านล่างนี้ — ขอบคุณเจ้าของภาพและผู้รวบรวมทุกท่าน",
"credits.breadHome": "หน้าแรก",
"credits.breadSelf": "เครดิต",
"credits.lineRed": "รถไฟฟ้าสายสีแดง",
"visitors.label": "ผู้เข้าชม",
"visitors.tip": "จำนวนผู้เข้าชมเว็บไซต์",
"pwa.install": "ติดตั้งแอป",
"aria.brandHome": "Atroute — หน้าแรก",
"aria.mainMenu": "เมนูหลัก",
"aria.langSwitch": "ภาษา / Language",
"credits.iconsFree": "— ใช้ได้ฟรีทั้งส่วนบุคคลและเชิงพาณิชย์ โดยไม่ต้องระบุเครดิต แต่เราระบุไว้เพื่อความโปร่งใส",
"credits.tiles": "ชุดแผนที่ (tiles):",
"credits.osmCredit": "OpenStreetMap © ผู้มีส่วนร่วม (ODbL)",
"credits.facebookGroup": "กลุ่ม Facebook (web.facebook.com)",
"credits.from": "จาก",
"credits.routeN": "สาย {n}"
}