[systemd-commits] 2 commits - src/journal

Lennart Poettering lennart at kemper.freedesktop.org
Wed Oct 10 14:59:36 PDT 2012


 src/journal/browse.html |   60 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

New commits:
commit 19f8efacc5ef96bd4f3553ff3dd3e94c4a1bd59c
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed Oct 10 23:59:29 2012 +0200

    journal: add mousewheel scrolling to browse.html

diff --git a/src/journal/browse.html b/src/journal/browse.html
index 5a161a1..d5e0717 100644
--- a/src/journal/browse.html
+++ b/src/journal/browse.html
@@ -419,10 +419,21 @@
                         }
                 }
 
+                function onMouseWheel(event) {
+                        if (event.detail < 0 || event.wheelDelta > 0)
+                                entriesLoadPrevious();
+                        else
+                                entriesLoadNext();
+                }
+
                 machineLoad();
                 entriesLoad("");
                 showNEntries(getNEntries());
                 document.onkeyup = onKeyUp;
+
+                logs = document.getElementById("tablelogs");
+                logs.addEventListener("mousewheel", onMouseWheel, false);
+                logs.addEventListener("DOMMouseScroll", onMouseWheel, false);
         </script>
 </body>
 </html>

commit 6d5f2f58033493a71402755944f46f09d990bad4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 10 23:49:21 2012 +0200

    journal: add keyboard navigation to browse.html

diff --git a/src/journal/browse.html b/src/journal/browse.html
index f16e346..5a161a1 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">→, j, SPACE</span>: Next Page     
+                <span class="key">←, k, BACKSPACE</span>: Previous Page     
+                <span class="key">g</span>: First Page     
+                <span class="key">G</span>: Last Page     
+                <span class="key">+</span>: More entries     
+                <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>



More information about the systemd-commits mailing list