Compare commits
2 commits
ff427d0354
...
c8351e8f0c
Author | SHA1 | Date | |
---|---|---|---|
c8351e8f0c | |||
cf2c691585 |
2 changed files with 14 additions and 8 deletions
|
@ -50,12 +50,12 @@ class Feedback extends ElemJS {
|
||||||
this.loading = state
|
this.loading = state
|
||||||
}
|
}
|
||||||
|
|
||||||
message(content) {
|
message(content, isError) {
|
||||||
if (content) {
|
|
||||||
this.class("form-feedback")
|
|
||||||
} else {
|
|
||||||
this.removeClass("form-feedback")
|
this.removeClass("form-feedback")
|
||||||
}
|
this.removeClass("form-error")
|
||||||
|
if (content) this.class("form-feedback")
|
||||||
|
if(isError) this.class("form-error")
|
||||||
|
|
||||||
this.messageSpan.text(content)
|
this.messageSpan.text(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,10 @@ class Form extends ElemJS {
|
||||||
let currentAddress = homeserver.value
|
let currentAddress = homeserver.value
|
||||||
let ok = false
|
let ok = false
|
||||||
while (!ok) {
|
while (!ok) {
|
||||||
if (!currentAddress.match(/^https?:\/\//)) currentAddress = "https://" + currentAddress
|
if (!currentAddress.match(/^https?:\/\//)) {
|
||||||
|
console.warn(`${currentAddress} doesn't specify the protocol, assuming https`)
|
||||||
|
currentAddress = "https://" + currentAddress
|
||||||
|
}
|
||||||
currentAddress = currentAddress.replace(/\/*$/, "")
|
currentAddress = currentAddress.replace(/\/*$/, "")
|
||||||
this.status(`Looking up homeserver... trying ${currentAddress}`)
|
this.status(`Looking up homeserver... trying ${currentAddress}`)
|
||||||
try {
|
try {
|
||||||
|
@ -141,7 +144,7 @@ class Form extends ElemJS {
|
||||||
cancel(message) {
|
cancel(message) {
|
||||||
this.processing = false
|
this.processing = false
|
||||||
feedback.setLoading(false)
|
feedback.setLoading(false)
|
||||||
feedback.message(message)
|
feedback.message(message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
width: 100%
|
width: 100%
|
||||||
margin: -0.5em 0 -0.8em
|
margin: -0.5em 0 -0.8em
|
||||||
|
|
||||||
|
.form-error
|
||||||
|
color: red
|
||||||
|
|
||||||
@keyframes spin
|
@keyframes spin
|
||||||
0%
|
0%
|
||||||
transform: rotate(0deg)
|
transform: rotate(0deg)
|
||||||
|
|
Loading…
Reference in a new issue