From a9540ffabe2cacd2511eb2686e038b05df5c1b8f Mon Sep 17 00:00:00 2001 From: "Ashley M. Kirchner" Date: Fri, 8 Jul 2016 18:57:23 -0600 Subject: [PATCH] Analog clock addition (cherry picked from commit 7bae93fdb2744b0deab84882506a333ff809b3a3) --- modules/default/clock/README.md | 7 +++++++ modules/default/clock/clock.js | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index 1e13333e..6f27d927 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -87,6 +87,13 @@ The following properties can be configured:
Default value: false + + secondsColor + **Specific to the analog clock** Specifies what color to make the 'seconds' hand.
+
Possible values: any HTML RGB Color +
Default value: #888888 + + analogPlacement **Specific to the analog clock** *(requires displayType set to 'both')* Specifies where the analog clock is in relation to the digital clock
diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index ec9b22d7..e9dc9415 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -18,6 +18,7 @@ Module.register("clock",{ analogSize: '200px', analogFace: false, analogPlacement: 'bottom', + secondsColor: '#888888', }, // Define required scripts. getScripts: function() { @@ -141,11 +142,14 @@ Module.register("clock",{ clockSecond.id = "clockSecond"; clockSecond.style.transform = "rotate(" + second + "deg)"; clockSecond.className = "clockSecond"; + clockSecond.style.backgroundColor = this.config.secondsColor; // Combine analog wrappers clockFace.appendChild(clockHour); clockFace.appendChild(clockMinute); - clockFace.appendChild(clockSecond); + if (this.config.displaySeconds) { + clockFace.appendChild(clockSecond); + } clockCircle.appendChild(clockFace); }