mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Extra modules fix, stuff fix attempt
This commit is contained in:
parent
74b750ef53
commit
c9aa819783
5 changed files with 9 additions and 89 deletions
|
@ -43,20 +43,16 @@
|
|||
clear: both;
|
||||
padding-bottom: 23px;
|
||||
}
|
||||
.showpwContainer {
|
||||
color: white;
|
||||
width: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
input[type=text], input[type=password], textarea {
|
||||
font-size: 16px;
|
||||
color: white;
|
||||
background-color: #181a1b;
|
||||
width: 20%;
|
||||
width: 300px;;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid white;
|
||||
text-align: center;
|
||||
}
|
||||
input[type=text]:focus, input[type=password]:focus, textarea:focus, input[type=text]:hover, input[type=password]:hover, textarea:hover {
|
||||
border: 2px solid #F2CB05;
|
||||
|
@ -85,25 +81,6 @@
|
|||
.disabledButton {
|
||||
background-color: #a38c1a;
|
||||
}
|
||||
.ircLinkContainer {
|
||||
display: flex;
|
||||
justify-content: flex-end
|
||||
}
|
||||
.ircLink {
|
||||
color: #9999ff;
|
||||
font-size: 12px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
#feedback {
|
||||
display: none;
|
||||
}
|
||||
#feedbackTextArea {
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
height: 160px;
|
||||
resize: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<div class='logindiv'>
|
||||
|
@ -112,22 +89,11 @@
|
|||
</div>
|
||||
<div id='text' class='text'>
|
||||
</div>
|
||||
<div id='feedback'>
|
||||
<textarea placeholder='Üzenet' id='feedbackTextArea'></textarea>
|
||||
<input id='email' type='text' placeholder='E-mail, amire választ vársz (nem kötelező)' />
|
||||
<div class='ircLinkContainer'>
|
||||
<a class='ircLink' href='<%= devel? 'http' : 'https' %>://qmining.frylabs.net/irc?loginClick'>IRC chatszoba</a>
|
||||
</div>
|
||||
<button id='sendFeedbackButton' onclick="SendFeedback(this)">Submit</button>
|
||||
</div>
|
||||
<div id='form'>
|
||||
<div class='inputContainer'>
|
||||
<input type='password' placeholder='Jelszó' onkeyup="PWKeyUp(this)" type='text' id='pw' name='pw' autocomplete="off" autofocus/>
|
||||
<input type='hidden' id='cid' name='pw' autocomplete="off"/>
|
||||
</div>
|
||||
<div class='ircLinkContainer' >
|
||||
<!--a class='ircLink' onclick='ShowFeedback()'>Contact</a-->
|
||||
</div>
|
||||
<button id='sendButton' onclick="Login(this)">Belépés</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -139,53 +105,6 @@
|
|||
Login(document.getElementById('sendButton'))
|
||||
}
|
||||
}
|
||||
function HandleFeedbackResp (resp) {
|
||||
document.getElementById('sendButton').innerText = 'Submit'
|
||||
const textNode = document.getElementById('text')
|
||||
const feedback = document.getElementById('feedback').style.display = "none";
|
||||
if (resp.success) {
|
||||
textNode.innerText = 'Visszajelzés elküldve'
|
||||
} else {
|
||||
textNode.innerText = 'Szerver oldali hiba :c'
|
||||
}
|
||||
}
|
||||
async function SendFeedback (button) {
|
||||
const feedback = document.getElementById('feedbackTextArea').value
|
||||
const email = document.getElementById('email').value
|
||||
button.innerText = '...'
|
||||
const rawResponse = await fetch('<%= devel? 'http' : 'https' %>://api.frylabs.net/postfeedback', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
description: feedback,
|
||||
email: email,
|
||||
fromLogin: true
|
||||
})
|
||||
})
|
||||
if (!rawResponse.ok) {
|
||||
document.getElementById('text').innerText = 'Internal server error'
|
||||
button.innerText = 'Submit'
|
||||
}
|
||||
try {
|
||||
rawResponse.json()
|
||||
.then((resp) => {
|
||||
HandleFeedbackResp(resp)
|
||||
})
|
||||
} catch (e) {
|
||||
document.getElementById('text').innerText = 'Invalid data recieved from server'
|
||||
button.innerText = 'Submit'
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
function ShowFeedback () {
|
||||
const form = document.getElementById('form').style.display = "none";
|
||||
const feedback = document.getElementById('feedback').style.display = "block";
|
||||
document.getElementById('text').innerText = 'Jelszót meglévő felhasználóktól lehet kérni! (nem itt)'
|
||||
}
|
||||
function HandleResp (resp) {
|
||||
const button = document.getElementById('sendButton')
|
||||
button.innerText = 'Login'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue