@xiee/utils
Advanced tools
Comparing version 1.3.18 to 1.3.19
@@ -1,2 +0,2 @@ | ||
// navigate to previous/next posts by Left/Right arrows | ||
// navigate to previous/next posts by Left/Right arrows, and Alt + <-/-> for back/forward | ||
(function(d) { | ||
@@ -7,6 +7,6 @@ const a1 = d.querySelector('.nav-prev > a'), a2 = d.querySelector('.nav-next > a'); | ||
let u; | ||
if (a1 && e.which == 37) { // Left arrow | ||
u = a1.href; | ||
} else if (a2 && e.which == 39) { // Right arrow | ||
u = a2.href; | ||
if (e.key === 'ArrowLeft') { | ||
e.altKey ? history.back() : (a1 && (u = a1.href)); | ||
} else if (e.key == 'ArrowRight') { | ||
e.altKey ? history.forward() : (a2 && (u = a2.href)); | ||
} | ||
@@ -13,0 +13,0 @@ if (u) window.location = u; |
@@ -1,1 +0,1 @@ | ||
!function(e){const r=e.querySelector(".nav-prev > a"),t=e.querySelector(".nav-next > a");e.addEventListener("keyup",(function(e){if("BODY"!=e.target.nodeName.toUpperCase())return;let n;r&&37==e.which?n=r.href:t&&39==e.which&&(n=t.href),n&&(window.location=n)}));const n=e.querySelectorAll(".unlist");if(0===n.length)return;if(null!==sessionStorage.getItem("hide-notes"))return n.forEach((e=>e.classList.remove("unlist")));r&&t&&(window.location=e.referrer===t.href?r.href:t.href)}(document); | ||
!function(e){const r=e.querySelector(".nav-prev > a"),t=e.querySelector(".nav-next > a");e.addEventListener("keyup",(function(e){if("BODY"!=e.target.nodeName.toUpperCase())return;let n;"ArrowLeft"===e.key?e.altKey?history.back():r&&(n=r.href):"ArrowRight"==e.key&&(e.altKey?history.forward():t&&(n=t.href)),n&&(window.location=n)}));const n=e.querySelectorAll(".unlist");if(0===n.length)return;if(null!==sessionStorage.getItem("hide-notes"))return n.forEach((e=>e.classList.remove("unlist")));r&&t&&(window.location=e.referrer===t.href?r.href:t.href)}(document); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.3.18", | ||
"version": "1.3.19", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -65,2 +65,8 @@ This repo contains miscellaneous tools and utilities written in JavaScript. They | ||
## fuse-search.js | ||
Perform client-side site searching via [Fuse.js](https://www.fusejs.io). See | ||
[this post](https://yihui.org/en/2023/09/fuse-search/) for an application to | ||
Hugo sites. | ||
## hash-notes.js | ||
@@ -67,0 +73,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58150
69
904
130