Skip to content

Commit

Permalink
Improved UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Jul 13, 2023
1 parent b5b4ced commit 89a5986
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/settings/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html id="elementToShowWithJavaScript" lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon" type="image/x-icon" href="../../../assets/images/logo.svg"><link href="../stylesheets/styles.css" rel="stylesheet"><title>Settings</title><script type="module" src="./init.js"></script></head><body class="option" dir="auto"><section class="links" id="links"><div class="title"><a href="#general"> <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg>
<span data-localise="__MSG_general__">General</span></a></div><div class="title"><a href="#lemmy"><img src="/assets/lemmy.svg"><span>Lemmy</span></a></div><div class="title"><a href="#mastodon"><img src="/assets/mastodon.webp"><span>Mastodon</span></a></div><div class="title"><a target="_blank" href="https://github.com/ManeraKai/fediredirect"><img src="/assets/about-icon-light.svg"><span data-localise="__MSG_about__">About</span></a></div></section><div id="pages"><section class="option-block" id="general_page"><h1>General</h1><hr></section><section class="option-block" id="lemmy_page"><h1>Lemmy</h1><hr><form id="lemmy_form"><div class="block option-input"><div> <h4>Your instance</h4><input class="custom-instance instance" type="url" placeholder="https://lemmy.ml"></div></div><div class="block option-input"><div> <h4>Username or Email</h4><input class="custom-instance username" type="text"></div><div> <h4>Password</h4><input class="custom-instance password" type="password"></div></div><div class="block option-input"><div> <h4>jwt</h4><input class="custom-instance jwt" type="password"></div></div><div class="block"><button class="button button-inline" type="submit">Save</button></div></form><hr><div class="block"><div> (Username and Password) or (jwt) are required for <a href="https://join-lemmy.org/api/classes/LemmyHttp.html#resolveObject">resolving</a> /post and /comment. If Username and Password didn't work, go to your instance's cookies and copy your jwt.<br><br>Username and Password will not work if your instance server has it's policy accepting ONLY http origins. FediRedirect sends a moz-extension:// request so contact your instance maintainer.</div></div><script type="module" src="widgets/lemmy/lemmy.js"></script></section><section class="option-block" id="mastodon_page"><h1>Mastodon</h1><hr><form id="mastodon_form"><div class="block option-input"><div> <h4>Your instance</h4><input class="custom-instance instance" type="url" placeholder="https://mastodon.ml"></div></div><div class="block option-input"><div> <h4>Code</h4><input class="code" type="password"></div></div><div class="block"><button class="button button-inline" type="submit">Save</button></div></form><hr><div class="block"><div> FediRedirect requires authorization to be able to use <a href="https://docs.joinmastodon.org/methods/search/">search</a>.</div></div><script type="module" src="widgets/mastodon/mastodon.js"></script></section></div></body><script type="module" src="./index.js"></script></html>
<span data-localise="__MSG_general__">General</span></a></div><div class="title"><a href="#lemmy"><img src="/assets/lemmy.svg"><span>Lemmy</span></a></div><div class="title"><a href="#mastodon"><img src="/assets/mastodon.webp"><span>Mastodon</span></a></div><div class="title"><a target="_blank" href="https://github.com/ManeraKai/fediredirect"><img src="/assets/about-icon-light.svg"><span data-localise="__MSG_about__">About</span></a></div></section><div id="pages"><section class="option-block" id="general_page"><h1>General</h1><hr></section><section class="option-block" id="lemmy_page"><h1>Lemmy</h1><hr><form id="lemmy_form"><div class="block option-input"><div> <h4>Your instance</h4><input class="custom-instance instance" type="url" placeholder="https://lemmy.ml"></div></div><div class="block option-input"><div> <h4>Username or Email</h4><input class="custom-instance username" type="text"></div><div> <h4>Password</h4><input class="custom-instance password" type="password"></div></div><div class="block option-input"><div> <h4>jwt</h4><input class="custom-instance jwt" type="text"></div></div><div class="block"><button class="button button-inline" type="submit">Save</button></div></form><hr><div class="block"><div> (Username and Password) or (jwt) are required for <a href="https://join-lemmy.org/api/classes/LemmyHttp.html#resolveObject">resolving</a> /post and /comment. If Username and Password didn't work, go to your instance's cookies and copy your jwt.<br><br>Username and Password will not work if your instance server has it's policy accepting ONLY http origins. FediRedirect sends a moz-extension:// request so contact your instance maintainer.</div></div><script type="module" src="widgets/lemmy/lemmy.js"></script></section><section class="option-block" id="mastodon_page"><h1>Mastodon</h1><hr><form id="mastodon_form"><div class="block option-input"><div> <h4>Your instance</h4><input class="custom-instance instance" type="url" placeholder="https://mastodon.ml"></div></div><div class="block option-input"><div> <h4>Code</h4><input class="code" type="text"></div></div><div class="block"><button class="button button-inline" type="submit">Save</button></div></form><hr><div class="block"><div> FediRedirect requires authorization to be able to use <a href="https://docs.joinmastodon.org/methods/search/">search</a>.</div></div><script type="module" src="widgets/mastodon/mastodon.js"></script></section></div></body><script type="module" src="./index.js"></script></html>
2 changes: 1 addition & 1 deletion src/pages/settings/widgets/lemmy/lemmy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ form.addEventListener("submit", async e => {
} catch {
return
}
if (jwt.value == "") jwt.value = await getJwt(url, username.value, password.value)
if (jwt.value == "" && username.value != '' && password.value != '') jwt.value = await getJwt(url, username.value, password.value)
if (jwt.value != "") {
browser.storage.local.set(
{ lemmy: { instance: `${url.protocol}//${url.hostname}`, auth: jwt.value } },
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/widgets/lemmy/lemmy.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ section(class="option-block" id="lemmy_page")
div(class="block option-input")
div
h4 jwt
input(class="custom-instance" type="password" class="jwt")
input(class="custom-instance" type="text" class="jwt")

div(class="block")
button(type="submit" class="button button-inline") Save
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/widgets/mastodon/mastodon.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ section(class="option-block" id="mastodon_page")
div(class="block option-input")
div
h4 Code
input(class="code" type="password")
input(class="code" type="text")

div(class="block")
button(type="submit" class="button button-inline") Save
Expand Down

0 comments on commit 89a5986

Please sign in to comment.