Добавляем все файлы
This commit is contained in:
43
main_plugin/auth/auth.php
Executable file
43
main_plugin/auth/auth.php
Executable file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @file auth.php
|
||||
* @brief Содержит интерфейс авторизации пользователя
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php /** @brief Кнопка вызова окна авторизации */ $authorizationButton; ?>
|
||||
<span id="authorizationButton"></span>
|
||||
|
||||
<?php /** @brief Основной контейнер окна авторизации */ $authorizationDiv; ?>
|
||||
<div id="authorizationDiv" class="borderStyle" style="visibility: hidden; top: 20%; left: 50%; transform: translate(-50%, -20%);">
|
||||
<div class="authorizationDivTop" class="borderStyle">
|
||||
<span class="authorizationDivTopTitle">{{authorization}}</span>
|
||||
<span class="authorizationDivCloseFun" onClick="authorizationDivCloseFun()" class="editib"></span>
|
||||
</div>
|
||||
<div class="authorizationDivMainDiv">
|
||||
<div class="formRow">{{account_authorization}}</div>
|
||||
<div class="formRow">
|
||||
<button type="button" id="loginButton" onClick="loginButtonFunCreate()">{{login}}</button>
|
||||
<button type="button" id="loginButton" onClick="registrationButtonFunCreate()">{{register}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener("load", function() {
|
||||
try {
|
||||
var buttonHTML = document.getElementById("authorizationButton").outerHTML;
|
||||
var divHTML = document.getElementById("authorizationDiv").outerHTML;
|
||||
|
||||
document.getElementById("authorizationButton").remove();
|
||||
document.getElementById("authorizationDiv").remove();
|
||||
|
||||
var container = document.getElementById("hbody");
|
||||
if (!container) throw new Error("#hbody не найден для authorization");
|
||||
container.insertAdjacentHTML("beforeend", buttonHTML);
|
||||
container.insertAdjacentHTML("beforeend", divHTML);
|
||||
} catch (e) {
|
||||
console.error("Ошибка в блоке authorization:", e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user