|
|
|
@ -2,6 +2,7 @@ const DEFAULT_USER = "defaultUser";
|
|
|
|
|
const DEFAULT_SESSION = "defaultSession"; |
|
|
|
|
const DEFAULT_WALLPAPPER = "defaultWallpapper"; |
|
|
|
|
const WALLPAPPER_ELEMENT = "wallpappers"; |
|
|
|
|
const WAITING_CLASS = "waiting"; |
|
|
|
|
|
|
|
|
|
function togglePasswordVisibility() { |
|
|
|
|
var passwd = document.getElementById("password"); |
|
|
|
@ -15,6 +16,21 @@ function togglePasswordVisibility() {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function toggleWaitingState(waiting) { |
|
|
|
|
var cylon_eye = document.getElementById("cylon_eye"); |
|
|
|
|
var passwd = document.getElementById("password"); |
|
|
|
|
passwd.disabled = waiting; |
|
|
|
|
|
|
|
|
|
var submit = document.getElementById("submit"); |
|
|
|
|
// submit.disabled = waiting;
|
|
|
|
|
|
|
|
|
|
if (waiting) { |
|
|
|
|
cylon_eye.classList.add(WAITING_CLASS); |
|
|
|
|
} else { |
|
|
|
|
cylon_eye.classList.remove(WAITING_CLASS); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateDefaults(user, session) { |
|
|
|
|
|
|
|
|
|
localStorage.setItem(DEFAULT_USER, user) |
|
|
|
@ -57,6 +73,8 @@ function doLogin() {
|
|
|
|
|
lightdm.cancel_authentication(); |
|
|
|
|
|
|
|
|
|
updateDefaults(user, session); |
|
|
|
|
|
|
|
|
|
toggleWaitingState(true); |
|
|
|
|
lightdm.authenticate(user) |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -134,6 +152,7 @@ function initGreeter() {
|
|
|
|
|
lightdm.respond(password); |
|
|
|
|
}); |
|
|
|
|
lightdm.authentication_complete.connect(() => { |
|
|
|
|
toggleWaitingState(false); |
|
|
|
|
if (lightdm.is_authenticated) { |
|
|
|
|
var session = document.getElementById("sessions").value |
|
|
|
|
lightdm.start_session(session); |
|
|
|
|