summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-10 23:49:21 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-10 23:49:21 +0200
commit6d5f2f58033493a71402755944f46f09d990bad4 (patch)
treee19171a601daa343f850da7b43d4c46d1938b047 /src
parent6c69cd8626d8ba9c879f6885122cf5f2eb855fda (diff)
journal: add keyboard navigation to browse.html
Diffstat (limited to 'src')
-rw-r--r--src/journal/browse.html49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/journal/browse.html b/src/journal/browse.html
index f16e346d90..5a161a13fb 100644
--- a/src/journal/browse.html
+++ b/src/journal/browse.html
@@ -76,13 +76,22 @@
td.data {
padding-left: 5px;
}
+ div#keynav {
+ text-align: center;
+ font-size: 7pt;
+ color: #818789;
+ padding-top: 50px;
+ }
+ .key {
+ font-weight: bold;
+ color: #313739;
+ }
</style>
</head>
<body>
<!-- TODO:
- live display
- - keyboard navigation
- localstorage
- show red lines for reboots -->
@@ -109,6 +118,15 @@
<input id="less" type="button" value="Less" onclick="entriesLess();"/>
</form>
+ <div id="keynav">
+ <span class="key">&#8594;, j, SPACE</span>: Next Page &nbsp;&nbsp;&nbsp;&nbsp;
+ <span class="key">&#8592;, k, BACKSPACE</span>: Previous Page &nbsp;&nbsp;&nbsp;&nbsp;
+ <span class="key">g</span>: First Page &nbsp;&nbsp;&nbsp;&nbsp;
+ <span class="key">G</span>: Last Page &nbsp;&nbsp;&nbsp;&nbsp;
+ <span class="key">+</span>: More entries &nbsp;&nbsp;&nbsp;&nbsp;
+ <span class="key">-</span>: Fewer entries
+ </div>
+
<script type="text/javascript">
var first_cursor = null;
var last_cursor = null;
@@ -373,9 +391,38 @@
request.send(null);
}
+ function onKeyUp(event) {
+ switch (event.keyCode) {
+ case 8:
+ case 37:
+ case 75:
+ entriesLoadPrevious();
+ break;
+ case 32:
+ case 39:
+ case 74:
+ entriesLoadNext();
+ break;
+
+ case 71:
+ if (event.shiftKey)
+ entriesLoadTail();
+ else
+ entriesLoadHead();
+ break;
+ case 171:
+ entriesMore();
+ break;
+ case 173:
+ entriesLess();
+ break;
+ }
+ }
+
machineLoad();
entriesLoad("");
showNEntries(getNEntries());
+ document.onkeyup = onKeyUp;
</script>
</body>
</html>