Modify Login/Register-System (almost working)
This commit is contained in:
@@ -4,17 +4,12 @@
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
function registerPlayer() {
|
||||
|
||||
var password = document.getElementById("passwordInputRegister");
|
||||
var passwordRepeat = document.getElementById("passwordRepeatInputRegister");
|
||||
|
||||
$('.message a').click(function () {
|
||||
$('.form-l').animate({ height: "toggle", opacity: "toggle" }, "slow");
|
||||
});
|
||||
|
||||
$('#registerBtn').click(function () {
|
||||
|
||||
var password = $('#passwordInputRegister').val();
|
||||
var passwordRepeat = $('#passwordRepeatInputRegister').val();
|
||||
mp.gui.chat.push(password.length);
|
||||
if (password === "" || passwordRepeat === "") {
|
||||
if(password === "" || passwordRepeat === "") {
|
||||
showError("Mindestens ein Passwort Feld ist leer!");
|
||||
return;
|
||||
}
|
||||
@@ -23,38 +18,23 @@ $('#registerBtn').click(function () {
|
||||
showError("Die beiden Passwörter stimmen nicht überein!")
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (password.length < 8) {
|
||||
showError("Das Passwort muss mindestens 8 Zeichen lang sein");
|
||||
return;
|
||||
}
|
||||
$('.isa_error').hide();
|
||||
mp.trigger("registerInformationToServer", password);
|
||||
}
|
||||
|
||||
mp.gui.chat.push(password.length);
|
||||
mp.trigger('registerInformationToServer', password);
|
||||
});
|
||||
|
||||
$('#loginBtn').click(function () {
|
||||
function loginPlayer() {
|
||||
|
||||
var password = $('#passwordInputLogin').val();
|
||||
let password = document.getElementById("passwordInputLogin");
|
||||
|
||||
if (password === "") {
|
||||
showError("Du musst ein Passwort angeben!");
|
||||
return;
|
||||
}
|
||||
|
||||
mp.trigger('loginInformationToServer', password);
|
||||
|
||||
});
|
||||
|
||||
$('.quitBtn').click(function () {
|
||||
resourceCall("Quit");
|
||||
});
|
||||
|
||||
function showError(error) {
|
||||
$('.isa_error').html(error);
|
||||
$('.isa_error').slideDown();
|
||||
}
|
||||
|
||||
function SendDisplayname(name) {
|
||||
$("h2#playerName").text(name);
|
||||
$('.isa_error').hide();
|
||||
mp.trigger("loginInformationToServer", password);
|
||||
}
|
||||
Reference in New Issue
Block a user