Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c96ba24d6 |
No files matched your search
@@ -17,11 +17,6 @@ button::-moz-focus-inner, input::-moz-focus-inner {
|
|||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
::selection {
|
|
||||||
background-color: #28a745;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, h1, h2, input, textarea, select, button, a {
|
p, h1, h2, input, textarea, select, button, a {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
}
|
}
|
||||||
@@ -251,7 +246,7 @@ div.modal {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: 6;
|
z-index: 3;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +258,7 @@ div.modal {
|
|||||||
right: 0;
|
right: 0;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
z-index: 5;
|
z-index: 2;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,7 +324,7 @@ div.buttonContainer>button {
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
margin-top: -32px;
|
margin-top: -32px;
|
||||||
margin-left: -32px;
|
margin-left: -32px;
|
||||||
z-index: 7;
|
z-index: 5;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
loginFormError.style.display = 'block';
|
loginFormError.style.display = 'block';
|
||||||
loginFormError.innerHTML = errorText;
|
loginFormError.innerHTML = errorText;
|
||||||
|
|
||||||
|
form.elements.email.select();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
added: {},
|
added: {},
|
||||||
edited: {},
|
edited: {},
|
||||||
deleted: {},
|
deleted: {},
|
||||||
|
saved: true,
|
||||||
|
|
||||||
editMetadata: function () {
|
editMetadata: function () {
|
||||||
var form = document.getElementById('metadataForm');
|
var form = document.getElementById('metadataForm');
|
||||||
@@ -24,6 +25,7 @@
|
|||||||
|
|
||||||
MapGuesser.hideModal();
|
MapGuesser.hideModal();
|
||||||
|
|
||||||
|
MapEditor.saved = false;
|
||||||
document.getElementById('saveButton').disabled = false;
|
document.getElementById('saveButton').disabled = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -210,6 +212,7 @@
|
|||||||
|
|
||||||
MapEditor.selectedMarker.setLatLng({ lat: places[placeId].lat, lng: places[placeId].lng });
|
MapEditor.selectedMarker.setLatLng({ lat: places[placeId].lat, lng: places[placeId].lng });
|
||||||
|
|
||||||
|
MapEditor.saved = false;
|
||||||
document.getElementById('saveButton').disabled = false;
|
document.getElementById('saveButton').disabled = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -243,6 +246,7 @@
|
|||||||
document.getElementById('added').innerHTML = String(Object.keys(MapEditor.added).length);
|
document.getElementById('added').innerHTML = String(Object.keys(MapEditor.added).length);
|
||||||
document.getElementById('edited').innerHTML = String(Object.keys(MapEditor.edited).length);
|
document.getElementById('edited').innerHTML = String(Object.keys(MapEditor.edited).length);
|
||||||
|
|
||||||
|
MapEditor.saved = false;
|
||||||
document.getElementById('saveButton').disabled = false;
|
document.getElementById('saveButton').disabled = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -300,6 +304,7 @@
|
|||||||
document.getElementById('edited').innerHTML = '0';
|
document.getElementById('edited').innerHTML = '0';
|
||||||
document.getElementById('deleted').innerHTML = '0';
|
document.getElementById('deleted').innerHTML = '0';
|
||||||
|
|
||||||
|
MapEditor.saved = true;
|
||||||
document.getElementById('saveButton').disabled = true;
|
document.getElementById('saveButton').disabled = true;
|
||||||
}, data);
|
}, data);
|
||||||
},
|
},
|
||||||
@@ -440,4 +445,13 @@
|
|||||||
document.getElementById('deleteButton').onclick = function () {
|
document.getElementById('deleteButton').onclick = function () {
|
||||||
MapEditor.deletePlace();
|
MapEditor.deletePlace();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', function (e) {
|
||||||
|
if (MapEditor.saved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
e.returnValue = '';
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
@@ -2,12 +2,11 @@ var MapGuesser = {
|
|||||||
httpRequest: function (method, url, callback, data) {
|
httpRequest: function (method, url, callback, data) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
xhr.responseType = 'json';
|
||||||
xhr.onload = callback;
|
xhr.onload = callback;
|
||||||
|
|
||||||
xhr.open(method, url, true);
|
xhr.open(method, url, true);
|
||||||
|
|
||||||
xhr.responseType = 'json';
|
|
||||||
|
|
||||||
if (method === 'POST') {
|
if (method === 'POST') {
|
||||||
if (typeof data === 'undefined') {
|
if (typeof data === 'undefined') {
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
|
|||||||
@@ -37,12 +37,15 @@
|
|||||||
profileFormError.style.display = 'block';
|
profileFormError.style.display = 'block';
|
||||||
profileFormError.innerHTML = errorText;
|
profileFormError.innerHTML = errorText;
|
||||||
|
|
||||||
|
form.elements.password_new.select();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('profileFormError').style.display = 'none';
|
document.getElementById('profileFormError').style.display = 'none';
|
||||||
form.reset();
|
form.reset();
|
||||||
form.elements.save.disabled = true;
|
form.elements.save.disabled = true;
|
||||||
|
form.elements.password_new.focus();
|
||||||
}, formData);
|
}, formData);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
@@ -14,9 +14,6 @@
|
|||||||
if (this.response.error) {
|
if (this.response.error) {
|
||||||
var errorText;
|
var errorText;
|
||||||
switch (this.response.error) {
|
switch (this.response.error) {
|
||||||
case 'email_not_valid':
|
|
||||||
errorText = 'The given email address is not valid.'
|
|
||||||
break;
|
|
||||||
case 'passwords_too_short':
|
case 'passwords_too_short':
|
||||||
errorText = 'The given password is too short. Please choose a password that is at least 6 characters long!'
|
errorText = 'The given password is too short. Please choose a password that is at least 6 characters long!'
|
||||||
break;
|
break;
|
||||||
@@ -35,11 +32,14 @@
|
|||||||
signupFormError.style.display = 'block';
|
signupFormError.style.display = 'block';
|
||||||
signupFormError.innerHTML = errorText;
|
signupFormError.innerHTML = errorText;
|
||||||
|
|
||||||
|
form.elements.email.select();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('signupFormError').style.display = 'none';
|
document.getElementById('signupFormError').style.display = 'none';
|
||||||
form.reset();
|
form.reset();
|
||||||
|
form.elements.email.focus();
|
||||||
|
|
||||||
MapGuesser.showModalWithContent('Sign up successful', 'Sign up was successful. Please check your email and click on the activation link to activate your account!');
|
MapGuesser.showModalWithContent('Sign up successful', 'Sign up was successful. Please check your email and click on the activation link to activate your account!');
|
||||||
}, formData);
|
}, formData);
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ class SignupController
|
|||||||
return new JsonContent($data);
|
return new JsonContent($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter_var($this->request->post('email'), FILTER_VALIDATE_EMAIL) === false) {
|
|
||||||
$data = ['error' => 'email_not_valid'];
|
|
||||||
return new JsonContent($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$select = new Select(\Container::$dbConnection, 'users');
|
$select = new Select(\Container::$dbConnection, 'users');
|
||||||
$select->columns(User::getFields());
|
$select->columns(User::getFields());
|
||||||
$select->where('email', '=', $this->request->post('email'));
|
$select->where('email', '=', $this->request->post('email'));
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ class UserController implements ISecured
|
|||||||
$modify->fill($user->toArray());
|
$modify->fill($user->toArray());
|
||||||
$modify->save();
|
$modify->save();
|
||||||
|
|
||||||
$this->request->session()->set('user', $user);
|
|
||||||
|
|
||||||
$data = ['success' => true];
|
$data = ['success' => true];
|
||||||
return new JsonContent($data);
|
return new JsonContent($data);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ $jsFiles = [
|
|||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="loginForm" action="/login" method="post">
|
<form id="loginForm" action="/login" method="post">
|
||||||
<input class="big fullWidth" type="email" name="email" placeholder="Email address" required autofocus>
|
<input class="big fullWidth" type="email" name="email" placeholder="Email address" autofocus>
|
||||||
<input class="big fullWidth marginTop" type="password" name="password" placeholder="Password" required minlength="6">
|
<input class="big fullWidth marginTop" type="password" name="password" placeholder="Password">
|
||||||
<p id="loginFormError" class="formError justify marginTop"></p>
|
<p id="loginFormError" class="formError justify marginTop"></p>
|
||||||
<div class="right marginTop">
|
<div class="right marginTop">
|
||||||
<button type="submit">Login</button>
|
<button type="submit">Login</button>
|
||||||
|
|||||||
+4
-4
@@ -9,12 +9,12 @@ $jsFiles = [
|
|||||||
<h2>Profile</h2>
|
<h2>Profile</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="profileForm" action="/profile" method="post">
|
<form id="profileForm" action="/profile" method="post">
|
||||||
<input class="big fullWidth" type="password" name="password" placeholder="Current password" autofocus>
|
|
||||||
<hr>
|
|
||||||
<?php /* TODO: disabled for the time being, email modification should be implemented */ ?>
|
<?php /* TODO: disabled for the time being, email modification should be implemented */ ?>
|
||||||
<input class="big fullWidth" type="email" name="email" placeholder="Email address" value="<?= $user['email'] ?>" disabled>
|
<input class="big fullWidth" type="email" name="email" placeholder="Email address" value="<?= $user['email'] ?>" disabled>
|
||||||
<input class="big fullWidth marginTop" type="password" name="password_new" placeholder="New password" minlength="6">
|
<input class="big fullWidth marginTop" type="password" name="password_new" placeholder="New password" autofocus>
|
||||||
<input class="big fullWidth marginTop" type="password" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
<input class="big fullWidth marginTop" type="password" name="password_new_confirm" placeholder="New password confirmation">
|
||||||
|
<hr>
|
||||||
|
<input class="big fullWidth" type="password" name="password" placeholder="Current password">
|
||||||
<p id="profileFormError" class="formError justify marginTop"></p>
|
<p id="profileFormError" class="formError justify marginTop"></p>
|
||||||
<div class="right marginTop">
|
<div class="right marginTop">
|
||||||
<button type="submit" name="save" disabled>Save</button>
|
<button type="submit" name="save" disabled>Save</button>
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ $jsFiles = [
|
|||||||
<h2>Sign up</h2>
|
<h2>Sign up</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="signupForm" action="/signup" method="post">
|
<form id="signupForm" action="/signup" method="post">
|
||||||
<input class="big fullWidth" type="email" name="email" placeholder="Email address" required autofocus>
|
<input class="big fullWidth" type="email" name="email" placeholder="Email address" autofocus>
|
||||||
<input class="big fullWidth marginTop" type="password" name="password" placeholder="Password" required minlength="6">
|
<input class="big fullWidth marginTop" type="password" name="password" placeholder="Password">
|
||||||
<input class="big fullWidth marginTop" type="password" name="password_confirm" placeholder="Password confirmation" required minlength="6">
|
<input class="big fullWidth marginTop" type="password" name="password_confirm" placeholder="Password confirmation">
|
||||||
<p id="signupFormError" class="formError justify marginTop"></p>
|
<p id="signupFormError" class="formError justify marginTop"></p>
|
||||||
<div class="right marginTop">
|
<div class="right marginTop">
|
||||||
<button type="submit">Sign up</button>
|
<button type="submit">Sign up</button>
|
||||||
|
|||||||
Reference in new issue
Block a user