diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-15 18:02:48 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-15 18:22:02 -0700 |
commit | 1546d1ad242f65fcb9ad0ec3c2fcc4b237dc7ff0 (patch) | |
tree | 102a86c70f841c3871b67be6c43ff041baa4594b /tempo.js | |
parent | cb2b45a5d6b1972b20dc715dfdf16320435167e4 (diff) | |
download | tempo-1546d1ad242f65fcb9ad0ec3c2fcc4b237dc7ff0.tar.gz tempo-1546d1ad242f65fcb9ad0ec3c2fcc4b237dc7ff0.tar.xz |
reuse variables for conciseness
Diffstat (limited to 'tempo.js')
-rw-r--r-- | tempo.js | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -31,17 +31,13 @@ function updateTime() { function startTempo() { timefmt = localStorage['timefmt']; - let fg = localStorage['fg']; - if (fg) - document.body.style.color = fg; - - let fg_date = localStorage['fg_date']; - if (fg_date) - document.getElementById('dateval').style.color = fg_date; - - let bg = localStorage['bg']; - if (bg) - document.body.style.backgroundColor = bg; + let val; + if ((val = localStorage['fg'])) + document.body.style.color = val; + if ((val = localStorage['fg_date'])) + document.getElementById('dateval').style.color = val; + if ((val = localStorage['bg'])) + document.body.style.backgroundColor = val; updateTime(); setTimeout(function() { updateTime(); setInterval(updateTime, 1000) }, |