Fixed several URLs
This commit is contained in:
parent
b70494f1ab
commit
4f4138e073
|
@ -258,14 +258,14 @@
|
|||
<option>Zambia</option>
|
||||
<option>Zimbabwe</option>
|
||||
</select>
|
||||
<img id="flagimg" src="/img/flags/flags_medium/Afghanistan.png" />
|
||||
<img id="flagimg" src="<?= base_url() ?>/img/flags/flags_medium/Afghanistan.png" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="register-right">
|
||||
<label>Profile image</label>
|
||||
<input type="file" name="imginput" id="imginput" required />
|
||||
<img src="/img/user.svg" id="profile-img">
|
||||
<img src="<?= base_url() ?>/img/user.svg" id="profile-img">
|
||||
|
||||
<label>Resolve the captcha</label>
|
||||
<div id="captcha-box">
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
</div><!-- #main -->
|
||||
<script type="text/javascript">
|
||||
const base_url = '<?= base_url() ?>';
|
||||
</script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/pequejs.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/app.js"></script>
|
||||
<?php if(!empty($custom_js)): ?>
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
//repeat password check
|
||||
//update passwordcheck validation pattern to match password value when this change
|
||||
$("#password").on('change', function() {
|
||||
$("#passwordcheck").pattern = this.value;
|
||||
});
|
||||
|
||||
//profile image preview
|
||||
function readURL(input) {
|
||||
|
||||
|
@ -24,13 +18,13 @@ $("#imginput").on('change', function() {
|
|||
|
||||
//flag image preview
|
||||
$("#flaginput").on('change', function() {
|
||||
var newsrc='./img/flags/flags_medium/'+this.value.replace(' ','_')+'.png';
|
||||
var newsrc = `${base_url}/img/flags/flags_medium/`+this.value.replace(' ','_')+'.png';
|
||||
$("#flagimg").attr('src', newsrc);
|
||||
});
|
||||
|
||||
$('#refresh-captcha').on('click', function() {
|
||||
$().ajax(
|
||||
'/register/new_captcha',
|
||||
`${base_url}/register/new_captcha`,
|
||||
{
|
||||
'dataType': 'text',
|
||||
'success': function(res) {
|
||||
|
@ -43,21 +37,22 @@ $('#refresh-captcha').on('click', function() {
|
|||
$('#reg-form > form').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
// Check if the password math
|
||||
let passwd = $('#password').val();
|
||||
let passwdcheck = $('#passwordcheck').val();
|
||||
const passwd = $('#password').val();
|
||||
const passwdcheck = $('#passwordcheck').val();
|
||||
$('#register-error').hide();
|
||||
$('#passwd-error').hide();
|
||||
if (passwd != passwdcheck) {
|
||||
|
||||
if (passwd.normalize() != passwdcheck.normalize()) {
|
||||
$('#passwd-error').show();
|
||||
} else {
|
||||
form_data = new FormData(this);
|
||||
const form_data = new FormData(this);
|
||||
|
||||
$().ajax('/register/newuser', {
|
||||
$().ajax(`${base_url}/register/newuser`, {
|
||||
type: 'POST',
|
||||
data: form_data,
|
||||
success: (resp) => {
|
||||
if (resp.ok) {
|
||||
location.href = '/register/ok';
|
||||
location.href = `${base_url}/register/ok`;
|
||||
} else {
|
||||
$('#register-error').text(resp.msg);
|
||||
$('#register-error').show();
|
||||
|
@ -68,11 +63,17 @@ $('#reg-form > form').on('submit', function(e) {
|
|||
});
|
||||
|
||||
$('input').on('keyup', function() {
|
||||
input = $(this);
|
||||
inputID = '#' + input.attr('id');
|
||||
const input = $(this);
|
||||
const inputID = '#' + input.attr('id');
|
||||
$(inputID + ' + .input-error').hide();
|
||||
|
||||
if (input.val() && input.is(':invalid')) $(inputID + ' + .input-error').show();
|
||||
if (input.val() && inputID == '#password') $('#passwordcheck').attr('pattern', input.val())
|
||||
if (input.val() && (inputID == '#password' || inputID == '#passwordcheck')) {
|
||||
const passwd = $('#password').val();
|
||||
const passwdcheck = $('#passwordcheck').val();
|
||||
if (passwd.normalize() != passwdcheck.normalize()) $('#passwd-error').show();
|
||||
else $('#passwd-error').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("#flaginput").trigger('change');
|
||||
|
|
Loading…
Reference in New Issue