From 3e87925a35f73aa2261eb66df3ef4ca11b64eeea Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 30 Jun 2026 17:11:32 +0200 Subject: Replace Shadowbox with GLightbox, drop jQuery from public site Vendors GLightbox 3.3.1 (MIT, dependency-free) as static files in public/javascripts and public/stylesheets, replacing the Shadowbox 2009 vendor tree and its jQuery adapter. Public site no longer loads jQuery at all. - app/views/layouts/application.html.erb: swap Shadowbox script/style includes and the public_bundle (jQuery) include for GLightbox's CSS/JS - app/views/content/_headline_image.html.erb: headline image is now itself a GLightbox trigger; additional images are direct a.glightbox links sharing a per-page data-gallery group, replacing the hidden shadowbox_images div and its click-forwarding trigger - public/javascripts/public.js: replace Shadowbox.init/setup and the click-forwarding handler with a single GLightbox() init call; remove the unused image_handler object - Remove public/javascripts/shadowbox/ (including vendored Sizzle, swfobject, and unused video/Flash players) and public/stylesheets/shadowbox.css - Remove app/assets/javascripts/public_bundle.js (jquery require) --- public/javascripts/public.js | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'public/javascripts/public.js') diff --git a/public/javascripts/public.js b/public/javascripts/public.js index 10f04e8..07ee05a 100644 --- a/public/javascripts/public.js +++ b/public/javascripts/public.js @@ -1,23 +1,6 @@ -Shadowbox.init({ - skipSetup : true -}); - - $(document).ready(function(){ - Shadowbox.setup(".shadowbox_image", {gallery : "fofo"}) - - if ($("#headline_image img").length != 0) { - image_handler.initialize(); - } - - $("div#headline_image a").bind("click", function() { - return false; - }); - - $("div#headline_image a img").bind("click", function(){ - $(".shadowbox_image:first").trigger("click"); - }); + GLightbox({ selector: '.glightbox' }); document.getElementById("light-mode").addEventListener("change", () => { if (document.getElementById("light-mode").checked) @@ -26,23 +9,3 @@ $(document).ready(function(){ localStorage.removeItem("override-prefers-color-scheme"); }); }); - - -var image_handler = { - initialize : function() { - - path_name = window.location.pathname; - locale_rexexp = /^\/(en|de)\\/; - locale_match = locale_rexexp.exec(path_name); - - if (locale_match) { - locale = locale_match[0]; - } - else { - locale = "/de/"; - } - - path = path_name.replace(/\/(de|en)*\/*/, ""); - gallery_path = ""; - } -}; -- cgit v1.3