Merge pull request #23 from ok2/codex/fix-system-issue-after-update

Fix initialization timing for CoBiE UI
This commit is contained in:
Kiyomichi Kosaka 2025-06-15 00:41:05 +02:00 committed by GitHub
commit 6371a195ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,13 @@
// CoBiE Time System Implementation
// Using Unix TAI epoch (January 1, 1970, 00:00:00 TAI)
// Note: TAI differs from UTC by leap seconds (37 seconds as of 2025)
(function() {
if (!window.Cobie) {
console.error('cobie.js not loaded');
return;
}
const {
COBIE_EPOCH,
COBIE_UNITS,
@ -794,6 +801,7 @@ function commitInput() {
span.addEventListener('click', enterEdit);
}
function init() {
// Timezone change handler
document.getElementById('timezone').addEventListener('change', (e) => {
currentTimezone = e.target.value;
@ -923,3 +931,15 @@ function wheelNavigate(e) {
}
document.addEventListener('wheel', wheelNavigate);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
window.navigatePeriod = navigatePeriod;
window.goToNow = goToNow;
})();