From 6dfe034f6f4a3f52820d365b4a765bd89961e182 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 29 Sep 2017 03:09:32 -0700 Subject: [PATCH] client: Fixes. --- modules/static/charybdis.css | 46 ++++++++++++++++++++----- modules/static/charybdis.js | 7 +++- modules/static/charybdis/auth.js | 1 + modules/static/charybdis/main.js | 4 +++ modules/static/charybdis/mc.js | 2 +- modules/static/charybdis/room/scroll.js | 10 ++++-- modules/static/charybdis/room/sync.js | 6 +++- modules/static/charybdis/sync.js | 4 +-- modules/static/index.html | 10 +++--- 9 files changed, 70 insertions(+), 20 deletions(-) diff --git a/modules/static/charybdis.css b/modules/static/charybdis.css index 7bc108feb..c95cc764d 100644 --- a/modules/static/charybdis.css +++ b/modules/static/charybdis.css @@ -1069,7 +1069,7 @@ body.loaded align-content: center; justify-content: center; margin: 1px 1px 1px 1px; - padding: 5px 5px 5px 5px; + padding: 1vh 1vw 1vh 1vw; background-color: inherit; outline: none; } @@ -1177,8 +1177,8 @@ body.loaded #charybdis_login_form { - align-items: flex-start; - margin: 0px 10px 0px 10px; + align-items: flex-end; + margin: 0px 1vw 0px 1vw; } .ircd .login_ @@ -1194,7 +1194,6 @@ body.loaded flex-flow: column nowrap; align-items: center; justify-content: center; - text-align: center; } /* This doesn't exist in the HTML until generated */ @@ -1207,10 +1206,40 @@ body.loaded .ircd .login_ h1 { - font-size: 39px; - text-align: left; - text-shadow: 1px 2px #404040; - color: #F8F8F8; + font-size: 1.5vw; + align-self: flex-end; + text-shadow: 1px 2px #707070; + align-items: center; +} + +.ircd .login_ img +{ + align-self: flex-end; + width: 30px; +} + +.ircd .login_ h2 +{ + font-size: 3vw; + align-self: flex-start; + text-shadow: 1px 1px #505050; + align-items: center; +} + +.ircd .login_ h3 +{ + font-size: 2.25vw; + align-self: center; + text-shadow: 1px 2px #707070; + align-items: baseline; + letter-spacing: -1px; +} + +.ircd .login_ h3 b +{ + color: var(--pal-CA); + font-size: 3.5vw; + letter-spacing: -2px; } .ircd .login_ h1:hover @@ -1226,6 +1255,7 @@ body.loaded box-sizing: border-box; margin: 10px 0px 0px 0px; padding: 0px 4px 0px 4px; + border-radius: 3px; } .ircd .login_ div.submit diff --git a/modules/static/charybdis.js b/modules/static/charybdis.js index 0a2e39fda..866e0bcdf 100644 --- a/modules/static/charybdis.js +++ b/modules/static/charybdis.js @@ -92,7 +92,12 @@ window.addEventListener("unload", async function(event) } }); -$(document).ready((event) => +mc.run = async function(event = {}) { mc.execution = mc.ready(event); +} + +$(document).ready((event) => +{ + mc.run(event); }); diff --git a/modules/static/charybdis/auth.js b/modules/static/charybdis/auth.js index 750faf57c..560f11fb3 100644 --- a/modules/static/charybdis/auth.js +++ b/modules/static/charybdis/auth.js @@ -156,6 +156,7 @@ mc.auth["m.register.user"] = async function(opts = {}) mc.session.guest = false; mc.instance.authentic = true; Object.update(mc.session, data); + mc.run(); return true; } catch(error) diff --git a/modules/static/charybdis/main.js b/modules/static/charybdis/main.js index 9aec16e69..25214d281 100644 --- a/modules/static/charybdis/main.js +++ b/modules/static/charybdis/main.js @@ -204,6 +204,7 @@ mc.main.fault["M_MISSING_TOKEN"] = async function(error) console.error("Authentication via " + type + ": " + result); } + mc.main.on_logout(); return false; }; @@ -215,6 +216,7 @@ mc.main.on_login = async function() await mc.filter.init(); mc.main.menu["ROOMS"].hide = false; + mc.main.menu["MENU"].hide = false; mc.show["#charybdis_rooms"] = true; if(!mc.session.guest) @@ -246,6 +248,7 @@ mc.main.on_logout = function() mc.main.menu["USERS"].hide = true; mc.main.menu["LOGIN"].hide = false; mc.main.menu["LOGOUT"].hide = true; + mc.main.menu["MENU"].hide = true; mc.show["#charybdis_menu"] = true; mc.show["#charybdis_login"] = true; mc.show["#charybdis_rooms"] = false; @@ -260,6 +263,7 @@ mc.main.menu = { icon: "fa-bars", target: "#charybdis_menu", + hide: true, }, "IRCd": diff --git a/modules/static/charybdis/mc.js b/modules/static/charybdis/mc.js index f3326d5b1..8eb0cff45 100644 --- a/modules/static/charybdis/mc.js +++ b/modules/static/charybdis/mc.js @@ -64,7 +64,7 @@ mc.opts = style: "charybdis.css", // Quick setting to debug incoming sync messages on the console - sync_debug: 0, + sync_debug: 10, account_data: { diff --git a/modules/static/charybdis/room/scroll.js b/modules/static/charybdis/room/scroll.js index 7b2a0cd8a..89b22c3b7 100644 --- a/modules/static/charybdis/room/scroll.js +++ b/modules/static/charybdis/room/scroll.js @@ -115,11 +115,17 @@ room.scroll.on = function(event) mc.ng.apply(); } - if(at_top || (going_up && pcts.top < 0.15)) + if(at_top || (going_up && pcts.top < 0.15)) try + { this.scroll.back(48); + } + catch(e) {} - if(!at_bottom && going_down && pcts.bottom < 0.15) + if(!at_bottom && going_down && pcts.bottom < 0.15) try + { this.scroll.front(48); + } + catch(e) {} this.control.scroll_pos_last = pos; this.control.scroll_pct_last = pcts; diff --git a/modules/static/charybdis/room/sync.js b/modules/static/charybdis/room/sync.js index 749fa859d..6da6b5d27 100644 --- a/modules/static/charybdis/room/sync.js +++ b/modules/static/charybdis/room/sync.js @@ -52,11 +52,15 @@ room.sync = function(data, action) if(this.focused()) { this.sync.activity(); - if(this.control.mode == "LIVE") + if(this.control.mode == "LIVE") try { this.scroll.to.bottom("fast"); this.receipt.send.current(); } + catch(e) + { + console.error(e); + } } }; diff --git a/modules/static/charybdis/sync.js b/modules/static/charybdis/sync.js index 398bb4491..6b3801aa4 100644 --- a/modules/static/charybdis/sync.js +++ b/modules/static/charybdis/sync.js @@ -69,8 +69,8 @@ mc.sync["rooms"] = function(rooms) mc.sync["presence"] = function(presence) { - let events = presence.events; - mc.users.sync(events); + if(presence.events) + mc.users.sync(presence.events); }; mc.sync["account_data"] = function(account_data) diff --git a/modules/static/index.html b/modules/static/index.html index 5eb5a0528..f8d525b15 100644 --- a/modules/static/index.html +++ b/modules/static/index.html @@ -14,7 +14,7 @@ lang="en" /> - Charybdis 5 - Internet Relay Collaboration + Charybdis 5 - Internet Relay Chat Matrix @@ -1064,9 +1064,9 @@ type="text/ng-template" id="charybdis_login_form" ircd-catch > -

- Matrix -

+

+ Internet   Relay   Chat +