Убрал IIFE — doLogin теперь доступен глобально для onclick

This commit is contained in:
Dauren777 2026-06-03 12:58:25 +00:00
parent cca3e99623
commit b68dd5b138

View File

@ -148,7 +148,7 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
<div id="formLogin" class="login-form active"> <div id="formLogin" class="login-form active">
<div class="fg"><label>Логин</label><input type="text" id="loginUser" placeholder="Введите логин"></div> <div class="fg"><label>Логин</label><input type="text" id="loginUser" placeholder="Введите логин"></div>
<div class="fg"><label>Пароль</label><input type="password" id="loginPass" placeholder="Введите пароль"></div> <div class="fg"><label>Пароль</label><input type="password" id="loginPass" placeholder="Введите пароль"></div>
<button class="btn btn-primary btn-block" id="loginBtn">Войти</button> <button class="btn btn-primary btn-block" id="loginBtn" onclick="doLogin()">Войти</button>
<div class="err-msg" id="loginError">Неверный логин или пароль</div> <div class="err-msg" id="loginError">Неверный логин или пароль</div>
</div> </div>
<div id="formRegister" class="login-form"> <div id="formRegister" class="login-form">
@ -217,7 +217,6 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
</div></div> </div></div>
<script> <script>
(function(){
"use strict"; "use strict";
// ===== DATA ===== // ===== DATA =====
var PREDEFINED = {admin:{pass:"admin",name:"Администратор",role:"Руководитель",email:"admin@telecom.kz",branch:"АО «Казахтелеком»",dept:"ЦА",region:"Центральный",oblast:"—",city:"г. Астана"}}; var PREDEFINED = {admin:{pass:"admin",name:"Администратор",role:"Руководитель",email:"admin@telecom.kz",branch:"АО «Казахтелеком»",dept:"ЦА",region:"Центральный",oblast:"—",city:"г. Астана"}};
@ -474,7 +473,6 @@ function init(){
var saved=localStorage.getItem("pab_current");if(saved){try{currentUser=JSON.parse(saved);showApp()}catch(e){localStorage.removeItem("pab_current")}} var saved=localStorage.getItem("pab_current");if(saved){try{currentUser=JSON.parse(saved);showApp()}catch(e){localStorage.removeItem("pab_current")}}
} }
init(); init();
})();
</script> </script>
</body> </body>
</html> </html>