From 3e28d4b6e17875583a4011464e089cdd88a7a6b4 Mon Sep 17 00:00:00 2001 From: Bad Date: Tue, 20 Oct 2020 20:22:13 +0200 Subject: [PATCH 01/10] Style the login form --- package-lock.json | 2 +- spec.js | 57 ++++++++++++++++++++++++-------------------- src/login.pug | 36 +++++++++++++++++----------- src/sass/login.sass | 58 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 112 insertions(+), 41 deletions(-) create mode 100644 src/sass/login.sass diff --git a/package-lock.json b/package-lock.json index e5806d8..94cc52b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "cosc212-assignment-1", + "name": "carbon", "version": "1.0.0", "lockfileVersion": 1, "requires": true, diff --git a/spec.js b/spec.js index 38bb96e..600af14 100644 --- a/spec.js +++ b/spec.js @@ -2,121 +2,126 @@ module.exports = [ { type: "file", source: "/assets/fonts/whitney-500.woff", - target: "/static/whitney-500.woff" + target: "/static/whitney-500.woff", }, { type: "file", source: "/assets/fonts/whitney-400.woff", - target: "/static/whitney-400.woff" + target: "/static/whitney-400.woff", }, { type: "js", source: "/js/basic.js", - target: "/static/basic.js" + target: "/static/basic.js", }, { type: "js", source: "/js/groups.js", - target: "/static/groups.js" + target: "/static/groups.js", }, { type: "js", source: "/js/chat-input.js", - target: "/static/chat-input.js" + target: "/static/chat-input.js", }, { type: "js", source: "/js/room-picker.js", - target: "/static/room-picker.js" + target: "/static/room-picker.js", }, { type: "js", source: "/js/store/store.js", - target: "/static/store/store.js" + target: "/static/store/store.js", }, { type: "js", source: "/js/store/Subscribable.js", - target: "/static/store/Subscribable.js" + target: "/static/store/Subscribable.js", }, { type: "js", source: "/js/store/SubscribeValue.js", - target: "/static/store/SubscribeValue.js" + target: "/static/store/SubscribeValue.js", }, { type: "js", source: "/js/store/SubscribeMapList.js", - target: "/static/store/SubscribeMapList.js" + target: "/static/store/SubscribeMapList.js", }, { type: "js", source: "/js/store/SubscribeSet.js", - target: "/static/store/SubscribeSet.js" + target: "/static/store/SubscribeSet.js", }, { type: "js", source: "/js/sync/sync.js", - target: "/static/sync/sync.js" + target: "/static/sync/sync.js", }, { type: "js", source: "/js/lsm.js", - target: "/static/lsm.js" + target: "/static/lsm.js", }, { type: "js", source: "/js/Timeline.js", - target: "/static/Timeline.js" + target: "/static/Timeline.js", }, { type: "js", source: "/js/Anchor.js", - target: "/static/Anchor.js" + target: "/static/Anchor.js", }, { type: "js", source: "/js/chat.js", - target: "/static/chat.js" + target: "/static/chat.js", }, { type: "js", source: "/js/functions.js", - target: "/static/functions.js" + target: "/static/functions.js", }, { type: "file", source: "/assets/fonts/whitney-500.woff", - target: "/static/whitney-500.woff" + target: "/static/whitney-500.woff", }, { type: "file", source: "/assets/icons/directs.svg", - target: "/static/directs.svg" + target: "/static/directs.svg", }, { type: "file", source: "/assets/icons/channels.svg", - target: "/static/channels.svg" + target: "/static/channels.svg", }, { type: "file", source: "/assets/icons/join-event.svg", - target: "/static/join-event.svg" + target: "/static/join-event.svg", }, { type: "sass", source: "/sass/main.sass", - target: "/static/main.css" + target: "/static/main.css", + }, + { + type: "sass", + source: "/sass/login.sass", + target: "/static/login.css", }, { type: "pug", source: "/home.pug", - target: "/index.html" + target: "/index.html", }, { type: "pug", source: "/login.pug", - target: "/login.html" - } -] + target: "/login.html", + }, +]; diff --git a/src/login.pug b/src/login.pug index 105b6bd..954728c 100644 --- a/src/login.pug +++ b/src/login.pug @@ -2,20 +2,28 @@ doctype html html head meta(charset="utf-8") - link(rel="stylesheet" type="text/css" href=getStatic("/sass/main.sass")) + link(rel="stylesheet" type="text/css" href=getStatic("/sass/login.sass")) title Carbon + meta(name="viewport" content= "width=device-width, initial-scale=1.0") + body main.main - form - div - label(for="login") Username - input(type="text" name="login" autocomplete="username" placeholder="example:matrix.org" required)#login - div - label(for="password") Password - input(type="text" name="password" autocomplete="current-password" required)#password - div - - label(for="homeserver") Homeserver - input(type="text" name="homeserver" value="matrix.org" required)#homeserver - div - input(type="submit" value="Login") + div.center-login-container + h1 Welcome to the Matrix! + form.login-form + div.data-input + div.form-input-container + label(for="login") Username + input(type="text" name="login" autocomplete="username" required)#login + div.form-input-container + + label(for="password") Password + input(name="password" autocomplete="current-password" type="password" required)#password + div.form-input-container + + + label(for="homeserver") Homeserver + input(type="text" name="homeserver" value="matrix.org" required)#homeserver + div.form-input-container + + input(type="submit" value="Login") diff --git a/src/sass/login.sass b/src/sass/login.sass new file mode 100644 index 0000000..4040453 --- /dev/null +++ b/src/sass/login.sass @@ -0,0 +1,58 @@ +@use "./base" +@use "./colors.sass" as c + +.main + justify-content: center + align-items: center + +.center-login-container + display: flex + flex-flow: column + justify-content: center + align-items: center + width: min(100vw, 30rem) + padding: max(1rem,3vw) 2rem + height: 27rem + box-shadow: -2px 2px 10px c.$darkest + background-color: c.$darker + border-radius: 5px + +.login-form + align-items: center + flex: 1 1 auto + width: 100% + display: flex + justify-content: space-around + flex-flow: column + +.data-input + width: 100% + + +.form-input-container + width: 100% + display: flex + flex-direction: column + margin: 1em 0 + +input + width: 100% + height: 2.4rem + border-radius: 5px + box-sizing: border-box + transition: background-color 1s, border-color 1s + padding: 0px 1ch + border: 0px + +input[type="text"],input[type="password"] + border: 3px solid transparent + margin: 0.4em 0px + &:hover + border-color: c.$mild + +input[type="submit"]:hover + background-color: c.$mild + +label + font-size: 1.2em + From c21ab3b90fc18a627fcc30d78a4bfb24e40b52d1 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 18:17:01 +1300 Subject: [PATCH 02/10] Adjust group list internal sizing --- src/js/Timeline.js | 1 - src/sass/components/groups.sass | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/Timeline.js b/src/js/Timeline.js index fa8f2e5..94e77bf 100644 --- a/src/js/Timeline.js +++ b/src/js/Timeline.js @@ -282,7 +282,6 @@ class Timeline extends Subscribable { if (eventData.type === "m.room.message" && eventData.content["m.relates_to"] && eventData.content["m.relates_to"].rel_type === "m.replace") { const replaces = eventData.content["m.relates_to"].event_id if (this.map.has(replaces)) { - console.log(eventData) const event = this.map.get(replaces) event.data.content = eventData.content["m.new_content"] event.setEdited(eventData.origin_server_ts) diff --git a/src/sass/components/groups.sass b/src/sass/components/groups.sass index 44685d5..e91f4cc 100644 --- a/src/sass/components/groups.sass +++ b/src/sass/components/groups.sass @@ -33,6 +33,7 @@ $out-width: $base-width + rooms.$list-width &__container width: $out-width padding: $icon-padding + box-sizing: border-box .c-group display: flex From 3fc8104bdd52334cfc98e8cbce66cc840b528d62 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 18:23:44 +1300 Subject: [PATCH 03/10] Format Bad's code --- src/login.pug | 51 ++++++++++++++++++++++----------------------- src/sass/login.sass | 4 +--- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/login.pug b/src/login.pug index 954728c..13acefd 100644 --- a/src/login.pug +++ b/src/login.pug @@ -1,29 +1,28 @@ doctype html html - head - meta(charset="utf-8") - link(rel="stylesheet" type="text/css" href=getStatic("/sass/login.sass")) - title Carbon - meta(name="viewport" content= "width=device-width, initial-scale=1.0") + head + meta(charset="utf-8") + link(rel="stylesheet" type="text/css" href=getStatic("/sass/login.sass")) + title Carbon + meta(name="viewport" content="width=device-width, initial-scale=1") - body - main.main - div.center-login-container - h1 Welcome to the Matrix! - form.login-form - div.data-input - div.form-input-container - label(for="login") Username - input(type="text" name="login" autocomplete="username" required)#login - div.form-input-container - - label(for="password") Password - input(name="password" autocomplete="current-password" type="password" required)#password - div.form-input-container - - - label(for="homeserver") Homeserver - input(type="text" name="homeserver" value="matrix.org" required)#homeserver - div.form-input-container - - input(type="submit" value="Login") + body + main.main + .center-login-container + h1 Welcome to the Matrix! + form.login-form + .data-input + .form-input-container + label(for="login") Username + input(type="text" name="login" autocomplete="username" required)#login + + .form-input-container + label(for="password") Password + input(name="password" autocomplete="current-password" type="password" required)#password + + .form-input-container + label(for="homeserver") Homeserver + input(type="text" name="homeserver" value="matrix.org" required)#homeserver + + .form-input-container + input(type="submit" value="Login") diff --git a/src/sass/login.sass b/src/sass/login.sass index 4040453..92f443f 100644 --- a/src/sass/login.sass +++ b/src/sass/login.sass @@ -27,8 +27,7 @@ .data-input width: 100% - - + .form-input-container width: 100% display: flex @@ -55,4 +54,3 @@ input[type="submit"]:hover label font-size: 1.2em - From 265d774b4f149f0fafe6f6e77b6e384967710c98 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 19:33:36 +1300 Subject: [PATCH 04/10] Some login functionality --- spec.js | 5 ++ src/js/login.js | 114 ++++++++++++++++++++++++++++++++++++++++++++ src/login.pug | 13 ++--- src/sass/login.sass | 31 +++++++----- 4 files changed, 145 insertions(+), 18 deletions(-) create mode 100644 src/js/login.js diff --git a/spec.js b/spec.js index 600af14..a488e5e 100644 --- a/spec.js +++ b/spec.js @@ -84,6 +84,11 @@ module.exports = [ source: "/js/functions.js", target: "/static/functions.js", }, + { + type: "js", + source: "/js/login.js", + target: "/static/login.js", + }, { type: "file", source: "/assets/fonts/whitney-500.woff", diff --git a/src/js/login.js b/src/js/login.js new file mode 100644 index 0000000..d3baf3a --- /dev/null +++ b/src/js/login.js @@ -0,0 +1,114 @@ +import {q, ElemJS} from $to_relative "/js/basic.js" + +const password = q("#password") +const homeserver = q("#homeserver") + +class Username extends ElemJS { + constructor() { + super(q("#username")) + + this.on("change", this.updateServer.bind(this)) + } + + isValid() { + return !!this.element.value.match(/^@?[a-z0-9._=\/-]+(?::[a-zA-Z0-9.:\[\]-]+)?$/) + } + + getUsername() { + return this.element.value.match(/^@?([a-z0-9._=\/-]+)/)[1] + } + + getServer() { + const server = this.element.value.match(/^@?[a-z0-9._=\?-]+:([a-zA-Z0-9.:\[\]-]+)$/) + if (server && server[1]) return server[1] + else return null + } + + updateServer() { + if (!this.isValid()) return + if (this.getServer()) homeserver.value = this.getServer() + } +} + +const username = new Username() + +class Form extends ElemJS { + constructor() { + super(q("#form")) + + this.processing = false + + this.on("submit", this.submit.bind(this)) + } + + async submit() { + if (this.processing) return + this.processing = true + if (!username.isValid()) return this.cancel("Username is not valid.") + + // Resolve homeserver address + let currentAddress = homeserver.value + let ok = false + while (!ok) { + if (!currentAddress.match(/^https?:\/\//)) currentAddress = "https://" + currentAddress + currentAddress = currentAddress.replace(/\/*$/, "") + this.status(`Looking up homeserver... trying ${currentAddress}`) + try { + // check if we found the actual matrix server + const exists = await fetch(`${currentAddress}/_matrix/client/r0`).then(res => res.json()) + if (exists.errcode === "M_UNRECOGNIZED") { + ok = true + break + } + // find the next matrix server in the chain + const root = await fetch(`${currentAddress}/.well-known/matrix/client`).then(res => res.json()) + let nextAddress = root["m.homeserver"].base_url + nextAddress = nextAddress.replace(/\/*$/, "") + if (currentAddress === nextAddress) { + ok = true + } + currentAddress = nextAddress + } catch (e) { + return this.cancel(`Failed to look up server ${currentAddress}`) + } + } + + // Request access token + this.status("Logging in...") + const root = await fetch(`${currentAddress}/_matrix/client/r0/login`, { + method: "POST", + body: JSON.stringify({ + type: "m.login.password", + user: username.getUsername(), + password: password.value + }) + }).then(res => res.json()) + + if (!root.access_token) { + if (root.error) { + this.cancel(`Server said: ${root.error}`) + } else { + this.cancel("Login mysteriously failed.") + console.error(root) + } + return + } + + localStorage.setItem("mx_user_id", root.user_id) + localStorage.setItem("domain", currentAddress) + localStorage.setItem("access_token", root.access_token) + + location.assign("./") + } + + status(message) { + //TODO: display the message + } + + cancel(message) { + this.processing = false + //TODO: display the message + } +} + +const form = new Form() diff --git a/src/login.pug b/src/login.pug index 13acefd..4e86f06 100644 --- a/src/login.pug +++ b/src/login.pug @@ -2,19 +2,20 @@ doctype html html head meta(charset="utf-8") - link(rel="stylesheet" type="text/css" href=getStatic("/sass/login.sass")) title Carbon meta(name="viewport" content="width=device-width, initial-scale=1") + link(rel="stylesheet" type="text/css" href=getStatic("/sass/login.sass")) + script(type="module" src=getStatic("/js/login.js")) body main.main .center-login-container h1 Welcome to the Matrix! - form.login-form + form.login-form(method="post" onsubmit="return false")#form .data-input .form-input-container - label(for="login") Username - input(type="text" name="login" autocomplete="username" required)#login + label(for="username") Username + input(type="text" name="username" autocomplete="username" placeholder="@username:server.tld" pattern="^@?[a-z0-9._=/-]+(?::[a-zA-Z0-9.:\\[\\]-]+)?$" required)#username .form-input-container label(for="password") Password @@ -22,7 +23,7 @@ html .form-input-container label(for="homeserver") Homeserver - input(type="text" name="homeserver" value="matrix.org" required)#homeserver + input(type="text" name="homeserver" value="matrix.org" placeholder="matrix.org" required)#homeserver .form-input-container - input(type="submit" value="Login") + input(type="submit" value="Log in")#submit diff --git a/src/sass/login.sass b/src/sass/login.sass index 92f443f..77144bc 100644 --- a/src/sass/login.sass +++ b/src/sass/login.sass @@ -10,10 +10,10 @@ flex-flow: column justify-content: center align-items: center - width: min(100vw, 30rem) + width: min(100vw, 450px) padding: max(1rem,3vw) 2rem - height: 27rem - box-shadow: -2px 2px 10px c.$darkest + margin: 8px + box-shadow: 0px 2px 10px c.$darkest background-color: c.$darker border-radius: 5px @@ -34,23 +34,30 @@ flex-direction: column margin: 1em 0 -input +input, button + font-family: inherit + font-size: 17px + background-color: c.$mild + color: #eee width: 100% - height: 2.4rem border-radius: 5px box-sizing: border-box - transition: background-color 1s, border-color 1s - padding: 0px 1ch + transition: background-color 0.15s ease-out, border-color 0.15s ease-out + padding: 4px 9px border: 0px input[type="text"],input[type="password"] border: 3px solid transparent margin: 0.4em 0px - &:hover - border-color: c.$mild -input[type="submit"]:hover - background-color: c.$mild + &:hover, &:focus + border-color: c.$milder + +button, input[type="submit"] + padding: 7px + + &:hover + background-color: c.$milder label - font-size: 1.2em + font-size: 18px From 735ca360c8dc24dd14597f12db5e50c846a5afd8 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 20:23:51 +1300 Subject: [PATCH 05/10] Login form feedback --- src/js/login.js | 50 ++++++++++++++++++++++++++++++++++++------- src/js/room-picker.js | 8 ++++--- src/login.pug | 3 +++ src/sass/login.sass | 18 ++++++++++++++++ 4 files changed, 68 insertions(+), 11 deletions(-) diff --git a/src/js/login.js b/src/js/login.js index d3baf3a..de32932 100644 --- a/src/js/login.js +++ b/src/js/login.js @@ -1,4 +1,4 @@ -import {q, ElemJS} from $to_relative "/js/basic.js" +import {q, ElemJS, ejs} from $to_relative "/js/basic.js" const password = q("#password") const homeserver = q("#homeserver") @@ -32,6 +32,36 @@ class Username extends ElemJS { const username = new Username() +class Feedback extends ElemJS { + constructor() { + super(q("#feedback")) + this.loading = false + this.loadingIcon = ejs("span").class("loading-icon") + this.messageSpan = ejs("span") + this.child(this.messageSpan) + } + + setLoading(state) { + if (this.loading && !state) { + this.loadingIcon.remove() + } else if (!this.loading && state) { + this.childAt(0, this.loadingIcon) + } + this.loading = state + } + + message(content) { + if (content) { + this.class("form-feedback") + } else { + this.removeClass("form-feedback") + } + this.messageSpan.text(content) + } +} + +const feedback = new Feedback() + class Form extends ElemJS { constructor() { super(q("#form")) @@ -55,11 +85,13 @@ class Form extends ElemJS { this.status(`Looking up homeserver... trying ${currentAddress}`) try { // check if we found the actual matrix server - const exists = await fetch(`${currentAddress}/_matrix/client/r0`).then(res => res.json()) - if (exists.errcode === "M_UNRECOGNIZED") { - ok = true - break - } + try { + const versions = await fetch(`${currentAddress}/_matrix/client/versions`).then(res => res.json()) + if (Array.isArray(versions.versions)) { + ok = true + break + } + } catch (e) {} // find the next matrix server in the chain const root = await fetch(`${currentAddress}/.well-known/matrix/client`).then(res => res.json()) let nextAddress = root["m.homeserver"].base_url @@ -102,12 +134,14 @@ class Form extends ElemJS { } status(message) { - //TODO: display the message + feedback.setLoading(true) + feedback.message(message) } cancel(message) { this.processing = false - //TODO: display the message + feedback.setLoading(false) + feedback.message(message) } } diff --git a/src/js/room-picker.js b/src/js/room-picker.js index 8e696de..9fbbece 100644 --- a/src/js/room-picker.js +++ b/src/js/room-picker.js @@ -108,10 +108,12 @@ class Room extends ElemJS { getIcon() { const avatar = this.data.state.events.find(e => e.type === "m.room.avatar") if (avatar) { - return resolveMxc(avatar.content.url || avatar.content.avatar_url, 32, "crop") - } else { - return null + const url = avatar.content.url || avatar.content.avatar_url + if (url) { + return resolveMxc(url, 32, "crop") + } } + return null } isDirect() { diff --git a/src/login.pug b/src/login.pug index 4e86f06..85d4485 100644 --- a/src/login.pug +++ b/src/login.pug @@ -25,5 +25,8 @@ html label(for="homeserver") Homeserver input(type="text" name="homeserver" value="matrix.org" placeholder="matrix.org" required)#homeserver + #feedback + .form-input-container input(type="submit" value="Log in")#submit + diff --git a/src/sass/login.sass b/src/sass/login.sass index 77144bc..e4820ee 100644 --- a/src/sass/login.sass +++ b/src/sass/login.sass @@ -34,6 +34,24 @@ flex-direction: column margin: 1em 0 +.form-feedback + width: 100% + margin: -0.5em 0 -0.8em + +@keyframes spin + 0% + transform: rotate(0deg) + 100% + transform: rotate(180deg) + +.loading-icon + display: inline-block + background-color: #ccc + width: 12px + height: 12px + margin-right: 6px + animation: spin 0.7s infinite + input, button font-family: inherit font-size: 17px From 988dd1050ba2dff0c92e8dfe2d538b0b19e40d53 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 20:27:22 +1300 Subject: [PATCH 06/10] Add note about encrypted messages --- src/js/Timeline.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/Timeline.js b/src/js/Timeline.js index 94e77bf..3e2a0b6 100644 --- a/src/js/Timeline.js +++ b/src/js/Timeline.js @@ -81,6 +81,8 @@ class Event extends ElemJS { } else { this.child(ejs("i").text("left the room")) } + } else if (this.data.type === "m.room.encrypted") { + this.child(ejs("i").text("Carbon does not yet support encrypted messages.")) } else { this.child(ejs("i").text(`Unsupported event type ${this.data.type}`)) } From 184c876fb96af0bc4ae9bb21b541ac07f47bb0d5 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 20:34:09 +1300 Subject: [PATCH 07/10] Redirect to login page if not logged in --- spec.js | 7 ++++++- src/home.pug | 10 +++------- src/js/main.js | 9 +++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/js/main.js diff --git a/spec.js b/spec.js index a488e5e..450f7cc 100644 --- a/spec.js +++ b/spec.js @@ -9,6 +9,11 @@ module.exports = [ source: "/assets/fonts/whitney-400.woff", target: "/static/whitney-400.woff", }, + { + type: "js", + source: "/js/main.js", + target: "/static/main.js", + }, { type: "js", source: "/js/basic.js", @@ -127,6 +132,6 @@ module.exports = [ { type: "pug", source: "/login.pug", - target: "/login.html", + target: "/login/index.html", }, ]; diff --git a/src/home.pug b/src/home.pug index 68bbd21..09a00c7 100644 --- a/src/home.pug +++ b/src/home.pug @@ -33,18 +33,14 @@ doctype html html head meta(charset="utf-8") + title Carbon // var static = !{JSON.stringify([...static.entries()].reduce((a, c) => (a[c[0]] = getRelative(c[1]), a), {}))} script | var staticFiles = new Map( != JSON.stringify([...static.keys()].map(k => [k, getStatic(k)])) | ) link(rel="stylesheet" type="text/css" href=getStatic("/sass/main.sass")) - script(type="module" src=getStatic("/js/groups.js")) - script(type="module" src=getStatic("/js/chat-input.js")) - script(type="module" src=getStatic("/js/room-picker.js")) - script(type="module" src=getStatic("/js/sync/sync.js")) - script(type="module" src=getStatic("/js/chat.js")) - title Carbon + script(type="module" src=getStatic("/js/main.js")) body main.main .c-groups @@ -56,4 +52,4 @@ html .c-chat__messages#c-chat-messages .c-chat__inner#c-chat .c-chat-input - textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea \ No newline at end of file + textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea diff --git a/src/js/main.js b/src/js/main.js new file mode 100644 index 0000000..98dd38b --- /dev/null +++ b/src/js/main.js @@ -0,0 +1,9 @@ +import $to_relative "/js/groups.js" +import $to_relative "/js/chat-input.js" +import $to_relative "/js/room-picker.js" +import $to_relative "/js/sync/sync.js" +import $to_relative "/js/chat.js" + +if (!localStorage.getItem("access_token")) { + location.assign("./login") +} From b9df147db5adb119d0f1f25e0abbf0608c3285ec Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 20:40:24 +1300 Subject: [PATCH 08/10] Branding --- src/login.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login.pug b/src/login.pug index 85d4485..470ee82 100644 --- a/src/login.pug +++ b/src/login.pug @@ -10,7 +10,7 @@ html body main.main .center-login-container - h1 Welcome to the Matrix! + h1 Welcome to Carbon! form.login-form(method="post" onsubmit="return false")#form .data-input .form-input-container From 253ccbadc2ded29d1436b0b074605d1d3d1b4f64 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 20:56:36 +1300 Subject: [PATCH 09/10] Only enter sync loop if logged in --- src/js/sync/sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/sync/sync.js b/src/js/sync/sync.js index bbd6b11..f338e4d 100644 --- a/src/js/sync/sync.js +++ b/src/js/sync/sync.js @@ -121,4 +121,6 @@ function syncLoop() { store.activeGroup.set(store.groups.get("directs").value()) -syncLoop() +if (lsm.get("access_token")) { + syncLoop() +} From 4869a31ec2ddc92d7817e28329261d1bffe79d08 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 21:57:38 +1300 Subject: [PATCH 10/10] Update README, remove login GUI from todo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75b3ef3..9d48a04 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ Carbon is currently _technically_ usable as a chat app, but is very early in development. These important features still need to be implemented: -- Login GUI - Unreads - Chat history +- Typing indicators - Formatting - Emojis - Reactions