var type = "auth";
function buton_regAuth(){
if(type == "auth") type = "reg";
else type = "auth";
if(type == "auth") document.getElementById("authwin").innerHTML = "
\n "
else document.getElementById("authwin").innerHTML = " \n "
}
function confirmation_mail(mail_adress) {
var codeConfirmation = "
\n \n
"
var GET_Request = new XMLHttpRequest();
GET_Request.open("GET", "http://127.0.0.1:8080/api/confirmation/start?email=" + mail_adress, true);
GET_Request.onload = function (){
var content = GET_Request.responseText;
document.getElementById("authwin").innerHTML = codeConfirmation;
}
GET_Request.send(null);
}
function get_cookies(){
var cookie_f = document.cookie;
cookies = cookie_f.split('; ');
returnCookie = {};
cookies.forEach(function(item, i, cookies) {
ItemArray = item.split('=');
returnCookie[ItemArray[0]] = returnCookie[ItemArray[1]];
});
return returnCookie;
}
function update(){
var cookies = get_cookies();
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://127.0.0.1:8080/api/user/get_pages?autogroup=1&token="
+ cookies.token, false);
xhr.send();
if (xhr.status != 200) {
var ok = 'ok';
} else {
var values = JSON.parse(xhr.responseText);
var groups = values.response;
var retV = '';
groups.forEach(function(group, i, groups) {
var item = '';
group.forEach(function(cellContent, i, group) {
item += `