Browse Source

some fixes

master
Sergey Markov 2 years ago
parent
commit
f935c6404e
  1. 2
      README.md
  2. 2
      index.yml
  3. 15
      main.js

2
README.md

@ -1,6 +1,6 @@
# Basealt web-greeter-theme # Basealt web-greeter-theme
The lightdm web-greeter theme for altlinux OSes The lightdm web-greeter theme for altlinux OSes
![](https://git.markow.su/markow/git-utils/raw/branch/master/screenshots/web-greeter-theme-basealt-1.png) ![](https://git.markow.su/markow/git-utils/raw/branch/master/screenshots/web-greeter-theme-basealt.gif)
# Install # Install
``` ```

2
index.yml

@ -0,0 +1,2 @@
primary_html: "index.html"
secondary_html: "index.html"

15
main.js

@ -33,12 +33,15 @@ function toggleWaitingState(waiting) {
function updateDefaults(user, session) { function updateDefaults(user, session) {
localStorage.setItem(DEFAULT_USER, user) console.log(user)
localStorage.setItem(DEFAULT_SESSION, session) console.log(session)
window.localStorage.setItem(DEFAULT_USER, user)
window.localStorage.setItem(DEFAULT_SESSION, session)
var wallpapper = document.getElementById(WALLPAPPER_ELEMENT).value var wallpapper = document.getElementById(WALLPAPPER_ELEMENT).value
if(wallpapper) { if(wallpapper) {
localStorage.setItem(DEFAULT_WALLPAPPER, wallpapper) console.log(wallpapper)
window.localStorage.setItem(DEFAULT_WALLPAPPER, wallpapper)
} }
} }
@ -103,7 +106,7 @@ function updateWallpapper(wallpapper) {
function initGreeter() { function initGreeter() {
let users = lightdm.users let users = lightdm.users
let defaultUser = localStorage.getItem(DEFAULT_USER) || users[0].username; let defaultUser = window.localStorage.getItem(DEFAULT_USER) || users[0].username;
updateUser(defaultUser); updateUser(defaultUser);
let select = document.getElementById('user-dropdown-content') let select = document.getElementById('user-dropdown-content')
@ -123,14 +126,14 @@ function initGreeter() {
updateWallpapper(event.target.value); updateWallpapper(event.target.value);
}); });
let defaultWallpapper = localStorage.getItem(DEFAULT_WALLPAPPER); let defaultWallpapper = window.localStorage.getItem(DEFAULT_WALLPAPPER);
if(defaultWallpapper) { if(defaultWallpapper) {
selectItemByValue(wallpappers, defaultWallpapper); selectItemByValue(wallpappers, defaultWallpapper);
updateWallpapper(defaultWallpapper); updateWallpapper(defaultWallpapper);
} }
let sessions = lightdm.sessions let sessions = lightdm.sessions
let defaultSession = localStorage.getItem(DEFAULT_SESSION) || sessions[0].key; let defaultSession = window.localStorage.getItem(DEFAULT_SESSION) || sessions[0].key;
let sessionsSelect = document.getElementById('sessions') let sessionsSelect = document.getElementById('sessions')
for (let i = 0; i < sessions.length; i++) { for (let i = 0; i < sessions.length; i++) {
var opt = document.createElement('option') var opt = document.createElement('option')

Loading…
Cancel
Save