Auto stash before merge of "main" and "origin/main"
This commit is contained in:
Executable
+1789
File diff suppressed because it is too large
Load Diff
Regular → Executable
Regular → Executable
Regular → Executable
+8
@@ -74,6 +74,14 @@ const renderCalendar = () => {
|
||||
days += `<div class="next-date" onClick="clickdate()">${j}</div>`;
|
||||
monthDays.innerHTML = days;
|
||||
}
|
||||
// 2021, 3, 28, 11, 30
|
||||
$('#test').click(function() {
|
||||
let newDate = new Date();
|
||||
|
||||
newDate.setDate(28);
|
||||
|
||||
console.log(newDate);
|
||||
});
|
||||
};
|
||||
|
||||
document.querySelector(".prev").addEventListener("click", () => {
|
||||
|
||||
Regular → Executable
+217
-17
@@ -1,29 +1,229 @@
|
||||
$(document).ready(function() {
|
||||
// Populate select with GameJams
|
||||
let JamArr = [];
|
||||
$(document).ready(function () {
|
||||
// Register Start
|
||||
let selectedGameJam;
|
||||
let MemberSize = $('#NUDDisplay').text();
|
||||
let displayValue = 0;
|
||||
let arr = [
|
||||
{"id": "-1", "Gamejam": "Vælg aktivt GameJam"}
|
||||
];
|
||||
|
||||
axios.get('/Backend/Controllers/GameJam/GetGameJam.php').then(res => {
|
||||
// Populate select with options from the database
|
||||
axios.get('/Backend/Controllers/GameJam/GetGameJam.php')
|
||||
.then(function(res) {
|
||||
let resArr = res.data;
|
||||
|
||||
for(let i = 0; i < resArr.data.length; i++)
|
||||
//console.log(res.data.data);
|
||||
|
||||
for(let i = 0; i < res.data.data.length; i++)
|
||||
{
|
||||
let Jam = resArr.data[i];
|
||||
JamArr.push({
|
||||
id: Jam.id,
|
||||
Name: Jam.name
|
||||
arr.push({
|
||||
id: res.data.data[i].id,
|
||||
Gamejam: res.data.data[i].name
|
||||
});
|
||||
}
|
||||
|
||||
$.each(JamArr, function(i, Jam) {
|
||||
console.log(`Id: ${Jam.id} \n Name: ${Jam.Name}`);
|
||||
if(i === 1)
|
||||
$.each(arr, function(i, data) {
|
||||
if (i === 0)
|
||||
{
|
||||
$('#AvailableGameJams').append('<option disabled selected value="'+ "0" + '">' + "Vælg et gamejam her" + '</option>');
|
||||
$('#GameJamSelect').append('<option disabled selected value="' + data.id + '">' + data.Gamejam + '</option>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#GameJamSelect').append('<option value="' + data.id + '">' + data.Gamejam + '</option>');
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
// Remove invalidInput if selected option has been changed
|
||||
$('#GameJamSelect').change(function() {
|
||||
selectedGameJam = $('#GameJamSelect').children("option:selected").val();
|
||||
|
||||
if (selectedGameJam >= 1)
|
||||
{
|
||||
$('#GameJamSelect').removeClass('invalidInput');
|
||||
}
|
||||
});
|
||||
|
||||
// Remove invalidInput if change in group name has been detected
|
||||
$('#username').on('input', function() {
|
||||
if ($(this).hasClass('invalidInput'))
|
||||
{
|
||||
$(this).removeClass('invalidInput');
|
||||
}
|
||||
})
|
||||
|
||||
GetGroupNames().then(function(res) {
|
||||
let resArr = res.data;
|
||||
let groupNameTaken = false;
|
||||
|
||||
$('#RegisterBtn').click(function() {
|
||||
let groupName = $('#username').val();
|
||||
|
||||
for(let i = 0; i < resArr.length; i++)
|
||||
{
|
||||
if (resArr[i].group_name.toUpperCase() === groupName.toUpperCase())
|
||||
{
|
||||
groupNameTaken = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
groupNameTaken = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Check data before submitting
|
||||
$('#RegisterForm').submit(function(e) {
|
||||
|
||||
if(!selectedGameJam >= 1)
|
||||
{
|
||||
$('#GameJamSelect').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#gameJamId').val($('#GameJamSelect option:selected').val());
|
||||
}
|
||||
|
||||
$('#AvailableGameJams').append('<option value="'+ Jam.id + '">' + Jam.Name + '</option>');
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(`Error: ${error}`)
|
||||
if($('#pass1').val().length === 0)
|
||||
{
|
||||
$('#pass1').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass2').val().length === 0)
|
||||
{
|
||||
$('#pass2').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#username').val().length === 0)
|
||||
{
|
||||
$('#username').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass1').hasClass('invalidInput'))
|
||||
{
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass2').hasClass('invalidInput'))
|
||||
{
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$.isNumeric($('#NUDDisplay').text()))
|
||||
{
|
||||
$('#NUDDisplay').text('Ugyldigt antal!');
|
||||
$('#NUDDisplay').css({"color": "red"});
|
||||
e.preventDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#groupAmount').val($('#NUDDisplay').text());
|
||||
}
|
||||
|
||||
if (groupNameTaken)
|
||||
{
|
||||
$('#username').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
let URL = "/Backend/Controllers/Group/SigningUp.php";
|
||||
|
||||
let form = $('#RegisterForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
let id = $('#RegisterBtn').attr('name');
|
||||
let value = $('#RegisterBtn').val();
|
||||
|
||||
formData.append(id, value);
|
||||
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
$('#NUDPlus').click(function() {
|
||||
if($('#NUDDisplay').css('color') === 'rgb(255, 0, 0)')
|
||||
{
|
||||
$('#NUDDisplay').css({'color': 'rgba(255, 255, 255, .55)'});
|
||||
}
|
||||
|
||||
displayValue++;
|
||||
|
||||
$('#NUDDisplay').text(displayValue);
|
||||
});
|
||||
|
||||
$('#NUDMinus').click(function() {
|
||||
if (displayValue <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if(displayValue <= 1)
|
||||
{
|
||||
$('#NUDDisplay').text(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayValue--;
|
||||
$('#NUDDisplay').text(displayValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
async function GetGroupNames() {
|
||||
const res = await axios.get('/Backend/Controllers/Group/GetGroup.php');
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
// Register end
|
||||
|
||||
// Login start
|
||||
$('#LoginForm').submit(function(e) {
|
||||
let URL = "/Backend/Controllers/Group/Login.php";
|
||||
|
||||
let form = $('#LoginForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
let id = $('#LoginBtn').attr('name');
|
||||
let value = $('#LoginBtn').val();
|
||||
|
||||
formData.append(id, value);
|
||||
|
||||
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
if (res.status === 200)
|
||||
{
|
||||
console.log('Logged in');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
})
|
||||
// Login end
|
||||
});
|
||||
Regular → Executable
+32
-6
@@ -4,21 +4,35 @@ $(document).ready(function() {
|
||||
var pass1 = $('#pass1').val();
|
||||
var pass2 = $('#pass2').val();
|
||||
|
||||
var len = false;
|
||||
var minLen = false;
|
||||
var maxLen = false;
|
||||
var le = false;
|
||||
var cle = false;
|
||||
var spc = false;
|
||||
var num = false;
|
||||
|
||||
// Length Validation.
|
||||
if (pass1.length < 8)
|
||||
{
|
||||
$('#length').removeClass('valid').addClass('invalid');
|
||||
len = false;
|
||||
$('#min-length').removeClass('valid').addClass('invalid');
|
||||
minLen = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#length').removeClass('invalid').addClass('valid');
|
||||
len = true;
|
||||
$('#min-length').removeClass('invalid').addClass('valid');
|
||||
minLen = true;
|
||||
}
|
||||
|
||||
// Max length validation
|
||||
if (pass1.length > 255)
|
||||
{
|
||||
$('#max-length').removeClass('valid').addClass('invalid');
|
||||
maxLen = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#max-length').removeClass('invalid').addClass('valid');
|
||||
maxLen = true;
|
||||
}
|
||||
|
||||
// Letter Validation
|
||||
@@ -45,6 +59,18 @@ $(document).ready(function() {
|
||||
cle = false
|
||||
}
|
||||
|
||||
// Special character validation
|
||||
if (pass1.match(/[!@#$%^&*(),.?":{}|<>]/))
|
||||
{
|
||||
$('#special').removeClass('invalid').addClass('valid');
|
||||
spc = true
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#special').removeClass('valid').addClass('invalid');
|
||||
spc = false
|
||||
}
|
||||
|
||||
// Number Validation
|
||||
if (pass1.match(/\d/))
|
||||
{
|
||||
@@ -57,7 +83,7 @@ $(document).ready(function() {
|
||||
num = false;
|
||||
}
|
||||
|
||||
if (len && le && cle && num)
|
||||
if (minLen && maxLen && le && cle && spc && num)
|
||||
{
|
||||
$('#pass_info').hide();
|
||||
$('#pass1, #pass2').removeClass('invalidInput').addClass('validInput');
|
||||
|
||||
Regular → Executable
Reference in New Issue
Block a user