chriskthomas / linkfree-generator

A simple, free, open-source, and self-hosted alternative to linktree
https://linkfree.ckt.im
Apache License 2.0
141 stars 29 forks source link

Add blur event to append the protocol if missing #29

Closed hoon610 closed 12 months ago

hoon610 commented 12 months ago

Wasnt sure if the line (197) declaring the variable for url input fields belong with the event listeners but it made more sense to put it there than with the function?

Other than that the addProtocolIfMissing function successfully appends the protocol if it does not detect one.

chriskthomas commented 12 months ago

This looks mostly good. Could you adjust it so that it only appends the protocol if there is no :?

As it's written, this would prevent people from using any protocol other than http(s). For example, people might want an extra mailto: link or a tel: link or something else like xmpp: or ftp://.

hoon610 commented 12 months ago

Ahh makes sense for the custom links. I have added the changes

chriskthomas commented 12 months ago

That looks right to me. I'll merge it into testing.

chriskthomas commented 12 months ago

Thanks! It's up here: https://linkfree.fly.dev/

It's looking good. I'll probably sync to production soon.