aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-02-22 10:11:52 +0000
committerStephen Blott2016-02-22 10:12:00 +0000
commit251496451907801c45b4b794a235030e6ab99ae2 (patch)
tree8731b0b890d416b3686b87075b25de92569e0f29
parent5cbc5ad702a01a81b98f8c82edb3b6d227c2c7b5 (diff)
downloadvimium-251496451907801c45b4b794a235030e6ab99ae2.tar.bz2
Add install date to logging page.
This implements a poor-man's build info. See #1352. Unfortunately, that requires a separate build target, and does not work with `cake autobuild`. This just records the *install date* and displays that info on the logging page. "Install date" because we can reliably determine it, and because it does answer the question *have I upgrade Vimium on this machine since last week?*. And on the logging page because that's out of the way, and not part of the regular Vimium interface.
-rw-r--r--background_scripts/main.coffee5
-rw-r--r--pages/logging.coffee10
-rw-r--r--pages/logging.html3
3 files changed, 18 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index a4162fc7..7c970866 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -658,5 +658,10 @@ showUpgradeMessage = ->
showUpgradeMessage()
+# The install date is shown on the logging page.
+chrome.runtime.onInstalled.addListener ({reason}) ->
+ unless reason in ["chrome_update", "shared_module_update"]
+ chrome.storage.local.set installDate: new Date().toString()
+
root.TabOperations = TabOperations
root.logMessage = logMessage
diff --git a/pages/logging.coffee b/pages/logging.coffee
new file mode 100644
index 00000000..473499b8
--- /dev/null
+++ b/pages/logging.coffee
@@ -0,0 +1,10 @@
+$ = (id) -> document.getElementById id
+
+document.addEventListener "DOMContentLoaded", ->
+ $("vimiumVersion").innerText = Utils.getCurrentVersion()
+ chrome.storage.local.get "installDate", (items) ->
+ console.log new Date
+ console.log items
+ console.log items.installDate, items.installDate.toString()
+ $("installDate").innerText = items.installDate.toString()
+
diff --git a/pages/logging.html b/pages/logging.html
index 2de04bce..409fa8e9 100644
--- a/pages/logging.html
+++ b/pages/logging.html
@@ -2,6 +2,7 @@
<head>
<title>Vimium Options</title>
<script src="content_script_loader.js"></script>
+ <script src="logging.js"></script>
<style type="text/css">
body {
font: 14px "DejaVu Sans", "Arial", sans-serif;
@@ -32,6 +33,8 @@
<br />
<textarea id="log-text" readonly></textarea>
<br />
+ Version: <span id="vimiumVersion"></span><br />
+ Installed: <span id="installDate"></span>
</div>
</body>
</html>