diff options
author | johannst <johannst@users.noreply.github.com> | 2023-07-21 18:14:59 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2023-07-21 18:14:59 +0000 |
commit | c4435063f699569dd1688966c20748f61d56683c (patch) | |
tree | 89c2710f5548b626817f00f6d8799b4ca76944d2 /linux | |
parent | 1b251a08f8c10ff292d1ca9b1c580e88df483b94 (diff) | |
download | notes-c4435063f699569dd1688966c20748f61d56683c.tar.gz notes-c4435063f699569dd1688966c20748f61d56683c.zip |
deploy: a311d67451eb4734684f314f1b56021da86459a0
Diffstat (limited to 'linux')
-rw-r--r-- | linux/acl.html | 24 | ||||
-rw-r--r-- | linux/coredump.html | 24 | ||||
-rw-r--r-- | linux/cryptsetup.html | 24 | ||||
-rw-r--r-- | linux/index.html | 24 | ||||
-rw-r--r-- | linux/input.html | 24 | ||||
-rw-r--r-- | linux/ptrace_scope.html | 24 | ||||
-rw-r--r-- | linux/swap.html | 24 | ||||
-rw-r--r-- | linux/systemd.html | 24 | ||||
-rw-r--r-- | linux/zfs.html | 24 |
9 files changed, 207 insertions, 9 deletions
diff --git a/linux/acl.html b/linux/acl.html index 4166152..5a420e3 100644 --- a/linux/acl.html +++ b/linux/acl.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/coredump.html b/linux/coredump.html index fbc82dd..d9ff589 100644 --- a/linux/coredump.html +++ b/linux/coredump.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/cryptsetup.html b/linux/cryptsetup.html index a301ed1..730ff00 100644 --- a/linux/cryptsetup.html +++ b/linux/cryptsetup.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/index.html b/linux/index.html index 3d8d8db..00bf1ee 100644 --- a/linux/index.html +++ b/linux/index.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/input.html b/linux/input.html index 836e185..f2daab7 100644 --- a/linux/input.html +++ b/linux/input.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/ptrace_scope.html b/linux/ptrace_scope.html index 234dda6..d17440d 100644 --- a/linux/ptrace_scope.html +++ b/linux/ptrace_scope.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/swap.html b/linux/swap.html index 42952c3..1a8a5d4 100644 --- a/linux/swap.html +++ b/linux/swap.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/systemd.html b/linux/systemd.html index 80540d8..5ebe003 100644 --- a/linux/systemd.html +++ b/linux/systemd.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> diff --git a/linux/zfs.html b/linux/zfs.html index 78e2847..aac907f 100644 --- a/linux/zfs.html +++ b/linux/zfs.html @@ -88,11 +88,33 @@ <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> + <!-- Track and set sidebar scroll position --> + <script> + var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); + sidebarScrollbox.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); + } + }, { passive: true }); + var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); + sessionStorage.removeItem('sidebar-scroll'); + if (sidebarScrollTop) { + // preserve sidebar scroll position when navigating via links within sidebar + sidebarScrollbox.scrollTop = sidebarScrollTop; + } else { + // scroll sidebar to current active section when navigating via "next/previous chapter" buttons + var activeSection = document.querySelector('#sidebar .active'); + if (activeSection) { + activeSection.scrollIntoView({ block: 'center' }); + } + } + </script> + <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> - <div id="menu-bar" class="menu-bar sticky bordered"> + <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> |