Browse Source

Improved adaptation to mocky

sisyphus
JezerM 4 years ago
parent
commit
8761176e87
  1. 5
      themes/gruvbox/index.html
  2. 20
      themes/gruvbox/js/debug.js
  3. 12
      themes/gruvbox/js/power.js

5
themes/gruvbox/index.html vendored

@ -3,8 +3,13 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/style.css" class="style">
<link rel="stylesheet" href="fonts/material/css/materialdesignicons.css" class="style">
<script src="../_vendor/js/moment-with-locales.min.js"></script>
<script src="../_vendor/js/mocky.js"></script>
<title>Gruvbox greeter</title>
</head>
<body>

20
themes/gruvbox/js/debug.js vendored

@ -1,6 +1,6 @@
class Debug {
constructor() {
this._debugPass = "just"
this._debugPass = "pes"
this._init()
}
@ -18,7 +18,12 @@ class Debug {
}
}
window.lightdm = {
if (!window.lightdm) {
window.lightdm = {}
}
var local_lightdm = {
default_password: "pes",
is_authenticated: false,
authentication_user: null,
default_session: "awesome",
@ -126,5 +131,16 @@ class Debug {
if (lightdm.brightness < 0) lightdm.brightness = 0
}
}
if (lightdm.mock == undefined) {
window.lightdm = {}
Object.assign(window.lightdm, local_lightdm)
} else {
Object.keys(local_lightdm).forEach((key) => {
var realKey = `_${key}`
lightdm[realKey] = local_lightdm[key]
})
}
}
}

12
themes/gruvbox/js/power.js vendored

@ -14,20 +14,24 @@ class Power {
this._cover.classList.remove("hide")
}
_do_shutdown() {
async _do_shutdown() {
this._show_message("Shutting down")
await wait(1000)
lightdm.shutdown()
}
_do_restart() {
async _do_restart() {
this._show_message("Restarting")
await wait(1000)
lightdm.restart()
}
_do_hibernate() {
async _do_hibernate() {
this._show_message("Hibernating")
await wait(1000)
lightdm.hibernate()
}
_do_suspend() {
async _do_suspend() {
this._show_message("Suspending")
await wait(1000)
lightdm.suspend()
}

Loading…
Cancel
Save