jekyll-hover-popup 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '093a8fdc8081648557c5767ccda5e569f65755d513df938c8c96b02bf8653348'
4
- data.tar.gz: 293393bc00ed5a9e096fb670b6c1468cf83450403db44f1cdd74258e1e1684c5
3
+ metadata.gz: cdae0cb64015858986ffe6c6dc11d44947b4e172dee08bccd68d191230416b26
4
+ data.tar.gz: af148150f8a1890b082adbccc2c4665a56dacbad3eea581608dd02c0cbee8f36
5
5
  SHA512:
6
- metadata.gz: 258b38b8e03cdb86f0f1c1ac7c62dc3b56e6046463a28128dd3c7049c0681bd1f0bc609e4a8f357cf3d66c4ca1c8312a6cbc4b72f019fe8392f56ac8c27ff2e6
7
- data.tar.gz: '09ab116eea32d0d8f310ea74b75466a19dc6c279ea4b551d22f4cedb8c8574f30c139305433c54283cd131b5291dafa10aea3458abe4165fd8a36ca21ac5dedf'
6
+ metadata.gz: a3192b0edd3563b6b267740ca86eff70b040b269d30aff9005366902be46d6f11026644757ea3f010296aa610f91f4969426e82c0bb1860ed473b7ed0cd07f44
7
+ data.tar.gz: 203ad982a1a4dd62680ee9798179a224835fca23322b2744e1239d09dfcce0ac8a63e63e574f90a58acf893a43cd69204015160ba37d229b2d5d1a9f40076d30
data/README.md CHANGED
@@ -6,14 +6,15 @@ Inspired by the hover window behavior in [5etools](https://github.com/5etools/5e
6
6
 
7
7
  ## Features
8
8
 
9
- - Hover an internal link to preview its target content in a floating window
10
- - Hold **Shift** while hovering (or when leaving the link) to pin the preview
11
- - Pinned windows show **Follow link** and **Close** (Ctrl/Cmd+click Close to close all)
12
- - Pinned links do not open additional previews on further hovers
13
- - Section links (`#heading-id`) show only that section; page links show the full page content
14
- - External links and non-page links are ignored
15
- - Popup windows are resizable (8 drag handles) and styled from the host page's computed theme
16
- - Exposes `window.JekyllHoverPopup` for other plugins (for example, image map region clicks)
9
+ - Hover over an internal link to see a reference preview
10
+ - Persist windows by holding the SHIFT key
11
+ - Close all windows by holding CTRL while closing one
12
+ - Minimize windows by double clicking the title bar
13
+ - Navigate to an entry later by clicking the link in the title bar
14
+ - Eight point window resize
15
+ - Exposes `window.JekyllHoverPopup` for other plugins
16
+
17
+ <img width="640" height="360" alt="window-preview-demo-2" src="https://github.com/user-attachments/assets/1f8f60ad-ad2a-4418-ad0f-0494f4e43faf" />
17
18
 
18
19
  ## Install
19
20
 
@@ -41,10 +42,12 @@ hover_popup:
41
42
  enabled: true
42
43
  assets_path: /assets/jekyll-hover-popup
43
44
  hover_delay_ms: 0
44
- nav_hover_preview: true
45
+ nav_hover_preview: false
45
46
  ```
46
47
 
47
- Set `nav_hover_preview: false` to disable hover previews for links inside navigation elements (`.site-nav`, `nav`, `[role="navigation"]`, etc.).
48
+ Add a `hover_delay_ms` to delay the preview window creation
49
+
50
+ Set `nav_hover_preview: true` to enable hover previews for links inside navigation elements (`.site-nav`, `nav`, `[role="navigation"]`, etc.).
48
51
 
49
52
  ## JavaScript API
50
53
 
@@ -72,4 +75,4 @@ window.JekyllHoverPopup.openContent({
72
75
 
73
76
  ## License
74
77
 
75
- MIT
78
+ [MIT](LICENSE)
@@ -3,7 +3,7 @@
3
3
 
4
4
  const config = window.__JHP_CONFIG__ || {};
5
5
  const HOVER_DELAY_MS = Number(config.hoverDelayMs) || 0;
6
- const NAV_HOVER_PREVIEW = config.navHoverPreview !== false;
6
+ const NAV_HOVER_PREVIEW = config.navHoverPreview === true;
7
7
  const TRANSIENT_TITLE_HINT = "SHIFT to persist";
8
8
  const MAX_VIEWPORT_WIDTH = 0.92;
9
9
  const MAX_VIEWPORT_HEIGHT = 0.92;
@@ -11,7 +11,7 @@ module Jekyll
11
11
  assets_path = cfg["assets_path"] || "/assets/jekyll-hover-popup"
12
12
  assets_path = "/#{assets_path}" unless assets_path.start_with?("/")
13
13
  hover_delay_ms = cfg["hover_delay_ms"] || 0
14
- nav_hover_preview = cfg.fetch("nav_hover_preview", true)
14
+ nav_hover_preview = cfg.fetch("nav_hover_preview", false)
15
15
 
16
16
  begin
17
17
  doc.output = inject_assets(doc.output.to_s, assets_path: assets_path, hover_delay_ms: hover_delay_ms, nav_hover_preview: nav_hover_preview)
@@ -21,7 +21,7 @@ module Jekyll
21
21
  end
22
22
  end
23
23
 
24
- def self.inject_assets(html, assets_path:, hover_delay_ms:, nav_hover_preview: true)
24
+ def self.inject_assets(html, assets_path:, hover_delay_ms:, nav_hover_preview: false)
25
25
  return html if html.include?('data-hover-popup-root="true"')
26
26
 
27
27
  tags = <<~HTML
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module HoverPopup
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-hover-popup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - directsun