Закончил разработку обучения

This commit is contained in:
2023-01-15 22:47:19 +01:00
parent 45fc2f51b4
commit 739caee04b
11 changed files with 253 additions and 36 deletions

View File

@@ -1,3 +1,24 @@
const request = new XMLHttpRequest();
const training_handler = () => {
request.open('POST', '/api/training/complete')
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
request.onreadystatechange = function() {//Call a function when the state changes.
if(request.readyState === 4 && request.status === 200) {
parent.frames['main'].location.reload();
}
}
request.send(JSON.stringify({
time: training_data().time,
token: training_data().token,
short_name: training_data().short_name
}))
}
let active_training = null;
(function () {
if (typeof window.CustomEvent === "function") return false;
function CustomEvent(event, params) {