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

+18 -18
View File
@@ -19,53 +19,53 @@
<main class="mu-page">
<div class="mu-credit-wrap">
<div class="mu-credit-hero">
<p class="mu-breadcrumb"><a href="#/">หน้าแรก</a>/ เครดิต</p>
<p class="mu-breadcrumb"><a href="#/" data-i18n="credits.breadHome">หน้าแรก</a>/ <span data-i18n="credits.breadSelf">เครดิต</span></p>
<h1><span data-i18n="credits.title">เครดิตและแหล่งที่มา</span></h1>
<p>รายการทรัพยากรทั้งหมดที่ใช้ในเว็บนี้ พร้อมใบอนุญาต (license) ตามข้อกำหนดของเจ้าของแต่ละราย</p>
<p data-i18n="credits.lead">รายการทรัพยากรทั้งหมดที่ใช้ในเว็บนี้ พร้อมใบอนุญาต (license) ตามข้อกำหนดของเจ้าของแต่ละราย</p>
</div>
<section class="mu-credit-section">
<h2><span data-i18n="credits.icons">ไอคอน — Lucide</span></h2>
<p class="src">แหล่งที่มา: <a href="https://lucide.dev" rel="noopener">lucide.dev</a> · ใบอนุญาต: <a href="https://github.com/lucide-icons/lucide/blob/main/LICENSE" rel="noopener">MIT License</a> — ใช้ได้ฟรีทั้งส่วนบุคคลและเชิงพาณิชย์ โดยไม่ต้องระบุเครดิต แต่เราระบุไว้เพื่อความโปร่งใส</p>
<p class="src"><span data-i18n="credits.src">แหล่งที่มา:</span> <a href="https://lucide.dev" rel="noopener">lucide.dev</a> · <span data-i18n="credits.lic">ใบอนุญาต:</span> <a href="https://github.com/lucide-icons/lucide/blob/main/LICENSE" rel="noopener">MIT License</a> — ใช้ได้ฟรีทั้งส่วนบุคคลและเชิงพาณิชย์ โดยไม่ต้องระบุเครดิต แต่เราระบุไว้เพื่อความโปร่งใส</p>
<ul>
<li>ไอคอนที่ใช้ทั้งหมด 15 รายการ เก็บที่ <code>.image/icons/lucide/</code></li>
<li>alarm-clock, arrow-right, bus, bus-front, check, clock, globe, hourglass, map, map-pin, message-circle, phone, refresh-cw, search, triangle-alert</li>
<li>วิธีใช้งาน: sprite <code>ui/partials/icons-sprite.svg</code> + <code>&lt;svg class="ic"&gt;&lt;use href="#ic-ชื่อ"&gt;</code></li>
<li><span data-i18n="credits.iconsCount">ไอคอนที่ใช้ทั้งหมด 15 รายการ เก็บที่</span> <code>.image/icons/lucide/</code></li>
<li data-i18n="credits.iconNames">alarm-clock, arrow-right, bus, bus-front, check, clock, globe, hourglass, map, map-pin, message-circle, phone, refresh-cw, search, triangle-alert</li>
<li><span data-i18n="credits.iconsUsage">วิธีใช้งาน: sprite</span> <code>ui/partials/icons-sprite.svg</code> + <code>&lt;svg class="ic"&gt;&lt;use href="#ic-ชื่อ"&gt;</code></li>
</ul>
<div class="mu-license">
<strong>MIT License (สรุป):</strong> อนุญาตให้ใช้ คัดลอก แก้ไข ผสาน เผยแพร่ แจกจ่าย ขาย และ/หรือให้สิทธิ์ใช้งานซอฟต์แวร์นี้ โดยมีเงื่อนไขให้ข้อความแสดงลิขสิทธิ์และข้อความอนุญาตข้างต้นปรากฏอยู่ในสำเนาทั้งหมดหรือส่วนสำคัญของซอฟต์แวร์ ซอฟต์แวร์นี้ให้บริการ "ตามสภาพ" โดยไม่มีการรับประกันใด ๆ
<strong data-i18n="credits.mitStrong">MIT License (สรุป):</strong> <span data-i18n="credits.mitText">อนุญาตให้ใช้ คัดลอก แก้ไข ผสาน เผยแพร่ แจกจ่าย ขาย และ/หรือให้สิทธิ์ใช้งานซอฟต์แวร์นี้ โดยมีเงื่อนไขให้ข้อความแสดงลิขสิทธิ์และข้อความอนุญาตข้างต้นปรากฏอยู่ในสำเนาทั้งหมดหรือส่วนสำคัญของซอฟต์แวร์ ซอฟต์แวร์นี้ให้บริการ "ตามสภาพ" โดยไม่มีการรับประกันใด ๆ</span>
</div>
</section>
<section class="mu-credit-section">
<h2><span data-i18n="credits.fonts">ฟอนต์ — Google Fonts</span></h2>
<p class="src">แหล่งที่มา: <a href="https://fonts.google.com" rel="noopener">fonts.google.com</a> · ใบอนุญาต: <a href="https://openfontlicense.org" rel="noopener">SIL Open Font License 1.1</a></p>
<p class="src"><span data-i18n="credits.src">แหล่งที่มา:</span> <a href="https://fonts.google.com" rel="noopener">fonts.google.com</a> · <span data-i18n="credits.lic">ใบอนุญาต:</span> <a href="https://openfontlicense.org" rel="noopener">SIL Open Font License 1.1</a></p>
<ul>
<li><strong>K2D</strong> — ฟอนต์หลักของเว็บ (เนื้อหา + หัวเรื่อง) · มีหัวแบบไทย น้ำหนัก 300–800</li>
<li><strong>Noto Sans Thai</strong> — ตัวสำรองเนื้อหา (โหลดผ่าน Google Fonts CDN)</li>
<li><strong>Prompt</strong> — ตัวสำรองหัวเรื่อง/ตัวหนา</li>
<li><strong>IBM Plex Mono</strong> — เวลา · เลขสาย · ตัวเลข (เรียงตรงกัน)</li>
<li><strong>K2D</strong> — <span data-i18n="credits.fontK2D">ฟอนต์หลักของเว็บ (เนื้อหา + หัวเรื่อง) · มีหัวแบบไทย น้ำหนัก 300–800</span></li>
<li><strong>Noto Sans Thai</strong> — <span data-i18n="credits.fontNoto">ตัวสำรองเนื้อหา (โหลดผ่าน Google Fonts CDN)</span></li>
<li><strong>Prompt</strong> — <span data-i18n="credits.fontPrompt">ตัวสำรองหัวเรื่อง/ตัวหนา</span></li>
<li><strong>IBM Plex Mono</strong> — <span data-i18n="credits.fontMono">เวลา · เลขสาย · ตัวเลข (เรียงตรงกัน)</span></li>
</ul>
</section>
<section class="mu-credit-section">
<h2><span data-i18n="credits.map">แผนที่</span></h2>
<p class="src">ใบอนุญาต: Leaflet <a href="https://github.com/Leaflet/Leaflet/blob/main/LICENSE" rel="noopener">BSD-2-Clause</a> · ชุดแผนที่ (tiles): <a href="https://www.openstreetmap.org/copyright" rel="noopener">OpenStreetMap © ผู้มีส่วนร่วม (ODbL)</a></p>
<p class="src"><span data-i18n="credits.lic">ใบอนุญาต:</span> Leaflet <a href="https://github.com/Leaflet/Leaflet/blob/main/LICENSE" rel="noopener">BSD-2-Clause</a> · ชุดแผนที่ (tiles): <a href="https://www.openstreetmap.org/copyright" rel="noopener">OpenStreetMap © ผู้มีส่วนร่วม (ODbL)</a></p>
<ul>
<li>Leaflet — ไลบรารีแผนที่แบบ open-source</li>
<li>OpenStreetMap — ภาพ tiles และข้อมูลแผนที่ที่ใช้แสดงผล</li>
<li>เส้นทางเดินรถ จุดจอด และหมุดสถานี วาดจากข้อมูล GIS ของทีม (<code>GeoJSON</code>) ทับบนแผนที่</li>
<li data-i18n="credits.mapLeaflet">Leaflet — ไลบรารีแผนที่แบบ open-source</li>
<li data-i18n="credits.mapOSM">OpenStreetMap — ภาพ tiles และข้อมูลแผนที่ที่ใช้แสดงผล</li>
<li><span data-i18n="credits.mapGIS">เส้นทางเดินรถ จุดจอด และหมุดสถานี วาดจากข้อมูล GIS ของทีม</span> (<code>GeoJSON</code>)</li>
</ul>
</section>
<section class="mu-credit-section">
<h2><span data-i18n="credits.photos">ขอขอบคุณภาพรถประจำทาง</span></h2>
<p class="src">ภาพรถโดยสารประจำทางที่แสดงในหน้ารายละเอียดสาย มาจากแหล่งข้อมูลสาธารณะด้านล่างนี้ — ขอบคุณเจ้าของภาพและผู้รวบรวมทุกท่าน</p>
<p class="src" data-i18n="credits.photosLead">ภาพรถโดยสารประจำทางที่แสดงในหน้ารายละเอียดสาย มาจากแหล่งข้อมูลสาธารณะด้านล่างนี้ — ขอบคุณเจ้าของภาพและผู้รวบรวมทุกท่าน</p>
<ul>
<li><strong>สาย 2194</strong> หัวเวียง-อยุธยา — จาก <a href="http://www.bangkokbusclub.com/cms/showthread.php?t=4968" rel="noopener">bangkokbusclub.com</a></li>
<li><strong>สาย 8</strong> กรุงเทพ-สรรคบุรี-ชัยนาท — จาก <a href="https://web.facebook.com/groups/431811197419587/posts/2006978336569524/" rel="noopener">กลุ่ม Facebook (web.facebook.com)</a></li>
<li><strong>สาย 954</strong> กรุงเทพ-ท่าช้าง — จาก <a href="https://gogo.town/route/bangkok-rangsit-angthong-thachang/" rel="noopener">gogo.town</a></li>
<li><strong>รถไฟฟ้าสายสีแดง </strong> กรุงเทพ-ชุมทางบ้านภาชี — จาก <a href="https://thelist.group/realist/blog/%E0%B8%A3%E0%B8%96%E0%B9%84%E0%B8%9F%E0%B8%9F%E0%B9%89%E0%B8%B2%E0%B8%AA%E0%B8%B2%E0%B8%A2%E0%B8%AA%E0%B8%B5%E0%B9%81%E0%B8%94%E0%B8%87/" rel="noopener">thelist.group</a></li>
<li><strong data-i18n="credits.lineRed">รถไฟฟ้าสายสีแดง</strong> กรุงเทพ-ชุมทางบ้านภาชี — จาก <a href="https://thelist.group/realist/blog/%E0%B8%A3%E0%B8%96%E0%B9%84%E0%B8%9F%E0%B8%9F%E0%B9%89%E0%B8%B2%E0%B8%AA%E0%B8%B2%E0%B8%A2%E0%B8%AA%E0%B8%B5%E0%B9%81%E0%B8%94%E0%B8%87/" rel="noopener">thelist.group</a></li>
</ul>
<p class="mu-license">
<span data-i18n="credits.photosNote">และสายอื่น ๆ ที่ไม่ได้ระบุ ขอขอบคุณมา ณ ที่นี้</span>