From 66c5111066c0494cecd3f944524bf62606f299ef Mon Sep 17 00:00:00 2001 From: JezerM Date: Sat, 21 Aug 2021 21:16:29 -0600 Subject: [PATCH] Updated mock.js --- themes/_vendor/js/mock.js | 40 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/themes/_vendor/js/mock.js b/themes/_vendor/js/mock.js index 22fa99a..43cd411 100644 --- a/themes/_vendor/js/mock.js +++ b/themes/_vendor/js/mock.js @@ -49,23 +49,29 @@ class LightDMSession { } class LightDMUser { - constructor( {display_name, username, language, layout, image, home_directory, session, logged_in} ) { + constructor( {display_name, username, language, layout, layouts, image, home_directory, session, logged_in, background} ) { this.display_name = display_name; this.username = username; this.language = language; this.layout = layout; + this.layouts = layouts; this.image = image; this.home_directory = home_directory; + this.background = background; this.session = session; this.logged_in = logged_in; } } class LightDMBattery { - constructor( {name, level, status}) { + constructor( {name, level, status, ac_status}) { this.name = name; this.level = level; this.status = status; + this.ac_status = ac_status; + this.capacity = 100; + this.time = "00:00"; + this.watt = 0; } } @@ -115,7 +121,7 @@ function emitSignal(name) { signal._run() } -_mockData = { +const _mockData = { languages: [ new LightDMLanguage({ name: 'English', @@ -192,6 +198,8 @@ _mockData = { home_directory: '/home/superman', session: 'gnome', logged_in: false, + background: "", + layouts: [], }), new LightDMUser({ display_name: 'Bruce Wayne', @@ -202,6 +210,8 @@ _mockData = { home_directory: '/home/batman', session: 'cinnamon', logged_in: false, + background: "", + layouts: [], }), new LightDMUser({ display_name: 'Peter Parker', @@ -212,12 +222,15 @@ _mockData = { home_directory: '/home/spiderman', session: 'MATE', logged_in: false, + background: "", + layouts: [], }) ], battery: new LightDMBattery({ name: "Battery 0", level: 85, - state: "Discharging" + status: "Discharging", + ac_status: 1, }), } @@ -557,13 +570,6 @@ class Greeter { this._authentication_user = "guest"; } - /** - * Updates the battery data - */ - batteryUpdate() { - console.log("Battery updated") - } - /** * Set the brightness to quantity * @param {Number} quantity The quantity to set @@ -682,6 +688,8 @@ class Greeter { brightness_update = new Signal("brightness_update"); + battery_update = new Signal("battery_update"); + idle = new Signal("idle"); reset = new Signal("reset"); @@ -725,6 +733,8 @@ class GreeterConfig { } } + _layouts = _mockData.layouts + /** * Holds keys/values from the `branding` section of the config file. * @@ -773,6 +783,10 @@ class GreeterConfig { return this._features; } + get layouts() { + return this._layouts; + } + } let time_language = null @@ -953,6 +967,4 @@ new Greeter(); window._ready_event = new Event("GreeterReady") -setTimeout(() => { - window.dispatchEvent(_ready_event) -}, 1000) +window.addEventListener("load", () => {window.dispatchEvent(_ready_event)})