bible270 1.15.1 → 1.16.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 +4 -4
- data/CHANGELOG.md +12 -1
- data/app/helpers/bible270/plan_helper.rb +3 -1
- data/app/views/bible270/admin/show.html.erb +17 -1
- data/app/views/bible270/shared/_avatar_preview_ui.html.erb +129 -0
- data/app/views/bible270/shared/_styles.html.erb +4 -0
- data/app/views/layouts/bible270/application.html.erb +1 -0
- data/lib/bible270/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e541ad7cbc896d3ab11422515731a78a1bc384a0b8d9974dd80fabfa96e382fb
|
|
4
|
+
data.tar.gz: 1a6041dec7e11aa375f02b22413737b0ea3fd144ffd657711d8b31087aa6c184
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7efa36f0c0353b93aa512e5d77e0403821458b0632b7d5f63493ce046b7d28c5c0c0ed259bec5d04b44e3481435a091a6eca4cc79ea8dea2e97ad08f8d12b04d
|
|
7
|
+
data.tar.gz: 21c60ff836fca4cb6c4235706ba34b3689bf3ef1ae1294ea353241b1fec80c7cd5aff0a1ffcb0dcd638ef97829fe44e4f2433e4792ac5fb66ea7f17566d39f8b
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ Notable changes, following [Keep a Changelog](https://keepachangelog.com/en/1.1.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- preview full photos after hovering over an avatar for 3 seconds; fit originals within the screen and fade out when the pointer leaves, without changing touch behavior
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- always confirm reader removal before deleting their check-offs and reflections, even when Turbo is unavailable
|
|
14
|
+
|
|
15
|
+
## [1.15.1] - 2026-11-06
|
|
16
|
+
|
|
7
17
|
### Fixed
|
|
8
18
|
|
|
9
19
|
- standardize dropdown arrows, spacing, keyboard focus, and disabled styling across reflections, filters, Profile, and Admin; keep header theme and reminder-time selectors compact
|
|
@@ -813,7 +823,8 @@ This is the initial public release.
|
|
|
813
823
|
|
|
814
824
|
- Email sign-in requires working Action Mailer delivery in the host application. Set `config.mailer_from`; delivery is inline by default, or set `email_sign_in_deliver_later` when a queue backend is available.
|
|
815
825
|
|
|
816
|
-
[Unreleased]: https://github.com/avonderluft/bible270/compare/v1.15.
|
|
826
|
+
[Unreleased]: https://github.com/avonderluft/bible270/compare/v1.15.1...main
|
|
827
|
+
[1.15.1]: https://github.com/avonderluft/bible270/compare/v1.15.0...v1.15.1
|
|
817
828
|
[1.15.0]: https://github.com/avonderluft/bible270/compare/v1.14.0...v1.15.0
|
|
818
829
|
[1.14.0]: https://github.com/avonderluft/bible270/compare/v1.13.5...v1.14.0
|
|
819
830
|
[1.13.5]: https://github.com/avonderluft/bible270/compare/v1.13.3...v1.13.5
|
|
@@ -167,10 +167,12 @@ module Bible270
|
|
|
167
167
|
style: dimensions, role: 'img', 'aria-label': reader.display_name
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
+
preview_src = reader.avatar_uploaded? ? main_app.rails_blob_path(reader.avatar, only_path: true) : src
|
|
170
171
|
content_tag :span, class: 'b270-avatar-frame', style: dimensions,
|
|
171
172
|
role: 'img', 'aria-label': reader.display_name do
|
|
172
173
|
image = image_tag src, class: 'b270-avatar', width: size, height: size, alt: reader.display_name,
|
|
173
|
-
loading: loading, data: { b270_avatar: true, b270_avatar_uploaded: reader.avatar_uploaded
|
|
174
|
+
loading: loading, data: { b270_avatar: true, b270_avatar_uploaded: reader.avatar_uploaded?,
|
|
175
|
+
b270_avatar_preview_src: preview_src }
|
|
174
176
|
fallback = content_tag :span, reader.initials, class: 'b270-avatar b270-avatar-fallback', 'aria-hidden': true
|
|
175
177
|
safe_join([image, fallback])
|
|
176
178
|
end
|
|
@@ -206,8 +206,24 @@
|
|
|
206
206
|
<p class="b270-hint" style="margin-top:0">Deletes the reader together with every check-off and
|
|
207
207
|
reflection they have written. This cannot be undone.</p>
|
|
208
208
|
<%= button_to "Remove #{@reader.display_name}", admin_reader_path(@reader), method: :delete,
|
|
209
|
-
class: 'b270-btn', form: { data: {
|
|
209
|
+
class: 'b270-btn', form: { data: { b270_remove_reader: "Are you sure you want to remove #{@reader.display_name} from the plan? All their check-offs and reflections will be permanently deleted. This cannot be undone." } } %>
|
|
210
210
|
</div>
|
|
211
211
|
|
|
212
212
|
<p style="margin-top:18px"><%= link_to '← All readers', admin_path %></p>
|
|
213
213
|
<%= render "bible270/shared/interaction_ui" %>
|
|
214
|
+
<script nonce="<%= content_security_policy_nonce %>" data-b270-reader-removal>
|
|
215
|
+
(() => {
|
|
216
|
+
if (window.Bible270ReaderRemoval) return;
|
|
217
|
+
window.Bible270ReaderRemoval = true;
|
|
218
|
+
|
|
219
|
+
// Capture submission before Turbo handles it, including keyboard submissions.
|
|
220
|
+
document.addEventListener("submit", (event) => {
|
|
221
|
+
const form = event.target;
|
|
222
|
+
if (event.defaultPrevented || !form.matches("form[data-b270-remove-reader]")) return;
|
|
223
|
+
if (window.confirm(form.dataset.b270RemoveReader)) return;
|
|
224
|
+
|
|
225
|
+
event.preventDefault();
|
|
226
|
+
event.stopImmediatePropagation();
|
|
227
|
+
}, true);
|
|
228
|
+
})();
|
|
229
|
+
</script>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script nonce="<%= content_security_policy_nonce %>">
|
|
2
|
+
(() => {
|
|
3
|
+
if (window.Bible270AvatarPreview) {
|
|
4
|
+
window.Bible270AvatarPreview.reset();
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const selector = "img[data-b270-avatar-preview-src]";
|
|
9
|
+
const finePointer = window.matchMedia?.("(hover: hover) and (pointer: fine)");
|
|
10
|
+
let active = null;
|
|
11
|
+
let fadingPopup = null;
|
|
12
|
+
let removalTimer = null;
|
|
13
|
+
|
|
14
|
+
function removeFadingPopup() {
|
|
15
|
+
clearTimeout(removalTimer);
|
|
16
|
+
removalTimer = null;
|
|
17
|
+
fadingPopup?.remove();
|
|
18
|
+
fadingPopup = null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function reset(immediate = true) {
|
|
22
|
+
if (immediate) removeFadingPopup();
|
|
23
|
+
if (!active) return;
|
|
24
|
+
|
|
25
|
+
const state = active;
|
|
26
|
+
active = null;
|
|
27
|
+
clearTimeout(state.timer);
|
|
28
|
+
if (!state.popup) return;
|
|
29
|
+
state.image.onload = null;
|
|
30
|
+
state.image.onerror = null;
|
|
31
|
+
state.popup.classList.remove("is-visible");
|
|
32
|
+
if (immediate) {
|
|
33
|
+
state.popup.remove();
|
|
34
|
+
} else {
|
|
35
|
+
removeFadingPopup();
|
|
36
|
+
fadingPopup = state.popup;
|
|
37
|
+
removalTimer = setTimeout(() => {
|
|
38
|
+
state.popup.remove();
|
|
39
|
+
fadingPopup = null;
|
|
40
|
+
removalTimer = null;
|
|
41
|
+
}, 200);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function current(state) {
|
|
46
|
+
return active === state && state.avatar.isConnected && finePointer?.matches;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function show(state) {
|
|
50
|
+
if (!current(state)) {
|
|
51
|
+
if (active === state) reset();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!state.image.naturalWidth) {
|
|
55
|
+
reset(false);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const avatar = state.avatar.getBoundingClientRect();
|
|
60
|
+
const popup = state.popup.getBoundingClientRect();
|
|
61
|
+
const margin = 16;
|
|
62
|
+
const gap = 12;
|
|
63
|
+
const right = avatar.right + gap;
|
|
64
|
+
const left = right + popup.width <= window.innerWidth - margin
|
|
65
|
+
? right : avatar.left - gap - popup.width;
|
|
66
|
+
state.popup.style.left = `${Math.max(margin, Math.min(left, window.innerWidth - margin - popup.width))}px`;
|
|
67
|
+
state.popup.style.top = `${Math.max(margin, Math.min(avatar.top, window.innerHeight - margin - popup.height))}px`;
|
|
68
|
+
state.popup.classList.add("is-visible");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
document.addEventListener("pointerover", (event) => {
|
|
72
|
+
if (!finePointer?.matches || !["mouse", "pen"].includes(event.pointerType)) return;
|
|
73
|
+
const avatar = event.target;
|
|
74
|
+
if (!avatar.matches?.(selector) || active?.avatar === avatar) return;
|
|
75
|
+
reset(false);
|
|
76
|
+
if (!avatar.isConnected) return;
|
|
77
|
+
|
|
78
|
+
const state = { avatar, timer: null, popup: null, image: null };
|
|
79
|
+
active = state;
|
|
80
|
+
state.timer = setTimeout(() => {
|
|
81
|
+
state.timer = null;
|
|
82
|
+
if (!current(state)) {
|
|
83
|
+
if (active === state) reset();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const source = avatar.getAttribute("data-b270-avatar-preview-src");
|
|
87
|
+
if (!source) {
|
|
88
|
+
reset();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const popup = document.createElement("div");
|
|
93
|
+
const image = document.createElement("img");
|
|
94
|
+
state.popup = popup;
|
|
95
|
+
state.image = image;
|
|
96
|
+
popup.className = "b270-avatar-preview";
|
|
97
|
+
popup.setAttribute("aria-hidden", "true");
|
|
98
|
+
popup.style.position = "fixed";
|
|
99
|
+
image.alt = "";
|
|
100
|
+
popup.append(image);
|
|
101
|
+
document.body.append(popup);
|
|
102
|
+
image.onload = () => show(state);
|
|
103
|
+
image.onerror = () => {
|
|
104
|
+
if (active === state) reset(false);
|
|
105
|
+
};
|
|
106
|
+
// Keep original blob/provider URLs intact, including signed query parameters.
|
|
107
|
+
image.src = source;
|
|
108
|
+
if (image.complete && active === state) show(state);
|
|
109
|
+
}, 3000);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
document.addEventListener("pointerout", (event) => {
|
|
113
|
+
if (event.target === active?.avatar && event.relatedTarget !== active.avatar) reset(false);
|
|
114
|
+
});
|
|
115
|
+
document.addEventListener("error", (event) => {
|
|
116
|
+
if (event.target === active?.avatar) reset(false);
|
|
117
|
+
}, true);
|
|
118
|
+
document.addEventListener("keydown", (event) => {
|
|
119
|
+
if (event.key === "Escape") reset(false);
|
|
120
|
+
});
|
|
121
|
+
document.addEventListener("scroll", () => reset(false), true);
|
|
122
|
+
window.addEventListener("resize", () => reset(false));
|
|
123
|
+
window.addEventListener("pagehide", () => reset());
|
|
124
|
+
document.addEventListener("turbo:before-cache", () => reset());
|
|
125
|
+
document.addEventListener("turbo:before-render", () => reset());
|
|
126
|
+
|
|
127
|
+
window.Bible270AvatarPreview = { reset };
|
|
128
|
+
})();
|
|
129
|
+
</script>
|
|
@@ -459,6 +459,10 @@
|
|
|
459
459
|
.b270-avatar-frame>.b270-avatar-fallback{position:absolute;inset:0;visibility:hidden}
|
|
460
460
|
.b270-avatar-frame>img[data-b270-avatar-failed]{visibility:hidden}
|
|
461
461
|
.b270-avatar-frame>img[data-b270-avatar-failed]+.b270-avatar-fallback{visibility:visible}
|
|
462
|
+
.b270-avatar-preview{position:fixed;inset:0 auto auto 0;z-index:1100;pointer-events:none;opacity:0;transition:opacity 200ms ease-out}
|
|
463
|
+
.b270-avatar-preview.is-visible{opacity:1}
|
|
464
|
+
.b270-avatar-preview>img{display:block;width:auto;height:auto;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);
|
|
465
|
+
box-sizing:border-box;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--card);box-shadow:var(--shadow)}
|
|
462
466
|
|
|
463
467
|
/* comments */
|
|
464
468
|
.b270-section-h{font-family:"Spectral",serif;font-size:20px;font-weight:600;margin:34px 0 14px}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
<%= b270_footer %>
|
|
35
35
|
</div>
|
|
36
36
|
<%= render "bible270/shared/avatar_ui" %>
|
|
37
|
+
<%= render "bible270/shared/avatar_preview_ui" %>
|
|
37
38
|
<%= render "bible270/shared/theme_ui" %>
|
|
38
39
|
<%= render "bible270/shared/scripture_popups" %>
|
|
39
40
|
<%= render "bible270/shared/video_embeds" %>
|
data/lib/bible270/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bible270
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.16.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew vonderLuft
|
|
@@ -201,6 +201,7 @@ files:
|
|
|
201
201
|
- app/views/bible270/readers/progress.html.erb
|
|
202
202
|
- app/views/bible270/readers/show.html.erb
|
|
203
203
|
- app/views/bible270/sessions/new.html.erb
|
|
204
|
+
- app/views/bible270/shared/_avatar_preview_ui.html.erb
|
|
204
205
|
- app/views/bible270/shared/_avatar_ui.html.erb
|
|
205
206
|
- app/views/bible270/shared/_comment_drafts.html.erb
|
|
206
207
|
- app/views/bible270/shared/_comment_notification_choices.html.erb
|