church_streamer/app/index.js

28 lines
644 B
JavaScript
Raw Permalink Normal View History

2024-02-13 23:54:45 +00:00
const m = require('mithril')
const Header = require('./header')
2024-02-13 23:54:45 +00:00
const Status = require('./page_status')
const Display = require('./page_display')
const Encoder = require('./page_encoder')
2024-02-13 23:54:45 +00:00
window.m = m
m.route.setOrig = m.route.set
m.route.set = function(path, data, options){
m.route.setOrig(path, data, options)
window.scrollTo(0, 0)
}
m.route.linkOrig = m.route.link
m.route.link = function(vnode){
m.route.linkOrig(vnode)
window.scrollTo(0, 0)
}
m.route.prefix = ''
m.mount(document.getElementById('header'), Header)
2024-02-13 23:54:45 +00:00
m.route(document.getElementById('main'), '/', {
'/': Status,
'/encoder': Encoder,
'/display': Display,
2024-02-13 23:54:45 +00:00
})