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:
1 parent
74d605f1c4
commit
750b4a2ea8
25 files changed
+426
-180
No files matched your search
+10
-10
@@ -17,14 +17,14 @@
|
||||
'use strict';
|
||||
|
||||
var VIEWS = {
|
||||
home: { partial: 'partials/home.html', nav: '/', title: 'หน้าแรก' },
|
||||
stops: { partial: 'partials/busStop.html', nav: '/stops', title: 'ป้ายหยุดรถ' },
|
||||
routes: { partial: 'partials/busDetail.html', nav: '/routes', title: 'รายละเอียดสายรถ' },
|
||||
check: { partial: 'partials/checkSchedule.html', nav: '/check', title: 'เช็กเวลาเดินรถ' },
|
||||
stop: { partial: 'partials/stopDetail.html', nav: '/stops/', title: 'รายละเอียดป้าย' },
|
||||
credits: { partial: 'partials/credits.html', nav: '/credits', title: 'เครดิต' },
|
||||
about: { partial: 'partials/about.html', nav: '/about', title: 'เกี่ยวกับเรา' },
|
||||
blog: { partial: 'partials/blog.html', nav: '/blog', title: 'บ่นไปเรื่อย' },
|
||||
home: { partial: 'partials/home.html', nav: '/', title: 'หน้าแรก', tkey: 'page.home' },
|
||||
stops: { partial: 'partials/busStop.html', nav: '/stops', title: 'ป้ายหยุดรถ', tkey: 'page.stops' },
|
||||
routes: { partial: 'partials/busDetail.html', nav: '/routes', title: 'รายละเอียดสายรถ', tkey: 'page.routes' },
|
||||
check: { partial: 'partials/checkSchedule.html', nav: '/check', title: 'เช็กเวลาเดินรถ', tkey: 'page.check' },
|
||||
stop: { partial: 'partials/stopDetail.html', nav: '/stops/', title: 'รายละเอียดป้าย', tkey: 'page.stop' },
|
||||
credits: { partial: 'partials/credits.html', nav: '/credits', title: 'เครดิต', tkey: 'page.credits' },
|
||||
about: { partial: 'partials/about.html', nav: '/about', title: 'เกี่ยวกับเรา', tkey: 'page.about' },
|
||||
blog: { partial: 'partials/blog.html', nav: '/blog', title: 'บ่นไปเรื่อย', tkey: 'page.blog' },
|
||||
};
|
||||
|
||||
function parseHash() {
|
||||
@@ -137,7 +137,7 @@
|
||||
var stateEl = viewEl.querySelector('.mu-inline-context strong');
|
||||
if (stateEl) stateEl.textContent = '?route=' + route.params.routeId;
|
||||
}
|
||||
document.title = 'Atroute — ' + view.title;
|
||||
document.title = (window.I18N && view.tkey) ? I18N.t(view.tkey) : ('Atroute — ' + view.title);
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
/* footer "สายที่เปิดดูบ่อย" — เรนเดอร์ทุกครั้ง (ตามภาษา + อันดับล่าสุด) */
|
||||
@@ -146,7 +146,7 @@
|
||||
.catch(function () {
|
||||
viewEl.innerHTML =
|
||||
'<div class="mu-container" style="padding:64px 28px;text-align:center;color:#6f7b95;">' +
|
||||
'โหลดเนื้อหาไม่สำเร็จ — กรุณาเปิดผ่าน HTTP server (เช่น python3 -m http.server)</div>';
|
||||
(window.I18N ? I18N.t('router.loadFail') : 'โหลดเนื้อหาไม่สำเร็จ') + '</div>';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user