summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icon/clock128.pngbin13338 -> 12291 bytes
-rw-r--r--icon/clock16.pngbin0 -> 763 bytes
-rw-r--r--icon/clock48.pngbin3629 -> 3277 bytes
-rw-r--r--manifest.json7
-rw-r--r--options.html10
-rw-r--r--tempo.html (renamed from index.html)1
-rw-r--r--tempo.js12
7 files changed, 14 insertions, 16 deletions
diff --git a/icon/clock128.png b/icon/clock128.png
index 58e423d..7d02349 100644
--- a/icon/clock128.png
+++ b/icon/clock128.png
Binary files differ
diff --git a/icon/clock16.png b/icon/clock16.png
new file mode 100644
index 0000000..f363720
--- /dev/null
+++ b/icon/clock16.png
Binary files differ
diff --git a/icon/clock48.png b/icon/clock48.png
index 4cb746b..7710510 100644
--- a/icon/clock48.png
+++ b/icon/clock48.png
Binary files differ
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 @@
</head>
<body>
<div>
- <p>Time format:</p>
- <p><input type="radio" name="timeformat" id="t12" /><label for="t12"> 12-hour</label></p>
- <p><input type="radio" name="timeformat" id="t24" /><label for="t24"> 24-hour</label></p>
+ <p style="margin: 0em;">Time format:</p>
+ <input type="radio" name="timeformat" id="t12" /><label for="t12"> 12-hour</label><br />
+ <input type="radio" name="timeformat" id="t24" /><label for="t24"> 24-hour</label>
</div>
- <div>
+ <div style="margin-top: 1em;">
<button id="save">Save</button>
+ <span id="status"></span>
</div>
- <div id="status"></div>
</body>
</html>
diff --git a/index.html b/tempo.html
index 50ddd97..8d03208 100644
--- a/index.html
+++ b/tempo.html
@@ -4,6 +4,7 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="fonts/lato.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
+ <link rel="icon" type="image/png" href="icon/clock16.png" />
<title>New Tab</title>
<script type="text/javascript" src="tempo.js"></script>
</head>
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) + '&nbsp;&nbsp;' + 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;