From ee0e4763c44ac38c05c92900f6c1b9d3e2d26069 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 10 Apr 2022 06:29:58 -0700 Subject: add favicon; minor cleanup --- icon/clock128.png | Bin 13338 -> 12291 bytes icon/clock16.png | Bin 0 -> 763 bytes icon/clock48.png | Bin 3629 -> 3277 bytes index.html | 20 -------------------- manifest.json | 7 ++++--- options.html | 10 +++++----- tempo.html | 21 +++++++++++++++++++++ tempo.js | 12 ++++-------- 8 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 icon/clock16.png delete mode 100644 index.html create mode 100644 tempo.html diff --git a/icon/clock128.png b/icon/clock128.png index 58e423d..7d02349 100644 Binary files a/icon/clock128.png and b/icon/clock128.png differ diff --git a/icon/clock16.png b/icon/clock16.png new file mode 100644 index 0000000..f363720 Binary files /dev/null and b/icon/clock16.png differ diff --git a/icon/clock48.png b/icon/clock48.png index 4cb746b..7710510 100644 Binary files a/icon/clock48.png and b/icon/clock48.png differ diff --git a/index.html b/index.html deleted file mode 100644 index 50ddd97..0000000 --- a/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - New Tab - - - -
-
-

 

-
-
-

 

-
-
- - diff --git a/manifest.json b/manifest.json index 4a0aac5..b8ba7a5 100644 --- a/manifest.json +++ b/manifest.json @@ -2,11 +2,12 @@ "manifest_version": 2, "name": "Tempo", - "version": "0.4", + "version": "0.5", "description": "Replace the New Tab page with a time display.", "icons": { + "16": "icon/clock16.png", "48": "icon/clock48.png", "128": "icon/clock128.png" }, @@ -17,10 +18,10 @@ }, "chrome_settings_overrides": { - "homepage": "index.html" + "homepage": "tempo.html" }, "chrome_url_overrides": { - "newtab": "index.html" + "newtab": "tempo.html" } } diff --git a/options.html b/options.html index 65f5e80..53238ef 100644 --- a/options.html +++ b/options.html @@ -8,13 +8,13 @@
-

Time format:

-

-

+

Time format:

+
+
-
+
+
-
diff --git a/tempo.html b/tempo.html new file mode 100644 index 0000000..8d03208 --- /dev/null +++ b/tempo.html @@ -0,0 +1,21 @@ + + + + + + + + New Tab + + + +
+
+

 

+
+
+

 

+
+
+ + diff --git a/tempo.js b/tempo.js index 40b426a..f280142 100644 --- a/tempo.js +++ b/tempo.js @@ -1,12 +1,9 @@ +var timeformat = null; var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; -var timeformat = null; function padTime(x) { - if (x < 10) - return '0' + x; - else - return x; + return (x < 10) ? '0' + x : x; } function updateTime() { @@ -20,7 +17,7 @@ function updateTime() { var dm = date.getMonth(); var dy = date.getFullYear(); - if (timeformat == 12) + if (timeformat == 12) // default to 24 h = (h + 11) % 12 + 1; var str_t = padTime(h) + '  ' + padTime(m) + @@ -35,9 +32,8 @@ function startTempo() { timeformat = localStorage['timeformat']; updateTime(); - setTimeout(function() { updateTime(); setInterval(updateTime, 1000) }, - 1000 - new Date().getTime() % 1000); + 1000 - (new Date()).getTime() % 1000); } window.onload = startTempo; -- cgit v1.2.3-70-g09d2