Commit Graph
3 Commits
Author SHA1 Message Date
477ad70d93 Added a beautiful and user-friendly image viewer GLightbox support to the Event page (#5352)
* Added GLightbox support to the Event page

* Fix arrow function syntax in skin.js

* Fix Eslint new-cap

* fix: snapshot and objdetect links on the event page

The class attribute ended up inside the href, so both links pointed at
?view=image&eid=N&fid=snapshot class= (404) and had no glightbox class.
Set the type and title on each link with data-type/data-title, which
GLightbox reads directly.

refs #5352

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: set up GLightbox in event.js, keep page keys out of the viewer

The library loads only on the event page, so set it up there instead of
initPageGeneral(), scoped to #frames. Its titles go through innerHTML;
they stay fixed strings.

While the viewer is open (body.glightbox-open), the event page's keydown
handler returns: arrows moved to another event, Space toggled playback
and Delete opened the delete confirmation behind it.

refs #5352

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* We won’t complicate the markup; instead, we’ll leave all the processing to JS. (event.php)

* We continue to initialize GLightbox globally within initPageGeneral().

Prefer data-title, falling back to the link's title and then the nested image's title.
Strip HTML markup from the selected title before passing it to GLightbox.

* We continue to initialize GLightbox globally within initPageGeneral().

* The check for an open GLightbox instance has been moved to a separate function, which is also called within `handleKeydownGeneral(evt)`.

* - Use `escapeHTML(title)` instead of `strip_html(title)`.
- Safely initialize GLightbox, dispatch a readiness event on success, and log initialization errors.
- When opening a GLightbox window, pause playback if it was currently playing.

* Removed extra space

* Add isLightboxOpen mock to event-view-state test

* Refactor Filter class to include id property

---------

Co-authored-by: Nic Boet <nic@boet.cc>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:05:45 -05:00
Jash Ambaliya 00a1984092 fix: reports explain a refused save and disable New and Save for users who would be refused refs #8295 (#8296) 2026-11-25 20:42:30 -05:00
Jash bdeb20e444 fix: report view and report creation need Events permission and the view hides events of monitors the user cannot view refs #7424 2026-11-22 10:32:56 +05:30