diff options
| -rw-r--r-- | background_scripts/main.coffee | 5 | ||||
| -rw-r--r-- | pages/logging.coffee | 19 | ||||
| -rw-r--r-- | pages/logging.html | 10 |
3 files changed, 34 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..3ccef4ff --- /dev/null +++ b/pages/logging.coffee @@ -0,0 +1,19 @@ +$ = (id) -> document.getElementById id + +document.addEventListener "DOMContentLoaded", -> + $("vimiumVersion").innerText = Utils.getCurrentVersion() + + chrome.storage.local.get "installDate", (items) -> + $("installDate").innerText = items.installDate.toString() + + branchRefRequest = new XMLHttpRequest() + branchRefRequest.addEventListener "load", -> + branchRefParts = branchRefRequest.responseText.split "refs/heads/", 2 + if branchRefParts.length == 2 + $("branchRef").innerText = branchRefParts[1] + else + $("branchRef").innerText = "HEAD detatched at #{branchRefParts[0]}" + $("branchRef-wrapper").classList.add "no-hide" + branchRefRequest.open "GET", chrome.extension.getURL ".git/HEAD" + branchRefRequest.send() + diff --git a/pages/logging.html b/pages/logging.html index 9d20d5d7..78095e4b 100644 --- a/pages/logging.html +++ b/pages/logging.html @@ -2,6 +2,7 @@ <head> <title>Vimium Logging</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; @@ -23,6 +24,12 @@ width: 100%; height: 80%; } + #branchRef-wrapper { + display: none; + } + #branchRef-wrapper.no-hide { + display: block; + } </style> </head> @@ -32,6 +39,9 @@ <br /> <textarea id="log-text" readonly></textarea> <br /> + Version: <span id="vimiumVersion"></span><br /> + Installed: <span id="installDate"></span> + <div id="branchRef-wrapper">Branch: <span id="branchRef"></span></div> </div> </body> </html> |
