mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
fixed eslint error into modules for Javascript files
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
Module.register("clock",{
|
||||
// Module config defaults.
|
||||
defaults: {
|
||||
displayType: 'digital', // options: digital, analog, both
|
||||
displayType: "digital", // options: digital, analog, both
|
||||
|
||||
timeFormat: config.timeFormat,
|
||||
displaySeconds: true,
|
||||
@@ -18,11 +18,11 @@ Module.register("clock",{
|
||||
showDate: true,
|
||||
|
||||
/* specific to the analog clock */
|
||||
analogSize: '200px',
|
||||
analogFace: 'simple', // options: 'none', 'simple', 'face-###' (where ### is 001 to 012 inclusive)
|
||||
analogPlacement: 'bottom', // options: 'top', 'bottom', 'left', 'right'
|
||||
analogShowDate: 'top', // options: false, 'top', or 'bottom'
|
||||
secondsColor: '#888888',
|
||||
analogSize: "200px",
|
||||
analogFace: "simple", // options: 'none', 'simple', 'face-###' (where ### is 001 to 012 inclusive)
|
||||
analogPlacement: "bottom", // options: 'top', 'bottom', 'left', 'right'
|
||||
analogShowDate: "top", // options: false, 'top', or 'bottom'
|
||||
secondsColor: "#888888",
|
||||
timezone: null,
|
||||
},
|
||||
// Define required scripts.
|
||||
@@ -92,7 +92,7 @@ Module.register("clock",{
|
||||
}
|
||||
}
|
||||
if(this.config.showDate){
|
||||
dateWrapper.innerHTML = now.format("dddd, LL");
|
||||
dateWrapper.innerHTML = now.format("dddd, LL");
|
||||
}
|
||||
timeWrapper.innerHTML = timeString;
|
||||
secondsWrapper.innerHTML = now.format("ss");
|
||||
@@ -112,7 +112,7 @@ Module.register("clock",{
|
||||
* Create wrappers for ANALOG clock, only if specified in config
|
||||
*/
|
||||
|
||||
if (this.config.displayType !== 'digital') {
|
||||
if (this.config.displayType !== "digital") {
|
||||
// If it isn't 'digital', then an 'analog' clock was also requested
|
||||
|
||||
// Calculate the degree offset for each hand of the clock
|
||||
@@ -131,10 +131,10 @@ Module.register("clock",{
|
||||
clockCircle.style.width = this.config.analogSize;
|
||||
clockCircle.style.height = this.config.analogSize;
|
||||
|
||||
if (this.config.analogFace != '' && this.config.analogFace != 'simple' && this.config.analogFace != 'none') {
|
||||
if (this.config.analogFace != "" && this.config.analogFace != "simple" && this.config.analogFace != "none") {
|
||||
clockCircle.style.background = "url("+ this.data.path + "faces/" + this.config.analogFace + ".svg)";
|
||||
clockCircle.style.backgroundSize = "100%";
|
||||
} else if (this.config.analogFace != 'none') {
|
||||
} else if (this.config.analogFace != "none") {
|
||||
clockCircle.style.border = "2px solid white";
|
||||
}
|
||||
var clockFace = document.createElement("div");
|
||||
@@ -168,18 +168,18 @@ Module.register("clock",{
|
||||
* Combine wrappers, check for .displayType
|
||||
*/
|
||||
|
||||
if (this.config.displayType === 'digital') {
|
||||
if (this.config.displayType === "digital") {
|
||||
// Display only a digital clock
|
||||
wrapper.appendChild(dateWrapper);
|
||||
wrapper.appendChild(timeWrapper);
|
||||
} else if (this.config.displayType === 'analog') {
|
||||
} else if (this.config.displayType === "analog") {
|
||||
// Display only an analog clock
|
||||
dateWrapper.style.textAlign = "center";
|
||||
dateWrapper.style.paddingBottom = "15px";
|
||||
if (this.config.analogShowDate === 'top') {
|
||||
if (this.config.analogShowDate === "top") {
|
||||
wrapper.appendChild(dateWrapper);
|
||||
wrapper.appendChild(clockCircle);
|
||||
} else if (this.config.analogShowDate === 'bottom') {
|
||||
} else if (this.config.analogShowDate === "bottom") {
|
||||
wrapper.appendChild(clockCircle);
|
||||
wrapper.appendChild(dateWrapper);
|
||||
} else {
|
||||
@@ -199,11 +199,11 @@ Module.register("clock",{
|
||||
digitalWrapper.appendChild(dateWrapper);
|
||||
digitalWrapper.appendChild(timeWrapper);
|
||||
|
||||
if (placement === 'left' || placement === 'right') {
|
||||
if (placement === "left" || placement === "right") {
|
||||
digitalWrapper.style.display = "inline-block";
|
||||
digitalWrapper.style.verticalAlign = "top";
|
||||
analogWrapper.style.display = "inline-block";
|
||||
if (placement === 'left') {
|
||||
if (placement === "left") {
|
||||
analogWrapper.style.padding = "0 20px 0 0";
|
||||
wrapper.appendChild(analogWrapper);
|
||||
wrapper.appendChild(digitalWrapper);
|
||||
@@ -214,7 +214,7 @@ Module.register("clock",{
|
||||
}
|
||||
} else {
|
||||
digitalWrapper.style.textAlign = "center";
|
||||
if (placement === 'top') {
|
||||
if (placement === "top") {
|
||||
analogWrapper.style.padding = "0 0 20px 0";
|
||||
wrapper.appendChild(analogWrapper);
|
||||
wrapper.appendChild(digitalWrapper);
|
||||
|
Reference in New Issue
Block a user