Browse Source

Updated mock.js

sisyphus
JezerM 3 years ago
parent
commit
66c5111066
No known key found for this signature in database
GPG Key ID: 66BBC5D01388C6B5
  1. 40
      themes/_vendor/js/mock.js

40
themes/_vendor/js/mock.js vendored

@ -49,23 +49,29 @@ class LightDMSession {
} }
class LightDMUser { 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.display_name = display_name;
this.username = username; this.username = username;
this.language = language; this.language = language;
this.layout = layout; this.layout = layout;
this.layouts = layouts;
this.image = image; this.image = image;
this.home_directory = home_directory; this.home_directory = home_directory;
this.background = background;
this.session = session; this.session = session;
this.logged_in = logged_in; this.logged_in = logged_in;
} }
} }
class LightDMBattery { class LightDMBattery {
constructor( {name, level, status}) { constructor( {name, level, status, ac_status}) {
this.name = name; this.name = name;
this.level = level; this.level = level;
this.status = status; 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() signal._run()
} }
_mockData = { const _mockData = {
languages: [ languages: [
new LightDMLanguage({ new LightDMLanguage({
name: 'English', name: 'English',
@ -192,6 +198,8 @@ _mockData = {
home_directory: '/home/superman', home_directory: '/home/superman',
session: 'gnome', session: 'gnome',
logged_in: false, logged_in: false,
background: "",
layouts: [],
}), }),
new LightDMUser({ new LightDMUser({
display_name: 'Bruce Wayne', display_name: 'Bruce Wayne',
@ -202,6 +210,8 @@ _mockData = {
home_directory: '/home/batman', home_directory: '/home/batman',
session: 'cinnamon', session: 'cinnamon',
logged_in: false, logged_in: false,
background: "",
layouts: [],
}), }),
new LightDMUser({ new LightDMUser({
display_name: 'Peter Parker', display_name: 'Peter Parker',
@ -212,12 +222,15 @@ _mockData = {
home_directory: '/home/spiderman', home_directory: '/home/spiderman',
session: 'MATE', session: 'MATE',
logged_in: false, logged_in: false,
background: "",
layouts: [],
}) })
], ],
battery: new LightDMBattery({ battery: new LightDMBattery({
name: "Battery 0", name: "Battery 0",
level: 85, level: 85,
state: "Discharging" status: "Discharging",
ac_status: 1,
}), }),
} }
@ -557,13 +570,6 @@ class Greeter {
this._authentication_user = "guest"; this._authentication_user = "guest";
} }
/**
* Updates the battery data
*/
batteryUpdate() {
console.log("Battery updated")
}
/** /**
* Set the brightness to quantity * Set the brightness to quantity
* @param {Number} quantity The quantity to set * @param {Number} quantity The quantity to set
@ -682,6 +688,8 @@ class Greeter {
brightness_update = new Signal("brightness_update"); brightness_update = new Signal("brightness_update");
battery_update = new Signal("battery_update");
idle = new Signal("idle"); idle = new Signal("idle");
reset = new Signal("reset"); reset = new Signal("reset");
@ -725,6 +733,8 @@ class GreeterConfig {
} }
} }
_layouts = _mockData.layouts
/** /**
* Holds keys/values from the `branding` section of the config file. * Holds keys/values from the `branding` section of the config file.
* *
@ -773,6 +783,10 @@ class GreeterConfig {
return this._features; return this._features;
} }
get layouts() {
return this._layouts;
}
} }
let time_language = null let time_language = null
@ -953,6 +967,4 @@ new Greeter();
window._ready_event = new Event("GreeterReady") window._ready_event = new Event("GreeterReady")
setTimeout(() => { window.addEventListener("load", () => {window.dispatchEvent(_ready_event)})
window.dispatchEvent(_ready_event)
}, 1000)

Loading…
Cancel
Save