var type = "auth"; function buton_regAuth(){ if(type == "auth") type = "reg"; else type = "auth"; if(type == "auth") document.getElementById("authwin").innerHTML = "
\n

Авторизация

\n

e-mail:

\n

password:

\n

\n
\n " else document.getElementById("authwin").innerHTML = "
\n

Регистрация

\n

e-mail:

\n

повторите e-mail:

\n

password:

\n

повторите password:

\n

\n
\n " } function confirmation_mail(mail_adress) { var codeConfirmation = "
\n
\n

Введите код

\n

\n

Если письмо не пришло, то проверьте папку \"Спам\", проверьте ваш чёрный список на наличие почтового адреса бота, проверьте правильность введённых данных при регистрации.

\n

\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 += `
${cellContent.title}
\n`; }); retV += `
${item}
\n`; }); document.getElementById("field").innerHTML = retV; } }