|
Description
David Cook
2026-01-20 00:26:15 UTC
Created attachment 191659 [details] [review] Bug 41665: Only include Greybox in OPAC if IdRef is enabled This patch wraps the Greybox include in the OPAC with a syspref check on IdRef, so that it's only loaded when it's needed. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29 2. Search through the HTML or the Sources tab in F12 tools and note that Greybox assets are not loaded 3. Enable the IdRef system preference 4. Note that the Greybox assets are loaded Created attachment 191708 [details] [review] Bug 41665: Only include Greybox in OPAC if IdRef is enabled This patch wraps the Greybox include in the OPAC with a syspref check on IdRef, so that it's only loaded when it's needed. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29 2. Search through the HTML or the Sources tab in F12 tools and note that Greybox assets are not loaded 3. Enable the IdRef system preference 4. Note that the Greybox assets are loaded Signed-off-by: Owen Leonard <oleonard@myacpl.org> Legend. Thanks, Owen! This seems to be a very old library? I am wondering how we use it? I dont really see it being used in the idref context. Only came across this line: koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl: <xsl:attribute name="rel">gb_page_center[600,500]</xsl:attribute> Which looks odd too btw. And if it is that old, should we even use it? There is a reference to an official site: http://orangoo.com/labs/GreyBox This site does not respond Adding (In reply to Marcel de Rooy from comment #4) > Adding Fridolin for feedback Changing status for now This is used indeed for opening a popup with IdRef datas. Bug 34710 will manage rewriting this. I attach a screenshot from AMU OPAC. Created attachment 195253 [details]
Screenshot of IdRef popup
Screenshot of IdRef popup
(In reply to Fridolin Somers from comment #7) > This is used indeed for opening a popup with IdRef datas. > > Bug 34710 will manage rewriting this. > > I attach a screenshot from AMU OPAC. Could you confirm that Greybox is not used here? On the contrary, it is used here. From XSLT file : koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl: <xsl:attribute name="rel">gb_page_center[600,500]</xsl:attribute> gb_page_center is JS from Greybox I've found a page speaking about it (looks very old) : https://www.jqueryscript.net/demo/Simple-Pop-up-Window-Plugin-GreyBox/normal_usage.html We find gb_page_center in : https://git.koha-community.org/Koha-community/Koha/src/commit/a1c7b7062c025dd286dad2c3ed5ecbfc61385f0e/koha-tmpl/opac-tmpl/lib/greybox/gb_scripts.js#L199 Thx for confirming that it is still used. Note also comment4 btw; it was not obvious from there only. Created attachment 195261 [details] [review] Bug 41665: Only include Greybox in OPAC if IdRef is enabled This patch wraps the Greybox include in the OPAC with a syspref check on IdRef, so that it's only loaded when it's needed. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29 2. Search through the HTML or the Sources tab in F12 tools and note that Greybox assets are not loaded 3. Enable the IdRef system preference 4. Note that the Greybox assets are loaded Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Lets move on with bug 34710 and remove this very old unsupported js lib. (In reply to Marcel de Rooy from comment #14) > Lets move on with bug 34710 and remove this very old unsupported js lib. We need to move on with Bug 32333! |