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": "ยังไม่ระบุเวลาเดินทางจากจุดแรก",
"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}"
}