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/shadowbox/adapters/README | 11 ----------- public/javascripts/shadowbox/adapters/shadowbox-base.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-dojo.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-ext.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-jquery.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-mootools.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-prototype.js | 1 - public/javascripts/shadowbox/adapters/shadowbox-yui.js | 1 - 8 files changed, 18 deletions(-) delete mode 100644 public/javascripts/shadowbox/adapters/README delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-base.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-dojo.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-ext.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-jquery.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-mootools.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-prototype.js delete mode 100644 public/javascripts/shadowbox/adapters/shadowbox-yui.js (limited to 'public/javascripts/shadowbox/adapters') diff --git a/public/javascripts/shadowbox/adapters/README b/public/javascripts/shadowbox/adapters/README deleted file mode 100644 index 5083961..0000000 --- a/public/javascripts/shadowbox/adapters/README +++ /dev/null @@ -1,11 +0,0 @@ -A Shadowbox "adapter" is a small helper file that makes it easy to use -Shadowbox with a given JavaScript framework. Since most JavaScript frameworks -tend to contain a basic set of very similar functions (for retrieving style -information on elements or handling events, for example) it is not necessary to -tie Shadowbox to a particular framework. Instead, the adapter can use the -underlying framework that is already loaded on the page to reuse some of the -code. - -If you do not see an adapter for your favorite framework in this directory, feel -free to create your own and implement the same interface as the others. It may -then be used the same as you would use any other. diff --git a/public/javascripts/shadowbox/adapters/shadowbox-base.js b/public/javascripts/shadowbox/adapters/shadowbox-base.js deleted file mode 100644 index bfe0573..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-base.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var b=Shadowbox.client,a=document.defaultView,d;if(b.isIE6){d=[];function c(){var h;for(var g=0,f=d.length;g<\/script>");document.getElementById("__onDOMReady").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}Shadowbox.lib.addEvent(window,"load",a)})(); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-dojo.js b/public/javascripts/shadowbox/adapters/shadowbox-dojo.js deleted file mode 100644 index f264c9b..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-dojo.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof dojo=="undefined"){throw"Unable to load Shadowbox adapter, Dojo not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=[];return{getStyle:function(c,b){return dojo.style(c,b)},remove:function(b){dojo._destroyElement(b)},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(e,b,d){var c=dojo.connect(e,b,d);a.push({el:e,name:b,handle:c})},removeEvent:function(d,b,c){dojo.forEach(a,function(f,e){if(f&&f.el==d&&f.name==b){dojo.disconnect(f.handle);a[e]=null}})},append:function(d,c){if(d.insertAdjacentHTML){d.insertAdjacentHTML("BeforeEnd",c)}else{if(d.lastChild){var b=d.ownerDocument.createRange();b.setStartAfter(d.lastChild);var e=b.createContextualFragment(c);d.appendChild(e)}else{d.innerHTML=c}}}}}();dojo.addOnLoad(Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-ext.js b/public/javascripts/shadowbox/adapters/shadowbox-ext.js deleted file mode 100644 index e88063b..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-ext.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Ext=="undefined"){throw"Unable to load Shadowbox adapter, Ext not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=Ext.lib.Event;return{getStyle:function(c,b){return Ext.get(c).getStyle(b)},remove:function(b){Ext.get(b).remove()},getTarget:function(b){return a.getTarget(b)},getPageXY:function(b){return[a.getPageX(b),a.getPageY(b)]},preventDefault:function(b){a.preventDefault(b)},keyCode:function(b){return a.getCharCode(b)},addEvent:function(d,b,c){a.addListener(d,b,c)},removeEvent:function(d,b,c){a.removeListener(d,b,c)},append:function(c,b){Ext.DomHelper.append(c,b)}}}();Ext.onReady(Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-jquery.js b/public/javascripts/shadowbox/adapters/shadowbox-jquery.js deleted file mode 100644 index a0965a4..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-jquery.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(a){return{getStyle:function(c,b){return a(c).css(b)},remove:function(b){a(b).remove()},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(d,b,c){a(d).bind(b,c)},removeEvent:function(d,b,c){a(d).unbind(b,c)},append:function(c,b){a(c).append(b)}}}(jQuery);jQuery(Shadowbox.load);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-mootools.js b/public/javascripts/shadowbox/adapters/shadowbox-mootools.js deleted file mode 100644 index 58c0015..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-mootools.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof MooTools=="undefined"){throw"Unable to load Shadowbox adapter, MooTools not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return $(b).getStyle(a)},remove:function(a){a.parentNode.removeChild(a)},getTarget:function(a){return a.target},getPageXY:function(a){return[a.page.x,a.page.y]},preventDefault:function(a){a.preventDefault()},keyCode:function(a){return a.code},addEvent:function(c,a,b){$(c).addEvent(a,b)},removeEvent:function(c,a,b){$(c).removeEvent(a,b)},append:function(c,b){if(c.insertAdjacentHTML){c.insertAdjacentHTML("BeforeEnd",b)}else{if(c.lastChild){var a=c.ownerDocument.createRange();a.setStartAfter(c.lastChild);var d=a.createContextualFragment(b);c.appendChild(d)}else{c.innerHTML=b}}}};window.addEvent("domready",Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-prototype.js b/public/javascripts/shadowbox/adapters/shadowbox-prototype.js deleted file mode 100644 index 637dd87..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-prototype.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Prototype=="undefined"){throw"Unable to load Shadowbox adapter, Prototype not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return Element.getStyle(b,a)},remove:function(a){Element.remove(a)},getTarget:function(a){return Event.element(a)},getPageXY:function(b){var a=Event.pointer(b);return[a.x,a.y]},preventDefault:function(a){Event.stop(a)},keyCode:function(a){return a.keyCode},addEvent:function(c,a,b){Event.observe(c,a,b)},removeEvent:function(c,a,b){Event.stopObserving(c,a,b)},append:function(b,a){Element.insert(b,a)}};document.observe("dom:loaded",Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-yui.js b/public/javascripts/shadowbox/adapters/shadowbox-yui.js deleted file mode 100644 index f045d76..0000000 --- a/public/javascripts/shadowbox/adapters/shadowbox-yui.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof YAHOO=="undefined"){throw"Unable to load Shadowbox adapter, YAHOO not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=YAHOO.util.Event;var b=YAHOO.util.Dom;return{getStyle:function(d,c){return b.getStyle(d,c)},remove:function(c){c.parentNode.removeChild(c)},getTarget:function(c){return a.getTarget(c)},getPageXY:function(c){return[a.getPageX(c),a.getPageY(c)]},preventDefault:function(c){a.preventDefault(c)},keyCode:function(c){return c.keyCode},addEvent:function(e,c,d){a.addListener(e,c,d)},removeEvent:function(e,c,d){a.removeListener(e,c,d)},append:function(e,d){if(e.insertAdjacentHTML){e.insertAdjacentHTML("BeforeEnd",d)}else{if(e.lastChild){var c=e.ownerDocument.createRange();c.setStartAfter(e.lastChild);var f=c.createContextualFragment(d);e.appendChild(f)}else{e.innerHTML=d}}}}}();YAHOO.util.Event.onDOMReady(Shadowbox.load); \ No newline at end of file -- cgit v1.3