| <!DOCTYPE html> | <!DOCTYPE html> | ||||
| <html> | <html> | ||||
| <title>PicoChat!</title> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||||
| <script src="https://unpkg.com/mithril/mithril.min.js"></script> | <script src="https://unpkg.com/mithril/mithril.min.js"></script> | ||||
| <script src="/pico.js" defer></script> | <script src="/pico.js" defer></script> |
| listen('peerInfo', (e) => onPeerInfo(e)) | listen('peerInfo', (e) => onPeerInfo(e)) | ||||
| const doNotLog = new Set(['login', 'post', 'peerInfo']) | const doNotLog = new Set(['login', 'post', 'peerInfo']) | ||||
| /* | |||||
| * | |||||
| * ALERTS | |||||
| * | |||||
| */ | |||||
| State.unseen = 0 | |||||
| listen('post', () => {State.unseen += !document.hasFocus(); updateTitle()}) | |||||
| listen('focus', () => {State.unseen = 0; updateTitle()}) | |||||
| const updateTitle = () => { | |||||
| document.title = `Pico.Chat` + (State.unseen ? ` (${State.unseen})` : ``) | |||||
| } | |||||
| /* | /* | ||||
| * | * |