2020-03-25 17:05:25 +01:00
|
|
|
"use strict";
|
2020-03-24 22:47:39 +01:00
|
|
|
|
2020-03-31 16:55:25 +02:00
|
|
|
byId("server_selection_add").addEventListener("click", e => { e.stopPropagation(); e.preventDefault(); window.location = "#login"; return false; });
|
|
|
|
byId("login").addEventListener("submit", e => { logIn(); e.stopPropagation(); e.preventDefault(); return false; });
|
|
|
|
byId("login_no_button").addEventListener("click", e => { e.stopPropagation(); e.preventDefault(); window.location = "#"; return false; });
|
2021-02-17 18:15:57 +01:00
|
|
|
byId("compose").addEventListener("keydown", e => {
|
|
|
|
if (checkKeyPress(e)) {
|
|
|
|
e.stopPropagation(); e.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
2020-03-26 23:25:35 +01:00
|
|
|
|
2020-03-29 18:54:49 +02:00
|
|
|
updateComposeHeight();
|
2020-03-30 17:12:07 +02:00
|
|
|
checkScrolledToBottom();
|
2021-02-07 21:10:36 +01:00
|
|
|
|
2020-03-31 12:09:33 +02:00
|
|
|
populateServerSelectionList();
|
2021-02-07 21:10:36 +01:00
|
|
|
|
2021-02-17 16:07:15 +01:00
|
|
|
localstorage_credentials.getServers()
|
|
|
|
.map(server => server.endpoint)
|
2022-06-09 15:26:44 +02:00
|
|
|
.map(mm_client.getOrCreate)
|
|
|
|
.forEach(client => client.start());
|
2021-02-07 21:10:36 +01:00
|
|
|
|
2021-02-17 16:07:15 +01:00
|
|
|
populateChannelList();
|
2022-06-09 15:14:40 +02:00
|
|
|
|
|
|
|
window.hasFocus = true;
|
|
|
|
window.addEventListener("focus", _ => {
|
|
|
|
window.hasFocus = true;
|
|
|
|
pubsub.publish("WINDOW_FOCUSED");
|
|
|
|
});
|
|
|
|
window.addEventListener("blur", _ => {
|
|
|
|
window.hasFocus = false;
|
|
|
|
});
|